@backstage/plugin-catalog-unprocessed-entities 0.2.16-next.1 → 0.2.16

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 CHANGED
@@ -1,5 +1,39 @@
1
1
  # @backstage/plugin-catalog-unprocessed-entities
2
2
 
3
+ ## 0.2.16
4
+
5
+ ### Patch Changes
6
+
7
+ - ba88bfa: Added confirmation popup for delete entities in Catalog Unprocessed Entities plugin
8
+ - a47fd39: Removes instances of default React imports, a necessary update for the upcoming React 19 migration.
9
+
10
+ <https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html>
11
+
12
+ - 2479827: Fixed the `convertTimeToLocalTimezone` function in the FailedEntities component to correctly parse ISO 8601 date strings and set the timezone to the current local timezone.
13
+ - Updated dependencies
14
+ - @backstage/frontend-plugin-api@0.10.1
15
+ - @backstage/core-compat-api@0.4.1
16
+ - @backstage/core-components@0.17.1
17
+ - @backstage/core-plugin-api@1.10.6
18
+ - @backstage/catalog-model@1.7.3
19
+ - @backstage/errors@1.2.7
20
+
21
+ ## 0.2.16-next.2
22
+
23
+ ### Patch Changes
24
+
25
+ - a47fd39: Removes instances of default React imports, a necessary update for the upcoming React 19 migration.
26
+
27
+ <https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html>
28
+
29
+ - Updated dependencies
30
+ - @backstage/frontend-plugin-api@0.10.1-next.1
31
+ - @backstage/core-compat-api@0.4.1-next.2
32
+ - @backstage/core-components@0.17.1-next.1
33
+ - @backstage/core-plugin-api@1.10.6-next.0
34
+ - @backstage/catalog-model@1.7.3
35
+ - @backstage/errors@1.2.7
36
+
3
37
  ## 0.2.16-next.1
4
38
 
5
39
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx } from 'react/jsx-runtime';
2
2
  import { ApiBlueprint, createApiFactory, discoveryApiRef, fetchApiRef, PageBlueprint, NavItemBlueprint, createFrontendPlugin } from '@backstage/frontend-plugin-api';
3
3
  import { catalogUnprocessedEntitiesApiRef, CatalogUnprocessedEntitiesClient } from '../api/index.esm.js';
4
4
  import { convertLegacyRouteRef, compatWrapper } from '@backstage/core-compat-api';
@@ -22,7 +22,7 @@ const catalogUnprocessedEntitiesPage = PageBlueprint.make({
22
22
  defaultPath: "/catalog-unprocessed-entities",
23
23
  routeRef: convertLegacyRouteRef(rootRouteRef),
24
24
  loader: () => import('../components/UnprocessedEntities.esm.js').then(
25
- (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.UnprocessedEntities, null))
25
+ (m) => compatWrapper(/* @__PURE__ */ jsx(m.UnprocessedEntities, {}))
26
26
  )
27
27
  }
28
28
  });
