@backstage/plugin-catalog 1.26.0-next.2 → 1.26.0
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 +27 -0
- package/dist/apis/StarredEntitiesApi/DefaultStarredEntitiesApi.esm.js.map +1 -1
- package/dist/components/CatalogKindHeader/CatalogKindHeader.esm.js +4 -3
- package/dist/components/CatalogKindHeader/CatalogKindHeader.esm.js.map +1 -1
- package/dist/components/CatalogKindHeader/kindFilterUtils.esm.js +13 -17
- package/dist/components/CatalogKindHeader/kindFilterUtils.esm.js.map +1 -1
- package/dist/components/CatalogTable/CatalogTable.esm.js +1 -1
- package/dist/components/CatalogTable/CatalogTable.esm.js.map +1 -1
- package/package.json +22 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @backstage/plugin-catalog
|
|
2
2
|
|
|
3
|
+
## 1.26.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 25beb82: Adds an optional columns attribute to HasSubdomainsCardProps and changes its default columns
|
|
8
|
+
- 39f1abc: Consistent title behaviour across CatalogTable, CursorPaginatedCatalogTable, and OffsetPaginatedCatalogTable.
|
|
9
|
+
- 1ffb9f3: Update `CatalogTable` title to use properly capitalized Kind facets (e.g. 'Component' instead of 'component')
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- @backstage/plugin-catalog-react@1.15.0
|
|
15
|
+
- @backstage/plugin-scaffolder-common@1.5.8
|
|
16
|
+
- @backstage/plugin-search-react@1.8.4
|
|
17
|
+
- @backstage/catalog-client@1.9.0
|
|
18
|
+
- @backstage/core-compat-api@0.3.4
|
|
19
|
+
- @backstage/frontend-plugin-api@0.9.3
|
|
20
|
+
- @backstage/core-components@0.16.2
|
|
21
|
+
- @backstage/errors@1.2.6
|
|
22
|
+
- @backstage/catalog-model@1.7.2
|
|
23
|
+
- @backstage/core-plugin-api@1.10.2
|
|
24
|
+
- @backstage/integration-react@1.2.2
|
|
25
|
+
- @backstage/types@1.2.0
|
|
26
|
+
- @backstage/plugin-catalog-common@1.1.2
|
|
27
|
+
- @backstage/plugin-permission-react@0.4.29
|
|
28
|
+
- @backstage/plugin-search-common@1.2.16
|
|
29
|
+
|
|
3
30
|
## 1.26.0-next.2
|
|
4
31
|
|
|
5
32
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultStarredEntitiesApi.esm.js","sources":["../../../src/apis/StarredEntitiesApi/DefaultStarredEntitiesApi.ts"],"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 { StorageApi } from '@backstage/core-plugin-api';\nimport { StarredEntitiesApi } from '@backstage/plugin-catalog-react';\nimport { Observable } from '@backstage/types';\nimport ObservableImpl from 'zen-observable';\nimport { performMigrationToTheNewBucket } from './migration';\n\n/**\n * Default implementation of the StarredEntitiesApi that is backed by the StorageApi.\n *\n * @public\n */\nexport class DefaultStarredEntitiesApi implements StarredEntitiesApi {\n private readonly settingsStore: StorageApi;\n private starredEntities: Set<string>;\n\n constructor(opts: { storageApi: StorageApi }) {\n // no need to await. The updated content will be caught by the observe$\n performMigrationToTheNewBucket(opts).then();\n\n this.settingsStore = opts.storageApi.forBucket('starredEntities');\n\n this.starredEntities = new Set(\n this.settingsStore.snapshot<string[]>('entityRefs').value ?? [],\n );\n\n this.settingsStore.observe$<string[]>('entityRefs').subscribe({\n next: next => {\n this.starredEntities = new Set(next.value ?? []);\n this.notifyChanges();\n },\n });\n }\n\n async toggleStarred(entityRef: string): Promise<void> {\n if (this.starredEntities.has(entityRef)) {\n this.starredEntities.delete(entityRef);\n } else {\n this.starredEntities.add(entityRef);\n }\n\n await this.settingsStore.set(\n 'entityRefs',\n Array.from(this.starredEntities),\n );\n }\n\n starredEntitie$(): Observable<Set<string>> {\n return this.observable;\n }\n\n private readonly subscribers = new Set<\n ZenObservable.SubscriptionObserver<Set<string>>\n >();\n\n private readonly observable = new ObservableImpl<Set<string>>(subscriber => {\n // forward the
|
|
1
|
+
{"version":3,"file":"DefaultStarredEntitiesApi.esm.js","sources":["../../../src/apis/StarredEntitiesApi/DefaultStarredEntitiesApi.ts"],"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 { StorageApi } from '@backstage/core-plugin-api';\nimport { StarredEntitiesApi } from '@backstage/plugin-catalog-react';\nimport { Observable } from '@backstage/types';\nimport ObservableImpl from 'zen-observable';\nimport { performMigrationToTheNewBucket } from './migration';\n\n/**\n * Default implementation of the StarredEntitiesApi that is backed by the StorageApi.\n *\n * @public\n */\nexport class DefaultStarredEntitiesApi implements StarredEntitiesApi {\n private readonly settingsStore: StorageApi;\n private starredEntities: Set<string>;\n\n constructor(opts: { storageApi: StorageApi }) {\n // no need to await. The updated content will be caught by the observe$\n performMigrationToTheNewBucket(opts).then();\n\n this.settingsStore = opts.storageApi.forBucket('starredEntities');\n\n this.starredEntities = new Set(\n this.settingsStore.snapshot<string[]>('entityRefs').value ?? [],\n );\n\n this.settingsStore.observe$<string[]>('entityRefs').subscribe({\n next: next => {\n this.starredEntities = new Set(next.value ?? []);\n this.notifyChanges();\n },\n });\n }\n\n async toggleStarred(entityRef: string): Promise<void> {\n if (this.starredEntities.has(entityRef)) {\n this.starredEntities.delete(entityRef);\n } else {\n this.starredEntities.add(entityRef);\n }\n\n await this.settingsStore.set(\n 'entityRefs',\n Array.from(this.starredEntities),\n );\n }\n\n starredEntitie$(): Observable<Set<string>> {\n return this.observable;\n }\n\n private readonly subscribers = new Set<\n ZenObservable.SubscriptionObserver<Set<string>>\n >();\n\n private readonly observable = new ObservableImpl<Set<string>>(subscriber => {\n // forward the latest value\n subscriber.next(new Set(this.starredEntities));\n\n this.subscribers.add(subscriber);\n return () => {\n this.subscribers.delete(subscriber);\n };\n });\n\n private notifyChanges() {\n for (const subscription of this.subscribers) {\n subscription.next(new Set(this.starredEntities));\n }\n }\n}\n"],"names":[],"mappings":";;;AA2BO,MAAM,yBAAwD,CAAA;AAAA,EAClD,aAAA;AAAA,EACT,eAAA;AAAA,EAER,YAAY,IAAkC,EAAA;AAE5C,IAA+B,8BAAA,CAAA,IAAI,EAAE,IAAK,EAAA;AAE1C,IAAA,IAAA,CAAK,aAAgB,GAAA,IAAA,CAAK,UAAW,CAAA,SAAA,CAAU,iBAAiB,CAAA;AAEhE,IAAA,IAAA,CAAK,kBAAkB,IAAI,GAAA;AAAA,MACzB,KAAK,aAAc,CAAA,QAAA,CAAmB,YAAY,CAAA,CAAE,SAAS;AAAC,KAChE;AAEA,IAAA,IAAA,CAAK,aAAc,CAAA,QAAA,CAAmB,YAAY,CAAA,CAAE,SAAU,CAAA;AAAA,MAC5D,MAAM,CAAQ,IAAA,KAAA;AACZ,QAAA,IAAA,CAAK,kBAAkB,IAAI,GAAA,CAAI,IAAK,CAAA,KAAA,IAAS,EAAE,CAAA;AAC/C,QAAA,IAAA,CAAK,aAAc,EAAA;AAAA;AACrB,KACD,CAAA;AAAA;AACH,EAEA,MAAM,cAAc,SAAkC,EAAA;AACpD,IAAA,IAAI,IAAK,CAAA,eAAA,CAAgB,GAAI,CAAA,SAAS,CAAG,EAAA;AACvC,MAAK,IAAA,CAAA,eAAA,CAAgB,OAAO,SAAS,CAAA;AAAA,KAChC,MAAA;AACL,MAAK,IAAA,CAAA,eAAA,CAAgB,IAAI,SAAS,CAAA;AAAA;AAGpC,IAAA,MAAM,KAAK,aAAc,CAAA,GAAA;AAAA,MACvB,YAAA;AAAA,MACA,KAAA,CAAM,IAAK,CAAA,IAAA,CAAK,eAAe;AAAA,KACjC;AAAA;AACF,EAEA,eAA2C,GAAA;AACzC,IAAA,OAAO,IAAK,CAAA,UAAA;AAAA;AACd,EAEiB,WAAA,uBAAkB,GAEjC,EAAA;AAAA,EAEe,UAAA,GAAa,IAAI,cAAA,CAA4B,CAAc,UAAA,KAAA;AAE1E,IAAA,UAAA,CAAW,IAAK,CAAA,IAAI,GAAI,CAAA,IAAA,CAAK,eAAe,CAAC,CAAA;AAE7C,IAAK,IAAA,CAAA,WAAA,CAAY,IAAI,UAAU,CAAA;AAC/B,IAAA,OAAO,MAAM;AACX,MAAK,IAAA,CAAA,WAAA,CAAY,OAAO,UAAU,CAAA;AAAA,KACpC;AAAA,GACD,CAAA;AAAA,EAEO,aAAgB,GAAA;AACtB,IAAW,KAAA,MAAA,YAAA,IAAgB,KAAK,WAAa,EAAA;AAC3C,MAAA,YAAA,CAAa,IAAK,CAAA,IAAI,GAAI,CAAA,IAAA,CAAK,eAAe,CAAC,CAAA;AAAA;AACjD;AAEJ;;;;"}
|
|
@@ -40,11 +40,12 @@ function CatalogKindHeader(props) {
|
|
|
40
40
|
setSelectedKind(filters.kind?.value);
|
|
41
41
|
}
|
|
42
42
|
}, [filters.kind]);
|
|
43
|
+
const selectedKindLabel = allKinds.get(selectedKind.toLocaleLowerCase("en-US")) || selectedKind;
|
|
43
44
|
useEffect(() => {
|
|
44
45
|
updateFilters({
|
|
45
|
-
kind: selectedKind ? new EntityKindFilter(selectedKind) : void 0
|
|
46
|
+
kind: selectedKind ? new EntityKindFilter(selectedKind, selectedKindLabel) : void 0
|
|
46
47
|
});
|
|
47
|
-
}, [selectedKind, updateFilters]);
|
|
48
|
+
}, [selectedKind, selectedKindLabel, updateFilters]);
|
|
48
49
|
const options = filterKinds(allKinds, allowedKinds, selectedKind);
|
|
49
50
|
return /* @__PURE__ */ React.createElement(
|
|
50
51
|
Select,
|
|
@@ -54,7 +55,7 @@ function CatalogKindHeader(props) {
|
|
|
54
55
|
onChange: (e) => setSelectedKind(e.target.value),
|
|
55
56
|
classes
|
|
56
57
|
},
|
|
57
|
-
|
|
58
|
+
[...options.keys()].map((kind) => /* @__PURE__ */ React.createElement(MenuItem, { value: kind, key: kind }, `${pluralize(options.get(kind) || kind)}`))
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
61
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatalogKindHeader.esm.js","sources":["../../../src/components/CatalogKindHeader/CatalogKindHeader.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 React, { useEffect, useState, useMemo } from 'react';\nimport InputBase from '@material-ui/core/InputBase';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Select from '@material-ui/core/Select';\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\nimport {\n EntityKindFilter,\n useEntityList,\n} from '@backstage/plugin-catalog-react';\nimport pluralize from 'pluralize';\nimport { filterKinds, useAllKinds } from './kindFilterUtils';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n ...theme.typography.h4,\n },\n }),\n);\n\n/**\n * Props for {@link CatalogKindHeader}.\n *\n * @public\n */\nexport interface CatalogKindHeaderProps {\n /**\n * Entity kinds to show in the dropdown; by default all kinds are fetched from the catalog and\n * displayed.\n */\n allowedKinds?: string[];\n /**\n * The initial kind to select; defaults to 'component'. A kind filter entered directly in the\n * query parameter will override this value.\n */\n initialFilter?: string;\n}\n\n/**\n * @public\n * @deprecated This component has been deprecated in favour of the EntityKindPicker in the list of filters. If you wish to keep this component long term make sure to raise an issue at github.com/backstage/backstage\n */\nexport function CatalogKindHeader(props: CatalogKindHeaderProps) {\n const { initialFilter = 'component', allowedKinds } = props;\n const classes = useStyles();\n const { allKinds } = useAllKinds();\n const {\n filters,\n updateFilters,\n queryParameters: { kind: kindParameter },\n } = useEntityList();\n\n const queryParamKind = useMemo(\n () => [kindParameter].flat()[0],\n [kindParameter],\n );\n\n const [selectedKind, setSelectedKind] = useState(\n queryParamKind ?? filters.kind?.value ?? initialFilter,\n );\n\n // Set selected kinds on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (queryParamKind) {\n setSelectedKind(queryParamKind);\n }\n }, [queryParamKind]);\n\n // Set selected kind from filters; this happens when the kind filter is\n // updated from another component\n useEffect(() => {\n if (filters.kind?.value) {\n setSelectedKind(filters.kind?.value);\n }\n }, [filters.kind]);\n\n useEffect(() => {\n updateFilters({\n kind: selectedKind
|
|
1
|
+
{"version":3,"file":"CatalogKindHeader.esm.js","sources":["../../../src/components/CatalogKindHeader/CatalogKindHeader.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 React, { useEffect, useState, useMemo } from 'react';\nimport InputBase from '@material-ui/core/InputBase';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Select from '@material-ui/core/Select';\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\nimport {\n EntityKindFilter,\n useEntityList,\n} from '@backstage/plugin-catalog-react';\nimport pluralize from 'pluralize';\nimport { filterKinds, useAllKinds } from './kindFilterUtils';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n ...theme.typography.h4,\n },\n }),\n);\n\n/**\n * Props for {@link CatalogKindHeader}.\n *\n * @public\n */\nexport interface CatalogKindHeaderProps {\n /**\n * Entity kinds to show in the dropdown; by default all kinds are fetched from the catalog and\n * displayed.\n */\n allowedKinds?: string[];\n /**\n * The initial kind to select; defaults to 'component'. A kind filter entered directly in the\n * query parameter will override this value.\n */\n initialFilter?: string;\n}\n\n/**\n * @public\n * @deprecated This component has been deprecated in favour of the EntityKindPicker in the list of filters. If you wish to keep this component long term make sure to raise an issue at github.com/backstage/backstage\n */\nexport function CatalogKindHeader(props: CatalogKindHeaderProps) {\n const { initialFilter = 'component', allowedKinds } = props;\n const classes = useStyles();\n const { allKinds } = useAllKinds();\n const {\n filters,\n updateFilters,\n queryParameters: { kind: kindParameter },\n } = useEntityList();\n\n const queryParamKind = useMemo(\n () => [kindParameter].flat()[0],\n [kindParameter],\n );\n\n const [selectedKind, setSelectedKind] = useState(\n queryParamKind ?? filters.kind?.value ?? initialFilter,\n );\n\n // Set selected kinds on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (queryParamKind) {\n setSelectedKind(queryParamKind);\n }\n }, [queryParamKind]);\n\n // Set selected kind from filters; this happens when the kind filter is\n // updated from another component\n useEffect(() => {\n if (filters.kind?.value) {\n setSelectedKind(filters.kind?.value);\n }\n }, [filters.kind]);\n\n const selectedKindLabel =\n allKinds.get(selectedKind.toLocaleLowerCase('en-US')) || selectedKind;\n\n useEffect(() => {\n updateFilters({\n kind: selectedKind\n ? new EntityKindFilter(selectedKind, selectedKindLabel)\n : undefined,\n });\n }, [selectedKind, selectedKindLabel, updateFilters]);\n\n const options = filterKinds(allKinds, allowedKinds, selectedKind);\n\n return (\n <Select\n input={<InputBase />}\n value={selectedKind.toLocaleLowerCase('en-US')}\n onChange={e => setSelectedKind(e.target.value as string)}\n classes={classes}\n >\n {[...options.keys()].map(kind => (\n <MenuItem value={kind} key={kind}>\n {`${pluralize(options.get(kind) || kind)}`}\n </MenuItem>\n ))}\n </Select>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AA4BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAa,CAAA;AAAA,IACX,IAAM,EAAA;AAAA,MACJ,GAAG,MAAM,UAAW,CAAA;AAAA;AACtB,GACD;AACH,CAAA;AAwBO,SAAS,kBAAkB,KAA+B,EAAA;AAC/D,EAAA,MAAM,EAAE,aAAA,GAAgB,WAAa,EAAA,YAAA,EAAiB,GAAA,KAAA;AACtD,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,WAAY,EAAA;AACjC,EAAM,MAAA;AAAA,IACJ,OAAA;AAAA,IACA,aAAA;AAAA,IACA,eAAA,EAAiB,EAAE,IAAA,EAAM,aAAc;AAAA,MACrC,aAAc,EAAA;AAElB,EAAA,MAAM,cAAiB,GAAA,OAAA;AAAA,IACrB,MAAM,CAAC,aAAa,CAAE,CAAA,IAAA,GAAO,CAAC,CAAA;AAAA,IAC9B,CAAC,aAAa;AAAA,GAChB;AAEA,EAAM,MAAA,CAAC,YAAc,EAAA,eAAe,CAAI,GAAA,QAAA;AAAA,IACtC,cAAA,IAAkB,OAAQ,CAAA,IAAA,EAAM,KAAS,IAAA;AAAA,GAC3C;AAIA,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,cAAgB,EAAA;AAClB,MAAA,eAAA,CAAgB,cAAc,CAAA;AAAA;AAChC,GACF,EA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 -9,29 +9,25 @@ function useAllKinds() {
|
|
|
9
9
|
loading,
|
|
10
10
|
value: allKinds
|
|
11
11
|
} = useAsync(async () => {
|
|
12
|
-
const
|
|
13
|
-
|
|
12
|
+
const { facets } = await catalogApi.getEntityFacets({ facets: ["kind"] });
|
|
13
|
+
const kindFacets = (facets.kind ?? []).map((f) => f.value);
|
|
14
|
+
return new Map(
|
|
15
|
+
kindFacets.map((kind) => [kind.toLocaleLowerCase("en-US"), kind])
|
|
16
|
+
);
|
|
14
17
|
}, [catalogApi]);
|
|
15
|
-
return { loading, error, allKinds: allKinds ??
|
|
18
|
+
return { loading, error, allKinds: allKinds ?? /* @__PURE__ */ new Map() };
|
|
16
19
|
}
|
|
17
20
|
function filterKinds(allKinds, allowedKinds, forcedKinds) {
|
|
18
|
-
let availableKinds = allKinds;
|
|
21
|
+
let availableKinds = Array.from(allKinds.keys());
|
|
19
22
|
if (allowedKinds) {
|
|
20
|
-
availableKinds =
|
|
21
|
-
(k) => allowedKinds.some(
|
|
22
|
-
(a) => a.toLocaleLowerCase("en-US") === k.toLocaleLowerCase("en-US")
|
|
23
|
-
)
|
|
24
|
-
);
|
|
23
|
+
availableKinds = allowedKinds.map((k) => k.toLocaleLowerCase("en-US")).filter((k) => allKinds.has(k));
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
(
|
|
28
|
-
)
|
|
29
|
-
|
|
25
|
+
const kindsMap = new Map(
|
|
26
|
+
availableKinds.map((kind) => [kind, allKinds.get(kind) || kind])
|
|
27
|
+
);
|
|
28
|
+
if (forcedKinds && !kindsMap.has(forcedKinds)) {
|
|
29
|
+
kindsMap.set(forcedKinds.toLocaleLowerCase("en-US"), forcedKinds);
|
|
30
30
|
}
|
|
31
|
-
const kindsMap = availableKinds.sort().reduce((acc, kind) => {
|
|
32
|
-
acc[kind.toLocaleLowerCase("en-US")] = kind;
|
|
33
|
-
return acc;
|
|
34
|
-
}, {});
|
|
35
31
|
return kindsMap;
|
|
36
32
|
}
|
|
37
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kindFilterUtils.esm.js","sources":["../../../src/components/CatalogKindHeader/kindFilterUtils.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport useAsync from 'react-use/esm/useAsync';\n\n/**\n * Fetch and return all
|
|
1
|
+
{"version":3,"file":"kindFilterUtils.esm.js","sources":["../../../src/components/CatalogKindHeader/kindFilterUtils.ts"],"sourcesContent":["/*\n * Copyright 2022 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 { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport useAsync from 'react-use/esm/useAsync';\n\n/**\n * Fetch and return all available kinds.\n */\nexport function useAllKinds(): {\n loading: boolean;\n error?: Error;\n allKinds: Map<string, string>;\n} {\n const catalogApi = useApi(catalogApiRef);\n\n const {\n error,\n loading,\n value: allKinds,\n } = useAsync(async () => {\n const { facets } = await catalogApi.getEntityFacets({ facets: ['kind'] });\n const kindFacets = (facets.kind ?? []).map(f => f.value);\n return new Map(\n kindFacets.map(kind => [kind.toLocaleLowerCase('en-US'), kind]),\n );\n }, [catalogApi]);\n\n return { loading, error, allKinds: allKinds ?? new Map() };\n}\n\n/**\n * Filter and capitalize accessible kinds.\n */\nexport function filterKinds(\n allKinds: Map<string, string>,\n allowedKinds?: string[],\n forcedKinds?: string,\n): Map<string, string> {\n // Before allKinds is loaded, or when a kind is entered manually in the URL, selectedKind may not\n // be present in allKinds. It should still be shown in the dropdown, but may not have the nice\n // enforced casing from the catalog-backend. This makes a key/value record for the Select options,\n // including selectedKind if it's unknown - but allows the selectedKind to get clobbered by the\n // more proper catalog kind if it exists.\n let availableKinds = Array.from(allKinds.keys());\n if (allowedKinds) {\n availableKinds = allowedKinds\n .map(k => k.toLocaleLowerCase('en-US'))\n .filter(k => allKinds.has(k));\n }\n\n const kindsMap = new Map(\n availableKinds.map(kind => [kind, allKinds.get(kind) || kind]),\n );\n\n if (forcedKinds && !kindsMap.has(forcedKinds)) {\n // this is the only time we set a label for a kind which is not properly capitalized\n kindsMap.set(forcedKinds.toLocaleLowerCase('en-US'), forcedKinds);\n }\n\n return kindsMap;\n}\n"],"names":[],"mappings":";;;;AAuBO,SAAS,WAId,GAAA;AACA,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA;AAEvC,EAAM,MAAA;AAAA,IACJ,KAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAO,EAAA;AAAA,GACT,GAAI,SAAS,YAAY;AACvB,IAAM,MAAA,EAAE,MAAO,EAAA,GAAI,MAAM,UAAA,CAAW,eAAgB,CAAA,EAAE,MAAQ,EAAA,CAAC,MAAM,CAAA,EAAG,CAAA;AACxE,IAAM,MAAA,UAAA,GAAA,CAAc,OAAO,IAAQ,IAAA,IAAI,GAAI,CAAA,CAAA,CAAA,KAAK,EAAE,KAAK,CAAA;AACvD,IAAA,OAAO,IAAI,GAAA;AAAA,MACT,UAAA,CAAW,IAAI,CAAQ,IAAA,KAAA,CAAC,KAAK,iBAAkB,CAAA,OAAO,CAAG,EAAA,IAAI,CAAC;AAAA,KAChE;AAAA,GACF,EAAG,CAAC,UAAU,CAAC,CAAA;AAEf,EAAA,OAAO,EAAE,OAAS,EAAA,KAAA,EAAO,UAAU,QAAY,oBAAA,IAAI,KAAM,EAAA;AAC3D;AAKgB,SAAA,WAAA,CACd,QACA,EAAA,YAAA,EACA,WACqB,EAAA;AAMrB,EAAA,IAAI,cAAiB,GAAA,KAAA,CAAM,IAAK,CAAA,QAAA,CAAS,MAAM,CAAA;AAC/C,EAAA,IAAI,YAAc,EAAA;AAChB,IAAA,cAAA,GAAiB,YACd,CAAA,GAAA,CAAI,CAAK,CAAA,KAAA,CAAA,CAAE,iBAAkB,CAAA,OAAO,CAAC,CAAA,CACrC,MAAO,CAAA,CAAA,CAAA,KAAK,QAAS,CAAA,GAAA,CAAI,CAAC,CAAC,CAAA;AAAA;AAGhC,EAAA,MAAM,WAAW,IAAI,GAAA;AAAA,IACnB,cAAA,CAAe,GAAI,CAAA,CAAA,IAAA,KAAQ,CAAC,IAAA,EAAM,SAAS,GAAI,CAAA,IAAI,CAAK,IAAA,IAAI,CAAC;AAAA,GAC/D;AAEA,EAAA,IAAI,WAAe,IAAA,CAAC,QAAS,CAAA,GAAA,CAAI,WAAW,CAAG,EAAA;AAE7C,IAAA,QAAA,CAAS,GAAI,CAAA,WAAA,CAAY,iBAAkB,CAAA,OAAO,GAAG,WAAW,CAAA;AAAA;AAGlE,EAAO,OAAA,QAAA;AACT;;;;"}
|
|
@@ -93,7 +93,7 @@ const CatalogTable = (props) => {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
];
|
|
96
|
-
const currentKind = filters.kind?.
|
|
96
|
+
const currentKind = filters.kind?.label || "";
|
|
97
97
|
const currentType = filters.type?.value || "";
|
|
98
98
|
const currentCount = typeof totalItems === "number" ? `(${totalItems})` : "";
|
|
99
99
|
const titlePreamble = capitalize(filters.user?.value ?? "all");
|
|
@@ -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 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 React, { 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/translation';\nimport { FavoriteToggleIcon } from '@backstage/core-components';\nimport { CatalogTableToolbar } from './CatalogTableToolbar';\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 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?.value || '';\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(filters.user?.value ?? 'all');\n const title =\n props.title ||\n [titlePreamble, currentType, pluralize(currentKind), currentCount]\n .filter(s => s)\n .join(' ');\n\n const actions = props.actions || defaultActions;\n const options = {\n actionsColumnIndex: -1,\n loadingType: 'linear' as const,\n showEmptyDataSourceMessage: !loading,\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={loading}\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={loading}\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={loading}\n columns={tableColumns}\n options={{\n paging: showPagination,\n pageSize: pageSize,\n pageSizeOptions: [20, 50, 100],\n ...options,\n }}\n components={{\n Toolbar: CatalogTableToolbar,\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,CAAc,KAAA;AAC3C,EAAA,MAAM,QAAQ,CAAC,MAAA,KACb,OAAO,QAAS,CAAA,KAAA,IAChB,kBAAkB,MAAQ,EAAA;AAAA,IACxB,WAAa,EAAA;AAAA,GACd,CAAA;AAEH,EAAA,OAAO,MAAM,CAAC,CAAA,CAAE,aAAc,CAAA,KAAA,CAAM,CAAC,CAAC,CAAA;AACxC,CAAA;AAYa,MAAA,YAAA,GAAe,CAAC,KAA6B,KAAA;AACxD,EAAM,MAAA;AAAA,IACJ,OAAU,GAAA,8BAAA;AAAA,IACV,YAAA;AAAA,IACA,QAAA;AAAA,IACA;AAAA,GACE,GAAA,KAAA;AACJ,EAAA,MAAM,EAAE,eAAA,EAAiB,mBAAoB,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AA,GACP,CAAA;AACD,EAAM,MAAA,gBAAA,GAAmB,kBAAmB,CAAA,MAAA,EAAQ,iBAAiB,CAAA;AAErE,EAAO,OAAA;AAAA,IACL,MAAA;AAAA,IACA,QAAU,EAAA;AAAA;AAAA;AAAA;AAAA,MAIR,IAAA,EAAM,kBAAkB,MAAQ,EAAA;AAAA,QAC9B,WAAa,EAAA;AAAA,OACd,CAAA;AAAA,MACD,SAAA,EAAW,mBAAmB,MAAM,CAAA;AAAA,MACpC,qBAAuB,EAAA,gBAAA,CACpB,GAAI,CAAA,CAAA,CAAA,KAAK,iBAAkB,CAAA,CAAA,EAAG,EAAE,WAAA,EAAa,OAAQ,EAAC,CAAC,CAAA,CACvD,KAAK,IAAI,CAAA;AAAA,MACZ,gBAAA;AAAA,MACA,2BAA2B,qBACxB,CAAA,GAAA;AAAA,QAAI,CAAA,CAAA,KACH,kBAAkB,CAAG,EAAA;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 getEntityRelations,\n humanizeEntityRef,\n useEntityList,\n useStarredEntities,\n} from '@backstage/plugin-catalog-react';\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 React, { 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/translation';\nimport { FavoriteToggleIcon } from '@backstage/core-components';\nimport { CatalogTableToolbar } from './CatalogTableToolbar';\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 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(filters.user?.value ?? 'all');\n const title =\n props.title ||\n [titlePreamble, currentType, pluralize(currentKind), currentCount]\n .filter(s => s)\n .join(' ');\n\n const actions = props.actions || defaultActions;\n const options = {\n actionsColumnIndex: -1,\n loadingType: 'linear' as const,\n showEmptyDataSourceMessage: !loading,\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={loading}\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={loading}\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={loading}\n columns={tableColumns}\n options={{\n paging: showPagination,\n pageSize: pageSize,\n pageSizeOptions: [20, 50, 100],\n ...options,\n }}\n components={{\n Toolbar: CatalogTableToolbar,\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,CAAc,KAAA;AAC3C,EAAA,MAAM,QAAQ,CAAC,MAAA,KACb,OAAO,QAAS,CAAA,KAAA,IAChB,kBAAkB,MAAQ,EAAA;AAAA,IACxB,WAAa,EAAA;AAAA,GACd,CAAA;AAEH,EAAA,OAAO,MAAM,CAAC,CAAA,CAAE,aAAc,CAAA,KAAA,CAAM,CAAC,CAAC,CAAA;AACxC,CAAA;AAYa,MAAA,YAAA,GAAe,CAAC,KAA6B,KAAA;AACxD,EAAM,MAAA;AAAA,IACJ,OAAU,GAAA,8BAAA;AAAA,IACV,YAAA;AAAA,IACA,QAAA;AAAA,IACA;AAAA,GACE,GAAA,KAAA;AACJ,EAAA,MAAM,EAAE,eAAA,EAAiB,mBAAoB,EAAA,GAAI,kBAAmB,EAAA;AACpE,EAAA,MAAM,oBAAoB,aAAc,EAAA;AAExC,EAAM,MAAA;AAAA,IACJ,OAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACE,GAAA,iBAAA;AAEJ,EAAA,MAAM,YAAe,GAAA,OAAA;AAAA,IACnB,MACE,OAAO,OAAA,KAAY,UAAa,GAAA,OAAA,CAAQ,iBAAiB,CAAI,GAAA,OAAA;AAAA,IAC/D,CAAC,SAAS,iBAAiB;AAAA,GAC7B;AACA,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,qBAAqB,CAAA;AAErD,EAAA,IAAI,KAAO,EAAA;AACT,IAAA,2CACG,KACC,EAAA,IAAA,kBAAA,KAAA,CAAA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H,kBAAkB,CAAG,EAAA;AAAA,UACnB,WAAa,EAAA;AAAA,SACd;AAAA,OACH,CACC,KAAK,IAAI,CAAA;AAAA,MACZ;AAAA;AACF,GACF;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog",
|
|
3
|
-
"version": "1.26.0
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"description": "The Backstage plugin for browsing the Backstage catalog",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -67,21 +67,21 @@
|
|
|
67
67
|
"test": "backstage-cli package test"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@backstage/catalog-client": "1.9.0
|
|
71
|
-
"@backstage/catalog-model": "1.7.2
|
|
72
|
-
"@backstage/core-compat-api": "0.3.4
|
|
73
|
-
"@backstage/core-components": "0.16.2
|
|
74
|
-
"@backstage/core-plugin-api": "1.10.2
|
|
75
|
-
"@backstage/errors": "1.2.6
|
|
76
|
-
"@backstage/frontend-plugin-api": "0.9.3
|
|
77
|
-
"@backstage/integration-react": "1.2.2
|
|
78
|
-
"@backstage/plugin-catalog-common": "1.1.2
|
|
79
|
-
"@backstage/plugin-catalog-react": "1.
|
|
80
|
-
"@backstage/plugin-permission-react": "0.4.29
|
|
81
|
-
"@backstage/plugin-scaffolder-common": "1.5.8
|
|
82
|
-
"@backstage/plugin-search-common": "1.2.16
|
|
83
|
-
"@backstage/plugin-search-react": "1.8.4
|
|
84
|
-
"@backstage/types": "1.2.0",
|
|
70
|
+
"@backstage/catalog-client": "^1.9.0",
|
|
71
|
+
"@backstage/catalog-model": "^1.7.2",
|
|
72
|
+
"@backstage/core-compat-api": "^0.3.4",
|
|
73
|
+
"@backstage/core-components": "^0.16.2",
|
|
74
|
+
"@backstage/core-plugin-api": "^1.10.2",
|
|
75
|
+
"@backstage/errors": "^1.2.6",
|
|
76
|
+
"@backstage/frontend-plugin-api": "^0.9.3",
|
|
77
|
+
"@backstage/integration-react": "^1.2.2",
|
|
78
|
+
"@backstage/plugin-catalog-common": "^1.1.2",
|
|
79
|
+
"@backstage/plugin-catalog-react": "^1.15.0",
|
|
80
|
+
"@backstage/plugin-permission-react": "^0.4.29",
|
|
81
|
+
"@backstage/plugin-scaffolder-common": "^1.5.8",
|
|
82
|
+
"@backstage/plugin-search-common": "^1.2.16",
|
|
83
|
+
"@backstage/plugin-search-react": "^1.8.4",
|
|
84
|
+
"@backstage/types": "^1.2.0",
|
|
85
85
|
"@material-ui/core": "^4.12.2",
|
|
86
86
|
"@material-ui/icons": "^4.9.1",
|
|
87
87
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
@@ -95,12 +95,12 @@
|
|
|
95
95
|
"zen-observable": "^0.10.0"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
|
-
"@backstage/cli": "0.29.
|
|
99
|
-
"@backstage/core-app-api": "1.15.3
|
|
100
|
-
"@backstage/dev-utils": "1.1.5
|
|
101
|
-
"@backstage/frontend-test-utils": "0.2.4
|
|
102
|
-
"@backstage/plugin-permission-common": "0.8.3
|
|
103
|
-
"@backstage/test-utils": "1.7.3
|
|
98
|
+
"@backstage/cli": "^0.29.4",
|
|
99
|
+
"@backstage/core-app-api": "^1.15.3",
|
|
100
|
+
"@backstage/dev-utils": "^1.1.5",
|
|
101
|
+
"@backstage/frontend-test-utils": "^0.2.4",
|
|
102
|
+
"@backstage/plugin-permission-common": "^0.8.3",
|
|
103
|
+
"@backstage/test-utils": "^1.7.3",
|
|
104
104
|
"@testing-library/dom": "^10.0.0",
|
|
105
105
|
"@testing-library/jest-dom": "^6.0.0",
|
|
106
106
|
"@testing-library/react": "^16.0.0",
|