@backstage/plugin-catalog-unprocessed-entities 0.2.20-next.1 → 0.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/alpha/plugin.esm.js +4 -4
- package/dist/alpha/plugin.esm.js.map +1 -1
- package/dist/alpha.d.ts +6 -5
- package/dist/api/index.esm.js.map +1 -1
- package/dist/components/DeleteEntityConfirmationDialog.esm.js.map +1 -1
- package/dist/components/EntityDialog.esm.js.map +1 -1
- package/dist/components/FailedEntities.esm.js.map +1 -1
- package/dist/components/PendingEntities.esm.js.map +1 -1
- package/dist/components/UnprocessedEntities.esm.js.map +1 -1
- package/dist/package.json.esm.js +1 -1
- package/dist/plugin.esm.js +2 -2
- package/dist/plugin.esm.js.map +1 -1
- package/dist/routes.esm.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-unprocessed-entities
|
|
2
2
|
|
|
3
|
+
## 0.2.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e4ddf22: Internal update to align with new blueprint parameter naming in the new frontend system.
|
|
8
|
+
- f2f133c: Internal update to use the new variant of `ApiBlueprint`.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @backstage/core-components@0.17.5
|
|
11
|
+
- @backstage/frontend-plugin-api@0.11.0
|
|
12
|
+
- @backstage/core-compat-api@0.5.0
|
|
13
|
+
|
|
14
|
+
## 0.2.20-next.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- e4ddf22: Internal update to align with new blueprint parameter naming in the new frontend system.
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
- @backstage/frontend-plugin-api@0.11.0-next.1
|
|
21
|
+
- @backstage/core-compat-api@0.5.0-next.2
|
|
22
|
+
- @backstage/core-components@0.17.5-next.1
|
|
23
|
+
- @backstage/catalog-model@1.7.5
|
|
24
|
+
- @backstage/core-plugin-api@1.10.9
|
|
25
|
+
- @backstage/errors@1.2.7
|
|
26
|
+
|
|
3
27
|
## 0.2.20-next.1
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/alpha/plugin.esm.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { ApiBlueprint,
|
|
3
|
-
import {
|
|
2
|
+
import { ApiBlueprint, fetchApiRef, discoveryApiRef, PageBlueprint, NavItemBlueprint, createFrontendPlugin } from '@backstage/frontend-plugin-api';
|
|
3
|
+
import { CatalogUnprocessedEntitiesClient, catalogUnprocessedEntitiesApiRef } from '../api/index.esm.js';
|
|
4
4
|
import { convertLegacyRouteRef, compatWrapper } from '@backstage/core-compat-api';
|
|
5
5
|
import QueueIcon from '@material-ui/icons/Queue';
|
|
6
6
|
import { rootRouteRef } from '../routes.esm.js';
|
|
7
7
|
|
|
8
8
|
const catalogUnprocessedEntitiesApi = ApiBlueprint.make({
|
|
9
|
-
params: (
|
|
9
|
+
params: (defineParams) => defineParams({
|
|
10
10
|
api: catalogUnprocessedEntitiesApiRef,
|
|
11
11
|
deps: {
|
|
12
12
|
discoveryApi: discoveryApiRef,
|
|
@@ -17,7 +17,7 @@ const catalogUnprocessedEntitiesApi = ApiBlueprint.make({
|
|
|
17
17
|
});
|
|
18
18
|
const catalogUnprocessedEntitiesPage = PageBlueprint.make({
|
|
19
19
|
params: {
|
|
20
|
-
|
|
20
|
+
path: "/catalog-unprocessed-entities",
|
|
21
21
|
routeRef: convertLegacyRouteRef(rootRouteRef),
|
|
22
22
|
loader: () => import('../components/UnprocessedEntities.esm.js').then(
|
|
23
23
|
(m) => compatWrapper(/* @__PURE__ */ jsx(m.UnprocessedEntities, {}))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createFrontendPlugin,\n discoveryApiRef,\n fetchApiRef,\n ApiBlueprint,\n PageBlueprint,\n NavItemBlueprint,\n} from '@backstage/frontend-plugin-api';\n\nimport {\n catalogUnprocessedEntitiesApiRef,\n CatalogUnprocessedEntitiesClient,\n} from '../api';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport QueueIcon from '@material-ui/icons/Queue';\nimport { rootRouteRef } from '../routes';\n\n/** @alpha */\nexport const catalogUnprocessedEntitiesApi = ApiBlueprint.make({\n params:
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createFrontendPlugin,\n discoveryApiRef,\n fetchApiRef,\n ApiBlueprint,\n PageBlueprint,\n NavItemBlueprint,\n} from '@backstage/frontend-plugin-api';\n\nimport {\n catalogUnprocessedEntitiesApiRef,\n CatalogUnprocessedEntitiesClient,\n} from '../api';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport QueueIcon from '@material-ui/icons/Queue';\nimport { rootRouteRef } from '../routes';\n\n/** @alpha */\nexport const catalogUnprocessedEntitiesApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: catalogUnprocessedEntitiesApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new CatalogUnprocessedEntitiesClient(discoveryApi, fetchApi),\n }),\n});\n\n/** @alpha */\nexport const catalogUnprocessedEntitiesPage = PageBlueprint.make({\n params: {\n path: '/catalog-unprocessed-entities',\n routeRef: convertLegacyRouteRef(rootRouteRef),\n loader: () =>\n import('../components/UnprocessedEntities').then(m =>\n compatWrapper(<m.UnprocessedEntities />),\n ),\n },\n});\n\n/** @alpha */\nexport const catalogUnprocessedEntitiesNavItem = NavItemBlueprint.make({\n params: {\n title: 'Unprocessed Entities',\n routeRef: convertLegacyRouteRef(rootRouteRef),\n icon: QueueIcon,\n },\n});\n\n/** @alpha */\nexport default createFrontendPlugin({\n pluginId: 'catalog-unprocessed-entities',\n info: { packageJson: () => import('../../package.json') },\n routes: {\n root: convertLegacyRouteRef(rootRouteRef),\n },\n extensions: [\n catalogUnprocessedEntitiesApi,\n catalogUnprocessedEntitiesPage,\n catalogUnprocessedEntitiesNavItem,\n ],\n});\n"],"names":[],"mappings":";;;;;;;AAqCO,MAAM,6BAAA,GAAgC,aAAa,IAAA,CAAK;AAAA,EAC7D,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,gCAAA;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,YAAA,EAAc,eAAA;AAAA,MACd,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,OAAA,EAAS,CAAC,EAAE,YAAA,EAAc,UAAS,KACjC,IAAI,gCAAA,CAAiC,YAAA,EAAc,QAAQ;AAAA,GAC9D;AACL,CAAC;AAGM,MAAM,8BAAA,GAAiC,cAAc,IAAA,CAAK;AAAA,EAC/D,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,+BAAA;AAAA,IACN,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,MAAA,EAAQ,MACN,OAAO,0CAAmC,CAAA,CAAE,IAAA;AAAA,MAAK,OAC/C,aAAA,iBAAc,GAAA,CAAC,CAAA,CAAE,mBAAA,EAAF,EAAsB,CAAE;AAAA;AACzC;AAEN,CAAC;AAGM,MAAM,iCAAA,GAAoC,iBAAiB,IAAA,CAAK;AAAA,EACrE,MAAA,EAAQ;AAAA,IACN,KAAA,EAAO,sBAAA;AAAA,IACP,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,IAAA,EAAM;AAAA;AAEV,CAAC;AAGD,aAAe,oBAAA,CAAqB;AAAA,EAClC,QAAA,EAAU,8BAAA;AAAA,EACV,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,wBAAoB,CAAA,EAAE;AAAA,EACxD,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,sBAAsB,YAAY;AAAA,GAC1C;AAAA,EACA,UAAA,EAAY;AAAA,IACV,6BAAA;AAAA,IACA,8BAAA;AAAA,IACA;AAAA;AAEJ,CAAC,CAAA;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
4
4
|
|
|
5
5
|
/** @alpha */
|
|
6
|
-
declare const _default: _backstage_frontend_plugin_api.
|
|
6
|
+
declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin<{
|
|
7
7
|
root: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
8
8
|
}, {}, {
|
|
9
9
|
"api:catalog-unprocessed-entities": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
@@ -11,7 +11,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
11
11
|
name: undefined;
|
|
12
12
|
config: {};
|
|
13
13
|
configInput: {};
|
|
14
|
-
output: _backstage_frontend_plugin_api.
|
|
14
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
|
|
15
15
|
inputs: {};
|
|
16
16
|
params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
|
|
17
17
|
}>;
|
|
@@ -20,7 +20,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
20
20
|
name: undefined;
|
|
21
21
|
config: {};
|
|
22
22
|
configInput: {};
|
|
23
|
-
output: _backstage_frontend_plugin_api.
|
|
23
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<{
|
|
24
24
|
title: string;
|
|
25
25
|
icon: _backstage_core_plugin_api.IconComponent;
|
|
26
26
|
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
@@ -41,12 +41,13 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
41
41
|
configInput: {
|
|
42
42
|
path?: string | undefined;
|
|
43
43
|
};
|
|
44
|
-
output: _backstage_frontend_plugin_api.
|
|
44
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
45
45
|
optional: true;
|
|
46
46
|
}>;
|
|
47
47
|
inputs: {};
|
|
48
48
|
params: {
|
|
49
|
-
defaultPath:
|
|
49
|
+
defaultPath?: [Error: `Use the 'path' param instead`];
|
|
50
|
+
path: string;
|
|
50
51
|
loader: () => Promise<JSX.Element>;
|
|
51
52
|
routeRef?: _backstage_frontend_plugin_api.RouteRef;
|
|
52
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../src/api/index.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n DiscoveryApi,\n createApiRef,\n FetchApi,\n} from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport { UnprocessedEntity } from '../types';\n\n/**\n * {@link @backstage/core-plugin-api#ApiRef} for the {@link CatalogUnprocessedEntitiesApi}\n *\n * @public\n */\nexport const catalogUnprocessedEntitiesApiRef =\n createApiRef<CatalogUnprocessedEntitiesApi>({\n id: 'plugin.catalog-unprocessed-entities.service',\n });\n\n/**\n * Response expected by the {@link CatalogUnprocessedEntitiesApi}\n *\n * @public\n */\nexport type CatalogUnprocessedEntitiesApiResponse = {\n entities: UnprocessedEntity[];\n};\n\n/**\n * Interface for the CatalogUnprocessedEntitiesApi.\n *\n * @public\n */\nexport interface CatalogUnprocessedEntitiesApi {\n /**\n * Returns a list of entities with state 'pending'\n */\n pending(): Promise<CatalogUnprocessedEntitiesApiResponse>;\n /**\n * Returns a list of entities with state 'failed'\n */\n failed(): Promise<CatalogUnprocessedEntitiesApiResponse>;\n /**\n * Deletes an entity from the refresh_state table\n */\n delete(entityId: string): Promise<void>;\n}\n\n/**\n * Default API implementation for the Catalog Unprocessed Entities plugin\n *\n * @public\n */\nexport class CatalogUnprocessedEntitiesClient\n implements CatalogUnprocessedEntitiesApi\n{\n constructor(public discovery: DiscoveryApi, public fetchApi: FetchApi) {}\n\n private async fetch<T>(path: string, init?: RequestInit): Promise<T> {\n const url = await this.discovery.getBaseUrl('catalog');\n const resp = await this.fetchApi.fetch(`${url}/${path}`, init);\n\n if (!resp.ok) {\n throw await ResponseError.fromResponse(resp);\n }\n\n return resp.status === 204 ? (resp as T) : await resp.json();\n }\n\n async pending(): Promise<CatalogUnprocessedEntitiesApiResponse> {\n return await this.fetch('entities/unprocessed/pending');\n }\n\n async failed(): Promise<CatalogUnprocessedEntitiesApiResponse> {\n return await this.fetch('entities/unprocessed/failed');\n }\n\n async delete(entityId: string): Promise<void> {\n await this.fetch(`entities/unprocessed/delete/${entityId}`, {\n method: 'DELETE',\n });\n }\n}\n"],"names":[],"mappings":";;;AA4BO,MAAM,mCACX,
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../src/api/index.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n DiscoveryApi,\n createApiRef,\n FetchApi,\n} from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport { UnprocessedEntity } from '../types';\n\n/**\n * {@link @backstage/core-plugin-api#ApiRef} for the {@link CatalogUnprocessedEntitiesApi}\n *\n * @public\n */\nexport const catalogUnprocessedEntitiesApiRef =\n createApiRef<CatalogUnprocessedEntitiesApi>({\n id: 'plugin.catalog-unprocessed-entities.service',\n });\n\n/**\n * Response expected by the {@link CatalogUnprocessedEntitiesApi}\n *\n * @public\n */\nexport type CatalogUnprocessedEntitiesApiResponse = {\n entities: UnprocessedEntity[];\n};\n\n/**\n * Interface for the CatalogUnprocessedEntitiesApi.\n *\n * @public\n */\nexport interface CatalogUnprocessedEntitiesApi {\n /**\n * Returns a list of entities with state 'pending'\n */\n pending(): Promise<CatalogUnprocessedEntitiesApiResponse>;\n /**\n * Returns a list of entities with state 'failed'\n */\n failed(): Promise<CatalogUnprocessedEntitiesApiResponse>;\n /**\n * Deletes an entity from the refresh_state table\n */\n delete(entityId: string): Promise<void>;\n}\n\n/**\n * Default API implementation for the Catalog Unprocessed Entities plugin\n *\n * @public\n */\nexport class CatalogUnprocessedEntitiesClient\n implements CatalogUnprocessedEntitiesApi\n{\n constructor(public discovery: DiscoveryApi, public fetchApi: FetchApi) {}\n\n private async fetch<T>(path: string, init?: RequestInit): Promise<T> {\n const url = await this.discovery.getBaseUrl('catalog');\n const resp = await this.fetchApi.fetch(`${url}/${path}`, init);\n\n if (!resp.ok) {\n throw await ResponseError.fromResponse(resp);\n }\n\n return resp.status === 204 ? (resp as T) : await resp.json();\n }\n\n async pending(): Promise<CatalogUnprocessedEntitiesApiResponse> {\n return await this.fetch('entities/unprocessed/pending');\n }\n\n async failed(): Promise<CatalogUnprocessedEntitiesApiResponse> {\n return await this.fetch('entities/unprocessed/failed');\n }\n\n async delete(entityId: string): Promise<void> {\n await this.fetch(`entities/unprocessed/delete/${entityId}`, {\n method: 'DELETE',\n });\n }\n}\n"],"names":[],"mappings":";;;AA4BO,MAAM,mCACX,YAAA,CAA4C;AAAA,EAC1C,EAAA,EAAI;AACN,CAAC;AAoCI,MAAM,gCAAA,CAEb;AAAA,EACE,WAAA,CAAmB,WAAgC,QAAA,EAAoB;AAApD,IAAA,IAAA,CAAA,SAAA,GAAA,SAAA;AAAgC,IAAA,IAAA,CAAA,QAAA,GAAA,QAAA;AAAA,EAAqB;AAAA,EAExE,MAAc,KAAA,CAAS,IAAA,EAAc,IAAA,EAAgC;AACnE,IAAA,MAAM,GAAA,GAAM,MAAM,IAAA,CAAK,SAAA,CAAU,WAAW,SAAS,CAAA;AACrD,IAAA,MAAM,IAAA,GAAO,MAAM,IAAA,CAAK,QAAA,CAAS,KAAA,CAAM,GAAG,GAAG,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA,EAAI,IAAI,CAAA;AAE7D,IAAA,IAAI,CAAC,KAAK,EAAA,EAAI;AACZ,MAAA,MAAM,MAAM,aAAA,CAAc,YAAA,CAAa,IAAI,CAAA;AAAA,IAC7C;AAEA,IAAA,OAAO,KAAK,MAAA,KAAW,GAAA,GAAO,IAAA,GAAa,MAAM,KAAK,IAAA,EAAK;AAAA,EAC7D;AAAA,EAEA,MAAM,OAAA,GAA0D;AAC9D,IAAA,OAAO,MAAM,IAAA,CAAK,KAAA,CAAM,8BAA8B,CAAA;AAAA,EACxD;AAAA,EAEA,MAAM,MAAA,GAAyD;AAC7D,IAAA,OAAO,MAAM,IAAA,CAAK,KAAA,CAAM,6BAA6B,CAAA;AAAA,EACvD;AAAA,EAEA,MAAM,OAAO,QAAA,EAAiC;AAC5C,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,CAAA,4BAAA,EAA+B,QAAQ,CAAA,CAAA,EAAI;AAAA,MAC1D,MAAA,EAAQ;AAAA,KACT,CAAA;AAAA,EACH;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteEntityConfirmationDialog.esm.js","sources":["../../src/components/DeleteEntityConfirmationDialog.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport { useState } from 'react';\nimport { assertError } from '@backstage/errors';\n\ninterface DeleteEntityConfirmationProps {\n open: boolean;\n onClose: () => any;\n onConfirm: () => any;\n}\n\nexport function DeleteEntityConfirmationDialog(\n props: DeleteEntityConfirmationProps,\n) {\n const { open, onClose, onConfirm } = props;\n const [busy, setBusy] = useState(false);\n const onDelete = async () => {\n setBusy(true);\n try {\n onConfirm();\n } catch (err) {\n assertError(err);\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <Dialog open={open} onClose={onClose}>\n <DialogTitle id=\"responsive-dialog-title\">\n Are you sure you want to delete this entity?\n </DialogTitle>\n <DialogActions>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n disabled={busy}\n onClick={onDelete}\n >\n Delete\n </Button>\n <Button onClick={onClose} color=\"primary\">\n Cancel\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AA6BO,SAAS,+BACd,
|
|
1
|
+
{"version":3,"file":"DeleteEntityConfirmationDialog.esm.js","sources":["../../src/components/DeleteEntityConfirmationDialog.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport { useState } from 'react';\nimport { assertError } from '@backstage/errors';\n\ninterface DeleteEntityConfirmationProps {\n open: boolean;\n onClose: () => any;\n onConfirm: () => any;\n}\n\nexport function DeleteEntityConfirmationDialog(\n props: DeleteEntityConfirmationProps,\n) {\n const { open, onClose, onConfirm } = props;\n const [busy, setBusy] = useState(false);\n const onDelete = async () => {\n setBusy(true);\n try {\n onConfirm();\n } catch (err) {\n assertError(err);\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <Dialog open={open} onClose={onClose}>\n <DialogTitle id=\"responsive-dialog-title\">\n Are you sure you want to delete this entity?\n </DialogTitle>\n <DialogActions>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n disabled={busy}\n onClick={onDelete}\n >\n Delete\n </Button>\n <Button onClick={onClose} color=\"primary\">\n Cancel\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AA6BO,SAAS,+BACd,KAAA,EACA;AACA,EAAA,MAAM,EAAE,IAAA,EAAM,OAAA,EAAS,SAAA,EAAU,GAAI,KAAA;AACrC,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA;AACtC,EAAA,MAAM,WAAW,YAAY;AAC3B,IAAA,OAAA,CAAQ,IAAI,CAAA;AACZ,IAAA,IAAI;AACF,MAAA,SAAA,EAAU;AAAA,IACZ,SAAS,GAAA,EAAK;AACZ,MAAA,WAAA,CAAY,GAAG,CAAA;AAAA,IACjB,CAAA,SAAE;AACA,MAAA,OAAA,CAAQ,KAAK,CAAA;AAAA,IACf;AAAA,EACF,CAAA;AAEA,EAAA,uBACE,IAAA,CAAC,MAAA,EAAA,EAAO,IAAA,EAAY,OAAA,EAClB,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,WAAA,EAAA,EAAY,EAAA,EAAG,yBAAA,EAA0B,QAAA,EAAA,8CAAA,EAE1C,CAAA;AAAA,yBACC,aAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAA,EAAQ,WAAA;AAAA,UACR,KAAA,EAAM,WAAA;AAAA,UACN,QAAA,EAAU,IAAA;AAAA,UACV,OAAA,EAAS,QAAA;AAAA,UACV,QAAA,EAAA;AAAA;AAAA,OAED;AAAA,0BACC,MAAA,EAAA,EAAO,OAAA,EAAS,OAAA,EAAS,KAAA,EAAM,WAAU,QAAA,EAAA,QAAA,EAE1C;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityDialog.esm.js","sources":["../../src/components/EntityDialog.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState } from 'react';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport IconButton from '@material-ui/core/IconButton';\nimport { makeStyles, createStyles, Theme } from '@material-ui/core/styles';\nimport CloseIcon from '@material-ui/icons/Close';\nimport DescriptionIcon from '@material-ui/icons/Description';\n\nimport { UnprocessedEntity } from './../types';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n entity: {\n overflow: 'scroll',\n width: '100%',\n },\n codeBox: {\n border: '1px solid black',\n padding: '1em',\n },\n }),\n);\n\nexport const EntityDialog = ({ entity }: { entity: UnprocessedEntity }) => {\n const [open, setOpen] = useState(false);\n const classes = useStyles();\n\n const openDialog = () => {\n setOpen(true);\n };\n\n const closeDialog = () => {\n setOpen(false);\n };\n\n const dialogContent = () => {\n return (\n <CodeSnippet\n language=\"json\"\n showLineNumbers\n text={JSON.stringify(entity, null, 4)}\n />\n );\n };\n\n return (\n <>\n <IconButton color=\"primary\" onClick={openDialog}>\n <DescriptionIcon />\n </IconButton>\n <Dialog fullWidth open={open} onClose={closeDialog}>\n <DialogTitle id=\"dialog-title\">\n <IconButton\n aria-label=\"close\"\n className={classes.closeButton}\n onClick={closeDialog}\n >\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <DialogContent>{dialogContent()}</DialogContent>\n </Dialog>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA4BA,MAAM,
|
|
1
|
+
{"version":3,"file":"EntityDialog.esm.js","sources":["../../src/components/EntityDialog.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState } from 'react';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport IconButton from '@material-ui/core/IconButton';\nimport { makeStyles, createStyles, Theme } from '@material-ui/core/styles';\nimport CloseIcon from '@material-ui/icons/Close';\nimport DescriptionIcon from '@material-ui/icons/Description';\n\nimport { UnprocessedEntity } from './../types';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n entity: {\n overflow: 'scroll',\n width: '100%',\n },\n codeBox: {\n border: '1px solid black',\n padding: '1em',\n },\n }),\n);\n\nexport const EntityDialog = ({ entity }: { entity: UnprocessedEntity }) => {\n const [open, setOpen] = useState(false);\n const classes = useStyles();\n\n const openDialog = () => {\n setOpen(true);\n };\n\n const closeDialog = () => {\n setOpen(false);\n };\n\n const dialogContent = () => {\n return (\n <CodeSnippet\n language=\"json\"\n showLineNumbers\n text={JSON.stringify(entity, null, 4)}\n />\n );\n };\n\n return (\n <>\n <IconButton color=\"primary\" onClick={openDialog}>\n <DescriptionIcon />\n </IconButton>\n <Dialog fullWidth open={open} onClose={closeDialog}>\n <DialogTitle id=\"dialog-title\">\n <IconButton\n aria-label=\"close\"\n className={classes.closeButton}\n onClick={closeDialog}\n >\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <DialogContent>{dialogContent()}</DialogContent>\n </Dialog>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA4BA,MAAM,SAAA,GAAY,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAA,CAAa;AAAA,IACX,WAAA,EAAa;AAAA,MACX,QAAA,EAAU,UAAA;AAAA,MACV,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MACtB,GAAA,EAAK,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MACpB,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,GAAG;AAAA,KAC/B;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,QAAA,EAAU,QAAA;AAAA,MACV,KAAA,EAAO;AAAA,KACT;AAAA,IACA,OAAA,EAAS;AAAA,MACP,MAAA,EAAQ,iBAAA;AAAA,MACR,OAAA,EAAS;AAAA;AACX,GACD;AACH,CAAA;AAEO,MAAM,YAAA,GAAe,CAAC,EAAE,MAAA,EAAO,KAAqC;AACzE,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA;AACtC,EAAA,MAAM,UAAU,SAAA,EAAU;AAE1B,EAAA,MAAM,aAAa,MAAM;AACvB,IAAA,OAAA,CAAQ,IAAI,CAAA;AAAA,EACd,CAAA;AAEA,EAAA,MAAM,cAAc,MAAM;AACxB,IAAA,OAAA,CAAQ,KAAK,CAAA;AAAA,EACf,CAAA;AAEA,EAAA,MAAM,gBAAgB,MAAM;AAC1B,IAAA,uBACE,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,QAAA,EAAS,MAAA;AAAA,QACT,eAAA,EAAe,IAAA;AAAA,QACf,IAAA,EAAM,IAAA,CAAK,SAAA,CAAU,MAAA,EAAQ,MAAM,CAAC;AAAA;AAAA,KACtC;AAAA,EAEJ,CAAA;AAEA,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,cAAW,KAAA,EAAM,SAAA,EAAU,SAAS,UAAA,EACnC,QAAA,kBAAA,GAAA,CAAC,mBAAgB,CAAA,EACnB,CAAA;AAAA,yBACC,MAAA,EAAA,EAAO,SAAA,EAAS,IAAA,EAAC,IAAA,EAAY,SAAS,WAAA,EACrC,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,WAAA,EAAA,EAAY,IAAG,cAAA,EACd,QAAA,kBAAA,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,YAAA,EAAW,OAAA;AAAA,UACX,WAAW,OAAA,CAAQ,WAAA;AAAA,UACnB,OAAA,EAAS,WAAA;AAAA,UAET,8BAAC,SAAA,EAAA,EAAU;AAAA;AAAA,OACb,EACF,CAAA;AAAA,sBACA,GAAA,CAAC,aAAA,EAAA,EAAe,QAAA,EAAA,aAAA,EAAc,EAAE;AAAA,KAAA,EAClC;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FailedEntities.esm.js","sources":["../../src/components/FailedEntities.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState } from 'react';\nimport { DateTime } from 'luxon';\nimport {\n ErrorPanel,\n MarkdownContent,\n Progress,\n Table,\n TableColumn,\n} from '@backstage/core-components';\n\nimport Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\nimport IconButton from '@material-ui/core/IconButton';\nimport { Theme, makeStyles } from '@material-ui/core/styles';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\n\nimport { UnprocessedEntity } from '../types';\nimport { EntityDialog } from './EntityDialog';\nimport { catalogUnprocessedEntitiesApiRef } from '../api';\nimport useAsync from 'react-use/esm/useAsync';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport { DeleteEntityConfirmationDialog } from './DeleteEntityConfirmationDialog';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n errorBox: {\n color: theme.palette.status.error,\n backgroundColor: theme.palette.errorBackground,\n padding: '1em',\n margin: '1em',\n border: `1px solid ${theme.palette.status.error}`,\n },\n errorTitle: {\n width: '100%',\n fontWeight: 'bold',\n },\n successMessage: {\n background: theme.palette.infoBackground,\n color: theme.palette.infoText,\n padding: theme.spacing(2),\n },\n}));\n\nconst RenderErrorContext = ({\n error,\n rowData,\n}: {\n error: { message: string };\n rowData: UnprocessedEntity;\n}) => {\n if (error.message.includes('tags.')) {\n return (\n <>\n <Typography>Tags</Typography>\n <ul>\n {rowData.unprocessed_entity.metadata.tags?.map(t => (\n <li>{t}</li>\n ))}\n </ul>\n </>\n );\n }\n\n if (error.message.includes('metadata.name')) {\n return (\n <>\n <Typography>Name</Typography>\n <Typography variant=\"caption\">\n {rowData.unprocessed_entity.metadata.name}\n </Typography>\n </>\n );\n }\n\n return null;\n};\n\n/**\n * Converts input datetime which lacks timezone info into user's local time so that they can\n * easily understand the times.\n */\nexport const convertTimeToLocalTimezone = (dateTime: string | Date) => {\n const isoDateTime =\n typeof dateTime === 'string' ? dateTime : dateTime.toISOString();\n\n const strDateTime = DateTime.fromISO(isoDateTime, {\n zone: DateTime.local().zoneName,\n });\n\n return strDateTime.toFormat('yyyy-MM-dd hh:mm:ss ZZZZ');\n};\n\nexport const FailedEntities = () => {\n const classes = useStyles();\n const unprocessedApi = useApi(catalogUnprocessedEntitiesApiRef);\n const {\n loading,\n error,\n value: data,\n } = useAsync(async () => await unprocessedApi.failed());\n const [, setSelectedSearchTerm] = useState<string>('');\n const unprocessedEntityApi = useApi(catalogUnprocessedEntitiesApiRef);\n const alertApi = useApi(alertApiRef);\n const [selectedEntityId, setSelectedEntityId] = useState<string | undefined>(\n undefined,\n );\n const [selectedEntityRef, setSelectedEntityRef] = useState<\n string | undefined\n >(undefined);\n const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n const handleDelete = ({\n entityId,\n entityRef,\n }: {\n entityId: string;\n entityRef: string;\n }) => {\n setSelectedEntityId(entityId);\n setSelectedEntityRef(entityRef);\n setConfirmationDialogOpen(true);\n };\n\n const cleanUpAfterRemoval = async () => {\n try {\n if (selectedEntityId) {\n await unprocessedEntityApi.delete(selectedEntityId);\n alertApi.post({\n message: `Entity ${selectedEntityRef} has been deleted`,\n severity: 'success',\n });\n }\n } catch (e) {\n alertApi.post({\n message: `Ran into an issue when deleting ${selectedEntityRef}. Please try again later.`,\n severity: 'error',\n });\n }\n setConfirmationDialogOpen(false);\n };\n\n const columns: TableColumn[] = [\n {\n title: <Typography>entityRef</Typography>,\n sorting: true,\n field: 'entity_ref',\n customFilterAndSearch: (query, row: any) =>\n row.entity_ref\n .toLocaleUpperCase('en-US')\n .includes(query.toLocaleUpperCase('en-US')),\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).entity_ref,\n },\n {\n title: <Typography>Location Path</Typography>,\n sorting: true,\n field: 'location_key',\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).location_key,\n },\n {\n title: <Typography>Kind</Typography>,\n sorting: true,\n field: 'kind',\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.kind,\n },\n {\n title: <Typography>Owner</Typography>,\n sorting: true,\n field: 'unprocessed_entity.spec.owner',\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.spec?.owner ||\n 'unknown',\n },\n {\n title: <Typography>Last Discovery At</Typography>,\n sorting: true,\n field: 'last_discovery_at',\n render: (rowData: UnprocessedEntity | {}) =>\n convertTimeToLocalTimezone(\n (rowData as UnprocessedEntity).last_discovery_at,\n ) || 'unknown',\n },\n {\n title: <Typography>Next Refresh At</Typography>,\n sorting: true,\n field: 'next_update_at',\n render: (rowData: UnprocessedEntity | {}) =>\n convertTimeToLocalTimezone(\n (rowData as UnprocessedEntity).next_update_at,\n ) || 'unknown',\n },\n {\n title: <Typography>Raw Entity Definition</Typography>,\n sorting: false,\n render: (rowData: UnprocessedEntity | {}) => (\n <EntityDialog entity={rowData as UnprocessedEntity} />\n ),\n },\n {\n title: <Typography>Actions</Typography>,\n render: (rowData: UnprocessedEntity | {}) => {\n const { entity_id, entity_ref } = rowData as UnprocessedEntity;\n\n return (\n <IconButton\n aria-label=\"delete\"\n onClick={() =>\n handleDelete({\n entityId: entity_id,\n entityRef: entity_ref,\n })\n }\n >\n <DeleteIcon fontSize=\"small\" data-testid=\"delete-icon\" />\n </IconButton>\n );\n },\n },\n ];\n\n return (\n <>\n <Table\n options={{ pageSize: 20, search: true }}\n columns={columns}\n data={data?.entities ?? []}\n emptyContent={\n <Typography className={classes.successMessage}>\n No failed entities found\n </Typography>\n }\n onSearchChange={(searchTerm: string) =>\n setSelectedSearchTerm(searchTerm)\n }\n detailPanel={({ rowData }) => {\n const errors = (rowData as UnprocessedEntity).errors;\n return (\n <>\n {errors?.map((e, idx) => {\n return (\n <Box key={idx} className={classes.errorBox}>\n <Typography className={classes.errorTitle}>\n {e.name}\n </Typography>\n <MarkdownContent content={e.message} />\n <RenderErrorContext\n error={e}\n rowData={rowData as UnprocessedEntity}\n />\n </Box>\n );\n })}\n </>\n );\n }}\n />\n <DeleteEntityConfirmationDialog\n open={confirmationDialogOpen}\n onClose={() => setConfirmationDialogOpen(false)}\n onConfirm={cleanUpAfterRemoval}\n />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAsCA,MAAM,SAAA,GAAY,UAAW,CAAA,CAAC,KAAkB,MAAA;AAAA,EAC9C,QAAU,EAAA;AAAA,IACR,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,KAAA;AAAA,IAC5B,eAAA,EAAiB,MAAM,OAAQ,CAAA,eAAA;AAAA,IAC/B,OAAS,EAAA,KAAA;AAAA,IACT,MAAQ,EAAA,KAAA;AAAA,IACR,MAAQ,EAAA,CAAA,UAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,OAAO,KAAK,CAAA;AAAA,GACjD;AAAA,EACA,UAAY,EAAA;AAAA,IACV,KAAO,EAAA,MAAA;AAAA,IACP,UAAY,EAAA;AAAA,GACd;AAAA,EACA,cAAgB,EAAA;AAAA,IACd,UAAA,EAAY,MAAM,OAAQ,CAAA,cAAA;AAAA,IAC1B,KAAA,EAAO,MAAM,OAAQ,CAAA,QAAA;AAAA,IACrB,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA;AAE5B,CAAE,CAAA,CAAA;AAEF,MAAM,qBAAqB,CAAC;AAAA,EAC1B,KAAA;AAAA,EACA;AACF,CAGM,KAAA;AACJ,EAAA,IAAI,KAAM,CAAA,OAAA,CAAQ,QAAS,CAAA,OAAO,CAAG,EAAA;AACnC,IAAA,uBAEI,IAAA,CAAA,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AA;AAAA,QACC,IAAM,EAAA,sBAAA;AAAA,QACN,OAAA,EAAS,MAAM,yBAAA,CAA0B,KAAK,CAAA;AAAA,QAC9C,SAAW,EAAA;AAAA;AAAA;AACb,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"FailedEntities.esm.js","sources":["../../src/components/FailedEntities.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState } from 'react';\nimport { DateTime } from 'luxon';\nimport {\n ErrorPanel,\n MarkdownContent,\n Progress,\n Table,\n TableColumn,\n} from '@backstage/core-components';\n\nimport Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\nimport IconButton from '@material-ui/core/IconButton';\nimport { Theme, makeStyles } from '@material-ui/core/styles';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\n\nimport { UnprocessedEntity } from '../types';\nimport { EntityDialog } from './EntityDialog';\nimport { catalogUnprocessedEntitiesApiRef } from '../api';\nimport useAsync from 'react-use/esm/useAsync';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport { DeleteEntityConfirmationDialog } from './DeleteEntityConfirmationDialog';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n errorBox: {\n color: theme.palette.status.error,\n backgroundColor: theme.palette.errorBackground,\n padding: '1em',\n margin: '1em',\n border: `1px solid ${theme.palette.status.error}`,\n },\n errorTitle: {\n width: '100%',\n fontWeight: 'bold',\n },\n successMessage: {\n background: theme.palette.infoBackground,\n color: theme.palette.infoText,\n padding: theme.spacing(2),\n },\n}));\n\nconst RenderErrorContext = ({\n error,\n rowData,\n}: {\n error: { message: string };\n rowData: UnprocessedEntity;\n}) => {\n if (error.message.includes('tags.')) {\n return (\n <>\n <Typography>Tags</Typography>\n <ul>\n {rowData.unprocessed_entity.metadata.tags?.map(t => (\n <li>{t}</li>\n ))}\n </ul>\n </>\n );\n }\n\n if (error.message.includes('metadata.name')) {\n return (\n <>\n <Typography>Name</Typography>\n <Typography variant=\"caption\">\n {rowData.unprocessed_entity.metadata.name}\n </Typography>\n </>\n );\n }\n\n return null;\n};\n\n/**\n * Converts input datetime which lacks timezone info into user's local time so that they can\n * easily understand the times.\n */\nexport const convertTimeToLocalTimezone = (dateTime: string | Date) => {\n const isoDateTime =\n typeof dateTime === 'string' ? dateTime : dateTime.toISOString();\n\n const strDateTime = DateTime.fromISO(isoDateTime, {\n zone: DateTime.local().zoneName,\n });\n\n return strDateTime.toFormat('yyyy-MM-dd hh:mm:ss ZZZZ');\n};\n\nexport const FailedEntities = () => {\n const classes = useStyles();\n const unprocessedApi = useApi(catalogUnprocessedEntitiesApiRef);\n const {\n loading,\n error,\n value: data,\n } = useAsync(async () => await unprocessedApi.failed());\n const [, setSelectedSearchTerm] = useState<string>('');\n const unprocessedEntityApi = useApi(catalogUnprocessedEntitiesApiRef);\n const alertApi = useApi(alertApiRef);\n const [selectedEntityId, setSelectedEntityId] = useState<string | undefined>(\n undefined,\n );\n const [selectedEntityRef, setSelectedEntityRef] = useState<\n string | undefined\n >(undefined);\n const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n const handleDelete = ({\n entityId,\n entityRef,\n }: {\n entityId: string;\n entityRef: string;\n }) => {\n setSelectedEntityId(entityId);\n setSelectedEntityRef(entityRef);\n setConfirmationDialogOpen(true);\n };\n\n const cleanUpAfterRemoval = async () => {\n try {\n if (selectedEntityId) {\n await unprocessedEntityApi.delete(selectedEntityId);\n alertApi.post({\n message: `Entity ${selectedEntityRef} has been deleted`,\n severity: 'success',\n });\n }\n } catch (e) {\n alertApi.post({\n message: `Ran into an issue when deleting ${selectedEntityRef}. Please try again later.`,\n severity: 'error',\n });\n }\n setConfirmationDialogOpen(false);\n };\n\n const columns: TableColumn[] = [\n {\n title: <Typography>entityRef</Typography>,\n sorting: true,\n field: 'entity_ref',\n customFilterAndSearch: (query, row: any) =>\n row.entity_ref\n .toLocaleUpperCase('en-US')\n .includes(query.toLocaleUpperCase('en-US')),\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).entity_ref,\n },\n {\n title: <Typography>Location Path</Typography>,\n sorting: true,\n field: 'location_key',\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).location_key,\n },\n {\n title: <Typography>Kind</Typography>,\n sorting: true,\n field: 'kind',\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.kind,\n },\n {\n title: <Typography>Owner</Typography>,\n sorting: true,\n field: 'unprocessed_entity.spec.owner',\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.spec?.owner ||\n 'unknown',\n },\n {\n title: <Typography>Last Discovery At</Typography>,\n sorting: true,\n field: 'last_discovery_at',\n render: (rowData: UnprocessedEntity | {}) =>\n convertTimeToLocalTimezone(\n (rowData as UnprocessedEntity).last_discovery_at,\n ) || 'unknown',\n },\n {\n title: <Typography>Next Refresh At</Typography>,\n sorting: true,\n field: 'next_update_at',\n render: (rowData: UnprocessedEntity | {}) =>\n convertTimeToLocalTimezone(\n (rowData as UnprocessedEntity).next_update_at,\n ) || 'unknown',\n },\n {\n title: <Typography>Raw Entity Definition</Typography>,\n sorting: false,\n render: (rowData: UnprocessedEntity | {}) => (\n <EntityDialog entity={rowData as UnprocessedEntity} />\n ),\n },\n {\n title: <Typography>Actions</Typography>,\n render: (rowData: UnprocessedEntity | {}) => {\n const { entity_id, entity_ref } = rowData as UnprocessedEntity;\n\n return (\n <IconButton\n aria-label=\"delete\"\n onClick={() =>\n handleDelete({\n entityId: entity_id,\n entityRef: entity_ref,\n })\n }\n >\n <DeleteIcon fontSize=\"small\" data-testid=\"delete-icon\" />\n </IconButton>\n );\n },\n },\n ];\n\n return (\n <>\n <Table\n options={{ pageSize: 20, search: true }}\n columns={columns}\n data={data?.entities ?? []}\n emptyContent={\n <Typography className={classes.successMessage}>\n No failed entities found\n </Typography>\n }\n onSearchChange={(searchTerm: string) =>\n setSelectedSearchTerm(searchTerm)\n }\n detailPanel={({ rowData }) => {\n const errors = (rowData as UnprocessedEntity).errors;\n return (\n <>\n {errors?.map((e, idx) => {\n return (\n <Box key={idx} className={classes.errorBox}>\n <Typography className={classes.errorTitle}>\n {e.name}\n </Typography>\n <MarkdownContent content={e.message} />\n <RenderErrorContext\n error={e}\n rowData={rowData as UnprocessedEntity}\n />\n </Box>\n );\n })}\n </>\n );\n }}\n />\n <DeleteEntityConfirmationDialog\n open={confirmationDialogOpen}\n onClose={() => setConfirmationDialogOpen(false)}\n onConfirm={cleanUpAfterRemoval}\n />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAsCA,MAAM,SAAA,GAAY,UAAA,CAAW,CAAC,KAAA,MAAkB;AAAA,EAC9C,QAAA,EAAU;AAAA,IACR,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,MAAA,CAAO,KAAA;AAAA,IAC5B,eAAA,EAAiB,MAAM,OAAA,CAAQ,eAAA;AAAA,IAC/B,OAAA,EAAS,KAAA;AAAA,IACT,MAAA,EAAQ,KAAA;AAAA,IACR,MAAA,EAAQ,CAAA,UAAA,EAAa,KAAA,CAAM,OAAA,CAAQ,OAAO,KAAK,CAAA;AAAA,GACjD;AAAA,EACA,UAAA,EAAY;AAAA,IACV,KAAA,EAAO,MAAA;AAAA,IACP,UAAA,EAAY;AAAA,GACd;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,UAAA,EAAY,MAAM,OAAA,CAAQ,cAAA;AAA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L,CAAA;AAAA,8BACA,GAAA,CAAC,eAAA,EAAA,EAAgB,OAAA,EAAS,CAAA,CAAE,OAAA,EAAS,CAAA;AAAA,8BACrC,GAAA;AAAA,gBAAC,kBAAA;AAAA,gBAAA;AAAA,kBACC,KAAA,EAAO,CAAA;AAAA,kBACP;AAAA;AAAA;AACF,aAAA,EAAA,EARQ,GASV,CAAA;AAAA,UAEJ,CAAC,CAAA,EACH,CAAA;AAAA,QAEJ;AAAA;AAAA,KACF;AAAA,oBACA,GAAA;AAAA,MAAC,8BAAA;AAAA,MAAA;AAAA,QACC,IAAA,EAAM,sBAAA;AAAA,QACN,OAAA,EAAS,MAAM,yBAAA,CAA0B,KAAK,CAAA;AAAA,QAC9C,SAAA,EAAW;AAAA;AAAA;AACb,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PendingEntities.esm.js","sources":["../../src/components/PendingEntities.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState } from 'react';\n\nimport {\n ErrorPanel,\n Progress,\n TableColumn,\n Table,\n} from '@backstage/core-components';\nimport Typography from '@material-ui/core/Typography';\nimport { Theme, makeStyles } from '@material-ui/core/styles';\n\nimport { UnprocessedEntity } from '../types';\n\nimport { EntityDialog } from './EntityDialog';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogUnprocessedEntitiesApiRef } from '../api';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n successMessage: {\n background: theme.palette.infoBackground,\n color: theme.palette.infoText,\n padding: theme.spacing(2),\n },\n}));\n\nexport const PendingEntities = () => {\n const classes = useStyles();\n const unprocessedApi = useApi(catalogUnprocessedEntitiesApiRef);\n const {\n loading,\n error,\n value: data,\n } = useAsync(async () => await unprocessedApi.pending());\n const [, setSelectedSearchTerm] = useState<string>('');\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n const columns: TableColumn[] = [\n {\n title: <Typography>entityRef</Typography>,\n sorting: true,\n field: 'entity_ref',\n customFilterAndSearch: (query, row: any) =>\n row.entity_ref\n .toLocaleUpperCase('en-US')\n .includes(query.toLocaleUpperCase('en-US')),\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).entity_ref,\n },\n {\n title: <Typography>Kind</Typography>,\n sorting: true,\n field: 'kind',\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.kind,\n },\n {\n title: <Typography>Owner</Typography>,\n sorting: true,\n field: 'unprocessed_entity.spec.owner',\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.spec?.owner ||\n 'unknown',\n },\n {\n title: <Typography>Raw</Typography>,\n sorting: false,\n render: (rowData: UnprocessedEntity | {}) => (\n <EntityDialog entity={rowData as UnprocessedEntity} />\n ),\n },\n ];\n return (\n <>\n <Table\n options={{ pageSize: 20 }}\n columns={columns}\n data={data?.entities || []}\n onSearchChange={(searchTerm: string) =>\n setSelectedSearchTerm(searchTerm)\n }\n emptyContent={\n <Typography className={classes.successMessage}>\n No pending entities found\n </Typography>\n }\n />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAiCA,MAAM,SAAA,GAAY,
|
|
1
|
+
{"version":3,"file":"PendingEntities.esm.js","sources":["../../src/components/PendingEntities.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState } from 'react';\n\nimport {\n ErrorPanel,\n Progress,\n TableColumn,\n Table,\n} from '@backstage/core-components';\nimport Typography from '@material-ui/core/Typography';\nimport { Theme, makeStyles } from '@material-ui/core/styles';\n\nimport { UnprocessedEntity } from '../types';\n\nimport { EntityDialog } from './EntityDialog';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogUnprocessedEntitiesApiRef } from '../api';\n\nconst useStyles = makeStyles((theme: Theme) => ({\n successMessage: {\n background: theme.palette.infoBackground,\n color: theme.palette.infoText,\n padding: theme.spacing(2),\n },\n}));\n\nexport const PendingEntities = () => {\n const classes = useStyles();\n const unprocessedApi = useApi(catalogUnprocessedEntitiesApiRef);\n const {\n loading,\n error,\n value: data,\n } = useAsync(async () => await unprocessedApi.pending());\n const [, setSelectedSearchTerm] = useState<string>('');\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n const columns: TableColumn[] = [\n {\n title: <Typography>entityRef</Typography>,\n sorting: true,\n field: 'entity_ref',\n customFilterAndSearch: (query, row: any) =>\n row.entity_ref\n .toLocaleUpperCase('en-US')\n .includes(query.toLocaleUpperCase('en-US')),\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).entity_ref,\n },\n {\n title: <Typography>Kind</Typography>,\n sorting: true,\n field: 'kind',\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.kind,\n },\n {\n title: <Typography>Owner</Typography>,\n sorting: true,\n field: 'unprocessed_entity.spec.owner',\n render: (rowData: UnprocessedEntity | {}) =>\n (rowData as UnprocessedEntity).unprocessed_entity.spec?.owner ||\n 'unknown',\n },\n {\n title: <Typography>Raw</Typography>,\n sorting: false,\n render: (rowData: UnprocessedEntity | {}) => (\n <EntityDialog entity={rowData as UnprocessedEntity} />\n ),\n },\n ];\n return (\n <>\n <Table\n options={{ pageSize: 20 }}\n columns={columns}\n data={data?.entities || []}\n onSearchChange={(searchTerm: string) =>\n setSelectedSearchTerm(searchTerm)\n }\n emptyContent={\n <Typography className={classes.successMessage}>\n No pending entities found\n </Typography>\n }\n />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAiCA,MAAM,SAAA,GAAY,UAAA,CAAW,CAAC,KAAA,MAAkB;AAAA,EAC9C,cAAA,EAAgB;AAAA,IACd,UAAA,EAAY,MAAM,OAAA,CAAQ,cAAA;AAAA,IAC1B,KAAA,EAAO,MAAM,OAAA,CAAQ,QAAA;AAAA,IACrB,OAAA,EAAS,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA;AAE5B,CAAA,CAAE,CAAA;AAEK,MAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,cAAA,GAAiB,OAAO,gCAAgC,CAAA;AAC9D,EAAA,MAAM;AAAA,IACJ,OAAA;AAAA,IACA,KAAA;AAAA,IACA,KAAA,EAAO;AAAA,MACL,QAAA,CAAS,YAAY,MAAM,cAAA,CAAe,SAAS,CAAA;AACvD,EAAA,MAAM,GAAG,qBAAqB,CAAA,GAAI,SAAiB,EAAE,CAAA;AAErD,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,2BAAQ,QAAA,EAAA,EAAS,CAAA;AAAA,EACnB;AACA,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,uBAAO,GAAA,CAAC,cAAW,KAAA,EAAc,CAAA;AAAA,EACnC;AAEA,EAAA,MAAM,OAAA,GAAyB;AAAA,IAC7B;AAAA,MACE,KAAA,kBAAO,GAAA,CAAC,UAAA,EAAA,EAAW,QAAA,EAA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AA,IAAY,EAAC;AAAA,MACzB,cAAA,EAAgB,CAAC,UAAA,KACf,qBAAA,CAAsB,UAAU,CAAA;AAAA,MAElC,8BACE,GAAA,CAAC,UAAA,EAAA,EAAW,SAAA,EAAW,OAAA,CAAQ,gBAAgB,QAAA,EAAA,2BAAA,EAE/C;AAAA;AAAA,GAEJ,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnprocessedEntities.esm.js","sources":["../../src/components/UnprocessedEntities.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ChangeEvent, useState } from 'react';\n\nimport { Page, Header, Content } from '@backstage/core-components';\nimport Tab from '@material-ui/core/Tab';\nimport { makeStyles } from '@material-ui/core/styles';\nimport TabContext from '@material-ui/lab/TabContext';\nimport TabList from '@material-ui/lab/TabList';\nimport TabPanel from '@material-ui/lab/TabPanel';\n\nimport { FailedEntities } from './FailedEntities';\nimport { PendingEntities } from './PendingEntities';\n\nconst useStyles = makeStyles(() => ({\n tabPanel: {\n paddingLeft: '0px',\n paddingRight: '0px',\n },\n}));\n\n/** @public */\nexport const UnprocessedEntitiesContent = () => {\n const classes = useStyles();\n const [tab, setTab] = useState('failed');\n const handleChange = (_event: ChangeEvent<{}>, tabValue: string) => {\n setTab(tabValue);\n };\n\n return (\n <TabContext value={tab}>\n <TabList onChange={handleChange}>\n <Tab label=\"Failed\" value=\"failed\" />\n <Tab label=\"Pending\" value=\"pending\" />\n </TabList>\n <TabPanel value=\"failed\" className={classes.tabPanel}>\n <FailedEntities />\n </TabPanel>\n <TabPanel value=\"pending\" className={classes.tabPanel}>\n <PendingEntities />\n </TabPanel>\n </TabContext>\n );\n};\n\nexport const UnprocessedEntities = () => {\n return (\n <Page themeId=\"tool\">\n <Header title=\"Unprocessed Entities\" />\n <Content>\n <UnprocessedEntitiesContent />\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA2BA,MAAM,SAAA,GAAY,WAAW,OAAO;AAAA,EAClC,
|
|
1
|
+
{"version":3,"file":"UnprocessedEntities.esm.js","sources":["../../src/components/UnprocessedEntities.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ChangeEvent, useState } from 'react';\n\nimport { Page, Header, Content } from '@backstage/core-components';\nimport Tab from '@material-ui/core/Tab';\nimport { makeStyles } from '@material-ui/core/styles';\nimport TabContext from '@material-ui/lab/TabContext';\nimport TabList from '@material-ui/lab/TabList';\nimport TabPanel from '@material-ui/lab/TabPanel';\n\nimport { FailedEntities } from './FailedEntities';\nimport { PendingEntities } from './PendingEntities';\n\nconst useStyles = makeStyles(() => ({\n tabPanel: {\n paddingLeft: '0px',\n paddingRight: '0px',\n },\n}));\n\n/** @public */\nexport const UnprocessedEntitiesContent = () => {\n const classes = useStyles();\n const [tab, setTab] = useState('failed');\n const handleChange = (_event: ChangeEvent<{}>, tabValue: string) => {\n setTab(tabValue);\n };\n\n return (\n <TabContext value={tab}>\n <TabList onChange={handleChange}>\n <Tab label=\"Failed\" value=\"failed\" />\n <Tab label=\"Pending\" value=\"pending\" />\n </TabList>\n <TabPanel value=\"failed\" className={classes.tabPanel}>\n <FailedEntities />\n </TabPanel>\n <TabPanel value=\"pending\" className={classes.tabPanel}>\n <PendingEntities />\n </TabPanel>\n </TabContext>\n );\n};\n\nexport const UnprocessedEntities = () => {\n return (\n <Page themeId=\"tool\">\n <Header title=\"Unprocessed Entities\" />\n <Content>\n <UnprocessedEntitiesContent />\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA2BA,MAAM,SAAA,GAAY,WAAW,OAAO;AAAA,EAClC,QAAA,EAAU;AAAA,IACR,WAAA,EAAa,KAAA;AAAA,IACb,YAAA,EAAc;AAAA;AAElB,CAAA,CAAE,CAAA;AAGK,MAAM,6BAA6B,MAAM;AAC9C,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,CAAC,GAAA,EAAK,MAAM,CAAA,GAAI,SAAS,QAAQ,CAAA;AACvC,EAAA,MAAM,YAAA,GAAe,CAAC,MAAA,EAAyB,QAAA,KAAqB;AAClE,IAAA,MAAA,CAAO,QAAQ,CAAA;AAAA,EACjB,CAAA;AAEA,EAAA,uBACE,IAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAO,GAAA,EACjB,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAC,OAAA,EAAA,EAAQ,UAAU,YAAA,EACjB,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,GAAA,EAAA,EAAI,KAAA,EAAM,QAAA,EAAS,KAAA,EAAM,QAAA,EAAS,CAAA;AAAA,sBACnC,GAAA,CAAC,GAAA,EAAA,EAAI,KAAA,EAAM,SAAA,EAAU,OAAM,SAAA,EAAU;AAAA,KAAA,EACvC,CAAA;AAAA,oBACA,GAAA,CAAC,YAAS,KAAA,EAAM,QAAA,EAAS,WAAW,OAAA,CAAQ,QAAA,EAC1C,QAAA,kBAAA,GAAA,CAAC,cAAA,EAAA,EAAe,CAAA,EAClB,CAAA;AAAA,oBACA,GAAA,CAAC,YAAS,KAAA,EAAM,SAAA,EAAU,WAAW,OAAA,CAAQ,QAAA,EAC3C,QAAA,kBAAA,GAAA,CAAC,eAAA,EAAA,EAAgB,CAAA,EACnB;AAAA,GAAA,EACF,CAAA;AAEJ;AAEO,MAAM,sBAAsB,MAAM;AACvC,EAAA,uBACE,IAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,MAAA,EACZ,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,OAAM,sBAAA,EAAuB,CAAA;AAAA,oBACrC,GAAA,CAAC,OAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,0BAAA,EAAA,EAA2B,CAAA,EAC9B;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
package/dist/package.json.esm.js
CHANGED
package/dist/plugin.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createPlugin, createApiFactory,
|
|
1
|
+
import { createPlugin, createApiFactory, fetchApiRef, discoveryApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
|
|
2
2
|
import { rootRouteRef } from './routes.esm.js';
|
|
3
|
-
import {
|
|
3
|
+
import { CatalogUnprocessedEntitiesClient, catalogUnprocessedEntitiesApiRef } from './api/index.esm.js';
|
|
4
4
|
|
|
5
5
|
const catalogUnprocessedEntitiesPlugin = createPlugin({
|
|
6
6
|
id: "catalog-unprocessed-entities",
|
package/dist/plugin.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\n\nimport { rootRouteRef } from './routes';\nimport {\n CatalogUnprocessedEntitiesClient,\n catalogUnprocessedEntitiesApiRef,\n} from './api';\n\n/**\n * Plugin entry point\n *\n * @public\n */\nexport const catalogUnprocessedEntitiesPlugin = createPlugin({\n id: 'catalog-unprocessed-entities',\n routes: {\n root: rootRouteRef,\n },\n apis: [\n createApiFactory({\n api: catalogUnprocessedEntitiesApiRef,\n deps: { discoveryApi: discoveryApiRef, fetchApi: fetchApiRef },\n factory: ({ discoveryApi, fetchApi }) =>\n new CatalogUnprocessedEntitiesClient(discoveryApi, fetchApi),\n }),\n ],\n});\n\n/**\n * Tool page for the Catalog Unprocessed Entities Plugin\n *\n * @public\n */\nexport const CatalogUnprocessedEntitiesPage =\n catalogUnprocessedEntitiesPlugin.provide(\n createRoutableExtension({\n name: 'CatalogUnprocessedEntitiesPage',\n component: () =>\n import('./components/UnprocessedEntities').then(\n m => m.UnprocessedEntities,\n ),\n mountPoint: rootRouteRef,\n }),\n );\n"],"names":[],"mappings":";;;;AAkCO,MAAM,mCAAmC,
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\n\nimport { rootRouteRef } from './routes';\nimport {\n CatalogUnprocessedEntitiesClient,\n catalogUnprocessedEntitiesApiRef,\n} from './api';\n\n/**\n * Plugin entry point\n *\n * @public\n */\nexport const catalogUnprocessedEntitiesPlugin = createPlugin({\n id: 'catalog-unprocessed-entities',\n routes: {\n root: rootRouteRef,\n },\n apis: [\n createApiFactory({\n api: catalogUnprocessedEntitiesApiRef,\n deps: { discoveryApi: discoveryApiRef, fetchApi: fetchApiRef },\n factory: ({ discoveryApi, fetchApi }) =>\n new CatalogUnprocessedEntitiesClient(discoveryApi, fetchApi),\n }),\n ],\n});\n\n/**\n * Tool page for the Catalog Unprocessed Entities Plugin\n *\n * @public\n */\nexport const CatalogUnprocessedEntitiesPage =\n catalogUnprocessedEntitiesPlugin.provide(\n createRoutableExtension({\n name: 'CatalogUnprocessedEntitiesPage',\n component: () =>\n import('./components/UnprocessedEntities').then(\n m => m.UnprocessedEntities,\n ),\n mountPoint: rootRouteRef,\n }),\n );\n"],"names":[],"mappings":";;;;AAkCO,MAAM,mCAAmC,YAAA,CAAa;AAAA,EAC3D,EAAA,EAAI,8BAAA;AAAA,EACJ,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,gBAAA,CAAiB;AAAA,MACf,GAAA,EAAK,gCAAA;AAAA,MACL,IAAA,EAAM,EAAE,YAAA,EAAc,eAAA,EAAiB,UAAU,WAAA,EAAY;AAAA,MAC7D,OAAA,EAAS,CAAC,EAAE,YAAA,EAAc,UAAS,KACjC,IAAI,gCAAA,CAAiC,YAAA,EAAc,QAAQ;AAAA,KAC9D;AAAA;AAEL,CAAC;AAOM,MAAM,iCACX,gCAAA,CAAiC,OAAA;AAAA,EAC/B,uBAAA,CAAwB;AAAA,IACtB,IAAA,EAAM,gCAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,yCAAkC,CAAA,CAAE,IAAA;AAAA,MACzC,OAAK,CAAA,CAAE;AAAA,KACT;AAAA,IACF,UAAA,EAAY;AAAA,GACb;AACH;;;;"}
|
package/dist/routes.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'catalog-unprocessed-entities',\n});\n"],"names":[],"mappings":";;AAiBO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'catalog-unprocessed-entities',\n});\n"],"names":[],"mappings":";;AAiBO,MAAM,eAAe,cAAA,CAAe;AAAA,EACzC,EAAA,EAAI;AACN,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-unprocessed-entities",
|
|
3
|
-
"version": "0.2.20
|
|
3
|
+
"version": "0.2.20",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "frontend-plugin",
|
|
6
6
|
"pluginId": "catalog-unprocessed-entities",
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
"test": "backstage-cli package test"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@backstage/catalog-model": "1.7.5",
|
|
66
|
-
"@backstage/core-compat-api": "0.
|
|
67
|
-
"@backstage/core-components": "0.17.5
|
|
68
|
-
"@backstage/core-plugin-api": "1.10.9",
|
|
69
|
-
"@backstage/errors": "1.2.7",
|
|
70
|
-
"@backstage/frontend-plugin-api": "0.11.0
|
|
65
|
+
"@backstage/catalog-model": "^1.7.5",
|
|
66
|
+
"@backstage/core-compat-api": "^0.5.0",
|
|
67
|
+
"@backstage/core-components": "^0.17.5",
|
|
68
|
+
"@backstage/core-plugin-api": "^1.10.9",
|
|
69
|
+
"@backstage/errors": "^1.2.7",
|
|
70
|
+
"@backstage/frontend-plugin-api": "^0.11.0",
|
|
71
71
|
"@material-ui/core": "^4.9.13",
|
|
72
72
|
"@material-ui/icons": "^4.9.1",
|
|
73
73
|
"@material-ui/lab": "^4.0.0-alpha.60",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"react-use": "^17.2.4"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@backstage/cli": "0.
|
|
79
|
-
"@backstage/dev-utils": "1.1.13
|
|
78
|
+
"@backstage/cli": "^0.34.0",
|
|
79
|
+
"@backstage/dev-utils": "^1.1.13",
|
|
80
80
|
"@testing-library/jest-dom": "^6.0.0",
|
|
81
81
|
"@testing-library/react": "^16.0.0",
|
|
82
82
|
"@types/react": "^18.0.0",
|