@@ -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 React from 'react';\nimport {\n createApiFactory,\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: {\n factory: createApiFactory({\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\n/** @alpha */\nexport const catalogUnprocessedEntitiesPage = PageBlueprint.make({\n params: {\n defaultPath: '/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 id: 'catalog-unprocessed-entities',\n routes: {\n root: convertLegacyRouteRef(rootRouteRef),\n },\n extensions: [\n catalogUnprocessedEntitiesApi,\n catalogUnprocessedEntitiesPage,\n catalogUnprocessedEntitiesNavItem,\n ],\n});\n"],"names":[],"mappings":";;;;;;;AAuCa,MAAA,6BAAA,GAAgC,aAAa,IAAK,CAAA;AAAA,EAC7D,MAAQ,EAAA;AAAA,IACN,SAAS,gBAAiB,CAAA;AAAA,MACxB,GAAK,EAAA,gCAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA;AAAA,OACZ;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,YAAA,EAAc,UACxB,KAAA,IAAI,gCAAiC,CAAA,YAAA,EAAc,QAAQ;AAAA,KAC9D;AAAA;AAEL,CAAC;AAGY,MAAA,8BAAA,GAAiC,cAAc,IAAK,CAAA;AAAA,EAC/D,MAAQ,EAAA;AAAA,IACN,WAAa,EAAA,+BAAA;AAAA,IACb,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,MAAQ,EAAA,MACN,OAAO,0CAAmC,CAAE,CAAA,IAAA;AAAA,MAAK,OAC/C,aAAc,iBAAA,KAAA,CAAA,aAAA,CAAC,CAAE,CAAA,mBAAA,EAAF,IAAsB,CAAE;AAAA;AACzC;AAEN,CAAC;AAGY,MAAA,iCAAA,GAAoC,iBAAiB,IAAK,CAAA;AAAA,EACrE,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,sBAAA;AAAA,IACP,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,IAAM,EAAA;AAAA;AAEV,CAAC;AAGD,aAAe,oBAAqB,CAAA;AAAA,EAClC,EAAI,EAAA,8BAAA;AAAA,EACJ,MAAQ,EAAA;AAAA,IACN,IAAA,EAAM,sBAAsB,YAAY;AAAA,GAC1C;AAAA,EACA,UAAY,EAAA;AAAA,IACV,6BAAA;AAAA,IACA,8BAAA;AAAA,IACA;AAAA;AAEJ,CAAC,CAAA;;;;"}
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 createApiFactory,\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: {\n factory: createApiFactory({\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\n/** @alpha */\nexport const catalogUnprocessedEntitiesPage = PageBlueprint.make({\n params: {\n defaultPath: '/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 id: 'catalog-unprocessed-entities',\n routes: {\n root: convertLegacyRouteRef(rootRouteRef),\n },\n extensions: [\n catalogUnprocessedEntitiesApi,\n catalogUnprocessedEntitiesPage,\n catalogUnprocessedEntitiesNavItem,\n ],\n});\n"],"names":[],"mappings":";;;;;;;AAsCa,MAAA,6BAAA,GAAgC,aAAa,IAAK,CAAA;AAAA,EAC7D,MAAQ,EAAA;AAAA,IACN,SAAS,gBAAiB,CAAA;AAAA,MACxB,GAAK,EAAA,gCAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA;AAAA,OACZ;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,YAAA,EAAc,UACxB,KAAA,IAAI,gCAAiC,CAAA,YAAA,EAAc,QAAQ;AAAA,KAC9D;AAAA;AAEL,CAAC;AAGY,MAAA,8BAAA,GAAiC,cAAc,IAAK,CAAA;AAAA,EAC/D,MAAQ,EAAA;AAAA,IACN,WAAa,EAAA,+BAAA;AAAA,IACb,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,MAAQ,EAAA,MACN,OAAO,0CAAmC,CAAE,CAAA,IAAA;AAAA,MAAK,OAC/C,aAAc,iBAAA,GAAA,CAAC,CAAE,CAAA,mBAAA,EAAF,EAAsB,CAAE;AAAA;AACzC;AAEN,CAAC;AAGY,MAAA,iCAAA,GAAoC,iBAAiB,IAAK,CAAA;AAAA,EACrE,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,sBAAA;AAAA,IACP,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,IAAM,EAAA;AAAA;AAEV,CAAC;AAGD,aAAe,oBAAqB,CAAA;AAAA,EAClC,EAAI,EAAA,8BAAA;AAAA,EACJ,MAAQ,EAAA;AAAA,IACN,IAAA,EAAM,sBAAsB,YAAY;AAAA,GAC1C;AAAA,EACA,UAAY,EAAA;AAAA,IACV,6BAAA;AAAA,IACA,8BAAA;AAAA,IACA;AAAA;AAEJ,CAAC,CAAA;;;;"}
package/dist/alpha.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
2
+ import * as react from 'react';
2
3
  import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
3
- import React__default from 'react';
4
4
 
5
5
  /** @alpha */
6
6
  declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
@@ -43,7 +43,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
43
43
  configInput: {
44
44
  path?: string | undefined;
45
45
  };
46
- output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
46
+ output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
47
47
  optional: true;
48
48
  }>;
49
49
  inputs: {};
@@ -1,8 +1,9 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import Button from '@material-ui/core/Button';
2
3
  import Dialog from '@material-ui/core/Dialog';
3
4
  import DialogActions from '@material-ui/core/DialogActions';
4
5
  import DialogTitle from '@material-ui/core/DialogTitle';
5
- import React, { useState } from 'react';
6
+ import { useState } from 'react';
6
7
  import { assertError } from '@backstage/errors';
7
8
 
8
9
  function DeleteEntityConfirmationDialog(props) {
@@ -18,16 +19,22 @@ function DeleteEntityConfirmationDialog(props) {
18
19
  setBusy(false);
19
20
  }
20
21
  };
21
- return /* @__PURE__ */ React.createElement(Dialog, { open, onClose }, /* @__PURE__ */ React.createElement(DialogTitle, { id: "responsive-dialog-title" }, "Are you sure you want to delete this entity?"), /* @__PURE__ */ React.createElement(DialogActions, null, /* @__PURE__ */ React.createElement(
22
- Button,
23
- {
24
- variant: "contained",
25
- color: "secondary",
26
- disabled: busy,
27
- onClick: onDelete
28
- },
29
- "Delete"
30
- ), /* @__PURE__ */ React.createElement(Button, { onClick: onClose, color: "primary" }, "Cancel")));
22
+ return /* @__PURE__ */ jsxs(Dialog, { open, onClose, children: [
23
+ /* @__PURE__ */ jsx(DialogTitle, { id: "responsive-dialog-title", children: "Are you sure you want to delete this entity?" }),
24
+ /* @__PURE__ */ jsxs(DialogActions, { children: [
25
+ /* @__PURE__ */ jsx(
26
+ Button,
27
+ {
28
+ variant: "contained",
29
+ color: "secondary",
30
+ disabled: busy,
31
+ onClick: onDelete,
32
+ children: "Delete"
33
+ }
34
+ ),
35
+ /* @__PURE__ */ jsx(Button, { onClick: onClose, color: "primary", children: "Cancel" })
36
+ ] })
37
+ ] });
31
38
  }
32
39
 
33
40
  export { DeleteEntityConfirmationDialog };
@@ -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 React, { 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,KACA,EAAA;AACA,EAAA,MAAM,EAAE,IAAA,EAAM,OAAS,EAAA,SAAA,EAAc,GAAA,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,IAAI,IAAA;AACF,MAAU,SAAA,EAAA;AAAA,aACH,GAAK,EAAA;AACZ,MAAA,WAAA,CAAY,GAAG,CAAA;AAAA,KACf,SAAA;AACA,MAAA,OAAA,CAAQ,KAAK,CAAA;AAAA;AACf,GACF;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,MAAO,EAAA,EAAA,IAAA,EAAY,OAClB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,WAAY,EAAA,EAAA,EAAA,EAAG,yBAA0B,EAAA,EAAA,8CAE1C,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,aACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,OAAQ,EAAA,WAAA;AAAA,MACR,KAAM,EAAA,WAAA;AAAA,MACN,QAAU,EAAA,IAAA;AAAA,MACV,OAAS,EAAA;AAAA,KAAA;AAAA,IACV;AAAA,GAED,sCACC,MAAO,EAAA,EAAA,OAAA,EAAS,SAAS,KAAM,EAAA,SAAA,EAAA,EAAU,QAE1C,CACF,CACF,CAAA;AAEJ;;;;"}
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,KACA,EAAA;AACA,EAAA,MAAM,EAAE,IAAA,EAAM,OAAS,EAAA,SAAA,EAAc,GAAA,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,IAAI,IAAA;AACF,MAAU,SAAA,EAAA;AAAA,aACH,GAAK,EAAA;AACZ,MAAA,WAAA,CAAY,GAAG,CAAA;AAAA,KACf,SAAA;AACA,MAAA,OAAA,CAAQ,KAAK,CAAA;AAAA;AACf,GACF;AAEA,EACE,uBAAA,IAAA,CAAC,MAAO,EAAA,EAAA,IAAA,EAAY,OAClB,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,WAAA,EAAA,EAAY,EAAG,EAAA,yBAAA,EAA0B,QAE1C,EAAA,8CAAA,EAAA,CAAA;AAAA,yBACC,aACC,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAQ,EAAA,WAAA;AAAA,UACR,KAAM,EAAA,WAAA;AAAA,UACN,QAAU,EAAA,IAAA;AAAA,UACV,OAAS,EAAA,QAAA;AAAA,UACV,QAAA,EAAA;AAAA;AAAA,OAED;AAAA,0BACC,MAAO,EAAA,EAAA,OAAA,EAAS,OAAS,EAAA,KAAA,EAAM,WAAU,QAE1C,EAAA,QAAA,EAAA;AAAA,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,5 @@
1
- import React, { useState } from 'react';
1
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
+ import { useState } from 'react';
2
3
  import Dialog from '@material-ui/core/Dialog';
3
4
  import DialogContent from '@material-ui/core/DialogContent';
4
5
  import DialogTitle from '@material-ui/core/DialogTitle';
@@ -36,7 +37,7 @@ const EntityDialog = ({ entity }) => {
36
37
  setOpen(false);
37
38
  };
38
39
  const dialogContent = () => {
39
- return /* @__PURE__ */ React.createElement(
40
+ return /* @__PURE__ */ jsx(
40
41
  CodeSnippet,
41
42
  {
42
43
  language: "json",
@@ -45,15 +46,21 @@ const EntityDialog = ({ entity }) => {
45
46
  }
46
47
  );
47
48
  };
48
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(IconButton, { color: "primary", onClick: openDialog }, /* @__PURE__ */ React.createElement(DescriptionIcon, null)), /* @__PURE__ */ React.createElement(Dialog, { fullWidth: true, open, onClose: closeDialog }, /* @__PURE__ */ React.createElement(DialogTitle, { id: "dialog-title" }, /* @__PURE__ */ React.createElement(
49
- IconButton,
50
- {
51
- "aria-label": "close",
52
- className: classes.closeButton,
53
- onClick: closeDialog
54
- },
55
- /* @__PURE__ */ React.createElement(CloseIcon, null)
56
- )), /* @__PURE__ */ React.createElement(DialogContent, null, dialogContent())));
49
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
50
+ /* @__PURE__ */ jsx(IconButton, { color: "primary", onClick: openDialog, children: /* @__PURE__ */ jsx(DescriptionIcon, {}) }),
51
+ /* @__PURE__ */ jsxs(Dialog, { fullWidth: true, open, onClose: closeDialog, children: [
52
+ /* @__PURE__ */ jsx(DialogTitle, { id: "dialog-title", children: /* @__PURE__ */ jsx(
53
+ IconButton,
54
+ {
55
+ "aria-label": "close",
56
+ className: classes.closeButton,
57
+ onClick: closeDialog,
58
+ children: /* @__PURE__ */ jsx(CloseIcon, {})
59
+ }
60
+ ) }),
61
+ /* @__PURE__ */ jsx(DialogContent, { children: dialogContent() })
62
+ ] })
63
+ ] });
57
64
  };
58
65
 
59
66
  export { EntityDialog };
@@ -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 React, { 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,SAAY,GAAA,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAa,CAAA;AAAA,IACX,WAAa,EAAA;AAAA,MACX,QAAU,EAAA,UAAA;AAAA,MACV,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MACtB,GAAA,EAAK,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MACpB,KAAO,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,GAAG;AAAA,KAC/B;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA,QAAA;AAAA,MACV,KAAO,EAAA;AAAA,KACT;AAAA,IACA,OAAS,EAAA;AAAA,MACP,MAAQ,EAAA,iBAAA;AAAA,MACR,OAAS,EAAA;AAAA;AACX,GACD;AACH,CAAA;AAEO,MAAM,YAAe,GAAA,CAAC,EAAE,MAAA,EAA4C,KAAA;AACzE,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA;AACtC,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EAAA,MAAM,aAAa,MAAM;AACvB,IAAA,OAAA,CAAQ,IAAI,CAAA;AAAA,GACd;AAEA,EAAA,MAAM,cAAc,MAAM;AACxB,IAAA,OAAA,CAAQ,KAAK,CAAA;AAAA,GACf;AAEA,EAAA,MAAM,gBAAgB,MAAM;AAC1B,IACE,uBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,QAAS,EAAA,MAAA;AAAA,QACT,eAAe,EAAA,IAAA;AAAA,QACf,IAAM,EAAA,IAAA,CAAK,SAAU,CAAA,MAAA,EAAQ,MAAM,CAAC;AAAA;AAAA,KACtC;AAAA,GAEJ;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,sCACG,UAAW,EAAA,EAAA,KAAA,EAAM,WAAU,OAAS,EAAA,UAAA,EAAA,sCAClC,eAAgB,EAAA,IAAA,CACnB,mBACC,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAO,WAAS,IAAC,EAAA,IAAA,EAAY,SAAS,WACrC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,WAAY,EAAA,EAAA,EAAA,EAAG,cACd,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,YAAW,EAAA,OAAA;AAAA,MACX,WAAW,OAAQ,CAAA,WAAA;AAAA,MACnB,OAAS,EAAA;AAAA,KAAA;AAAA,wCAER,SAAU,EAAA,IAAA;AAAA,GAEf,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,qBAAe,aAAc,EAAE,CAClC,CACF,CAAA;AAEJ;;;;"}
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,SAAY,GAAA,UAAA;AA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AA;AAAA,yBACC,MAAO,EAAA,EAAA,SAAA,EAAS,IAAC,EAAA,IAAA,EAAY,SAAS,WACrC,EAAA,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,WAAA,EAAA,EAAY,IAAG,cACd,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,YAAW,EAAA,OAAA;AAAA,UACX,WAAW,OAAQ,CAAA,WAAA;AAAA,UACnB,OAAS,EAAA,WAAA;AAAA,UAET,8BAAC,SAAU,EAAA,EAAA;AAAA;AAAA,OAEf,EAAA,CAAA;AAAA,sBACA,GAAA,CAAC,aAAe,EAAA,EAAA,QAAA,EAAA,aAAA,EAAgB,EAAA;AAAA,KAClC,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,5 @@
1
- import React, { useState } from 'react';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { useState } from 'react';
2
3
  import { DateTime } from 'luxon';
3
4
  import { Progress, ErrorPanel, Table, MarkdownContent } from '@backstage/core-components';
4
5
  import Box from '@material-ui/core/Box';
@@ -35,10 +36,16 @@ const RenderErrorContext = ({
35
36
  rowData
36
37
  }) => {
37
38
  if (error.message.includes("tags.")) {
38
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, null, "Tags"), /* @__PURE__ */ React.createElement("ul", null, rowData.unprocessed_entity.metadata.tags?.map((t) => /* @__PURE__ */ React.createElement("li", null, t))));
39
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
40
+ /* @__PURE__ */ jsx(Typography, { children: "Tags" }),
41
+ /* @__PURE__ */ jsx("ul", { children: rowData.unprocessed_entity.metadata.tags?.map((t) => /* @__PURE__ */ jsx("li", { children: t })) })
42
+ ] });
39
43
  }
40
44
  if (error.message.includes("metadata.name")) {
41
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, null, "Name"), /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, rowData.unprocessed_entity.metadata.name));
45
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
46
+ /* @__PURE__ */ jsx(Typography, { children: "Name" }),
47
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", children: rowData.unprocessed_entity.metadata.name })
48
+ ] });
42
49
  }
