@backstage/plugin-catalog 2.0.2-next.1 → 2.0.2-next.2
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 +26 -0
- package/dist/alpha/translation.esm.js +3 -0
- package/dist/alpha/translation.esm.js.map +1 -1
- package/dist/alpha.d.ts +4 -0
- package/dist/alpha.esm.js +3 -0
- package/dist/alpha.esm.js.map +1 -1
- package/dist/components/AboutCard/AboutContent.esm.js +9 -8
- package/dist/components/AboutCard/AboutContent.esm.js.map +1 -1
- package/dist/components/CatalogPage/DefaultCatalogPage.esm.js.map +1 -1
- package/dist/components/CatalogPage/index.esm.js +1 -1
- package/dist/components/CatalogTable/CatalogTable.esm.js +25 -18
- package/dist/components/CatalogTable/CatalogTable.esm.js.map +1 -1
- package/dist/components/CatalogTable/columns.esm.js +8 -3
- package/dist/components/CatalogTable/columns.esm.js.map +1 -1
- package/dist/components/EntityOrphanWarning/DeleteEntityDialog.esm.js +2 -3
- package/dist/components/EntityOrphanWarning/DeleteEntityDialog.esm.js.map +1 -1
- package/dist/index.d.ts +7 -41
- package/dist/package.json.esm.js +1 -1
- package/dist/types/DefaultCatalogPage.d-C6OI0JvL.d.ts +47 -0
- package/package.json +23 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @backstage/plugin-catalog
|
|
2
2
|
|
|
3
|
+
## 2.0.2-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ee1531d: Exported the NFS variant of the catalog index page as `CatalogIndexPage` from the `./alpha` entry point, along with supporting types `CatalogIndexPageProps`, `CatalogTableRow`, and `CatalogTableColumnsFunc`. This allows adopters to use and customize the catalog index page within a `PageBlueprint` in the new frontend system.
|
|
8
|
+
- 482ceed: Migrated from `assertError` to `toError` for error handling.
|
|
9
|
+
- c193ef1: Added Kind field to the About Card. Tags moved before Type and Lifecycle, Kind placed after them. A new `aboutCard.kindField.label` translation key was added.
|
|
10
|
+
- e5af44c: Replaced deprecated `humanizeEntityRef` usage with the Catalog Presentation API.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @backstage/ui@0.14.0-next.2
|
|
13
|
+
- @backstage/errors@1.3.0-next.0
|
|
14
|
+
- @backstage/core-components@0.18.9-next.1
|
|
15
|
+
- @backstage/plugin-catalog-react@2.1.2-next.2
|
|
16
|
+
- @backstage/catalog-client@1.14.1-next.0
|
|
17
|
+
- @backstage/catalog-model@1.7.8-next.0
|
|
18
|
+
- @backstage/core-compat-api@0.5.10-next.2
|
|
19
|
+
- @backstage/core-plugin-api@1.12.5-next.2
|
|
20
|
+
- @backstage/frontend-plugin-api@0.16.0-next.2
|
|
21
|
+
- @backstage/plugin-scaffolder-common@2.0.1-next.0
|
|
22
|
+
- @backstage/plugin-search-react@1.11.1-next.2
|
|
23
|
+
- @backstage/plugin-techdocs-react@1.3.10-next.2
|
|
24
|
+
- @backstage/integration-react@1.2.17-next.1
|
|
25
|
+
- @backstage/plugin-catalog-common@1.1.9-next.0
|
|
26
|
+
- @backstage/plugin-permission-react@0.4.42-next.1
|
|
27
|
+
- @backstage/plugin-search-common@1.2.23-next.0
|
|
28
|
+
|
|
3
29
|
## 2.0.2-next.1
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.esm.js","sources":["../../src/alpha/translation.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 */\n\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport const catalogTranslationRef = createTranslationRef({\n id: 'catalog',\n messages: {\n indexPage: {\n title: `{{orgName}} Catalog`,\n createButtonTitle: 'Create',\n supportButtonContent: 'All your software catalog entities',\n },\n entityPage: {\n notFoundMessage: 'There is no {{kind}} with the requested {{link}}.',\n notFoundLinkText: 'kind, namespace, and name',\n },\n aboutCard: {\n title: 'About',\n refreshButtonTitle: 'Schedule entity refresh',\n editButtonTitle: 'Edit Metadata',\n editButtonAriaLabel: 'Edit',\n createSimilarButtonTitle: 'Create something similar',\n refreshScheduledMessage: 'Refresh scheduled',\n refreshButtonAriaLabel: 'Refresh',\n launchTemplate: 'Launch Template',\n viewTechdocs: 'View TechDocs',\n viewSource: 'View Source',\n unknown: 'unknown',\n descriptionField: {\n label: 'Description',\n value: 'No description',\n },\n ownerField: {\n label: 'Owner',\n value: 'No Owner',\n },\n domainField: {\n label: 'Domain',\n value: 'No Domain',\n },\n systemField: {\n label: 'System',\n value: 'No System',\n },\n parentComponentField: {\n label: 'Parent Component',\n value: 'No Parent Component',\n },\n typeField: {\n label: 'Type',\n },\n lifecycleField: {\n label: 'Lifecycle',\n },\n tagsField: {\n label: 'Tags',\n value: 'No Tags',\n },\n targetsField: {\n label: 'Targets',\n },\n },\n searchResultItem: {\n kind: 'Kind',\n type: 'Type',\n lifecycle: 'Lifecycle',\n owner: 'Owner',\n },\n catalogTable: {\n warningPanelTitle: 'Could not fetch catalog entities.',\n viewActionTitle: 'View',\n editActionTitle: 'Edit',\n starActionTitle: 'Add to favorites',\n unStarActionTitle: 'Remove from favorites',\n allFilters: 'All',\n },\n dependencyOfComponentsCard: {\n title: 'Dependency of components',\n emptyMessage: 'No component depends on this component.',\n },\n dependsOnComponentsCard: {\n title: 'Depends on components',\n emptyMessage: 'No component is a dependency of this component.',\n },\n dependsOnResourcesCard: {\n title: 'Depends on resources',\n emptyMessage: 'No resource is a dependency of this component.',\n },\n entityContextMenu: {\n copiedMessage: 'Copied!',\n moreButtonTitle: 'More',\n inspectMenuTitle: 'Inspect entity',\n copyURLMenuTitle: 'Copy entity URL',\n unregisterMenuTitle: 'Unregister entity',\n moreButtonAriaLabel: 'more',\n },\n entityLabelsCard: {\n title: 'Labels',\n columnKeyLabel: 'Label',\n columnValueLabel: 'Value',\n emptyDescription:\n 'No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityLabels: {\n warningPanelTitle: 'Entity not found',\n ownerLabel: 'Owner',\n lifecycleLabel: 'Lifecycle',\n },\n entityLinksCard: {\n title: 'Links',\n emptyDescription:\n 'No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityNotFound: {\n title: 'Entity was not found',\n description:\n 'Want to help us build this? Check out our Getting Started documentation.',\n docButtonTitle: 'DOCS',\n },\n entityTabs: {\n tabsAriaLabel: 'Tabs',\n },\n deleteEntity: {\n dialogTitle: 'Are you sure you want to delete this entity?',\n deleteButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n description:\n 'This entity is not referenced by any location and is therefore not receiving updates.',\n actionButtonTitle: 'Delete entity',\n },\n entityProcessingErrorsDescription: 'The error below originates from',\n entityRelationWarningDescription:\n \"This entity has relations to other entities, which can't be found in the catalog.\\n Entities not found are: \",\n hasComponentsCard: {\n title: 'Has components',\n emptyMessage: 'No component is part of this system.',\n },\n hasResourcesCard: {\n title: 'Has resources',\n emptyMessage: 'No resource is part of this system.',\n },\n hasSubcomponentsCard: {\n title: 'Has subcomponents',\n emptyMessage: 'No subcomponent is part of this component.',\n },\n hasSubdomainsCard: {\n title: 'Has subdomains',\n emptyMessage: 'No subdomain is part of this domain.',\n },\n hasSystemsCard: {\n title: 'Has systems',\n emptyMessage: 'No system is part of this domain.',\n },\n relatedEntitiesCard: {\n emptyHelpLinkTitle: 'Learn how to change this.',\n },\n systemDiagramCard: {\n title: 'System Diagram',\n description: 'Use pinch & zoom to move around the diagram.',\n edgeLabels: {\n partOf: 'part of',\n provides: 'provides',\n dependsOn: 'depends on',\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,wBAAwB,oBAAA,CAAqB;AAAA,EACxD,EAAA,EAAI,SAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,SAAA,EAAW;AAAA,MACT,KAAA,EAAO,CAAA,mBAAA,CAAA;AAAA,MACP,iBAAA,EAAmB,QAAA;AAAA,MACnB,oBAAA,EAAsB;AAAA,KACxB;AAAA,IACA,UAAA,EAAY;AAAA,MACV,eAAA,EAAiB,mDAAA;AAAA,MACjB,gBAAA,EAAkB;AAAA,KACpB;AAAA,IACA,SAAA,EAAW;AAAA,MACT,KAAA,EAAO,OAAA;AAAA,MACP,kBAAA,EAAoB,yBAAA;AAAA,MACpB,eAAA,EAAiB,eAAA;AAAA,MACjB,mBAAA,EAAqB,MAAA;AAAA,MACrB,wBAAA,EAA0B,0BAAA;AAAA,MAC1B,uBAAA,EAAyB,mBAAA;AAAA,MACzB,sBAAA,EAAwB,SAAA;AAAA,MACxB,cAAA,EAAgB,iBAAA;AAAA,MAChB,YAAA,EAAc,eAAA;AAAA,MACd,UAAA,EAAY,aAAA;AAAA,MACZ,OAAA,EAAS,SAAA;AAAA,MACT,gBAAA,EAAkB;AAAA,QAChB,KAAA,EAAO,aAAA;AAAA,QACP,KAAA,EAAO;AAAA,OACT;AAAA,MACA,UAAA,EAAY;AAAA,QACV,KAAA,EAAO,OAAA;AAAA,QACP,KAAA,EAAO;AAAA,OACT;AAAA,MACA,WAAA,EAAa;AAAA,QACX,KAAA,EAAO,QAAA;AAAA,QACP,KAAA,EAAO;AAAA,OACT;AAAA,MACA,WAAA,EAAa;AAAA,QACX,KAAA,EAAO,QAAA;AAAA,QACP,KAAA,EAAO;AAAA,OACT;AAAA,MACA,oBAAA,EAAsB;AAAA,QACpB,KAAA,EAAO,kBAAA;AAAA,QACP,KAAA,EAAO;AAAA,OACT;AAAA,MACA,SAAA,EAAW;AAA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AAAA,KACtB;AAAA,IACA,iBAAA,EAAmB;AAAA,MACjB,KAAA,EAAO,gBAAA;AAAA,MACP,WAAA,EAAa,8CAAA;AAAA,MACb,UAAA,EAAY;AAAA,QACV,MAAA,EAAQ,SAAA;AAAA,QACR,QAAA,EAAU,UAAA;AAAA,QACV,SAAA,EAAW;AAAA;AACb;AACF;AAEJ,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"translation.esm.js","sources":["../../src/alpha/translation.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 */\n\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport const catalogTranslationRef = createTranslationRef({\n id: 'catalog',\n messages: {\n indexPage: {\n title: `{{orgName}} Catalog`,\n createButtonTitle: 'Create',\n supportButtonContent: 'All your software catalog entities',\n },\n entityPage: {\n notFoundMessage: 'There is no {{kind}} with the requested {{link}}.',\n notFoundLinkText: 'kind, namespace, and name',\n },\n aboutCard: {\n title: 'About',\n refreshButtonTitle: 'Schedule entity refresh',\n editButtonTitle: 'Edit Metadata',\n editButtonAriaLabel: 'Edit',\n createSimilarButtonTitle: 'Create something similar',\n refreshScheduledMessage: 'Refresh scheduled',\n refreshButtonAriaLabel: 'Refresh',\n launchTemplate: 'Launch Template',\n viewTechdocs: 'View TechDocs',\n viewSource: 'View Source',\n unknown: 'unknown',\n descriptionField: {\n label: 'Description',\n value: 'No description',\n },\n ownerField: {\n label: 'Owner',\n value: 'No Owner',\n },\n domainField: {\n label: 'Domain',\n value: 'No Domain',\n },\n systemField: {\n label: 'System',\n value: 'No System',\n },\n parentComponentField: {\n label: 'Parent Component',\n value: 'No Parent Component',\n },\n kindField: {\n label: 'Kind',\n },\n typeField: {\n label: 'Type',\n },\n lifecycleField: {\n label: 'Lifecycle',\n },\n tagsField: {\n label: 'Tags',\n value: 'No Tags',\n },\n targetsField: {\n label: 'Targets',\n },\n },\n searchResultItem: {\n kind: 'Kind',\n type: 'Type',\n lifecycle: 'Lifecycle',\n owner: 'Owner',\n },\n catalogTable: {\n warningPanelTitle: 'Could not fetch catalog entities.',\n viewActionTitle: 'View',\n editActionTitle: 'Edit',\n starActionTitle: 'Add to favorites',\n unStarActionTitle: 'Remove from favorites',\n allFilters: 'All',\n },\n dependencyOfComponentsCard: {\n title: 'Dependency of components',\n emptyMessage: 'No component depends on this component.',\n },\n dependsOnComponentsCard: {\n title: 'Depends on components',\n emptyMessage: 'No component is a dependency of this component.',\n },\n dependsOnResourcesCard: {\n title: 'Depends on resources',\n emptyMessage: 'No resource is a dependency of this component.',\n },\n entityContextMenu: {\n copiedMessage: 'Copied!',\n moreButtonTitle: 'More',\n inspectMenuTitle: 'Inspect entity',\n copyURLMenuTitle: 'Copy entity URL',\n unregisterMenuTitle: 'Unregister entity',\n moreButtonAriaLabel: 'more',\n },\n entityLabelsCard: {\n title: 'Labels',\n columnKeyLabel: 'Label',\n columnValueLabel: 'Value',\n emptyDescription:\n 'No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityLabels: {\n warningPanelTitle: 'Entity not found',\n ownerLabel: 'Owner',\n lifecycleLabel: 'Lifecycle',\n },\n entityLinksCard: {\n title: 'Links',\n emptyDescription:\n 'No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityNotFound: {\n title: 'Entity was not found',\n description:\n 'Want to help us build this? Check out our Getting Started documentation.',\n docButtonTitle: 'DOCS',\n },\n entityTabs: {\n tabsAriaLabel: 'Tabs',\n },\n deleteEntity: {\n dialogTitle: 'Are you sure you want to delete this entity?',\n deleteButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n description:\n 'This entity is not referenced by any location and is therefore not receiving updates.',\n actionButtonTitle: 'Delete entity',\n },\n entityProcessingErrorsDescription: 'The error below originates from',\n entityRelationWarningDescription:\n \"This entity has relations to other entities, which can't be found in the catalog.\\n Entities not found are: \",\n hasComponentsCard: {\n title: 'Has components',\n emptyMessage: 'No component is part of this system.',\n },\n hasResourcesCard: {\n title: 'Has resources',\n emptyMessage: 'No resource is part of this system.',\n },\n hasSubcomponentsCard: {\n title: 'Has subcomponents',\n emptyMessage: 'No subcomponent is part of this component.',\n },\n hasSubdomainsCard: {\n title: 'Has subdomains',\n emptyMessage: 'No subdomain is part of this domain.',\n },\n hasSystemsCard: {\n title: 'Has systems',\n emptyMessage: 'No system is part of this domain.',\n },\n relatedEntitiesCard: {\n emptyHelpLinkTitle: 'Learn how to change this.',\n },\n systemDiagramCard: {\n title: 'System Diagram',\n description: 'Use pinch & zoom to move around the diagram.',\n edgeLabels: {\n partOf: 'part of',\n provides: 'provides',\n dependsOn: 'depends on',\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAmBO,MAAM,wBAAwB,oBAAA,CAAqB;AAAA,EACxD,EAAA,EAAI,SAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,SAAA,EAAW;AAAA,MACT,KAAA,EAAO,CAAA,mBAAA,CAAA;AAAA,MACP,iBAAA,EAAmB,QAAA;AAAA,MACnB,oBAAA,EAAsB;AAAA,KACxB;AAAA,IACA,UAAA,EAAY;AAAA,MACV,eAAA,EAAiB,mDAAA;AAAA,MACjB,gBAAA,EAAkB;AAAA,KACpB;AAAA,IACA,SAAA,EAAW;AAAA,MACT,KAAA,EAAO,OAAA;AAAA,MACP,kBAAA,EAAoB,yBAAA;AAAA,MACpB,eAAA,EAAiB,eAAA;AAAA,MACjB,mBAAA,EAAqB,MAAA;AAAA,MACrB,wBAAA,EAA0B,0BAAA;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,8CAAA;AAAA,MACb,iBAAA,EAAmB,QAAA;AAAA,MACnB,iBAAA,EAAmB,QAAA;AAAA,MACnB,WAAA,EACE,uFAAA;AAAA,MACF,iBAAA,EAAmB;AAAA,KACrB;AAAA,IACA,iCAAA,EAAmC,iCAAA;AAAA,IACnC,gCAAA,EACE,8GAAA;AAAA,IACF,iBAAA,EAAmB;AAAA,MACjB,KAAA,EAAO,gBAAA;AAAA,MACP,YAAA,EAAc;AAAA,KAChB;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,KAAA,EAAO,eAAA;AAAA,MACP,YAAA,EAAc;AAAA,KAChB;AAAA,IACA,oBAAA,EAAsB;AAAA,MACpB,KAAA,EAAO,mBAAA;AAAA,MACP,YAAA,EAAc;AAAA,KAChB;AAAA,IACA,iBAAA,EAAmB;AAAA,MACjB,KAAA,EAAO,gBAAA;AAAA,MACP,YAAA,EAAc;AAAA,KAChB;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,KAAA,EAAO,aAAA;AAAA,MACP,YAAA,EAAc;AAAA,KAChB;AAAA,IACA,mBAAA,EAAqB;AAAA,MACnB,kBAAA,EAAoB;AAAA,KACtB;AAAA,IACA,iBAAA,EAAmB;AAAA,MACjB,KAAA,EAAO,gBAAA;AAAA,MACP,WAAA,EAAa,8CAAA;AAAA,MACb,UAAA,EAAY;AAAA,QACV,MAAA,EAAQ,SAAA;AAAA,QACR,QAAA,EAAU,UAAA;AAAA,QACV,SAAA,EAAW;AAAA;AACb;AACF;AAEJ,CAAC;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ import * as _backstage_catalog_model from '@backstage/catalog-model';
|
|
|
6
6
|
import * as _backstage_filter_predicates from '@backstage/filter-predicates';
|
|
7
7
|
import * as react from 'react';
|
|
8
8
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
9
|
+
export { N as CatalogIndexPage, D as CatalogIndexPageProps, a as CatalogTableColumnsFunc, C as CatalogTableRow } from './types/DefaultCatalogPage.d-C6OI0JvL.js';
|
|
10
|
+
import 'react/jsx-runtime';
|
|
11
|
+
import '@backstage/plugin-catalog-react';
|
|
9
12
|
|
|
10
13
|
/** @alpha */
|
|
11
14
|
declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin<{
|
|
@@ -761,6 +764,7 @@ declare const catalogTranslationRef: _backstage_frontend_plugin_api.TranslationR
|
|
|
761
764
|
readonly "aboutCard.systemField.label": "System";
|
|
762
765
|
readonly "aboutCard.parentComponentField.value": "No Parent Component";
|
|
763
766
|
readonly "aboutCard.parentComponentField.label": "Parent Component";
|
|
767
|
+
readonly "aboutCard.kindField.label": "Kind";
|
|
764
768
|
readonly "aboutCard.typeField.label": "Type";
|
|
765
769
|
readonly "aboutCard.lifecycleField.label": "Lifecycle";
|
|
766
770
|
readonly "aboutCard.tagsField.value": "No Tags";
|
package/dist/alpha.esm.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { default } from './alpha/plugin.esm.js';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import 'react-router-dom';
|
|
4
|
+
export { NfsDefaultCatalogPage as CatalogIndexPage } from './components/CatalogPage/DefaultCatalogPage.esm.js';
|
|
2
5
|
import { catalogTranslationRef as catalogTranslationRef$1 } from './alpha/translation.esm.js';
|
|
3
6
|
|
|
4
7
|
const catalogTranslationRef = catalogTranslationRef$1;
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha/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 */\n\nexport { default } from './plugin';\n\nimport { catalogTranslationRef as _catalogTranslationRef } from './translation';\n\n/**\n * @alpha\n * @deprecated Import from `@backstage/plugin-catalog` instead.\n */\nexport const catalogTranslationRef = _catalogTranslationRef;\n"],"names":["_catalogTranslationRef"],"mappings":"
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha/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 */\n\nexport { default } from './plugin';\n\nexport { NfsDefaultCatalogPage as CatalogIndexPage } from '../components/CatalogPage';\nexport type { DefaultCatalogPageProps as CatalogIndexPageProps } from '../components/CatalogPage';\nexport type {\n CatalogTableRow,\n CatalogTableColumnsFunc,\n} from '../components/CatalogTable';\n\nimport { catalogTranslationRef as _catalogTranslationRef } from './translation';\n\n/**\n * @alpha\n * @deprecated Import from `@backstage/plugin-catalog` instead.\n */\nexport const catalogTranslationRef = _catalogTranslationRef;\n"],"names":["_catalogTranslationRef"],"mappings":";;;;;;AA+BO,MAAM,qBAAA,GAAwBA;;;;"}
|
|
@@ -116,6 +116,15 @@ function AboutContent(props) {
|
|
|
116
116
|
)
|
|
117
117
|
}
|
|
118
118
|
),
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
120
|
+
AboutField,
|
|
121
|
+
{
|
|
122
|
+
label: t("aboutCard.tagsField.label"),
|
|
123
|
+
value: t("aboutCard.tagsField.value"),
|
|
124
|
+
children: (entity?.metadata?.tags || []).map((tag) => /* @__PURE__ */ jsx(Chip, { size: "small", label: tag }, tag))
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
/* @__PURE__ */ jsx(AboutField, { label: t("aboutCard.kindField.label"), value: entity.kind }),
|
|
119
128
|
(isAPI || isComponent || isResource || isTemplate || isGroup || isLocation || typeof entity?.spec?.type === "string") && /* @__PURE__ */ jsx(
|
|
120
129
|
AboutField,
|
|
121
130
|
{
|
|
@@ -130,14 +139,6 @@ function AboutContent(props) {
|
|
|
130
139
|
value: entity?.spec?.lifecycle
|
|
131
140
|
}
|
|
132
141
|
),
|
|
133
|
-
/* @__PURE__ */ jsx(
|
|
134
|
-
AboutField,
|
|
135
|
-
{
|
|
136
|
-
label: t("aboutCard.tagsField.label"),
|
|
137
|
-
value: t("aboutCard.tagsField.value"),
|
|
138
|
-
children: (entity?.metadata?.tags || []).map((tag) => /* @__PURE__ */ jsx(Chip, { size: "small", label: tag }, tag))
|
|
139
|
-
}
|
|
140
|
-
),
|
|
141
142
|
isLocation && (entity?.spec?.targets || entity?.spec?.target) && /* @__PURE__ */ jsx(Grid.Item, { colSpan: columns, children: /* @__PURE__ */ jsx(AboutField, { label: t("aboutCard.targetsField.label"), children: /* @__PURE__ */ jsx(
|
|
142
143
|
LinksGridList,
|
|
143
144
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AboutContent.esm.js","sources":["../../../src/components/AboutCard/AboutContent.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 Entity,\n getEntitySourceLocation,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n} from '@backstage/catalog-model';\nimport {\n EntityRefLinks,\n getEntityRelations,\n} from '@backstage/plugin-catalog-react';\nimport { JsonArray } from '@backstage/types';\nimport Chip from '@material-ui/core/Chip';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { Grid } from '@backstage/ui';\nimport { MarkdownContent } from '@backstage/core-components';\nimport { AboutField } from './AboutField';\nimport { LinksGridList } from '../EntityLinksCard/LinksGridList';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { catalogTranslationRef } from '../../alpha/translation';\n\nconst useStyles = makeStyles({\n description: {\n wordBreak: 'break-word',\n },\n});\n\n/**\n * Props for {@link AboutContent}.\n *\n * @public\n */\nexport interface AboutContentProps {\n entity: Entity;\n}\n\nfunction getLocationTargetHref(\n target: string,\n type: string,\n entitySourceLocation: {\n type: string;\n target: string;\n },\n): string {\n if (type === 'url' || target.includes('://')) {\n return target;\n }\n\n const srcLocationUrl =\n entitySourceLocation.type === 'file'\n ? `file://${entitySourceLocation.target}`\n : entitySourceLocation.target;\n\n if (type === 'file' || entitySourceLocation.type === 'file') {\n return new URL(target, srcLocationUrl).href;\n }\n\n return srcLocationUrl;\n}\n\n/** @public */\nexport function AboutContent(props: AboutContentProps) {\n const { entity } = props;\n const classes = useStyles();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const isSystem = entity.kind.toLocaleLowerCase('en-US') === 'system';\n const isResource = entity.kind.toLocaleLowerCase('en-US') === 'resource';\n const isComponent = entity.kind.toLocaleLowerCase('en-US') === 'component';\n const isAPI = entity.kind.toLocaleLowerCase('en-US') === 'api';\n const isTemplate = entity.kind.toLocaleLowerCase('en-US') === 'template';\n const isLocation = entity.kind.toLocaleLowerCase('en-US') === 'location';\n const isGroup = entity.kind.toLocaleLowerCase('en-US') === 'group';\n\n const partOfSystemRelations = getEntityRelations(entity, RELATION_PART_OF, {\n kind: 'system',\n });\n const partOfComponentRelations = getEntityRelations(\n entity,\n RELATION_PART_OF,\n {\n kind: 'component',\n },\n );\n const partOfDomainRelations = getEntityRelations(entity, RELATION_PART_OF, {\n kind: 'domain',\n });\n const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);\n\n let entitySourceLocation:\n | {\n type: string;\n target: string;\n }\n | undefined;\n try {\n entitySourceLocation = getEntitySourceLocation(entity);\n } catch (e) {\n entitySourceLocation = undefined;\n }\n\n const columns = { initial: '1', sm: '2', lg: '3' } as const;\n\n return (\n <Grid.Root columns={columns} gap=\"3\">\n <Grid.Item colSpan={columns}>\n <AboutField label={t('aboutCard.descriptionField.label')}>\n <MarkdownContent\n className={classes.description}\n content={\n entity?.metadata?.description ||\n t('aboutCard.descriptionField.value')\n }\n />\n </AboutField>\n </Grid.Item>\n <AboutField\n label={t('aboutCard.ownerField.label')}\n value={t('aboutCard.ownerField.value')}\n className={classes.description}\n >\n {ownedByRelations.length > 0 && (\n <EntityRefLinks entityRefs={ownedByRelations} defaultKind=\"group\" />\n )}\n </AboutField>\n {(isSystem || partOfDomainRelations.length > 0) && (\n <AboutField\n label={t('aboutCard.domainField.label')}\n value={t('aboutCard.domainField.value')}\n >\n {partOfDomainRelations.length > 0 && (\n <EntityRefLinks\n entityRefs={partOfDomainRelations}\n defaultKind=\"domain\"\n />\n )}\n </AboutField>\n )}\n {(isAPI ||\n isComponent ||\n isResource ||\n partOfSystemRelations.length > 0) && (\n <AboutField\n label={t('aboutCard.systemField.label')}\n value={t('aboutCard.systemField.value')}\n >\n {partOfSystemRelations.length > 0 && (\n <EntityRefLinks\n entityRefs={partOfSystemRelations}\n defaultKind=\"system\"\n />\n )}\n </AboutField>\n )}\n {isComponent && partOfComponentRelations.length > 0 && (\n <AboutField\n label={t('aboutCard.parentComponentField.label')}\n value={t('aboutCard.parentComponentField.value')}\n >\n <EntityRefLinks\n entityRefs={partOfComponentRelations}\n defaultKind=\"component\"\n />\n </AboutField>\n )}\n {(isAPI ||\n isComponent ||\n isResource ||\n isTemplate ||\n isGroup ||\n isLocation ||\n typeof entity?.spec?.type === 'string') && (\n <AboutField\n label={t('aboutCard.typeField.label')}\n value={entity?.spec?.type as string}\n />\n )}\n {(isAPI ||\n isComponent ||\n typeof entity?.spec?.lifecycle === 'string') && (\n <AboutField\n label={t('aboutCard.lifecycleField.label')}\n value={entity?.spec?.lifecycle as string}\n />\n )}\n <AboutField\n label={t('aboutCard.tagsField.label')}\n value={t('aboutCard.tagsField.value')}\n >\n {(entity?.metadata?.tags || []).map(tag => (\n <Chip key={tag} size=\"small\" label={tag} />\n ))}\n </AboutField>\n {isLocation && (entity?.spec?.targets || entity?.spec?.target) && (\n <Grid.Item colSpan={columns}>\n <AboutField label={t('aboutCard.targetsField.label')}>\n <LinksGridList\n cols={1}\n items={(\n (entity.spec.targets as JsonArray) || [entity.spec.target]\n )\n .map(target => target as string)\n .map(target => ({\n text: target,\n href: getLocationTargetHref(\n target,\n (entity?.spec?.type || t('aboutCard.unknown')) as string,\n entitySourceLocation!,\n ),\n }))}\n />\n </AboutField>\n </Grid.Item>\n )}\n </Grid.Root>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAoCA,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,WAAA,EAAa;AAAA,IACX,SAAA,EAAW;AAAA;AAEf,CAAC,CAAA;AAWD,SAAS,qBAAA,CACP,MAAA,EACA,IAAA,EACA,oBAAA,EAIQ;AACR,EAAA,IAAI,IAAA,KAAS,KAAA,IAAS,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,EAAG;AAC5C,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,MAAM,cAAA,GACJ,qBAAqB,IAAA,KAAS,MAAA,GAC1B,UAAU,oBAAA,CAAqB,MAAM,KACrC,oBAAA,CAAqB,MAAA;AAE3B,EAAA,IAAI,IAAA,KAAS,MAAA,IAAU,oBAAA,CAAqB,IAAA,KAAS,MAAA,EAAQ;AAC3D,IAAA,OAAO,IAAI,GAAA,CAAI,MAAA,EAAQ,cAAc,CAAA,CAAE,IAAA;AAAA,EACzC;AAEA,EAAA,OAAO,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CAAA,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"AboutContent.esm.js","sources":["../../../src/components/AboutCard/AboutContent.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 Entity,\n getEntitySourceLocation,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n} from '@backstage/catalog-model';\nimport {\n EntityRefLinks,\n getEntityRelations,\n} from '@backstage/plugin-catalog-react';\nimport { JsonArray } from '@backstage/types';\nimport Chip from '@material-ui/core/Chip';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { Grid } from '@backstage/ui';\nimport { MarkdownContent } from '@backstage/core-components';\nimport { AboutField } from './AboutField';\nimport { LinksGridList } from '../EntityLinksCard/LinksGridList';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { catalogTranslationRef } from '../../alpha/translation';\n\nconst useStyles = makeStyles({\n description: {\n wordBreak: 'break-word',\n },\n});\n\n/**\n * Props for {@link AboutContent}.\n *\n * @public\n */\nexport interface AboutContentProps {\n entity: Entity;\n}\n\nfunction getLocationTargetHref(\n target: string,\n type: string,\n entitySourceLocation: {\n type: string;\n target: string;\n },\n): string {\n if (type === 'url' || target.includes('://')) {\n return target;\n }\n\n const srcLocationUrl =\n entitySourceLocation.type === 'file'\n ? `file://${entitySourceLocation.target}`\n : entitySourceLocation.target;\n\n if (type === 'file' || entitySourceLocation.type === 'file') {\n return new URL(target, srcLocationUrl).href;\n }\n\n return srcLocationUrl;\n}\n\n/** @public */\nexport function AboutContent(props: AboutContentProps) {\n const { entity } = props;\n const classes = useStyles();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const isSystem = entity.kind.toLocaleLowerCase('en-US') === 'system';\n const isResource = entity.kind.toLocaleLowerCase('en-US') === 'resource';\n const isComponent = entity.kind.toLocaleLowerCase('en-US') === 'component';\n const isAPI = entity.kind.toLocaleLowerCase('en-US') === 'api';\n const isTemplate = entity.kind.toLocaleLowerCase('en-US') === 'template';\n const isLocation = entity.kind.toLocaleLowerCase('en-US') === 'location';\n const isGroup = entity.kind.toLocaleLowerCase('en-US') === 'group';\n\n const partOfSystemRelations = getEntityRelations(entity, RELATION_PART_OF, {\n kind: 'system',\n });\n const partOfComponentRelations = getEntityRelations(\n entity,\n RELATION_PART_OF,\n {\n kind: 'component',\n },\n );\n const partOfDomainRelations = getEntityRelations(entity, RELATION_PART_OF, {\n kind: 'domain',\n });\n const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);\n\n let entitySourceLocation:\n | {\n type: string;\n target: string;\n }\n | undefined;\n try {\n entitySourceLocation = getEntitySourceLocation(entity);\n } catch (e) {\n entitySourceLocation = undefined;\n }\n\n const columns = { initial: '1', sm: '2', lg: '3' } as const;\n\n return (\n <Grid.Root columns={columns} gap=\"3\">\n <Grid.Item colSpan={columns}>\n <AboutField label={t('aboutCard.descriptionField.label')}>\n <MarkdownContent\n className={classes.description}\n content={\n entity?.metadata?.description ||\n t('aboutCard.descriptionField.value')\n }\n />\n </AboutField>\n </Grid.Item>\n <AboutField\n label={t('aboutCard.ownerField.label')}\n value={t('aboutCard.ownerField.value')}\n className={classes.description}\n >\n {ownedByRelations.length > 0 && (\n <EntityRefLinks entityRefs={ownedByRelations} defaultKind=\"group\" />\n )}\n </AboutField>\n {(isSystem || partOfDomainRelations.length > 0) && (\n <AboutField\n label={t('aboutCard.domainField.label')}\n value={t('aboutCard.domainField.value')}\n >\n {partOfDomainRelations.length > 0 && (\n <EntityRefLinks\n entityRefs={partOfDomainRelations}\n defaultKind=\"domain\"\n />\n )}\n </AboutField>\n )}\n {(isAPI ||\n isComponent ||\n isResource ||\n partOfSystemRelations.length > 0) && (\n <AboutField\n label={t('aboutCard.systemField.label')}\n value={t('aboutCard.systemField.value')}\n >\n {partOfSystemRelations.length > 0 && (\n <EntityRefLinks\n entityRefs={partOfSystemRelations}\n defaultKind=\"system\"\n />\n )}\n </AboutField>\n )}\n {isComponent && partOfComponentRelations.length > 0 && (\n <AboutField\n label={t('aboutCard.parentComponentField.label')}\n value={t('aboutCard.parentComponentField.value')}\n >\n <EntityRefLinks\n entityRefs={partOfComponentRelations}\n defaultKind=\"component\"\n />\n </AboutField>\n )}\n <AboutField\n label={t('aboutCard.tagsField.label')}\n value={t('aboutCard.tagsField.value')}\n >\n {(entity?.metadata?.tags || []).map(tag => (\n <Chip key={tag} size=\"small\" label={tag} />\n ))}\n </AboutField>\n <AboutField label={t('aboutCard.kindField.label')} value={entity.kind} />\n {(isAPI ||\n isComponent ||\n isResource ||\n isTemplate ||\n isGroup ||\n isLocation ||\n typeof entity?.spec?.type === 'string') && (\n <AboutField\n label={t('aboutCard.typeField.label')}\n value={entity?.spec?.type as string}\n />\n )}\n {(isAPI ||\n isComponent ||\n typeof entity?.spec?.lifecycle === 'string') && (\n <AboutField\n label={t('aboutCard.lifecycleField.label')}\n value={entity?.spec?.lifecycle as string}\n />\n )}\n {isLocation && (entity?.spec?.targets || entity?.spec?.target) && (\n <Grid.Item colSpan={columns}>\n <AboutField label={t('aboutCard.targetsField.label')}>\n <LinksGridList\n cols={1}\n items={(\n (entity.spec.targets as JsonArray) || [entity.spec.target]\n )\n .map(target => target as string)\n .map(target => ({\n text: target,\n href: getLocationTargetHref(\n target,\n (entity?.spec?.type || t('aboutCard.unknown')) as string,\n entitySourceLocation!,\n ),\n }))}\n />\n </AboutField>\n </Grid.Item>\n )}\n </Grid.Root>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAoCA,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,WAA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AAM,WAAW,MAAA,EAAQ,IAAA,EAAM,2BACrD,GAAA,CAAC,IAAA,CAAK,IAAA,EAAL,EAAU,SAAS,OAAA,EAClB,QAAA,kBAAA,GAAA,CAAC,cAAW,KAAA,EAAO,CAAA,CAAE,8BAA8B,CAAA,EACjD,QAAA,kBAAA,GAAA;AAAA,MAAC,aAAA;AAAA,MAAA;AAAA,QACC,IAAA,EAAM,CAAA;AAAA,QACN,KAAA,EAAA,CACG,MAAA,CAAO,IAAA,CAAK,OAAA,IAAyB,CAAC,MAAA,CAAO,IAAA,CAAK,MAAM,CAAA,EAExD,GAAA,CAAI,CAAA,MAAA,KAAU,MAAgB,CAAA,CAC9B,IAAI,CAAA,MAAA,MAAW;AAAA,UACd,IAAA,EAAM,MAAA;AAAA,UACN,IAAA,EAAM,qBAAA;AAAA,YACJ,MAAA;AAAA,YACC,MAAA,EAAQ,IAAA,EAAM,IAAA,IAAQ,CAAA,CAAE,mBAAmB,CAAA;AAAA,YAC5C;AAAA;AACF,SACF,CAAE;AAAA;AAAA,OAER,CAAA,EACF;AAAA,GAAA,EAEJ,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultCatalogPage.esm.js","sources":["../../../src/components/CatalogPage/DefaultCatalogPage.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 {\n Content,\n ContentHeader,\n CreateButton,\n PageWithHeader,\n SupportButton,\n TableColumn,\n TableProps,\n} from '@backstage/core-components';\nimport { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport { HeaderPage } from '@backstage/ui';\nimport {\n CatalogFilterLayout,\n DefaultFilters,\n EntityListPagination,\n EntityListProvider,\n EntityOwnerPickerProps,\n UserListFilterKind,\n} from '@backstage/plugin-catalog-react';\nimport { ReactNode } from 'react';\nimport { createComponentRouteRef } from '../../routes';\nimport { CatalogTable, CatalogTableRow } from '../CatalogTable';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { CatalogTableColumnsFunc } from '../CatalogTable/types';\nimport { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';\nimport { usePermission } from '@backstage/plugin-permission-react';\n\n/** @internal */\nexport type BaseCatalogPageProps = {\n filters: ReactNode;\n content?: ReactNode;\n pagination?: EntityListPagination;\n};\n\nfunction CatalogPageContent(props: BaseCatalogPageProps) {\n const { filters, content = <CatalogTable />, pagination } = props;\n\n return (\n <EntityListProvider pagination={pagination}>\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>{filters}</CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>{content}</CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </EntityListProvider>\n );\n}\n\n/** @internal */\nexport function BaseCatalogPage(props: BaseCatalogPageProps) {\n const orgName =\n useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage';\n const createComponentLink = useRouteRef(createComponentRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n const headerActions = (\n <>\n {allowed && (\n <CreateButton\n title={t('indexPage.createButtonTitle')}\n to={createComponentLink && createComponentLink()}\n />\n )}\n <SupportButton>{t('indexPage.supportButtonContent')}</SupportButton>\n </>\n );\n\n return (\n <PageWithHeader title={t('indexPage.title', { orgName })} themeId=\"home\">\n <Content>\n <ContentHeader title=\"\">{headerActions}</ContentHeader>\n <CatalogPageContent {...props} />\n </Content>\n </PageWithHeader>\n );\n}\n\nfunction NfsBaseCatalogPage(props: BaseCatalogPageProps) {\n const orgName =\n useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage';\n const createComponentLink = useRouteRef(createComponentRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n\n return (\n <>\n <HeaderPage\n title={t('indexPage.title', { orgName })}\n customActions={\n <>\n {allowed && (\n <CreateButton\n title={t('indexPage.createButtonTitle')}\n to={createComponentLink && createComponentLink()}\n />\n )}\n <SupportButton>{t('indexPage.supportButtonContent')}</SupportButton>\n </>\n }\n />\n <Content>\n <CatalogPageContent {...props} />\n </Content>\n </>\n );\n}\n\n/**\n * Props for root catalog pages.\n *\n * @public\n */\nexport interface DefaultCatalogPageProps {\n initiallySelectedFilter?: UserListFilterKind;\n columns?: TableColumn<CatalogTableRow>[] | CatalogTableColumnsFunc;\n actions?: TableProps<CatalogTableRow>['actions'];\n initialKind?: string;\n tableOptions?: TableProps<CatalogTableRow>['options'];\n emptyContent?: ReactNode;\n ownerPickerMode?: EntityOwnerPickerProps['mode'];\n filters?: ReactNode;\n initiallySelectedNamespaces?: string[];\n pagination?: EntityListPagination;\n}\n\nexport function DefaultCatalogPage(props: DefaultCatalogPageProps) {\n const {\n columns,\n actions,\n initiallySelectedFilter = 'owned',\n initialKind = 'component',\n tableOptions = {},\n emptyContent,\n pagination,\n ownerPickerMode,\n filters,\n initiallySelectedNamespaces,\n } = props;\n\n return (\n <BaseCatalogPage\n filters={\n filters ?? (\n <DefaultFilters\n initialKind={initialKind}\n initiallySelectedFilter={initiallySelectedFilter}\n ownerPickerMode={ownerPickerMode}\n initiallySelectedNamespaces={initiallySelectedNamespaces}\n />\n )\n }\n content={\n <CatalogTable\n columns={columns}\n actions={actions}\n tableOptions={tableOptions}\n emptyContent={emptyContent}\n />\n }\n pagination={pagination}\n />\n );\n}\n\nexport function NfsDefaultCatalogPage(props: DefaultCatalogPageProps) {\n const {\n columns,\n actions,\n initiallySelectedFilter = 'owned',\n initialKind = 'component',\n tableOptions = {},\n emptyContent,\n pagination,\n ownerPickerMode,\n filters,\n initiallySelectedNamespaces,\n } = props;\n\n return (\n <NfsBaseCatalogPage\n filters={\n filters ?? (\n <DefaultFilters\n initialKind={initialKind}\n initiallySelectedFilter={initiallySelectedFilter}\n ownerPickerMode={ownerPickerMode}\n initiallySelectedNamespaces={initiallySelectedNamespaces}\n />\n )\n }\n content={\n <CatalogTable\n columns={columns}\n actions={actions}\n tableOptions={tableOptions}\n emptyContent={emptyContent}\n />\n }\n pagination={pagination}\n />\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAmDA,SAAS,mBAAmB,KAAA,EAA6B;AACvD,EAAA,MAAM,EAAE,OAAA,EAAS,OAAA,uBAAW,YAAA,EAAA,EAAa,CAAA,EAAI,YAAW,GAAI,KAAA;AAE5D,EAAA,uBACE,GAAA,CAAC,kBAAA,EAAA,EAAmB,UAAA,EAClB,QAAA,kBAAA,IAAA,CAAC,mBAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,mBAAA,CAAoB,OAAA,EAApB,EAA6B,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,oBACtC,GAAA,CAAC,mBAAA,CAAoB,OAAA,EAApB,EAA6B,QAAA,EAAA,OAAA,EAAQ;AAAA,GAAA,EACxC,CAAA,EACF,CAAA;AAEJ;AAGO,SAAS,gBAAgB,KAAA,EAA6B;AAC3D,EAAA,MAAM,UACJ,MAAA,CAAO,YAAY,CAAA,CAAE,iBAAA,CAAkB,mBAAmB,CAAA,IAAK,WAAA;AACjE,EAAA,MAAM,mBAAA,GAAsB,YAAY,uBAAuB,CAAA;AAC/D,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,MAAM,EAAE,OAAA,EAAQ,GAAI,aAAA,CAAc;AAAA,IAChC,UAAA,EAAY;AAAA,GACb,CAAA;AACD,EAAA,MAAM,gCACJ,IAA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,GAA0B,OAAA;AAAA,IAC1B,WAAA,GAAc,WAAA;AAAA,IACd,eAAe,EAAC;AAAA,IAChB,YAAA;AAAA,IACA,UAAA;AAAA,IACA,eAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GACF,GAAI,KAAA;AAEJ,EAAA,uBACE,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,SACE,OAAA,oBACE,GAAA;AAAA,QAAC,cAAA;AAAA,QAAA;AAAA,UACC,WAAA;AAAA,UACA,uBAAA;AAAA,UACA,eAAA;AAAA,UACA;AAAA;AAAA,OACF;AAAA,MAGJ,OAAA,kBACE,GAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,OAAA;AAAA,UACA,OAAA;AAAA,UACA,YAAA;AAAA,UACA;AAAA;AAAA,OACF;AAAA,MAEF;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"DefaultCatalogPage.esm.js","sources":["../../../src/components/CatalogPage/DefaultCatalogPage.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 {\n Content,\n ContentHeader,\n CreateButton,\n PageWithHeader,\n SupportButton,\n TableColumn,\n TableProps,\n} from '@backstage/core-components';\nimport { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport { HeaderPage } from '@backstage/ui';\nimport {\n CatalogFilterLayout,\n DefaultFilters,\n EntityListPagination,\n EntityListProvider,\n EntityOwnerPickerProps,\n UserListFilterKind,\n} from '@backstage/plugin-catalog-react';\nimport { ReactNode } from 'react';\nimport { createComponentRouteRef } from '../../routes';\nimport { CatalogTable, CatalogTableRow } from '../CatalogTable';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { CatalogTableColumnsFunc } from '../CatalogTable/types';\nimport { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';\nimport { usePermission } from '@backstage/plugin-permission-react';\n\n/** @internal */\nexport type BaseCatalogPageProps = {\n filters: ReactNode;\n content?: ReactNode;\n pagination?: EntityListPagination;\n};\n\nfunction CatalogPageContent(props: BaseCatalogPageProps) {\n const { filters, content = <CatalogTable />, pagination } = props;\n\n return (\n <EntityListProvider pagination={pagination}>\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>{filters}</CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>{content}</CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </EntityListProvider>\n );\n}\n\n/** @internal */\nexport function BaseCatalogPage(props: BaseCatalogPageProps) {\n const orgName =\n useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage';\n const createComponentLink = useRouteRef(createComponentRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n const headerActions = (\n <>\n {allowed && (\n <CreateButton\n title={t('indexPage.createButtonTitle')}\n to={createComponentLink && createComponentLink()}\n />\n )}\n <SupportButton>{t('indexPage.supportButtonContent')}</SupportButton>\n </>\n );\n\n return (\n <PageWithHeader title={t('indexPage.title', { orgName })} themeId=\"home\">\n <Content>\n <ContentHeader title=\"\">{headerActions}</ContentHeader>\n <CatalogPageContent {...props} />\n </Content>\n </PageWithHeader>\n );\n}\n\nfunction NfsBaseCatalogPage(props: BaseCatalogPageProps) {\n const orgName =\n useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage';\n const createComponentLink = useRouteRef(createComponentRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n\n return (\n <>\n <HeaderPage\n title={t('indexPage.title', { orgName })}\n customActions={\n <>\n {allowed && (\n <CreateButton\n title={t('indexPage.createButtonTitle')}\n to={createComponentLink && createComponentLink()}\n />\n )}\n <SupportButton>{t('indexPage.supportButtonContent')}</SupportButton>\n </>\n }\n />\n <Content>\n <CatalogPageContent {...props} />\n </Content>\n </>\n );\n}\n\n/**\n * Props for root catalog pages.\n *\n * @public\n */\nexport interface DefaultCatalogPageProps {\n initiallySelectedFilter?: UserListFilterKind;\n columns?: TableColumn<CatalogTableRow>[] | CatalogTableColumnsFunc;\n actions?: TableProps<CatalogTableRow>['actions'];\n initialKind?: string;\n tableOptions?: TableProps<CatalogTableRow>['options'];\n emptyContent?: ReactNode;\n ownerPickerMode?: EntityOwnerPickerProps['mode'];\n filters?: ReactNode;\n initiallySelectedNamespaces?: string[];\n pagination?: EntityListPagination;\n}\n\nexport function DefaultCatalogPage(props: DefaultCatalogPageProps) {\n const {\n columns,\n actions,\n initiallySelectedFilter = 'owned',\n initialKind = 'component',\n tableOptions = {},\n emptyContent,\n pagination,\n ownerPickerMode,\n filters,\n initiallySelectedNamespaces,\n } = props;\n\n return (\n <BaseCatalogPage\n filters={\n filters ?? (\n <DefaultFilters\n initialKind={initialKind}\n initiallySelectedFilter={initiallySelectedFilter}\n ownerPickerMode={ownerPickerMode}\n initiallySelectedNamespaces={initiallySelectedNamespaces}\n />\n )\n }\n content={\n <CatalogTable\n columns={columns}\n actions={actions}\n tableOptions={tableOptions}\n emptyContent={emptyContent}\n />\n }\n pagination={pagination}\n />\n );\n}\n\n/** @public */\nexport function NfsDefaultCatalogPage(props: DefaultCatalogPageProps) {\n const {\n columns,\n actions,\n initiallySelectedFilter = 'owned',\n initialKind = 'component',\n tableOptions = {},\n emptyContent,\n pagination,\n ownerPickerMode,\n filters,\n initiallySelectedNamespaces,\n } = props;\n\n return (\n <NfsBaseCatalogPage\n filters={\n filters ?? (\n <DefaultFilters\n initialKind={initialKind}\n initiallySelectedFilter={initiallySelectedFilter}\n ownerPickerMode={ownerPickerMode}\n initiallySelectedNamespaces={initiallySelectedNamespaces}\n />\n )\n }\n content={\n <CatalogTable\n columns={columns}\n actions={actions}\n tableOptions={tableOptions}\n emptyContent={emptyContent}\n />\n }\n pagination={pagination}\n />\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAmDA,SAAS,mBAAmB,KAAA,EAA6B;AACvD,EAAA,MAAM,EAAE,OAAA,EAAS,OAAA,uBAAW,YAAA,EAAA,EAAa,CAAA,EAAI,YAAW,GAAI,KAAA;AAE5D,EAAA,uBACE,GAAA,CAAC,kBAAA,EAAA,EAAmB,UAAA,EAClB,QAAA,kBAAA,IAAA,CAAC,mBAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,mBAAA,CAAoB,OAAA,EAApB,EAA6B,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,oBACtC,GAAA,CAAC,mBAAA,CAAoB,OAAA,EAApB,EAA6B,QAAA,EAAA,OAAA,EAAQ;AAAA,GAAA,EACxC,CAAA,EACF,CAAA;AAEJ;AAGO,SAAS,gBAAgB,KAAA,EAA6B;AAC3D,EAAA,MAAM,UACJ,MAAA,CAAO,YAAY,CAAA,CAAE,iBAAA,CAAkB,mBAAmB,CAAA,IAAK,WAAA;AACjE,EAAA,MAAM,mBAAA,GAAsB,YAAY,uBAAuB,CAAA;AAC/D,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,MAAM,EAAE,OAAA,EAAQ,GAAI,aAAA,CAAc;AAAA,IAChC,UAAA,EAAY;AAAA,GACb,CAAA;AACD,EAAA,MAAM,gCACJ,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,OAAA,oBACC,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,EAAE,6BAA6B,CAAA;AAAA,QACtC,EAAA,E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AAI,KAAA;AAEJ,EAAA,uBACE,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,SACE,OAAA,oBACE,GAAA;AAAA,QAAC,cAAA;AAAA,QAAA;AAAA,UACC,WAAA;AAAA,UACA,uBAAA;AAAA,UACA,eAAA;AAAA,UACA;AAAA;AAAA,OACF;AAAA,MAGJ,OAAA,kBACE,GAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,OAAA;AAAA,UACA,OAAA;AAAA,UACA,YAAA;AAAA,UACA;AAAA;AAAA,OACF;AAAA,MAEF;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { ANNOTATION_VIEW_URL, ANNOTATION_EDIT_URL, RELATION_PART_OF, RELATION_OWNED_BY, stringifyEntityRef } from '@backstage/catalog-model';
|
|
3
3
|
import { WarningPanel, CodeSnippet, Table, FavoriteToggleIcon } from '@backstage/core-components';
|
|
4
|
-
import { useStarredEntities, useEntityList, getEntityRelations,
|
|
4
|
+
import { useStarredEntities, entityPresentationApiRef, useEntityList, getEntityRelations, entityPresentationSnapshot } from '@backstage/plugin-catalog-react';
|
|
5
5
|
import CircularProgress from '@material-ui/core/CircularProgress';
|
|
6
6
|
import Typography from '@material-ui/core/Typography';
|
|
7
7
|
import { visuallyHidden } from '@mui/utils';
|
|
8
8
|
import EditIcon from '@material-ui/icons/Edit';
|
|
9
9
|
import OpenInNew from '@material-ui/icons/OpenInNew';
|
|
10
|
-
import { capitalize } from 'lodash';
|
|
10
|
+
import { capitalize, sortBy } from 'lodash';
|
|
11
11
|
import pluralize from 'pluralize';
|
|
12
12
|
import { useMemo } from 'react';
|
|
13
13
|
import { columnFactories } from './columns.esm.js';
|
|
14
14
|
import { OffsetPaginatedCatalogTable } from './OffsetPaginatedCatalogTable.esm.js';
|
|
15
15
|
import { CursorPaginatedCatalogTable } from './CursorPaginatedCatalogTable.esm.js';
|
|
16
16
|
import { defaultCatalogTableColumnsFunc } from './defaultCatalogTableColumnsFunc.esm.js';
|
|
17
|
+
import { useApiHolder } from '@backstage/core-plugin-api';
|
|
17
18
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
18
19
|
import { catalogTranslationRef } from '../../alpha.esm.js';
|
|
19
20
|
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const sortEntities = (entities, api) => {
|
|
22
|
+
return sortBy(
|
|
23
|
+
entities,
|
|
24
|
+
(e) => entityPresentationSnapshot(e, { defaultKind: "Component" }, api).primaryTitle
|
|
25
|
+
);
|
|
25
26
|
};
|
|
26
27
|
const CatalogTable = (props) => {
|
|
27
28
|
const {
|
|
@@ -31,6 +32,8 @@ const CatalogTable = (props) => {
|
|
|
31
32
|
emptyContent
|
|
32
33
|
} = props;
|
|
33
34
|
const { isStarredEntity, toggleStarredEntity } = useStarredEntities();
|
|
35
|
+
const apis = useApiHolder();
|
|
36
|
+
const entityPresentationApi = apis.get(entityPresentationApiRef);
|
|
34
37
|
const entityListContext = useEntityList();
|
|
35
38
|
const {
|
|
36
39
|
loading,
|
|
@@ -137,7 +140,7 @@ const CatalogTable = (props) => {
|
|
|
137
140
|
actions,
|
|
138
141
|
subtitle,
|
|
139
142
|
options,
|
|
140
|
-
data: entities.map(toEntityRow),
|
|
143
|
+
data: entities.map((e) => toEntityRow(e, entityPresentationApi)),
|
|
141
144
|
next: pageInfo?.next,
|
|
142
145
|
prev: pageInfo?.prev
|
|
143
146
|
}
|
|
@@ -153,11 +156,13 @@ const CatalogTable = (props) => {
|
|
|
153
156
|
actions,
|
|
154
157
|
subtitle,
|
|
155
158
|
options,
|
|
156
|
-
data: entities.map(toEntityRow)
|
|
159
|
+
data: entities.map((e) => toEntityRow(e, entityPresentationApi))
|
|
157
160
|
}
|
|
158
161
|
);
|
|
159
162
|
}
|
|
160
|
-
const rows = entities
|
|
163
|
+
const rows = sortEntities(entities, entityPresentationApi).map(
|
|
164
|
+
(e) => toEntityRow(e, entityPresentationApi)
|
|
165
|
+
);
|
|
161
166
|
const pageSize = 20;
|
|
162
167
|
const showPagination = rows.length > pageSize;
|
|
163
168
|
return /* @__PURE__ */ jsx(
|
|
@@ -181,7 +186,7 @@ const CatalogTable = (props) => {
|
|
|
181
186
|
};
|
|
182
187
|
CatalogTable.columns = columnFactories;
|
|
183
188
|
CatalogTable.defaultColumnsFunc = defaultCatalogTableColumnsFunc;
|
|
184
|
-
function toEntityRow(entity) {
|
|
189
|
+
function toEntityRow(entity, api) {
|
|
185
190
|
const partOfSystemRelations = getEntityRelations(entity, RELATION_PART_OF, {
|
|
186
191
|
kind: "system"
|
|
187
192
|
});
|
|
@@ -192,16 +197,18 @@ function toEntityRow(entity) {
|
|
|
192
197
|
// This name is here for backwards compatibility mostly; the
|
|
193
198
|
// presentation of refs in the table should in general be handled with
|
|
194
199
|
// EntityRefLink / EntityName components
|
|
195
|
-
name:
|
|
196
|
-
|
|
197
|
-
|
|
200
|
+
name: entityPresentationSnapshot(
|
|
201
|
+
entity,
|
|
202
|
+
{ defaultKind: "Component" },
|
|
203
|
+
api
|
|
204
|
+
).primaryTitle,
|
|
198
205
|
entityRef: stringifyEntityRef(entity),
|
|
199
|
-
ownedByRelationsTitle: ownedByRelations.map(
|
|
206
|
+
ownedByRelationsTitle: ownedByRelations.map(
|
|
207
|
+
(r) => entityPresentationSnapshot(r, { defaultKind: "group" }, api).primaryTitle
|
|
208
|
+
).join(", "),
|
|
200
209
|
ownedByRelations,
|
|
201
210
|
partOfSystemRelationTitle: partOfSystemRelations.map(
|
|
202
|
-
(r) =>
|
|
203
|
-
defaultKind: "system"
|
|
204
|
-
})
|
|
211
|
+
(r) => entityPresentationSnapshot(r, { defaultKind: "system" }, api).primaryTitle
|
|
205
212
|
).join(", "),
|
|
206
213
|
partOfSystemRelations
|
|
207
214
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatalogTable.esm.js","sources":["../../../src/components/CatalogTable/CatalogTable.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 ANNOTATION_EDIT_URL,\n ANNOTATION_VIEW_URL,\n Entity,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n CodeSnippet,\n Table,\n TableColumn,\n TableProps,\n WarningPanel,\n} from '@backstage/core-components';\nimport {\n getEntityRelations,\n humanizeEntityRef,\n useEntityList,\n useStarredEntities,\n} from '@backstage/plugin-catalog-react';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport Typography from '@material-ui/core/Typography';\nimport { visuallyHidden } from '@mui/utils';\nimport Edit from '@material-ui/icons/Edit';\nimport OpenInNew from '@material-ui/icons/OpenInNew';\nimport { capitalize } from 'lodash';\nimport pluralize from 'pluralize';\nimport { ReactNode, useMemo } from 'react';\nimport { columnFactories } from './columns';\nimport { CatalogTableColumnsFunc, CatalogTableRow } from './types';\nimport { OffsetPaginatedCatalogTable } from './OffsetPaginatedCatalogTable';\nimport { CursorPaginatedCatalogTable } from './CursorPaginatedCatalogTable';\nimport { defaultCatalogTableColumnsFunc } from './defaultCatalogTableColumnsFunc';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { catalogTranslationRef } from '../../alpha';\nimport { FavoriteToggleIcon } from '@backstage/core-components';\n\n/**\n * Props for {@link CatalogTable}.\n *\n * @public\n */\nexport interface CatalogTableProps {\n columns?: TableColumn<CatalogTableRow>[] | CatalogTableColumnsFunc;\n actions?: TableProps<CatalogTableRow>['actions'];\n tableOptions?: TableProps<CatalogTableRow>['options'];\n emptyContent?: ReactNode;\n /**\n * A static title to use for the table. If not provided, a title will be\n * generated based on the current Kind and Type filters and total number of items.\n */\n title?: string;\n subtitle?: string;\n}\n\nconst refCompare = (a: Entity, b: Entity) => {\n const toRef = (entity: Entity) =>\n entity.metadata.title ||\n humanizeEntityRef(entity, {\n defaultKind: 'Component',\n });\n\n return toRef(a).localeCompare(toRef(b));\n};\n\n/**\n * CatalogTable is a wrapper around the Table component that is pre-configured\n * to display catalog entities.\n *\n * @remarks\n *\n * See {@link https://backstage.io/docs/features/software-catalog/catalog-customization}\n *\n * @public\n */\nexport const CatalogTable = (props: CatalogTableProps) => {\n const {\n columns = defaultCatalogTableColumnsFunc,\n tableOptions,\n subtitle,\n emptyContent,\n } = props;\n const { isStarredEntity, toggleStarredEntity } = useStarredEntities();\n const entityListContext = useEntityList();\n\n const {\n loading,\n error,\n entities,\n filters,\n pageInfo,\n totalItems,\n paginationMode,\n } = entityListContext;\n\n // For non-paginated tables, only show the full loading indicator when\n // there's no data yet (initial load). During filter changes we keep stale\n // data visible and let the new results swap in seamlessly. For paginated\n // tables we always show loading, since stale data from a different page\n // would be misleading.\n const isLoading =\n paginationMode === 'none' ? loading && entities.length === 0 : loading;\n\n const tableColumns = useMemo(\n () =>\n typeof columns === 'function' ? columns(entityListContext) : columns,\n [columns, entityListContext],\n );\n const { t } = useTranslationRef(catalogTranslationRef);\n\n if (error) {\n return (\n <div>\n <WarningPanel\n severity=\"error\"\n title={t('catalogTable.warningPanelTitle')}\n >\n <CodeSnippet language=\"text\" text={error.toString()} />\n </WarningPanel>\n </div>\n );\n }\n\n const defaultActions: TableProps<CatalogTableRow>['actions'] = [\n ({ entity }) => {\n const url = entity.metadata.annotations?.[ANNOTATION_VIEW_URL];\n const title = t('catalogTable.viewActionTitle');\n\n return {\n icon: () => (\n <>\n <Typography style={visuallyHidden}>{title}</Typography>\n <OpenInNew fontSize=\"small\" />\n </>\n ),\n tooltip: title,\n disabled: !url,\n onClick: () => {\n if (!url) return;\n window.open(url, '_blank');\n },\n };\n },\n ({ entity }) => {\n const url = entity.metadata.annotations?.[ANNOTATION_EDIT_URL];\n const title = t('catalogTable.editActionTitle');\n\n return {\n icon: () => (\n <>\n <Typography style={visuallyHidden}>{title}</Typography>\n <Edit fontSize=\"small\" />\n </>\n ),\n tooltip: title,\n disabled: !url,\n onClick: () => {\n if (!url) return;\n window.open(url, '_blank');\n },\n };\n },\n ({ entity }) => {\n const isStarred = isStarredEntity(entity);\n const title = isStarred\n ? t('catalogTable.unStarActionTitle')\n : t('catalogTable.starActionTitle');\n\n return {\n cellStyle: { paddingLeft: '1em' },\n icon: () => <FavoriteToggleIcon isFavorite={isStarred} />,\n tooltip: title,\n onClick: () => toggleStarredEntity(entity),\n };\n },\n ];\n\n const currentKind = filters.kind?.label || '';\n const currentType = filters.type?.value || '';\n const currentCount = typeof totalItems === 'number' ? `(${totalItems})` : '';\n // TODO(timbonicus): remove the title from the CatalogTable once using EntitySearchBar\n const titlePreamble = capitalize(\n filters.user?.value ?? t('catalogTable.allFilters'),\n );\n const titleText =\n props.title ||\n [titlePreamble, currentType, pluralize(currentKind), currentCount]\n .filter(s => s)\n .join(' ');\n const title =\n loading && !isLoading ? (\n <span\n style={{ display: 'inline-flex', alignItems: 'center', gap: '0.5em' }}\n >\n {titleText}\n <CircularProgress size=\"0.8em\" data-testid=\"loading-indicator\" />\n </span>\n ) : (\n titleText\n );\n\n const actions = props.actions || defaultActions;\n const options: TableProps['options'] = {\n actionsColumnIndex: -1,\n loadingType: 'linear' as const,\n showEmptyDataSourceMessage: !isLoading,\n padding: 'dense' as const,\n ...tableOptions,\n };\n\n if (paginationMode === 'cursor') {\n return (\n <CursorPaginatedCatalogTable\n columns={tableColumns}\n emptyContent={emptyContent}\n isLoading={isLoading}\n title={title}\n actions={actions}\n subtitle={subtitle}\n options={options}\n data={entities.map(toEntityRow)}\n next={pageInfo?.next}\n prev={pageInfo?.prev}\n />\n );\n } else if (paginationMode === 'offset') {\n return (\n <OffsetPaginatedCatalogTable\n columns={tableColumns}\n emptyContent={emptyContent}\n isLoading={isLoading}\n title={title}\n actions={actions}\n subtitle={subtitle}\n options={options}\n data={entities.map(toEntityRow)}\n />\n );\n }\n\n const rows = entities.sort(refCompare).map(toEntityRow);\n const pageSize = 20;\n const showPagination = rows.length > pageSize;\n\n return (\n <Table<CatalogTableRow>\n isLoading={isLoading}\n columns={tableColumns}\n options={{\n paging: showPagination,\n pageSize: pageSize,\n pageSizeOptions: [20, 50, 100],\n ...options,\n }}\n title={title}\n data={rows}\n actions={actions}\n subtitle={subtitle}\n emptyContent={emptyContent}\n />\n );\n};\n\nCatalogTable.columns = columnFactories;\nCatalogTable.defaultColumnsFunc = defaultCatalogTableColumnsFunc;\n\nfunction toEntityRow(entity: Entity) {\n const partOfSystemRelations = getEntityRelations(entity, RELATION_PART_OF, {\n kind: 'system',\n });\n const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);\n\n return {\n entity,\n resolved: {\n // This name is here for backwards compatibility mostly; the\n // presentation of refs in the table should in general be handled with\n // EntityRefLink / EntityName components\n name: humanizeEntityRef(entity, {\n defaultKind: 'Component',\n }),\n entityRef: stringifyEntityRef(entity),\n ownedByRelationsTitle: ownedByRelations\n .map(r => humanizeEntityRef(r, { defaultKind: 'group' }))\n .join(', '),\n ownedByRelations,\n partOfSystemRelationTitle: partOfSystemRelations\n .map(r =>\n humanizeEntityRef(r, {\n defaultKind: 'system',\n }),\n )\n .join(', '),\n partOfSystemRelations,\n },\n };\n}\n"],"names":["title","Edit"],"mappings":";;;;;;;;;;;;;;;;;;;AAuEA,MAAM,UAAA,GAAa,CAAC,CAAA,EAAW,CAAA,KAAc;AAC3C,EAAA,MAAM,QAAQ,CAAC,MAAA,KACb,OAAO,QAAA,CAAS,KAAA,IAChB,kBAAkB,MAAA,EAAQ;AAAA,IACxB,WAAA,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A,QAAI,CAAA,CAAA,KACH,kBAAkB,CAAA,EAAG;AAAA,UACnB,WAAA,EAAa;AAAA,SACd;AAAA,OACH,CACC,KAAK,IAAI,CAAA;AAAA,MACZ;AAAA;AACF,GACF;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CatalogTable.esm.js","sources":["../../../src/components/CatalogTable/CatalogTable.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 ANNOTATION_EDIT_URL,\n ANNOTATION_VIEW_URL,\n Entity,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n CodeSnippet,\n Table,\n TableColumn,\n TableProps,\n WarningPanel,\n} from '@backstage/core-components';\nimport {\n entityPresentationApiRef,\n entityPresentationSnapshot,\n getEntityRelations,\n useEntityList,\n useStarredEntities,\n type EntityPresentationApi,\n} from '@backstage/plugin-catalog-react';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport Typography from '@material-ui/core/Typography';\nimport { visuallyHidden } from '@mui/utils';\nimport Edit from '@material-ui/icons/Edit';\nimport OpenInNew from '@material-ui/icons/OpenInNew';\nimport { capitalize, sortBy } from 'lodash';\nimport pluralize from 'pluralize';\nimport { ReactNode, useMemo } from 'react';\nimport { columnFactories } from './columns';\nimport { CatalogTableColumnsFunc, CatalogTableRow } from './types';\nimport { OffsetPaginatedCatalogTable } from './OffsetPaginatedCatalogTable';\nimport { CursorPaginatedCatalogTable } from './CursorPaginatedCatalogTable';\nimport { defaultCatalogTableColumnsFunc } from './defaultCatalogTableColumnsFunc';\nimport { useApiHolder } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { catalogTranslationRef } from '../../alpha';\nimport { FavoriteToggleIcon } from '@backstage/core-components';\n\n/**\n * Props for {@link CatalogTable}.\n *\n * @public\n */\nexport interface CatalogTableProps {\n columns?: TableColumn<CatalogTableRow>[] | CatalogTableColumnsFunc;\n actions?: TableProps<CatalogTableRow>['actions'];\n tableOptions?: TableProps<CatalogTableRow>['options'];\n emptyContent?: ReactNode;\n /**\n * A static title to use for the table. If not provided, a title will be\n * generated based on the current Kind and Type filters and total number of items.\n */\n title?: string;\n subtitle?: string;\n}\n\nconst sortEntities = (entities: Entity[], api?: EntityPresentationApi) => {\n return sortBy(\n entities,\n e =>\n entityPresentationSnapshot(e, { defaultKind: 'Component' }, api)\n .primaryTitle,\n );\n};\n\n/**\n * CatalogTable is a wrapper around the Table component that is pre-configured\n * to display catalog entities.\n *\n * @remarks\n *\n * See {@link https://backstage.io/docs/features/software-catalog/catalog-customization}\n *\n * @public\n */\nexport const CatalogTable = (props: CatalogTableProps) => {\n const {\n columns = defaultCatalogTableColumnsFunc,\n tableOptions,\n subtitle,\n emptyContent,\n } = props;\n const { isStarredEntity, toggleStarredEntity } = useStarredEntities();\n const apis = useApiHolder();\n const entityPresentationApi = apis.get(entityPresentationApiRef);\n const entityListContext = useEntityList();\n\n const {\n loading,\n error,\n entities,\n filters,\n pageInfo,\n totalItems,\n paginationMode,\n } = entityListContext;\n\n // For non-paginated tables, only show the full loading indicator when\n // there's no data yet (initial load). During filter changes we keep stale\n // data visible and let the new results swap in seamlessly. For paginated\n // tables we always show loading, since stale data from a different page\n // would be misleading.\n const isLoading =\n paginationMode === 'none' ? loading && entities.length === 0 : loading;\n\n const tableColumns = useMemo(\n () =>\n typeof columns === 'function' ? columns(entityListContext) : columns,\n [columns, entityListContext],\n );\n const { t } = useTranslationRef(catalogTranslationRef);\n\n if (error) {\n return (\n <div>\n <WarningPanel\n severity=\"error\"\n title={t('catalogTable.warningPanelTitle')}\n >\n <CodeSnippet language=\"text\" text={error.toString()} />\n </WarningPanel>\n </div>\n );\n }\n\n const defaultActions: TableProps<CatalogTableRow>['actions'] = [\n ({ entity }) => {\n const url = entity.metadata.annotations?.[ANNOTATION_VIEW_URL];\n const title = t('catalogTable.viewActionTitle');\n\n return {\n icon: () => (\n <>\n <Typography style={visuallyHidden}>{title}</Typography>\n <OpenInNew fontSize=\"small\" />\n </>\n ),\n tooltip: title,\n disabled: !url,\n onClick: () => {\n if (!url) return;\n window.open(url, '_blank');\n },\n };\n },\n ({ entity }) => {\n const url = entity.metadata.annotations?.[ANNOTATION_EDIT_URL];\n const title = t('catalogTable.editActionTitle');\n\n return {\n icon: () => (\n <>\n <Typography style={visuallyHidden}>{title}</Typography>\n <Edit fontSize=\"small\" />\n </>\n ),\n tooltip: title,\n disabled: !url,\n onClick: () => {\n if (!url) return;\n window.open(url, '_blank');\n },\n };\n },\n ({ entity }) => {\n const isStarred = isStarredEntity(entity);\n const title = isStarred\n ? t('catalogTable.unStarActionTitle')\n : t('catalogTable.starActionTitle');\n\n return {\n cellStyle: { paddingLeft: '1em' },\n icon: () => <FavoriteToggleIcon isFavorite={isStarred} />,\n tooltip: title,\n onClick: () => toggleStarredEntity(entity),\n };\n },\n ];\n\n const currentKind = filters.kind?.label || '';\n const currentType = filters.type?.value || '';\n const currentCount = typeof totalItems === 'number' ? `(${totalItems})` : '';\n // TODO(timbonicus): remove the title from the CatalogTable once using EntitySearchBar\n const titlePreamble = capitalize(\n filters.user?.value ?? t('catalogTable.allFilters'),\n );\n const titleText =\n props.title ||\n [titlePreamble, currentType, pluralize(currentKind), currentCount]\n .filter(s => s)\n .join(' ');\n const title =\n loading && !isLoading ? (\n <span\n style={{ display: 'inline-flex', alignItems: 'center', gap: '0.5em' }}\n >\n {titleText}\n <CircularProgress size=\"0.8em\" data-testid=\"loading-indicator\" />\n </span>\n ) : (\n titleText\n );\n\n const actions = props.actions || defaultActions;\n const options: TableProps['options'] = {\n actionsColumnIndex: -1,\n loadingType: 'linear' as const,\n showEmptyDataSourceMessage: !isLoading,\n padding: 'dense' as const,\n ...tableOptions,\n };\n\n if (paginationMode === 'cursor') {\n return (\n <CursorPaginatedCatalogTable\n columns={tableColumns}\n emptyContent={emptyContent}\n isLoading={isLoading}\n title={title}\n actions={actions}\n subtitle={subtitle}\n options={options}\n data={entities.map(e => toEntityRow(e, entityPresentationApi))}\n next={pageInfo?.next}\n prev={pageInfo?.prev}\n />\n );\n } else if (paginationMode === 'offset') {\n return (\n <OffsetPaginatedCatalogTable\n columns={tableColumns}\n emptyContent={emptyContent}\n isLoading={isLoading}\n title={title}\n actions={actions}\n subtitle={subtitle}\n options={options}\n data={entities.map(e => toEntityRow(e, entityPresentationApi))}\n />\n );\n }\n\n const rows = sortEntities(entities, entityPresentationApi).map(e =>\n toEntityRow(e, entityPresentationApi),\n );\n const pageSize = 20;\n const showPagination = rows.length > pageSize;\n\n return (\n <Table<CatalogTableRow>\n isLoading={isLoading}\n columns={tableColumns}\n options={{\n paging: showPagination,\n pageSize: pageSize,\n pageSizeOptions: [20, 50, 100],\n ...options,\n }}\n title={title}\n data={rows}\n actions={actions}\n subtitle={subtitle}\n emptyContent={emptyContent}\n />\n );\n};\n\nCatalogTable.columns = columnFactories;\nCatalogTable.defaultColumnsFunc = defaultCatalogTableColumnsFunc;\n\nfunction toEntityRow(entity: Entity, api?: EntityPresentationApi) {\n const partOfSystemRelations = getEntityRelations(entity, RELATION_PART_OF, {\n kind: 'system',\n });\n const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);\n\n return {\n entity,\n resolved: {\n // This name is here for backwards compatibility mostly; the\n // presentation of refs in the table should in general be handled with\n // EntityRefLink / EntityName components\n name: entityPresentationSnapshot(\n entity,\n { defaultKind: 'Component' },\n api,\n ).primaryTitle,\n entityRef: stringifyEntityRef(entity),\n ownedByRelationsTitle: ownedByRelations\n .map(\n r =>\n entityPresentationSnapshot(r, { defaultKind: 'group' }, api)\n .primaryTitle,\n )\n .join(', '),\n ownedByRelations,\n partOfSystemRelationTitle: partOfSystemRelations\n .map(\n r =>\n entityPresentationSnapshot(r, { defaultKind: 'system' }, api)\n .primaryTitle,\n )\n .join(', '),\n partOfSystemRelations,\n },\n };\n}\n"],"names":["title","Edit"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0EA,MAAM,YAAA,GAAe,CAAC,QAAA,EAAoB,GAAA,KAAgC;AACxE,EAAA,OAAO,MAAA;AAAA,IACL,QAAA;AAAA,IACA,CAAA,CAAA,KACE,2BAA2B,CAAA,EAAG,EAAE,aAAa,WAAA,EAAY,EAAG,GAAG,CAAA,CAC5D;AAAA,GACP;AACF,CAAA;AAYO,MAAM,YAAA,GAAe,CAAC,KAAA,KAA6B;AACxD,EAAA,MAAM;AAAA,IACJ,OAAA,GAAU,8BAAA;AAAA,IACV,YAAA;AAAA,IACA,QAAA;AAAA,IACA;AAAA,GACF,GAAI,KAAA;AACJ,EAAA,MAAM,EAAE,eAAA,EAAiB,mBAAA,EAAoB,GAAI,kBAAA,EAAmB;AACpE,EAAA,MAAM,OAAO,YAAA,EAAa;AAC1B,EAAA,MAAM,qBAAA,GAAwB,IAAA,CAAK,GAAA,CAAI,wBAAwB,CAAA;AAC/D,EAAA,MAAM,oBAAoB,aAAA,EAAc;AAExC,EAAA,MAAM;AAAA,IACJ,OAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF,GAAI,iBAAA;AAOJ,EAAA,MAAM,YACJ,cAAA,KAAmB,MAAA,GAAS,OAAA,IAAW,QAAA,CAAS,WAAW,CAAA,GAAI,OAAA;AAEjE,EAAA,MAAM,YAAA,GAAe,OAAA;AAAA,IACnB,MACE,OAAO,OAAA,KAAY,UAAA,GAAa,OAAA,CAAQ,iBAAiB,CAAA,GAAI,OAAA;AAAA,IAC/D,CAAC,S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GAAwB,kBAAA,CAAmB,MAAA,EAAQ,gBAAA,EAAkB;AAAA,IACzE,IAAA,EAAM;AAAA,GACP,CAAA;AACD,EAAA,MAAM,gBAAA,GAAmB,kBAAA,CAAmB,MAAA,EAAQ,iBAAiB,CAAA;AAErE,EAAA,OAAO;AAAA,IACL,MAAA;AAAA,IACA,QAAA,EAAU;AAAA;AAAA;AAAA;AAAA,MAIR,IAAA,EAAM,0BAAA;AAAA,QACJ,MAAA;AAAA,QACA,EAAE,aAAa,WAAA,EAAY;AAAA,QAC3B;AAAA,OACF,CAAE,YAAA;AAAA,MACF,SAAA,EAAW,mBAAmB,MAAM,CAAA;AAAA,MACpC,uBAAuB,gBAAA,CACpB,GAAA;AAAA,QACC,CAAA,CAAA,KACE,2BAA2B,CAAA,EAAG,EAAE,aAAa,OAAA,EAAQ,EAAG,GAAG,CAAA,CACxD;AAAA,OACP,CACC,KAAK,IAAI,CAAA;AAAA,MACZ,gBAAA;AAAA,MACA,2BAA2B,qBAAA,CACxB,GAAA;AAAA,QACC,CAAA,CAAA,KACE,2BAA2B,CAAA,EAAG,EAAE,aAAa,QAAA,EAAS,EAAG,GAAG,CAAA,CACzD;AAAA,OACP,CACC,KAAK,IAAI,CAAA;AAAA,MACZ;AAAA;AACF,GACF;AACF;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { EntityRefLinks, EntityRefLink,
|
|
2
|
+
import { EntityRefLinks, EntityRefLink, defaultEntityPresentation } from '@backstage/plugin-catalog-react';
|
|
3
3
|
import Chip from '@material-ui/core/Chip';
|
|
4
4
|
import { OverflowTooltip } from '@backstage/core-components';
|
|
5
5
|
import { EntityTableColumnTitle } from '@backstage/plugin-catalog-react/alpha';
|
|
@@ -7,9 +7,14 @@ import { EntityTableColumnTitle } from '@backstage/plugin-catalog-react/alpha';
|
|
|
7
7
|
const columnFactories = Object.freeze({
|
|
8
8
|
createNameColumn(options) {
|
|
9
9
|
function formatContent(entity) {
|
|
10
|
-
|
|
10
|
+
if (options?.entityPresentationApi) {
|
|
11
|
+
return options.entityPresentationApi.forEntity(entity, {
|
|
12
|
+
defaultKind: options?.defaultKind
|
|
13
|
+
}).snapshot.primaryTitle;
|
|
14
|
+
}
|
|
15
|
+
return defaultEntityPresentation(entity, {
|
|
11
16
|
defaultKind: options?.defaultKind
|
|
12
|
-
});
|
|
17
|
+
}).primaryTitle;
|
|
13
18
|
}
|
|
14
19
|
return {
|
|
15
20
|
title: /* @__PURE__ */ jsx(EntityTableColumnTitle, { translationKey: "name" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns.esm.js","sources":["../../../src/components/CatalogTable/columns.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 */\nimport {\n humanizeEntityRef,\n EntityRefLink,\n EntityRefLinks,\n} from '@backstage/plugin-catalog-react';\nimport Chip from '@material-ui/core/Chip';\nimport { CatalogTableRow } from './types';\nimport { OverflowTooltip, TableColumn } from '@backstage/core-components';\nimport { Entity } from '@backstage/catalog-model';\nimport { JsonArray } from '@backstage/types';\nimport { EntityTableColumnTitle } from '@backstage/plugin-catalog-react/alpha';\n\n// The columnFactories symbol is not directly exported, but through the\n// CatalogTable.columns field.\n/** @public */\nexport const columnFactories = Object.freeze({\n createNameColumn(options?: {\n defaultKind?: string;\n }): TableColumn<CatalogTableRow> {\n function formatContent(entity: Entity): string {\n return (\n entity.metadata?.title ||\n humanizeEntityRef(entity, {\n defaultKind: options?.defaultKind,\n })\n );\n }\n\n return {\n title: <EntityTableColumnTitle translationKey=\"name\" />,\n field: 'resolved.entityRef',\n highlight: true,\n customSort({ entity: entity1 }, { entity: entity2 }) {\n // TODO: We could implement this more efficiently by comparing field by field.\n // This has similar issues as above.\n return formatContent(entity1).localeCompare(formatContent(entity2));\n },\n render: ({ entity }) => (\n <EntityRefLink\n entityRef={entity}\n defaultKind={options?.defaultKind || 'Component'}\n />\n ),\n };\n },\n createSystemColumn(): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"system\" />,\n field: 'resolved.partOfSystemRelationTitle',\n customFilterAndSearch: (query, row) => {\n if (!row.resolved.partOfSystemRelations) {\n return false;\n }\n\n const systemNames = row.resolved.partOfSystemRelations.map(\n ref => ref.name,\n ); // Extract system names from entityRefs\n\n const searchText = systemNames.join(', ').toLocaleUpperCase('en-US');\n return searchText.includes(query.toLocaleUpperCase('en-US'));\n },\n render: ({ resolved }) => (\n <EntityRefLinks\n entityRefs={resolved.partOfSystemRelations}\n defaultKind=\"system\"\n />\n ),\n };\n },\n createOwnerColumn(): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"owner\" />,\n field: 'resolved.ownedByRelationsTitle',\n render: ({ resolved }) => (\n <EntityRefLinks\n entityRefs={resolved.ownedByRelations}\n defaultKind=\"group\"\n />\n ),\n };\n },\n createSpecTargetsColumn(): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"targets\" />,\n field: 'entity.spec.targets',\n customFilterAndSearch: (query, row) => {\n let targets: JsonArray = [];\n if (\n row.entity?.spec?.targets &&\n Array.isArray(row.entity?.spec?.targets)\n ) {\n targets = row.entity?.spec?.targets;\n } else if (row.entity?.spec?.target) {\n targets = [row.entity?.spec?.target];\n }\n return targets\n .join(', ')\n .toLocaleUpperCase('en-US')\n .includes(query.toLocaleUpperCase('en-US'));\n },\n render: ({ entity }) => (\n <>\n {(entity?.spec?.targets || entity?.spec?.target) && (\n <OverflowTooltip\n text={(\n (entity!.spec!.targets as JsonArray) || [entity.spec.target]\n ).join(', ')}\n placement=\"bottom-start\"\n />\n )}\n </>\n ),\n };\n },\n createSpecTypeColumn(\n options: {\n hidden: boolean;\n } = { hidden: false },\n ): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"type\" />,\n field: 'entity.spec.type',\n hidden: options.hidden,\n width: 'auto',\n };\n },\n createSpecLifecycleColumn(): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"lifecycle\" />,\n field: 'entity.spec.lifecycle',\n };\n },\n createMetadataDescriptionColumn(): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"description\" />,\n field: 'entity.metadata.description',\n render: ({ entity }) => (\n <OverflowTooltip\n text={entity.metadata.description}\n placement=\"bottom-start\"\n />\n ),\n width: 'auto',\n };\n },\n createTagsColumn(): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"tags\" />,\n field: 'entity.metadata.tags',\n cellStyle: {\n padding: '0px 16px 0px 20px',\n },\n render: ({ entity }) => (\n <>\n {entity.metadata.tags &&\n entity.metadata.tags.map(t => (\n <Chip\n key={t}\n label={t}\n size=\"small\"\n variant=\"outlined\"\n style={{ margin: '2px' }}\n />\n ))}\n </>\n ),\n width: 'auto',\n };\n },\n createTitleColumn(options?: {\n hidden?: boolean;\n }): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"title\" />,\n field: 'entity.metadata.title',\n hidden: options?.hidden,\n searchable: true,\n };\n },\n createLabelColumn(\n key: string,\n options?: { title?: string; defaultValue?: string },\n ): TableColumn<CatalogTableRow> {\n function formatContent(keyLabel: string, entity: Entity): string {\n const labels: Record<string, string> | undefined =\n entity.metadata?.labels;\n return (labels && labels[keyLabel]) || '';\n }\n\n return {\n title: options?.title || (\n <EntityTableColumnTitle translationKey=\"label\" />\n ),\n field: 'entity.metadata.labels',\n cellStyle: {\n padding: '0px 16px 0px 20px',\n },\n customSort({ entity: entity1 }, { entity: entity2 }) {\n return formatContent(key, entity1).localeCompare(\n formatContent(key, entity2),\n );\n },\n render: ({ entity }: { entity: Entity }) => {\n const labels: Record<string, string> | undefined =\n entity.metadata?.labels;\n const specifiedLabelValue =\n (labels && labels[key]) || options?.defaultValue;\n return (\n <>\n {specifiedLabelValue && (\n <Chip\n key={specifiedLabelValue}\n label={specifiedLabelValue}\n size=\"small\"\n variant=\"outlined\"\n />\n )}\n </>\n );\n },\n width: 'auto',\n };\n },\n createNamespaceColumn(): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"namespace\" />,\n field: 'entity.metadata.namespace',\n width: 'auto',\n };\n },\n});\n"],"names":[],"mappings":";;;;;;AA8BO,MAAM,eAAA,GAAkB,OAAO,MAAA,CAAO;AAAA,EAC3C,iBAAiB,OAAA,EAEgB;AAC/B,IAAA,SAAS,cAAc,MAAA,EAAwB;AAC7C,MAAA,OACE,MAAA,CAAO,QAAA,EAAU,KAAA,IACjB,iBAAA,CAAkB,MAAA,EAAQ;AAAA,QACxB,aAAa,OAAA,EAAS;AAAA,OACvB,CAAA;AAAA,IAEL;AAEA,IAAA,OAAO;AAAA,MACL,KAAA,kBAAO,GAAA,CAAC,sBAAA,EAAA,EAAuB,cAAA,EAAe,MAAA,EAAO,CAAA;AAAA,MACrD,KAAA,EAAO,oBAAA;AAAA,MACP,SAAA,EAAW,IAAA;AAAA,MACX,UAAA,CAAW,EAAE,MAAA,EAAQ,OAAA,IAAW,EAAE,MAAA,EAAQ,SAAQ,EAAG;AAGnD,QAAA,OAAO,cAAc,OAAO,CAAA,CAAE,aAAA,CAAc,aAAA,CAAc,OAAO,CAAC,CAAA;AAAA,MACpE,CAAA;AAAA,MACA,MAAA,EAAQ,CAAC,EAAE,MAAA,EAAO,qBAChB,GAAA;AAAA,QAAC,aAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,MAAA;AAAA,UACX,WAAA,EAAa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ACA,MAAA,EAAQ,CAAC,EAAE,MAAA,EAAO,KAA0B;AAC1C,QAAA,MAAM,MAAA,GACJ,OAAO,QAAA,EAAU,MAAA;AACnB,QAAA,MAAM,mBAAA,GACH,MAAA,IAAU,MAAA,CAAO,GAAG,KAAM,OAAA,EAAS,YAAA;AACtC,QAAA,uCAEK,QAAA,EAAA,mBAAA,oBACC,GAAA;AAAA,UAAC,IAAA;AAAA,UAAA;AAAA,YAEC,KAAA,EAAO,mBAAA;AAAA,YACP,IAAA,EAAK,OAAA;AAAA,YACL,OAAA,EAAQ;AAAA,WAAA;AAAA,UAHH;AAAA,SAIP,EAEJ,CAAA;AAAA,MAEJ,CAAA;AAAA,MACA,KAAA,EAAO;AAAA,KACT;AAAA,EACF,CAAA;AAAA,EACA,qBAAA,GAAsD;AACpD,IAAA,OAAO;AAAA,MACL,KAAA,kBAAO,GAAA,CAAC,sBAAA,EAAA,EAAuB,cAAA,EAAe,WAAA,EAAY,CAAA;AAAA,MAC1D,KAAA,EAAO,2BAAA;AAAA,MACP,KAAA,EAAO;AAAA,KACT;AAAA,EACF;AACF,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"columns.esm.js","sources":["../../../src/components/CatalogTable/columns.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 */\nimport {\n defaultEntityPresentation,\n EntityRefLink,\n EntityRefLinks,\n type EntityPresentationApi,\n} from '@backstage/plugin-catalog-react';\nimport Chip from '@material-ui/core/Chip';\nimport { CatalogTableRow } from './types';\nimport { OverflowTooltip, TableColumn } from '@backstage/core-components';\nimport { Entity } from '@backstage/catalog-model';\nimport { JsonArray } from '@backstage/types';\nimport { EntityTableColumnTitle } from '@backstage/plugin-catalog-react/alpha';\n\n// The columnFactories symbol is not directly exported, but through the\n// CatalogTable.columns field.\n/** @public */\nexport const columnFactories = Object.freeze({\n createNameColumn(options?: {\n defaultKind?: string;\n entityPresentationApi?: EntityPresentationApi;\n }): TableColumn<CatalogTableRow> {\n function formatContent(entity: Entity): string {\n if (options?.entityPresentationApi) {\n return options.entityPresentationApi.forEntity(entity, {\n defaultKind: options?.defaultKind,\n }).snapshot.primaryTitle;\n }\n return defaultEntityPresentation(entity, {\n defaultKind: options?.defaultKind,\n }).primaryTitle;\n }\n\n return {\n title: <EntityTableColumnTitle translationKey=\"name\" />,\n field: 'resolved.entityRef',\n highlight: true,\n customSort({ entity: entity1 }, { entity: entity2 }) {\n // TODO: We could implement this more efficiently by comparing field by field.\n // This has similar issues as above.\n return formatContent(entity1).localeCompare(formatContent(entity2));\n },\n render: ({ entity }) => (\n <EntityRefLink\n entityRef={entity}\n defaultKind={options?.defaultKind || 'Component'}\n />\n ),\n };\n },\n createSystemColumn(): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"system\" />,\n field: 'resolved.partOfSystemRelationTitle',\n customFilterAndSearch: (query, row) => {\n if (!row.resolved.partOfSystemRelations) {\n return false;\n }\n\n const systemNames = row.resolved.partOfSystemRelations.map(\n ref => ref.name,\n ); // Extract system names from entityRefs\n\n const searchText = systemNames.join(', ').toLocaleUpperCase('en-US');\n return searchText.includes(query.toLocaleUpperCase('en-US'));\n },\n render: ({ resolved }) => (\n <EntityRefLinks\n entityRefs={resolved.partOfSystemRelations}\n defaultKind=\"system\"\n />\n ),\n };\n },\n createOwnerColumn(): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"owner\" />,\n field: 'resolved.ownedByRelationsTitle',\n render: ({ resolved }) => (\n <EntityRefLinks\n entityRefs={resolved.ownedByRelations}\n defaultKind=\"group\"\n />\n ),\n };\n },\n createSpecTargetsColumn(): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"targets\" />,\n field: 'entity.spec.targets',\n customFilterAndSearch: (query, row) => {\n let targets: JsonArray = [];\n if (\n row.entity?.spec?.targets &&\n Array.isArray(row.entity?.spec?.targets)\n ) {\n targets = row.entity?.spec?.targets;\n } else if (row.entity?.spec?.target) {\n targets = [row.entity?.spec?.target];\n }\n return targets\n .join(', ')\n .toLocaleUpperCase('en-US')\n .includes(query.toLocaleUpperCase('en-US'));\n },\n render: ({ entity }) => (\n <>\n {(entity?.spec?.targets || entity?.spec?.target) && (\n <OverflowTooltip\n text={(\n (entity!.spec!.targets as JsonArray) || [entity.spec.target]\n ).join(', ')}\n placement=\"bottom-start\"\n />\n )}\n </>\n ),\n };\n },\n createSpecTypeColumn(\n options: {\n hidden: boolean;\n } = { hidden: false },\n ): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"type\" />,\n field: 'entity.spec.type',\n hidden: options.hidden,\n width: 'auto',\n };\n },\n createSpecLifecycleColumn(): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"lifecycle\" />,\n field: 'entity.spec.lifecycle',\n };\n },\n createMetadataDescriptionColumn(): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"description\" />,\n field: 'entity.metadata.description',\n render: ({ entity }) => (\n <OverflowTooltip\n text={entity.metadata.description}\n placement=\"bottom-start\"\n />\n ),\n width: 'auto',\n };\n },\n createTagsColumn(): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"tags\" />,\n field: 'entity.metadata.tags',\n cellStyle: {\n padding: '0px 16px 0px 20px',\n },\n render: ({ entity }) => (\n <>\n {entity.metadata.tags &&\n entity.metadata.tags.map(t => (\n <Chip\n key={t}\n label={t}\n size=\"small\"\n variant=\"outlined\"\n style={{ margin: '2px' }}\n />\n ))}\n </>\n ),\n width: 'auto',\n };\n },\n createTitleColumn(options?: {\n hidden?: boolean;\n }): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"title\" />,\n field: 'entity.metadata.title',\n hidden: options?.hidden,\n searchable: true,\n };\n },\n createLabelColumn(\n key: string,\n options?: { title?: string; defaultValue?: string },\n ): TableColumn<CatalogTableRow> {\n function formatContent(keyLabel: string, entity: Entity): string {\n const labels: Record<string, string> | undefined =\n entity.metadata?.labels;\n return (labels && labels[keyLabel]) || '';\n }\n\n return {\n title: options?.title || (\n <EntityTableColumnTitle translationKey=\"label\" />\n ),\n field: 'entity.metadata.labels',\n cellStyle: {\n padding: '0px 16px 0px 20px',\n },\n customSort({ entity: entity1 }, { entity: entity2 }) {\n return formatContent(key, entity1).localeCompare(\n formatContent(key, entity2),\n );\n },\n render: ({ entity }: { entity: Entity }) => {\n const labels: Record<string, string> | undefined =\n entity.metadata?.labels;\n const specifiedLabelValue =\n (labels && labels[key]) || options?.defaultValue;\n return (\n <>\n {specifiedLabelValue && (\n <Chip\n key={specifiedLabelValue}\n label={specifiedLabelValue}\n size=\"small\"\n variant=\"outlined\"\n />\n )}\n </>\n );\n },\n width: 'auto',\n };\n },\n createNamespaceColumn(): TableColumn<CatalogTableRow> {\n return {\n title: <EntityTableColumnTitle translationKey=\"namespace\" />,\n field: 'entity.metadata.namespace',\n width: 'auto',\n };\n },\n});\n"],"names":[],"mappings":";;;;;;AA+BO,MAAM,eAAA,GAAkB,OAAO,MAAA,CAAO;AAAA,EAC3C,iBAAiB,OAAA,EAGgB;AAC/B,IAAA,SAAS,cAAc,MAAA,EAAwB;AAC7C,MAAA,IAAI,SAAS,qBAAA,EAAuB;AAClC,QAAA,OAAO,OAAA,CAAQ,qBAAA,CAAsB,SAAA,CAAU,MAAA,EAAQ;AAAA,UACrD,aAAa,OAAA,EAAS;AAAA,SACvB,EAAE,QAAA,CAAS,YAAA;AAAA,MACd;AACA,MAAA,OAAO,0BAA0B,M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AAO;AAAA,KACT;AAAA,EACF;AACF,CAAC;;;;"}
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { catalogApiRef } from '@backstage/plugin-catalog-react';
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { useApi, alertApiRef } from '@backstage/core-plugin-api';
|
|
5
|
-
import {
|
|
5
|
+
import { toError } from '@backstage/errors';
|
|
6
6
|
import { catalogTranslationRef } from '../../alpha/translation.esm.js';
|
|
7
7
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
8
8
|
import { Dialog, DialogHeader, DialogFooter, Button } from '@backstage/ui';
|
|
@@ -20,8 +20,7 @@ function DeleteEntityDialog(props) {
|
|
|
20
20
|
await catalogApi.removeEntityByUid(uid);
|
|
21
21
|
onConfirm();
|
|
22
22
|
} catch (err) {
|
|
23
|
-
|
|
24
|
-
alertApi.post({ message: err.message });
|
|
23
|
+
alertApi.post({ message: toError(err).message });
|
|
25
24
|
} finally {
|
|
26
25
|
setBusy(false);
|
|
27
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteEntityDialog.esm.js","sources":["../../../src/components/EntityOrphanWarning/DeleteEntityDialog.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 { Entity } from '@backstage/catalog-model';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport { useState } from 'react';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport {
|
|
1
|
+
{"version":3,"file":"DeleteEntityDialog.esm.js","sources":["../../../src/components/EntityOrphanWarning/DeleteEntityDialog.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 { Entity } from '@backstage/catalog-model';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport { useState } from 'react';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { toError } from '@backstage/errors';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { Button, Dialog, DialogFooter, DialogHeader } from '@backstage/ui';\n\ninterface DeleteEntityDialogProps {\n open: boolean;\n onClose: () => any;\n onConfirm: () => any;\n entity: Entity;\n}\n\nexport function DeleteEntityDialog(props: DeleteEntityDialogProps) {\n const { open, onClose, onConfirm, entity } = props;\n const [busy, setBusy] = useState(false);\n const catalogApi = useApi(catalogApiRef);\n const alertApi = useApi(alertApiRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const onDelete = async () => {\n setBusy(true);\n try {\n const uid = entity.metadata.uid;\n await catalogApi.removeEntityByUid(uid!);\n onConfirm();\n } catch (err) {\n alertApi.post({ message: toError(err).message });\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <Dialog isOpen={open} onOpenChange={isOpen => !isOpen && onClose()}>\n <DialogHeader>{t('deleteEntity.dialogTitle')}</DialogHeader>\n <DialogFooter>\n <Button variant=\"secondary\" onPress={onClose}>\n {t('deleteEntity.cancelButtonTitle')}\n </Button>\n <Button variant=\"primary\" destructive loading={busy} onPress={onDelete}>\n {t('deleteEntity.deleteButtonTitle')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AA;AAAA,sBACA,GAAA,CAAC,MAAA,EAAA,EAAO,OAAA,EAAQ,SAAA,EAAU,WAAA,EAAW,IAAA,EAAC,OAAA,EAAS,IAAA,EAAM,OAAA,EAAS,QAAA,EAC3D,QAAA,EAAA,CAAA,CAAE,gCAAgC,CAAA,EACrC;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Entity,
|
|
1
|
+
import { Entity, ComponentEntity, ResourceEntity, DomainEntity, SystemEntity } from '@backstage/catalog-model';
|
|
2
2
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
3
3
|
import { IconComponent, StorageApi, ApiHolder } from '@backstage/core-plugin-api';
|
|
4
|
-
import { EntityPresentationApi, CatalogApi, EntityRefPresentationSnapshot, EntityRefPresentation, StarredEntitiesApi
|
|
4
|
+
import { EntityPresentationApi, CatalogApi, EntityRefPresentationSnapshot, EntityRefPresentation, StarredEntitiesApi } from '@backstage/plugin-catalog-react';
|
|
5
5
|
import { HumanDuration, Observable } from '@backstage/types';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
import * as react from 'react';
|
|
8
8
|
import { ReactNode, ElementType } from 'react';
|
|
9
9
|
import { TableColumn, TableProps, InfoCardVariants, TableOptions } from '@backstage/core-components';
|
|
10
|
+
import { C as CatalogTableRow, a as CatalogTableColumnsFunc, D as DefaultCatalogPageProps } from './types/DefaultCatalogPage.d-C6OI0JvL.js';
|
|
10
11
|
import { TabProps } from '@material-ui/core/Tab';
|
|
11
12
|
import { Overrides } from '@material-ui/core/styles/overrides';
|
|
12
13
|
import { StyleRules } from '@material-ui/core/styles/withStyles';
|
|
@@ -205,25 +206,6 @@ interface CatalogKindHeaderProps {
|
|
|
205
206
|
*/
|
|
206
207
|
declare function CatalogKindHeader(props: CatalogKindHeaderProps): react_jsx_runtime.JSX.Element;
|
|
207
208
|
|
|
208
|
-
/** @public */
|
|
209
|
-
interface CatalogTableRow {
|
|
210
|
-
entity: Entity;
|
|
211
|
-
resolved: {
|
|
212
|
-
name: string;
|
|
213
|
-
entityRef: string;
|
|
214
|
-
partOfSystemRelationTitle?: string;
|
|
215
|
-
partOfSystemRelations: CompoundEntityRef[];
|
|
216
|
-
ownedByRelationsTitle?: string;
|
|
217
|
-
ownedByRelations: CompoundEntityRef[];
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Typed columns function to dynamically render columns based on entity list context.
|
|
222
|
-
*
|
|
223
|
-
* @public
|
|
224
|
-
*/
|
|
225
|
-
type CatalogTableColumnsFunc = (entityListContext: EntityListContextProps) => TableColumn<CatalogTableRow>[];
|
|
226
|
-
|
|
227
209
|
/**
|
|
228
210
|
* Props for {@link CatalogTable}.
|
|
229
211
|
*
|
|
@@ -256,6 +238,7 @@ declare const CatalogTable: {
|
|
|
256
238
|
columns: Readonly<{
|
|
257
239
|
createNameColumn(options?: {
|
|
258
240
|
defaultKind?: string;
|
|
241
|
+
entityPresentationApi?: EntityPresentationApi;
|
|
259
242
|
}): TableColumn<CatalogTableRow>;
|
|
260
243
|
createSystemColumn(): TableColumn<CatalogTableRow>;
|
|
261
244
|
createOwnerColumn(): TableColumn<CatalogTableRow>;
|
|
@@ -538,24 +521,6 @@ declare module '@backstage/theme' {
|
|
|
538
521
|
}
|
|
539
522
|
}
|
|
540
523
|
|
|
541
|
-
/**
|
|
542
|
-
* Props for root catalog pages.
|
|
543
|
-
*
|
|
544
|
-
* @public
|
|
545
|
-
*/
|
|
546
|
-
interface DefaultCatalogPageProps {
|
|
547
|
-
initiallySelectedFilter?: UserListFilterKind;
|
|
548
|
-
columns?: TableColumn<CatalogTableRow>[] | CatalogTableColumnsFunc;
|
|
549
|
-
actions?: TableProps<CatalogTableRow>['actions'];
|
|
550
|
-
initialKind?: string;
|
|
551
|
-
tableOptions?: TableProps<CatalogTableRow>['options'];
|
|
552
|
-
emptyContent?: ReactNode;
|
|
553
|
-
ownerPickerMode?: EntityOwnerPickerProps['mode'];
|
|
554
|
-
filters?: ReactNode;
|
|
555
|
-
initiallySelectedNamespaces?: string[];
|
|
556
|
-
pagination?: EntityListPagination;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
524
|
/** @public */
|
|
560
525
|
interface DependencyOfComponentsCardProps {
|
|
561
526
|
title?: string;
|
|
@@ -827,6 +792,7 @@ declare const catalogTranslationRef: _backstage_frontend_plugin_api.TranslationR
|
|
|
827
792
|
readonly "aboutCard.systemField.label": "System";
|
|
828
793
|
readonly "aboutCard.parentComponentField.value": "No Parent Component";
|
|
829
794
|
readonly "aboutCard.parentComponentField.label": "Parent Component";
|
|
795
|
+
readonly "aboutCard.kindField.label": "Kind";
|
|
830
796
|
readonly "aboutCard.typeField.label": "Type";
|
|
831
797
|
readonly "aboutCard.lifecycleField.label": "Lifecycle";
|
|
832
798
|
readonly "aboutCard.tagsField.value": "No Tags";
|
|
@@ -889,5 +855,5 @@ declare const catalogTranslationRef: _backstage_frontend_plugin_api.TranslationR
|
|
|
889
855
|
readonly "systemDiagramCard.edgeLabels.provides": "provides";
|
|
890
856
|
}>;
|
|
891
857
|
|
|
892
|
-
export { AboutContent, AboutField, CatalogEntityPage, CatalogIndexPage, CatalogKindHeader, CatalogSearchResultListItem, CatalogTable, DefaultEntityPresentationApi, DefaultStarredEntitiesApi, EntityAboutCard, EntityDependencyOfComponentsCard, EntityDependsOnComponentsCard, EntityDependsOnResourcesCard, EntityHasComponentsCard, EntityHasResourcesCard, EntityHasSubcomponentsCard, EntityHasSubdomainsCard, EntityHasSystemsCard, EntityLabelsCard, EntityLayout, EntityLinksCard, EntityListContainer, EntityOrphanWarning, EntityProcessingErrorsPanel, EntityRelationWarning, EntitySwitch, FilterContainer, FilteredEntityLayout, RelatedEntitiesCard, catalogPlugin, catalogTranslationRef, hasCatalogProcessingErrors, hasLabels, hasRelationWarnings, isApiType, isComponentType, isEntityWith, isKind, isNamespace, isOrphan, isResourceType };
|
|
893
|
-
export type { AboutContentProps, AboutFieldProps, BackstageOverrides, Breakpoint, CatalogKindHeaderProps, CatalogSearchResultListItemClassKey, CatalogSearchResultListItemProps,
|
|
858
|
+
export { AboutContent, AboutField, CatalogEntityPage, CatalogIndexPage, CatalogKindHeader, CatalogSearchResultListItem, CatalogTable, CatalogTableColumnsFunc, CatalogTableRow, DefaultCatalogPageProps, DefaultEntityPresentationApi, DefaultStarredEntitiesApi, EntityAboutCard, EntityDependencyOfComponentsCard, EntityDependsOnComponentsCard, EntityDependsOnResourcesCard, EntityHasComponentsCard, EntityHasResourcesCard, EntityHasSubcomponentsCard, EntityHasSubdomainsCard, EntityHasSystemsCard, EntityLabelsCard, EntityLayout, EntityLinksCard, EntityListContainer, EntityOrphanWarning, EntityProcessingErrorsPanel, EntityRelationWarning, EntitySwitch, FilterContainer, FilteredEntityLayout, RelatedEntitiesCard, catalogPlugin, catalogTranslationRef, hasCatalogProcessingErrors, hasLabels, hasRelationWarnings, isApiType, isComponentType, isEntityWith, isKind, isNamespace, isOrphan, isResourceType };
|
|
859
|
+
export type { AboutContentProps, AboutFieldProps, BackstageOverrides, Breakpoint, CatalogKindHeaderProps, CatalogSearchResultListItemClassKey, CatalogSearchResultListItemProps, CatalogTableProps, CatalogTableToolbarClassKey, ColumnBreakpoints, DefaultEntityPresentationApiOptions, DefaultEntityPresentationApiRenderer, DependencyOfComponentsCardLegacyProps, DependencyOfComponentsCardProps, DependsOnComponentsCardLegacyProps, DependsOnComponentsCardProps, DependsOnResourcesCardLegacyProps, DependsOnResourcesCardProps, EntityContextMenuClassKey, EntityLabelsCardProps, EntityLabelsEmptyStateClassKey, EntityLayoutProps, EntityLayoutRouteProps, EntityLinksCardProps, EntityLinksEmptyStateClassKey, EntityPredicates, EntitySwitchCaseProps, EntitySwitchProps, HasComponentsCardLegacyProps, HasComponentsCardProps, HasResourcesCardLegacyProps, HasResourcesCardProps, HasSubcomponentsCardLegacyProps, HasSubcomponentsCardProps, HasSubdomainsCardLegacyProps, HasSubdomainsCardProps, HasSystemsCardLegacyProps, HasSystemsCardProps, PluginCatalogComponentsNameToClassKey, RelatedEntitiesCardProps, SystemDiagramCardClassKey };
|
package/dist/package.json.esm.js
CHANGED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { TableColumn, TableProps } from '@backstage/core-components';
|
|
3
|
+
import { EntityListContextProps, UserListFilterKind, EntityOwnerPickerProps, EntityListPagination } from '@backstage/plugin-catalog-react';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
import { Entity, CompoundEntityRef } from '@backstage/catalog-model';
|
|
6
|
+
|
|
7
|
+
/** @public */
|
|
8
|
+
interface CatalogTableRow {
|
|
9
|
+
entity: Entity;
|
|
10
|
+
resolved: {
|
|
11
|
+
name: string;
|
|
12
|
+
entityRef: string;
|
|
13
|
+
partOfSystemRelationTitle?: string;
|
|
14
|
+
partOfSystemRelations: CompoundEntityRef[];
|
|
15
|
+
ownedByRelationsTitle?: string;
|
|
16
|
+
ownedByRelations: CompoundEntityRef[];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Typed columns function to dynamically render columns based on entity list context.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
type CatalogTableColumnsFunc = (entityListContext: EntityListContextProps) => TableColumn<CatalogTableRow>[];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Props for root catalog pages.
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
interface DefaultCatalogPageProps {
|
|
32
|
+
initiallySelectedFilter?: UserListFilterKind;
|
|
33
|
+
columns?: TableColumn<CatalogTableRow>[] | CatalogTableColumnsFunc;
|
|
34
|
+
actions?: TableProps<CatalogTableRow>['actions'];
|
|
35
|
+
initialKind?: string;
|
|
36
|
+
tableOptions?: TableProps<CatalogTableRow>['options'];
|
|
37
|
+
emptyContent?: ReactNode;
|
|
38
|
+
ownerPickerMode?: EntityOwnerPickerProps['mode'];
|
|
39
|
+
filters?: ReactNode;
|
|
40
|
+
initiallySelectedNamespaces?: string[];
|
|
41
|
+
pagination?: EntityListPagination;
|
|
42
|
+
}
|
|
43
|
+
/** @public */
|
|
44
|
+
declare function NfsDefaultCatalogPage(props: DefaultCatalogPageProps): react_jsx_runtime.JSX.Element;
|
|
45
|
+
|
|
46
|
+
export { NfsDefaultCatalogPage as N };
|
|
47
|
+
export type { CatalogTableRow as C, DefaultCatalogPageProps as D, CatalogTableColumnsFunc as a };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog",
|
|
3
|
-
"version": "2.0.2-next.
|
|
3
|
+
"version": "2.0.2-next.2",
|
|
4
4
|
"description": "The Backstage plugin for browsing the Backstage catalog",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -70,24 +70,24 @@
|
|
|
70
70
|
"test": "backstage-cli package test"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@backstage/catalog-client": "1.14.0",
|
|
74
|
-
"@backstage/catalog-model": "1.7.
|
|
75
|
-
"@backstage/core-compat-api": "0.5.10-next.
|
|
76
|
-
"@backstage/core-components": "0.18.9-next.
|
|
77
|
-
"@backstage/core-plugin-api": "1.12.5-next.
|
|
78
|
-
"@backstage/errors": "1.
|
|
79
|
-
"@backstage/frontend-plugin-api": "0.16.0-next.
|
|
80
|
-
"@backstage/integration-react": "1.2.17-next.
|
|
81
|
-
"@backstage/plugin-catalog-common": "1.1.
|
|
82
|
-
"@backstage/plugin-catalog-react": "2.1.2-next.
|
|
83
|
-
"@backstage/plugin-permission-react": "0.4.42-next.
|
|
84
|
-
"@backstage/plugin-scaffolder-common": "2.0.0",
|
|
85
|
-
"@backstage/plugin-search-common": "1.2.
|
|
86
|
-
"@backstage/plugin-search-react": "1.11.1-next.
|
|
73
|
+
"@backstage/catalog-client": "1.14.1-next.0",
|
|
74
|
+
"@backstage/catalog-model": "1.7.8-next.0",
|
|
75
|
+
"@backstage/core-compat-api": "0.5.10-next.2",
|
|
76
|
+
"@backstage/core-components": "0.18.9-next.1",
|
|
77
|
+
"@backstage/core-plugin-api": "1.12.5-next.2",
|
|
78
|
+
"@backstage/errors": "1.3.0-next.0",
|
|
79
|
+
"@backstage/frontend-plugin-api": "0.16.0-next.2",
|
|
80
|
+
"@backstage/integration-react": "1.2.17-next.1",
|
|
81
|
+
"@backstage/plugin-catalog-common": "1.1.9-next.0",
|
|
82
|
+
"@backstage/plugin-catalog-react": "2.1.2-next.2",
|
|
83
|
+
"@backstage/plugin-permission-react": "0.4.42-next.1",
|
|
84
|
+
"@backstage/plugin-scaffolder-common": "2.0.1-next.0",
|
|
85
|
+
"@backstage/plugin-search-common": "1.2.23-next.0",
|
|
86
|
+
"@backstage/plugin-search-react": "1.11.1-next.2",
|
|
87
87
|
"@backstage/plugin-techdocs-common": "0.1.1",
|
|
88
|
-
"@backstage/plugin-techdocs-react": "1.3.10-next.
|
|
88
|
+
"@backstage/plugin-techdocs-react": "1.3.10-next.2",
|
|
89
89
|
"@backstage/types": "1.2.2",
|
|
90
|
-
"@backstage/ui": "0.14.0-next.
|
|
90
|
+
"@backstage/ui": "0.14.0-next.2",
|
|
91
91
|
"@backstage/version-bridge": "1.0.12",
|
|
92
92
|
"@material-ui/core": "^4.12.2",
|
|
93
93
|
"@material-ui/icons": "^4.9.1",
|
|
@@ -103,12 +103,12 @@
|
|
|
103
103
|
"zen-observable": "^0.10.0"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
|
-
"@backstage/cli": "0.36.1-next.
|
|
107
|
-
"@backstage/core-app-api": "1.20.0-next.
|
|
108
|
-
"@backstage/dev-utils": "1.1.22-next.
|
|
109
|
-
"@backstage/frontend-test-utils": "0.5.2-next.
|
|
110
|
-
"@backstage/plugin-permission-common": "0.9.
|
|
111
|
-
"@backstage/test-utils": "1.7.17-next.
|
|
106
|
+
"@backstage/cli": "0.36.1-next.2",
|
|
107
|
+
"@backstage/core-app-api": "1.20.0-next.2",
|
|
108
|
+
"@backstage/dev-utils": "1.1.22-next.2",
|
|
109
|
+
"@backstage/frontend-test-utils": "0.5.2-next.2",
|
|
110
|
+
"@backstage/plugin-permission-common": "0.9.8-next.0",
|
|
111
|
+
"@backstage/test-utils": "1.7.17-next.2",
|
|
112
112
|
"@testing-library/dom": "^10.0.0",
|
|
113
113
|
"@testing-library/jest-dom": "^6.0.0",
|
|
114
114
|
"@testing-library/react": "^16.0.0",
|