feature: remove instanceof check from CITable, add @backstage/errors to jenkins plugin to resolve eslint related issues
Signed-off-by: Hasan Ozdemir <21654050+nodify-at@users.noreply.github.com>
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
"@backstage/catalog-model": "^0.9.7",
|
||||
"@backstage/core-components": "^0.8.1",
|
||||
"@backstage/core-plugin-api": "^0.3.1",
|
||||
"@backstage/errors": "^0.1.5",
|
||||
"@backstage/plugin-catalog-react": "^0.6.5",
|
||||
"@backstage/theme": "^0.2.14",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
IdentityApi,
|
||||
} from '@backstage/core-plugin-api';
|
||||
import type { EntityName, EntityRef } from '@backstage/catalog-model';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { ResponseError } from '@backstage/errors';
|
||||
|
||||
export const jenkinsApiRef = createApiRef<JenkinsApi>({
|
||||
|
||||
@@ -24,8 +24,6 @@ import { buildRouteRef } from '../../../../plugin';
|
||||
import { Progress, Table, TableColumn } from '@backstage/core-components';
|
||||
import { Project } from '../../../../api/JenkinsApi';
|
||||
import { alertApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
import { ResponseError } from '@backstage/errors';
|
||||
|
||||
const FailCount = ({ count }: { count: number }): JSX.Element | null => {
|
||||
if (count !== 0) {
|
||||
@@ -190,12 +188,10 @@ const generatedColumns: TableColumn[] = [
|
||||
severity: 'success',
|
||||
});
|
||||
} catch (e) {
|
||||
if (e instanceof ResponseError) {
|
||||
alertApi.post({
|
||||
message: `Jenkins re-build has failed. Error: ${e.message}`,
|
||||
severity: 'error',
|
||||
});
|
||||
}
|
||||
alertApi.post({
|
||||
message: `Jenkins re-build has failed. Error: ${e.message}`,
|
||||
severity: 'error',
|
||||
});
|
||||
} finally {
|
||||
setIsLoadingRebuild(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user