43
50
  return null;
44
51
  };
@@ -66,10 +73,10 @@ const FailedEntities = () => {
66
73
  const [selectedEntityRef, setSelectedEntityRef] = useState(void 0);
67
74
  const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);
68
75
  if (loading) {
69
- return /* @__PURE__ */ React.createElement(Progress, null);
76
+ return /* @__PURE__ */ jsx(Progress, {});
70
77
  }
71
78
  if (error) {
72
- return /* @__PURE__ */ React.createElement(ErrorPanel, { error });
79
+ return /* @__PURE__ */ jsx(ErrorPanel, { error });
73
80
  }
74
81
  const handleDelete = ({
75
82
  entityId,
@@ -98,32 +105,32 @@ const FailedEntities = () => {
98
105
  };
99
106
  const columns = [
100
107
  {
101
- title: /* @__PURE__ */ React.createElement(Typography, null, "entityRef"),
108
+ title: /* @__PURE__ */ jsx(Typography, { children: "entityRef" }),
102
109
  sorting: true,
103
110
  field: "entity_ref",
104
111
  customFilterAndSearch: (query, row) => row.entity_ref.toLocaleUpperCase("en-US").includes(query.toLocaleUpperCase("en-US")),
105
112
  render: (rowData) => rowData.entity_ref
106
113
  },
107
114
  {
108
- title: /* @__PURE__ */ React.createElement(Typography, null, "Location Path"),
115
+ title: /* @__PURE__ */ jsx(Typography, { children: "Location Path" }),
109
116
  sorting: true,
110
117
  field: "location_key",
111
118
  render: (rowData) => rowData.location_key
112
119
  },
113
120
  {
114
- title: /* @__PURE__ */ React.createElement(Typography, null, "Kind"),
121
+ title: /* @__PURE__ */ jsx(Typography, { children: "Kind" }),
115
122
  sorting: true,
116
123
  field: "kind",
117
124
  render: (rowData) => rowData.unprocessed_entity.kind
118
125
  },
119
126
  {
120
- title: /* @__PURE__ */ React.createElement(Typography, null, "Owner"),
127
+ title: /* @__PURE__ */ jsx(Typography, { children: "Owner" }),
121
128
  sorting: true,
122
129
  field: "unprocessed_entity.spec.owner",
123
130
  render: (rowData) => rowData.unprocessed_entity.spec?.owner || "unknown"
124
131
  },
125
132
  {
126
- title: /* @__PURE__ */ React.createElement(Typography, null, "Last Discovery At"),
133
+ title: /* @__PURE__ */ jsx(Typography, { children: "Last Discovery At" }),
127
134
  sorting: true,
128
135
  field: "last_discovery_at",
129
136
  render: (rowData) => convertTimeToLocalTimezone(
@@ -131,7 +138,7 @@ const FailedEntities = () => {
131
138
  ) || "unknown"
132
139
  },
133
140
  {
134
- title: /* @__PURE__ */ React.createElement(Typography, null, "Next Refresh At"),
141
+ title: /* @__PURE__ */ jsx(Typography, { children: "Next Refresh At" }),
135
142
  sorting: true,
136
143
  field: "next_update_at",
137
144
  render: (rowData) => convertTimeToLocalTimezone(
@@ -139,57 +146,64 @@ const FailedEntities = () => {
139
146
  ) || "unknown"
140
147
  },
141
148
  {
142
- title: /* @__PURE__ */ React.createElement(Typography, null, "Raw Entity Definition"),
149
+ title: /* @__PURE__ */ jsx(Typography, { children: "Raw Entity Definition" }),
143
150
  sorting: false,
144
- render: (rowData) => /* @__PURE__ */ React.createElement(EntityDialog, { entity: rowData })
151
+ render: (rowData) => /* @__PURE__ */ jsx(EntityDialog, { entity: rowData })
145
152
  },
146
153
  {
147
- title: /* @__PURE__ */ React.createElement(Typography, null, "Actions"),
154
+ title: /* @__PURE__ */ jsx(Typography, { children: "Actions" }),
148
155
  render: (rowData) => {
149
156
  const { entity_id, entity_ref } = rowData;
150
- return /* @__PURE__ */ React.createElement(
157
+ return /* @__PURE__ */ jsx(
151
158
  IconButton,
152
159
  {
153
160
  "aria-label": "delete",
154
161
  onClick: () => handleDelete({
155
162
  entityId: entity_id,
156
163
  entityRef: entity_ref
157
- })
158
- },
159
- /* @__PURE__ */ React.createElement(DeleteIcon, { fontSize: "small", "data-testid": "delete-icon" })
164
+ }),
165
+ children: /* @__PURE__ */ jsx(DeleteIcon, { fontSize: "small", "data-testid": "delete-icon" })
166
+ }
160
167
  );
161
168
  }
162
169
  }
163
170
  ];
164
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
165
- Table,
166
- {
167
- options: { pageSize: 20, search: true },
168
- columns,
169
- data: data?.entities ?? [],
170
- emptyContent: /* @__PURE__ */ React.createElement(Typography, { className: classes.successMessage }, "No failed entities found"),
171
- onSearchChange: (searchTerm) => setSelectedSearchTerm(searchTerm),
172
- detailPanel: ({ rowData }) => {
173
- const errors = rowData.errors;
174
- return /* @__PURE__ */ React.createElement(React.Fragment, null, errors?.map((e, idx) => {
175
- return /* @__PURE__ */ React.createElement(Box, { key: idx, className: classes.errorBox }, /* @__PURE__ */ React.createElement(Typography, { className: classes.errorTitle }, e.name), /* @__PURE__ */ React.createElement(MarkdownContent, { content: e.message }), /* @__PURE__ */ React.createElement(
176
- RenderErrorContext,
177
- {
178
- error: e,
179
- rowData
180
- }
181
- ));
182
- }));
171
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
172
+ /* @__PURE__ */ jsx(
173
+ Table,
174
+ {
175
+ options: { pageSize: 20, search: true },
176
+ columns,
177
+ data: data?.entities ?? [],
178
+ emptyContent: /* @__PURE__ */ jsx(Typography, { className: classes.successMessage, children: "No failed entities found" }),
179
+ onSearchChange: (searchTerm) => setSelectedSearchTerm(searchTerm),
180
+ detailPanel: ({ rowData }) => {
181
+ const errors = rowData.errors;
182
+ return /* @__PURE__ */ jsx(Fragment, { children: errors?.map((e, idx) => {
183
+ return /* @__PURE__ */ jsxs(Box, { className: classes.errorBox, children: [
184
+ /* @__PURE__ */ jsx(Typography, { className: classes.errorTitle, children: e.name }),
185
+ /* @__PURE__ */ jsx(MarkdownContent, { content: e.message }),
186
+ /* @__PURE__ */ jsx(
187
+ RenderErrorContext,
188
+ {
189
+ error: e,
190
+ rowData
191
+ }
192
+ )
193
+ ] }, idx);
194
+ }) });
195
+ }
183
196
  }
184
- }
185
- ), /* @__PURE__ */ React.createElement(
186
- DeleteEntityConfirmationDialog,
187
- {
188
- open: confirmationDialogOpen,
189
- onClose: () => setConfirmationDialogOpen(false),
190
- onConfirm: cleanUpAfterRemoval
191
- }
192
- ));
197
+ ),
198
+ /* @__PURE__ */ jsx(
199
+ DeleteEntityConfirmationDialog,
200
+ {
201
+ open: confirmationDialogOpen,
202
+ onClose: () => setConfirmationDialogOpen(false),
203
+ onConfirm: cleanUpAfterRemoval
204
+ }
205
+ )
206
+ ] });
193
207
  };
194
208
 
195
209
  export { FailedEntities, convertTimeToLocalTimezone };
@@ -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 React, { 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,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,KAAA;AACvB,UACE,uBAAA,KAAA,CAAA,aAAA,CAAC,OAAI,GAAK,EAAA,GAAA,EAAK,WAAW,OAAQ,CAAA,QAAA,EAAA,sCAC/B,UAAW,EAAA,EAAA,SAAA,EAAW,QAAQ,UAC5B,EAAA,EAAA,CAAA,CAAE,IACL,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,mBAAgB,OAAS,EAAA,CAAA,CAAE,SAAS,CACrC,kBAAA,KAAA,CAAA,aAAA;AAAA,YAAC,kBAAA;AAAA,YAAA;AAAA,cACC,KAAO,EAAA,CAAA;AAAA,cACP;AAAA;AAAA,WAEJ,CAAA;AAAA,SAEH,CACH,CAAA;AAAA;AAEJ;AAAA,GAEF,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,8BAAA;AAAA,IAAA;AAAA,MACC,IAAM,EAAA,sBAAA;AAAA,MACN,OAAA,EAAS,MAAM,yBAAA,CAA0B,KAAK,CAAA;AAAA,MAC9C,SAAW,EAAA;AAAA;AAAA,GAEf,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,UAAW,CAAA,CA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gB,EAAA,CAAC,UACf,KAAA,qBAAA,CAAsB,UAAU,CAAA;AAAA,QAElC,WAAa,EAAA,CAAC,EAAE,OAAA,EAAc,KAAA;AAC5B,UAAA,MAAM,SAAU,OAA8B,CAAA,MAAA;AAC9C,UAAA,uBAEK,GAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA,MAAA,EAAQ,GAAI,CAAA,CAAC,GAAG,GAAQ,KAAA;AACvB,YAAA,uBACG,IAAA,CAAA,GAAA,EAAA,EAAc,SAAW,EAAA,OAAA,CAAQ,QAChC,EAAA,QAAA,EAAA;AAAA,8BAAA,GAAA,CAAC,UAAW,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,UAAA,EAC5B,YAAE,IACL,EAAA,CAAA;AAAA,8BACC,GAAA,CAAA,eAAA,EAAA,EAAgB,OAAS,EAAA,CAAA,CAAE,OAAS,EAAA,CAAA;AAAA,8BACrC,GAAA;AAAA,gBAAC,kBAAA;AAAA,gBAAA;AAAA,kBACC,KAAO,EAAA,CAAA;AAAA,kBACP;AAAA;AAAA;AACF,aAAA,EAAA,EARQ,GASV,CAAA;AAAA,WAEH,CACH,EAAA,CAAA;AAAA;AAEJ;AAAA,KACF;AAAA,oBACA,GAAA;AAAA,MAAC,8BAAA;AAAA,MAAA;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,4 +1,5 @@
1
- import React, { useState } from 'react';
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
2
+ import { useState } from 'react';
2
3
  import { Progress, ErrorPanel, Table } from '@backstage/core-components';
3
4
  import Typography from '@material-ui/core/Typography';
4
5
  import { makeStyles } from '@material-ui/core/styles';
@@ -24,47 +25,47 @@ const PendingEntities = () => {
24
25
  } = useAsync(async () => await unprocessedApi.pending());
25
26
  const [, setSelectedSearchTerm] = useState("");
26
27
  if (loading) {
27
- return /* @__PURE__ */ React.createElement(Progress, null);
28
+ return /* @__PURE__ */ jsx(Progress, {});
28
29
  }
29
30
  if (error) {
30
- return /* @__PURE__ */ React.createElement(ErrorPanel, { error });
31
+ return /* @__PURE__ */ jsx(ErrorPanel, { error });
31
32
  }
32
33
  const columns = [
33
34
  {
34
- title: /* @__PURE__ */ React.createElement(Typography, null, "entityRef"),
35
+ title: /* @__PURE__ */ jsx(Typography, { children: "entityRef" }),
35
36
  sorting: true,
36
37
  field: "entity_ref",
37
38
  customFilterAndSearch: (query, row) => row.entity_ref.toLocaleUpperCase("en-US").includes(query.toLocaleUpperCase("en-US")),
38
39
  render: (rowData) => rowData.entity_ref
39
40
  },
40
41
  {
41
- title: /* @__PURE__ */ React.createElement(Typography, null, "Kind"),
42
+ title: /* @__PURE__ */ jsx(Typography, { children: "Kind" }),
42
43
  sorting: true,
43
44
  field: "kind",
44
45
  render: (rowData) => rowData.unprocessed_entity.kind
45
46
  },
46
47
  {
47
- title: /* @__PURE__ */ React.createElement(Typography, null, "Owner"),
48
+ title: /* @__PURE__ */ jsx(Typography, { children: "Owner" }),
48
49
  sorting: true,
49
50
  field: "unprocessed_entity.spec.owner",
50
51
  render: (rowData) => rowData.unprocessed_entity.spec?.owner || "unknown"
51
52
  },
52
53
  {
53
- title: /* @__PURE__ */ React.createElement(Typography, null, "Raw"),
54
+ title: /* @__PURE__ */ jsx(Typography, { children: "Raw" }),
54
55
  sorting: false,
55
- render: (rowData) => /* @__PURE__ */ React.createElement(EntityDialog, { entity: rowData })
56
+ render: (rowData) => /* @__PURE__ */ jsx(EntityDialog, { entity: rowData })
56
57
  }
57
58
  ];
58
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
59
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
59
60
  Table,
60
61
  {
61
62
  options: { pageSize: 20 },
62
63
  columns,
63
64
  data: data?.entities || [],
64
65
  onSearchChange: (searchTerm) => setSelectedSearchTerm(searchTerm),
65
- emptyContent: /* @__PURE__ */ React.createElement(Typography, { className: classes.successMessage }, "No pending entities found")
66
+ emptyContent: /* @__PURE__ */ jsx(Typography, { className: classes.successMessage, children: "No pending entities found" })
66
67
  }
67
- ));
68
+ ) });
68
69
  };
69
70
 
70
71
  export { PendingEntities };
@@ -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 React, { 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,UAAW,CAAA,CAAC,KAAkB,MAAA;AAAA,EAC9C,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;AAEK,MAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,cAAA,GAAiB,OAAO,gCAAgC,CAAA;AAC9D,EAAM,MAAA;AAAA,IACJ,OAAA;AAAA,IACA,KAAA;AAAA,IACA,KAAO,EAAA;AAAA,MACL,QAAS,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AAQ,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,IAAA,EAAW,KAAG,CAAA;AAAA,MACtB,OAAS,EAAA,KAAA;AAAA,MACT,QAAQ,CAAC,OAAA,qBACN,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,EAAa,QAAQ,OAA8B,EAAA;AAAA;AAExD,GACF;AACA,EAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAS,EAAE,QAAA,EAAU,EAAG,EAAA;AAAA,MACxB,OAAA;AAAA,MACA,IAAA,EAAM,IAAM,EAAA,QAAA,IAAY,EAAC;AAAA,MACzB,cAAgB,EAAA,CAAC,UACf,KAAA,qBAAA,CAAsB,UAAU,CAAA;AAAA,MAElC,8BACG,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,SAAW,EAAA,OAAA,CAAQ,kBAAgB,2BAE/C;AAAA;AAAA,GAGN,CAAA;AAEJ;;;;"}
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,UAAW,CAAA,CAAC,KAAkB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AA,MACvB,OAAS,EAAA,IAAA;AAAA,MACT,KAAO,EAAA,MAAA;AAAA,MACP,MAAQ,EAAA,CAAC,OACN,KAAA,OAAA,CAA8B,kBAAmB,CAAA;AAAA,KACtD;AAAA,IACA;AAAA,MACE,KAAA,kBAAQ,GAAA,CAAA,UAAA,EAAA,EAAW,QAAK,EAAA,OAAA,EAAA,CAAA;AAAA,MACxB,OAAS,EAAA,IAAA;AAAA,MACT,KAAO,EAAA,+BAAA;AAAA,MACP,QAAQ,CAAC,OAAA,KACN,OAA8B,CAAA,kBAAA,CAAmB,MAAM,KACxD,IAAA;AAAA,KACJ;AAAA,IACA;AAAA,MACE,KAAA,kBAAQ,GAAA,CAAA,UAAA,EAAA,EAAW,QAAG,EAAA,KAAA,EAAA,CAAA;AAAA,MACtB,OAAS,EAAA,KAAA;AAAA,MACT,QAAQ,CAAC,OAAA,qBACN,GAAA,CAAA,YAAA,EAAA,EAAa,QAAQ,OAA8B,EAAA;AAAA;AAExD,GACF;AACA,EAAA,uBAEI,GAAA,CAAA,QAAA,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAS,EAAE,QAAA,EAAU,EAAG,EAAA;AAAA,MACxB,OAAA;AAAA,MACA,IAAA,EAAM,IAAM,EAAA,QAAA,IAAY,EAAC;AAAA,MACzB,cAAgB,EAAA,CAAC,UACf,KAAA,qBAAA,CAAsB,UAAU,CAAA;AAAA,MAElC,8BACG,GAAA,CAAA,UAAA,EAAA,EAAW,SAAW,EAAA,OAAA,CAAQ,gBAAgB,QAE/C,EAAA,2BAAA,EAAA;AAAA;AAAA,GAGN,EAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,5 @@
1
- import React, { useState } from 'react';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useState } from 'react';
2
3
  import { Page, Header, Content } from '@backstage/core-components';
3
4
  import Tab from '@material-ui/core/Tab';
4
5
  import { makeStyles } from '@material-ui/core/styles';
@@ -20,10 +21,20 @@ const UnprocessedEntitiesContent = () => {
20
21
  const handleChange = (_event, tabValue) => {
21
22
  setTab(tabValue);
22
23
  };
23
- return /* @__PURE__ */ React.createElement(TabContext, { value: tab }, /* @__PURE__ */ React.createElement(TabList, { onChange: handleChange }, /* @__PURE__ */ React.createElement(Tab, { label: "Failed", value: "failed" }), /* @__PURE__ */ React.createElement(Tab, { label: "Pending", value: "pending" })), /* @__PURE__ */ React.createElement(TabPanel, { value: "failed", className: classes.tabPanel }, /* @__PURE__ */ React.createElement(FailedEntities, null)), /* @__PURE__ */ React.createElement(TabPanel, { value: "pending", className: classes.tabPanel }, /* @__PURE__ */ React.createElement(PendingEntities, null)));
24
+ return /* @__PURE__ */ jsxs(TabContext, { value: tab, children: [
25
+ /* @__PURE__ */ jsxs(TabList, { onChange: handleChange, children: [
26
+ /* @__PURE__ */ jsx(Tab, { label: "Failed", value: "failed" }),
27
+ /* @__PURE__ */ jsx(Tab, { label: "Pending", value: "pending" })
28
+ ] }),
29
+ /* @__PURE__ */ jsx(TabPanel, { value: "failed", className: classes.tabPanel, children: /* @__PURE__ */ jsx(FailedEntities, {}) }),
30
+ /* @__PURE__ */ jsx(TabPanel, { value: "pending", className: classes.tabPanel, children: /* @__PURE__ */ jsx(PendingEntities, {}) })
31
+ ] });
24
32
  };
25
33
  const UnprocessedEntities = () => {
26
- return /* @__PURE__ */ React.createElement(Page, { themeId: "tool" }, /* @__PURE__ */ React.createElement(Header, { title: "Unprocessed Entities" }), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(UnprocessedEntitiesContent, null)));
34
+ return /* @__PURE__ */ jsxs(Page, { themeId: "tool", children: [
35
+ /* @__PURE__ */ jsx(Header, { title: "Unprocessed Entities" }),
36
+ /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsx(UnprocessedEntitiesContent, {}) })
37
+ ] });
27
38
  };
28
39
 
29
40
  export { UnprocessedEntities, UnprocessedEntitiesContent };
@@ -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 React, { 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: React.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,SAA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CACF,CAAA;AAEJ;;;;"}
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":";;;;;;;;;;;AA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,OAAM,sBAAuB,EAAA,CAAA;AAAA,oBACpC,GAAA,CAAA,OAAA,EAAA,EACC,QAAC,kBAAA,GAAA,CAAA,0BAAA,EAAA,EAA2B,CAC9B,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import * as React from 'react';
2
- import React__default from 'react';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
4
3
  import { Entity } from '@backstage/catalog-model';
5
4
 
@@ -16,10 +15,10 @@ declare const catalogUnprocessedEntitiesPlugin: _backstage_core_plugin_api.Backs
16
15
  *
17
16
  * @public
18
17
  */
19
- declare const CatalogUnprocessedEntitiesPage: () => React.JSX.Element;
18
+ declare const CatalogUnprocessedEntitiesPage: () => react_jsx_runtime.JSX.Element;
20
19
 
21
20
  /** @public */
22
- declare const UnprocessedEntitiesContent: () => React__default.JSX.Element;
21
+ declare const UnprocessedEntitiesContent: () => react_jsx_runtime.JSX.Element;
23
22
 
24
23
  /**
25
24
  * Unprocessed entity data stored in the database.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-unprocessed-entities",
3
- "version": "0.2.16-next.1",
3
+ "version": "0.2.16",
4
4
  "backstage": {
5
5
  "role": "frontend-plugin",
6
6
  "pluginId": "catalog-unprocessed-entities",
@@ -41,11 +41,11 @@
41
41
  "types": "./dist/index.d.ts",
42
42
  "typesVersions": {
43
43
  "*": {
44
- "*": [
45
- "dist/index.d.ts"
46
- ],
47
44
  "alpha": [
48
45
  "dist/alpha.d.ts"
46
+ ],
47
+ "package.json": [
48
+ "package.json"
49
49
  ]
50
50
  }
51
51
  },
@@ -62,12 +62,12 @@
62
62
  "test": "backstage-cli package test"
63
63
  },
64
64
  "dependencies": {
65
- "@backstage/catalog-model": "1.7.3",
66
- "@backstage/core-compat-api": "0.4.1-next.1",
67
- "@backstage/core-components": "0.17.1-next.0",
68
- "@backstage/core-plugin-api": "1.10.5",
69
- "@backstage/errors": "1.2.7",
70
- "@backstage/frontend-plugin-api": "0.10.1-next.0",
65
+ "@backstage/catalog-model": "^1.7.3",
66
+ "@backstage/core-compat-api": "^0.4.1",
67
+ "@backstage/core-components": "^0.17.1",
68
+ "@backstage/core-plugin-api": "^1.10.6",
69
+ "@backstage/errors": "^1.2.7",
70
+ "@backstage/frontend-plugin-api": "^0.10.1",
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.32.0-next.1",
79
- "@backstage/dev-utils": "1.1.9-next.1",
78
+ "@backstage/cli": "^0.32.0",
79
+ "@backstage/dev-utils": "^1.1.9",
80
80
  "@testing-library/jest-dom": "^6.0.0",
81
81
  "@testing-library/react": "^16.0.0",
82
82
  "@types/react": "^18.0.0",