@backstage/plugin-catalog 1.4.0 → 1.5.0-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 CHANGED
@@ -1,5 +1,53 @@
1
1
  # @backstage/plugin-catalog
2
2
 
3
+ ## 1.5.0-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/plugin-catalog-react@1.1.3-next.2
9
+ - @backstage/core-components@0.11.0-next.2
10
+ - @backstage/integration-react@1.1.3-next.1
11
+ - @backstage/plugin-search-react@1.0.1-next.1
12
+
13
+ ## 1.5.0-next.1
14
+
15
+ ### Minor Changes
16
+
17
+ - fe94398418: Allow changing the subtitle of the `CatalogTable` component
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+ - @backstage/core-components@0.10.1-next.1
23
+ - @backstage/plugin-catalog-common@1.0.5-next.0
24
+ - @backstage/plugin-catalog-react@1.1.3-next.1
25
+
26
+ ## 1.5.0-next.0
27
+
28
+ ### Minor Changes
29
+
30
+ - 80da5162c7: Plugin catalog has been modified to use an experimental feature where you can customize the title of the create button.
31
+
32
+ You can modify it by doing:
33
+
34
+ ```typescript jsx
35
+ import { catalogPlugin } from '@backstage/plugin-catalog';
36
+
37
+ catalogPlugin.__experimentalReconfigure({
38
+ createButtonTitle: 'New',
39
+ });
40
+ ```
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies
45
+ - @backstage/core-plugin-api@1.0.5-next.0
46
+ - @backstage/integration-react@1.1.3-next.0
47
+ - @backstage/plugin-catalog-react@1.1.3-next.0
48
+ - @backstage/core-components@0.10.1-next.0
49
+ - @backstage/plugin-search-react@1.0.1-next.0
50
+
3
51
  ## 1.4.0
4
52
 
5
53
  ### Minor Changes
@@ -14,7 +14,10 @@ const useEntityFromUrl = () => {
14
14
  error,
15
15
  loading,
16
16
  retry: refresh
17
- } = useAsyncRetry(() => catalogApi.getEntityByRef({ kind, namespace, name }), [catalogApi, kind, namespace, name]);
17
+ } = useAsyncRetry(
18
+ () => catalogApi.getEntityByRef({ kind, namespace, name }),
19
+ [catalogApi, kind, namespace, name]
20
+ );
18
21
  useEffect(() => {
19
22
  if (!name) {
20
23
  errorApi.post(new Error("No name provided!"));
@@ -31,4 +34,4 @@ function CatalogEntityPage() {
31
34
  }
32
35
 
33
36
  export { CatalogEntityPage };
34
- //# sourceMappingURL=index-4e6adb42.esm.js.map
37
+ //# sourceMappingURL=index-46417657.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-4e6adb42.esm.js","sources":["../../src/components/CatalogEntityPage/useEntityFromUrl.ts","../../src/components/CatalogEntityPage/CatalogEntityPage.tsx"],"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 {\n errorApiRef,\n useApi,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n EntityLoadingStatus,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { useEffect } from 'react';\nimport { useNavigate } from 'react-router';\nimport useAsyncRetry from 'react-use/lib/useAsyncRetry';\n\nexport const useEntityFromUrl = (): EntityLoadingStatus => {\n const { kind, namespace, name } = useRouteRefParams(entityRouteRef);\n const navigate = useNavigate();\n const errorApi = useApi(errorApiRef);\n const catalogApi = useApi(catalogApiRef);\n\n const {\n value: entity,\n error,\n loading,\n retry: refresh,\n } = useAsyncRetry(\n () => catalogApi.getEntityByRef({ kind, namespace, name }),\n [catalogApi, kind, namespace, name],\n );\n\n useEffect(() => {\n if (!name) {\n errorApi.post(new Error('No name provided!'));\n navigate('/');\n }\n }, [errorApi, navigate, error, loading, entity, name]);\n\n return { entity, loading, error, refresh };\n};\n","/*\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 React from 'react';\nimport { Outlet } from 'react-router';\nimport { AsyncEntityProvider } from '@backstage/plugin-catalog-react';\nimport { useEntityFromUrl } from './useEntityFromUrl';\n\n/** @public */\nexport function CatalogEntityPage() {\n return (\n <AsyncEntityProvider {...useEntityFromUrl()}>\n <Outlet />\n </AsyncEntityProvider>\n );\n}\n"],"names":[],"mappings":";;;;;;AAYO,MAAM,gBAAgB,GAAG,MAAM;AACtC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,iBAAiB,CAAC,cAAc,CAAC,CAAC;AACtE,EAAE,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;AACjC,EAAE,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AACvC,EAAE,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAC3C,EAAE,MAAM;AACR,IAAI,KAAK,EAAE,MAAM;AACjB,IAAI,KAAK;AACT,IAAI,OAAO;AACX,IAAI,KAAK,EAAE,OAAO;AAClB,GAAG,GAAG,aAAa,CAAC,MAAM,UAAU,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;AACrH,EAAE,SAAS,CAAC,MAAM;AAClB,IAAI,IAAI,CAAC,IAAI,EAAE;AACf,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;AACpD,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC;AACpB,KAAK;AACL,GAAG,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACzD,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC7C,CAAC;;AC1BM,SAAS,iBAAiB,GAAG;AACpC,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE;AAClE,IAAI,GAAG,gBAAgB,EAAE;AACzB,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACxD;;;;"}
1
+ {"version":3,"file":"index-46417657.esm.js","sources":["../../src/components/CatalogEntityPage/useEntityFromUrl.ts","../../src/components/CatalogEntityPage/CatalogEntityPage.tsx"],"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 {\n errorApiRef,\n useApi,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n EntityLoadingStatus,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { useEffect } from 'react';\nimport { useNavigate } from 'react-router';\nimport useAsyncRetry from 'react-use/lib/useAsyncRetry';\n\nexport const useEntityFromUrl = (): EntityLoadingStatus => {\n const { kind, namespace, name } = useRouteRefParams(entityRouteRef);\n const navigate = useNavigate();\n const errorApi = useApi(errorApiRef);\n const catalogApi = useApi(catalogApiRef);\n\n const {\n value: entity,\n error,\n loading,\n retry: refresh,\n } = useAsyncRetry(\n () => catalogApi.getEntityByRef({ kind, namespace, name }),\n [catalogApi, kind, namespace, name],\n );\n\n useEffect(() => {\n if (!name) {\n errorApi.post(new Error('No name provided!'));\n navigate('/');\n }\n }, [errorApi, navigate, error, loading, entity, name]);\n\n return { entity, loading, error, refresh };\n};\n","/*\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 React from 'react';\nimport { Outlet } from 'react-router';\nimport { AsyncEntityProvider } from '@backstage/plugin-catalog-react';\nimport { useEntityFromUrl } from './useEntityFromUrl';\n\n/** @public */\nexport function CatalogEntityPage() {\n return (\n <AsyncEntityProvider {...useEntityFromUrl()}>\n <Outlet />\n </AsyncEntityProvider>\n );\n}\n"],"names":[],"mappings":";;;;;;AAYO,MAAM,gBAAgB,GAAG,MAAM;AACtC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,iBAAiB,CAAC,cAAc,CAAC,CAAC;AACtE,EAAE,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;AACjC,EAAE,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AACvC,EAAE,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAC3C,EAAE,MAAM;AACR,IAAI,KAAK,EAAE,MAAM;AACjB,IAAI,KAAK;AACT,IAAI,OAAO;AACX,IAAI,KAAK,EAAE,OAAO;AAClB,GAAG,GAAG,aAAa;AACnB,IAAI,MAAM,UAAU,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAC9D,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC;AACvC,GAAG,CAAC;AACJ,EAAE,SAAS,CAAC,MAAM;AAClB,IAAI,IAAI,CAAC,IAAI,EAAE;AACf,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;AACpD,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC;AACpB,KAAK;AACL,GAAG,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACzD,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC7C,CAAC;;AC7BM,SAAS,iBAAiB,GAAG;AACpC,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE;AAClE,IAAI,GAAG,gBAAgB,EAAE;AACzB,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACxD;;;;"}
@@ -13,10 +13,10 @@ import React, { useCallback, useMemo, useState, useEffect } from 'react';
13
13
  import LanguageIcon from '@material-ui/icons/Language';
14
14
  import useAsync from 'react-use/lib/useAsync';
15
15
  import { HighlightedSearchResultText } from '@backstage/plugin-search-react';
16
- import OpenInNew from '@material-ui/icons/OpenInNew';
17
- import StarBorder from '@material-ui/icons/StarBorder';
18
16
  import { withStyles, makeStyles as makeStyles$1 } from '@material-ui/core/styles';
17
+ import OpenInNew from '@material-ui/icons/OpenInNew';
19
18
  import Star from '@material-ui/icons/Star';
19
+ import StarBorder from '@material-ui/icons/StarBorder';
20
20
  import { Alert } from '@material-ui/lab';
21
21
  import { useLocation, useNavigate } from 'react-router';
22
22
  import BugReportIcon from '@material-ui/icons/BugReport';
@@ -36,8 +36,12 @@ async function performMigrationToTheNewBucket({
36
36
  if (!isArray(oldStarredEntities)) {
37
37
  return;
38
38
  }
39
- const targetEntities = new Set((_a = target.snapshot("entityRefs").value) != null ? _a : []);
40
- oldStarredEntities.filter(isString).map((old) => old.split(":")).filter((split) => split.length === 4 && split[0] === "entity").map(([_, kind, namespace, name]) => stringifyEntityRef({ kind, namespace, name })).forEach((e) => targetEntities.add(e));
39
+ const targetEntities = new Set(
40
+ (_a = target.snapshot("entityRefs").value) != null ? _a : []
41
+ );
42
+ oldStarredEntities.filter(isString).map((old) => old.split(":")).filter((split) => split.length === 4 && split[0] === "entity").map(
43
+ ([_, kind, namespace, name]) => stringifyEntityRef({ kind, namespace, name })
44
+ ).forEach((e) => targetEntities.add(e));
41
45
  await target.set("entityRefs", Array.from(targetEntities));
42
46
  await source.remove("starredEntities");
43
47
  }
@@ -55,7 +59,9 @@ class DefaultStarredEntitiesApi {
55
59
  var _a;
56
60
  performMigrationToTheNewBucket(opts).then();
57
61
  this.settingsStore = opts.storageApi.forBucket("starredEntities");
58
- this.starredEntities = new Set((_a = this.settingsStore.snapshot("entityRefs").value) != null ? _a : []);
62
+ this.starredEntities = new Set(
63
+ (_a = this.settingsStore.snapshot("entityRefs").value) != null ? _a : []
64
+ );
59
65
  this.settingsStore.observe$("entityRefs").subscribe({
60
66
  next: (next) => {
61
67
  var _a2;
@@ -70,7 +76,10 @@ class DefaultStarredEntitiesApi {
70
76
  } else {
71
77
  this.starredEntities.add(entityRef);
72
78
  }
73
- await this.settingsStore.set("entityRefs", Array.from(this.starredEntities));
79
+ await this.settingsStore.set(
80
+ "entityRefs",
81
+ Array.from(this.starredEntities)
82
+ );
74
83
  }
75
84
  starredEntitie$() {
76
85
  return this.observable;
@@ -228,9 +237,13 @@ function AboutContent(props) {
228
237
  const partOfSystemRelations = getEntityRelations(entity, RELATION_PART_OF, {
229
238
  kind: "system"
230
239
  });
231
- const partOfComponentRelations = getEntityRelations(entity, RELATION_PART_OF, {
232
- kind: "component"
233
- });
240
+ const partOfComponentRelations = getEntityRelations(
241
+ entity,
242
+ RELATION_PART_OF,
243
+ {
244
+ kind: "component"
245
+ }
246
+ );
234
247
  const partOfDomainRelations = getEntityRelations(entity, RELATION_PART_OF, {
235
248
  kind: "domain"
236
249
  });
@@ -303,7 +316,11 @@ function AboutContent(props) {
303
316
  var _a2;
304
317
  return {
305
318
  text: target,
306
- href: getLocationTargetHref(target, ((_a2 = entity == null ? void 0 : entity.spec) == null ? void 0 : _a2.type) || "unknown", entitySourceLocation)
319
+ href: getLocationTargetHref(
320
+ target,
321
+ ((_a2 = entity == null ? void 0 : entity.spec) == null ? void 0 : _a2.type) || "unknown",
322
+ entitySourceLocation
323
+ )
307
324
  };
308
325
  })
309
326
  })));
@@ -337,7 +354,10 @@ function AboutCard(props) {
337
354
  const catalogApi = useApi(catalogApiRef);
338
355
  const alertApi = useApi(alertApiRef);
339
356
  const viewTechdocLink = useRouteRef(viewTechDocRouteRef);
340
- const entitySourceLocation = getEntitySourceLocation$1(entity, scmIntegrationsApi);
357
+ const entitySourceLocation = getEntitySourceLocation$1(
358
+ entity,
359
+ scmIntegrationsApi
360
+ );
341
361
  const entityMetadataEditUrl = (_a = entity.metadata.annotations) == null ? void 0 : _a[ANNOTATION_EDIT_URL];
342
362
  const viewInSource = {
343
363
  label: "View Source",
@@ -400,11 +420,13 @@ function AboutCard(props) {
400
420
  })));
401
421
  }
402
422
 
403
- const useStyles$2 = makeStyles((theme) => createStyles({
404
- root: {
405
- ...theme.typography.h4
406
- }
407
- }));
423
+ const useStyles$2 = makeStyles(
424
+ (theme) => createStyles({
425
+ root: {
426
+ ...theme.typography.h4
427
+ }
428
+ })
429
+ );
408
430
  function CatalogKindHeader(props) {
409
431
  var _a;
410
432
  const { initialFilter = "component", allowedKinds } = props;
@@ -420,11 +442,16 @@ function CatalogKindHeader(props) {
420
442
  updateFilters,
421
443
  queryParameters: { kind: kindParameter }
422
444
  } = useEntityList();
423
- const queryParamKind = useMemo(() => {
424
- var _a2;
425
- return (_a2 = [kindParameter].flat()[0]) == null ? void 0 : _a2.toLocaleLowerCase("en-US");
426
- }, [kindParameter]);
427
- const [selectedKind, setSelectedKind] = useState(queryParamKind != null ? queryParamKind : initialFilter);
445
+ const queryParamKind = useMemo(
446
+ () => {
447
+ var _a2;
448
+ return (_a2 = [kindParameter].flat()[0]) == null ? void 0 : _a2.toLocaleLowerCase("en-US");
449
+ },
450
+ [kindParameter]
451
+ );
452
+ const [selectedKind, setSelectedKind] = useState(
453
+ queryParamKind != null ? queryParamKind : initialFilter
454
+ );
428
455
  useEffect(() => {
429
456
  updateFilters({
430
457
  kind: selectedKind ? new EntityKindFilter(selectedKind) : void 0
@@ -435,7 +462,13 @@ function CatalogKindHeader(props) {
435
462
  setSelectedKind(queryParamKind);
436
463
  }
437
464
  }, [queryParamKind]);
438
- const availableKinds = [capitalize(selectedKind)].concat((_a = allKinds == null ? void 0 : allKinds.filter((k) => allowedKinds ? allowedKinds.some((a) => a.toLocaleLowerCase("en-US") === k.toLocaleLowerCase("en-US")) : true)) != null ? _a : []);
465
+ const availableKinds = [capitalize(selectedKind)].concat(
466
+ (_a = allKinds == null ? void 0 : allKinds.filter(
467
+ (k) => allowedKinds ? allowedKinds.some(
468
+ (a) => a.toLocaleLowerCase("en-US") === k.toLocaleLowerCase("en-US")
469
+ ) : true
470
+ )) != null ? _a : []
471
+ );
439
472
  const options = availableKinds.sort().reduce((acc, kind) => {
440
473
  acc[kind.toLocaleLowerCase("en-US")] = kind;
441
474
  return acc;
@@ -623,7 +656,7 @@ const YellowStar = withStyles({
623
656
  })(Star);
624
657
  const CatalogTable = (props) => {
625
658
  var _a, _b, _c;
626
- const { columns, actions, tableOptions } = props;
659
+ const { columns, actions, tableOptions, subtitle } = props;
627
660
  const { isStarredEntity, toggleStarredEntity } = useStarredEntities();
628
661
  const { loading, error, entities, filters } = useEntityList();
629
662
  const defaultColumns = useMemo(() => {
@@ -737,9 +770,11 @@ const CatalogTable = (props) => {
737
770
  }),
738
771
  ownedByRelationsTitle: ownedByRelations.map((r) => humanizeEntityRef(r, { defaultKind: "group" })).join(", "),
739
772
  ownedByRelations,
740
- partOfSystemRelationTitle: partOfSystemRelations.map((r) => humanizeEntityRef(r, {
741
- defaultKind: "system"
742
- })).join(", "),
773
+ partOfSystemRelationTitle: partOfSystemRelations.map(
774
+ (r) => humanizeEntityRef(r, {
775
+ defaultKind: "system"
776
+ })
777
+ ).join(", "),
743
778
  partOfSystemRelations
744
779
  }
745
780
  };
@@ -764,7 +799,8 @@ const CatalogTable = (props) => {
764
799
  },
765
800
  title: `${titlePreamble} (${entities.length})`,
766
801
  data: rows,
767
- actions: actions || defaultActions
802
+ actions: actions || defaultActions,
803
+ subtitle
768
804
  });
769
805
  };
770
806
  CatalogTable.columns = columnFactories;
@@ -796,13 +832,16 @@ function UnregisterEntity(props) {
796
832
  return /* @__PURE__ */ React.createElement(React.Fragment, null, unregisterButton);
797
833
  }
798
834
 
799
- const useStyles = makeStyles$1((theme) => {
800
- return {
801
- button: {
802
- color: theme.page.fontColor
803
- }
804
- };
805
- }, { name: "PluginCatalogEntityContextMenu" });
835
+ const useStyles = makeStyles$1(
836
+ (theme) => {
837
+ return {
838
+ button: {
839
+ color: theme.page.fontColor
840
+ }
841
+ };
842
+ },
843
+ { name: "PluginCatalogEntityContextMenu" }
844
+ );
806
845
  function EntityContextMenu(props) {
807
846
  const {
808
847
  UNSTABLE_extraContextMenuItems,
@@ -812,7 +851,9 @@ function EntityContextMenu(props) {
812
851
  } = props;
813
852
  const [anchorEl, setAnchorEl] = useState();
814
853
  const classes = useStyles();
815
- const unregisterPermission = useEntityPermission(catalogEntityDeletePermission);
854
+ const unregisterPermission = useEntityPermission(
855
+ catalogEntityDeletePermission
856
+ );
816
857
  const isAllowed = unregisterPermission.allowed;
817
858
  const onOpen = (event) => {
818
859
  setAnchorEl(event.currentTarget);
@@ -934,25 +975,34 @@ const EntityLayout = (props) => {
934
975
  const { kind, namespace, name } = useRouteRefParams(entityRouteRef);
935
976
  const { entity, loading, error } = useAsyncEntity();
936
977
  const location = useLocation();
937
- const routes = useElementFilter(children, (elements) => elements.selectByComponentData({
938
- key: dataKey,
939
- withStrictError: "Child of EntityLayout must be an EntityLayout.Route"
940
- }).getElements().flatMap(({ props: elementProps }) => {
941
- if (!entity) {
942
- return [];
943
- } else if (elementProps.if && !elementProps.if(entity)) {
944
- return [];
945
- }
946
- return [
947
- {
948
- path: elementProps.path,
949
- title: elementProps.title,
950
- children: elementProps.children,
951
- tabProps: elementProps.tabProps
978
+ const routes = useElementFilter(
979
+ children,
980
+ (elements) => elements.selectByComponentData({
981
+ key: dataKey,
982
+ withStrictError: "Child of EntityLayout must be an EntityLayout.Route"
983
+ }).getElements().flatMap(({ props: elementProps }) => {
984
+ if (!entity) {
985
+ return [];
986
+ } else if (elementProps.if && !elementProps.if(entity)) {
987
+ return [];
952
988
  }
953
- ];
954
- }), [entity]);
955
- const { headerTitle, headerType } = headerProps(kind, namespace, name, entity);
989
+ return [
990
+ {
991
+ path: elementProps.path,
992
+ title: elementProps.title,
993
+ children: elementProps.children,
994
+ tabProps: elementProps.tabProps
995
+ }
996
+ ];
997
+ }),
998
+ [entity]
999
+ );
1000
+ const { headerTitle, headerType } = headerProps(
1001
+ kind,
1002
+ namespace,
1003
+ name,
1004
+ entity
1005
+ );
956
1006
  const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);
957
1007
  const [inspectionDialogOpen, setInspectionDialogOpen] = useState(false);
958
1008
  const navigate = useNavigate();
@@ -1076,7 +1126,10 @@ async function hasCatalogProcessingErrors(entity, context) {
1076
1126
  if (!catalogApi) {
1077
1127
  throw new Error(`No implementation available for ${catalogApiRef}`);
1078
1128
  }
1079
- const errors = await getOwnAndAncestorsErrors(stringifyEntityRef(entity), catalogApi);
1129
+ const errors = await getOwnAndAncestorsErrors(
1130
+ stringifyEntityRef(entity),
1131
+ catalogApi
1132
+ );
1080
1133
  return errors.items.length > 0;
1081
1134
  }
1082
1135
  function EntityProcessingErrorsPanel() {
@@ -1116,31 +1169,37 @@ const EntitySwitch = (props) => {
1116
1169
  var _a, _b;
1117
1170
  const { entity, loading } = useAsyncEntity();
1118
1171
  const apis = useApiHolder();
1119
- const results = useElementFilter(props.children, (collection) => collection.selectByComponentData({
1120
- key: ENTITY_SWITCH_KEY,
1121
- withStrictError: "Child of EntitySwitch is not an EntitySwitch.Case"
1122
- }).getElements().flatMap((element) => {
1123
- var _a2;
1124
- if (loading) {
1125
- return [];
1126
- }
1127
- const { if: condition, children: elementsChildren } = element.props;
1128
- if (!entity) {
1172
+ const results = useElementFilter(
1173
+ props.children,
1174
+ (collection) => collection.selectByComponentData({
1175
+ key: ENTITY_SWITCH_KEY,
1176
+ withStrictError: "Child of EntitySwitch is not an EntitySwitch.Case"
1177
+ }).getElements().flatMap((element) => {
1178
+ var _a2;
1179
+ if (loading) {
1180
+ return [];
1181
+ }
1182
+ const { if: condition, children: elementsChildren } = element.props;
1183
+ if (!entity) {
1184
+ return [
1185
+ {
1186
+ if: condition === void 0,
1187
+ children: elementsChildren
1188
+ }
1189
+ ];
1190
+ }
1129
1191
  return [
1130
1192
  {
1131
- if: condition === void 0,
1193
+ if: (_a2 = condition == null ? void 0 : condition(entity, { apis })) != null ? _a2 : true,
1132
1194
  children: elementsChildren
1133
1195
  }
1134
1196
  ];
1135
- }
1136
- return [
1137
- {
1138
- if: (_a2 = condition == null ? void 0 : condition(entity, { apis })) != null ? _a2 : true,
1139
- children: elementsChildren
1140
- }
1141
- ];
1142
- }), [apis, entity, loading]);
1143
- const hasAsyncCases = results.some((r) => typeof r.if === "object" && "then" in r.if);
1197
+ }),
1198
+ [apis, entity, loading]
1199
+ );
1200
+ const hasAsyncCases = results.some(
1201
+ (r) => typeof r.if === "object" && "then" in r.if
1202
+ );
1144
1203
  if (hasAsyncCases) {
1145
1204
  return /* @__PURE__ */ React.createElement(AsyncEntitySwitch, {
1146
1205
  results
@@ -1151,15 +1210,17 @@ const EntitySwitch = (props) => {
1151
1210
  function AsyncEntitySwitch({ results }) {
1152
1211
  const { loading, value } = useAsync(async () => {
1153
1212
  var _a;
1154
- const promises = results.map(async ({ if: condition, children: output }) => {
1155
- try {
1156
- if (await condition) {
1157
- return output;
1213
+ const promises = results.map(
1214
+ async ({ if: condition, children: output }) => {
1215
+ try {
1216
+ if (await condition) {
1217
+ return output;
1218
+ }
1219
+ } catch {
1158
1220
  }
1159
- } catch {
1221
+ return null;
1160
1222
  }
1161
- return null;
1162
- });
1223
+ );
1163
1224
  return (_a = (await Promise.all(promises)).find(Boolean)) != null ? _a : null;
1164
1225
  }, [results]);
1165
1226
  if (loading || !value) {
@@ -1170,7 +1231,9 @@ function AsyncEntitySwitch({ results }) {
1170
1231
  EntitySwitch.Case = EntitySwitchCaseComponent;
1171
1232
 
1172
1233
  function strCmp(a, b) {
1173
- return Boolean(a && (a == null ? void 0 : a.toLocaleLowerCase("en-US")) === (b == null ? void 0 : b.toLocaleLowerCase("en-US")));
1234
+ return Boolean(
1235
+ a && (a == null ? void 0 : a.toLocaleLowerCase("en-US")) === (b == null ? void 0 : b.toLocaleLowerCase("en-US"))
1236
+ );
1174
1237
  }
1175
1238
  function strCmpAll(value, cmpValues) {
1176
1239
  return typeof cmpValues === "string" ? strCmp(value, cmpValues) : cmpValues.some((cmpVal) => strCmp(value, cmpVal));
@@ -1222,78 +1285,118 @@ const catalogPlugin = createPlugin({
1222
1285
  externalRoutes: {
1223
1286
  createComponent: createComponentRouteRef,
1224
1287
  viewTechDoc: viewTechDocRouteRef
1288
+ },
1289
+ __experimentalConfigure(options) {
1290
+ const defaultOptions = {
1291
+ createButtonTitle: "Create"
1292
+ };
1293
+ return { ...defaultOptions, ...options };
1225
1294
  }
1226
1295
  });
1227
- const CatalogIndexPage = catalogPlugin.provide(createRoutableExtension({
1228
- name: "CatalogIndexPage",
1229
- component: () => import('./index-1a954f75.esm.js').then((m) => m.CatalogPage),
1230
- mountPoint: rootRouteRef
1231
- }));
1232
- const CatalogEntityPage = catalogPlugin.provide(createRoutableExtension({
1233
- name: "CatalogEntityPage",
1234
- component: () => import('./index-4e6adb42.esm.js').then((m) => m.CatalogEntityPage),
1235
- mountPoint: entityRouteRef
1236
- }));
1237
- const EntityAboutCard = catalogPlugin.provide(createComponentExtension({
1238
- name: "EntityAboutCard",
1239
- component: {
1240
- lazy: () => import('./index-10cb0abb.esm.js').then((m) => m.AboutCard)
1241
- }
1242
- }));
1243
- const EntityLinksCard = catalogPlugin.provide(createComponentExtension({
1244
- name: "EntityLinksCard",
1245
- component: {
1246
- lazy: () => import('./index-c6279600.esm.js').then((m) => m.EntityLinksCard)
1247
- }
1248
- }));
1249
- const EntityHasSystemsCard = catalogPlugin.provide(createComponentExtension({
1250
- name: "EntityHasSystemsCard",
1251
- component: {
1252
- lazy: () => import('./index-3763491b.esm.js').then((m) => m.HasSystemsCard)
1253
- }
1254
- }));
1255
- const EntityHasComponentsCard = catalogPlugin.provide(createComponentExtension({
1256
- name: "EntityHasComponentsCard",
1257
- component: {
1258
- lazy: () => import('./index-acb3cf04.esm.js').then((m) => m.HasComponentsCard)
1259
- }
1260
- }));
1261
- const EntityHasSubcomponentsCard = catalogPlugin.provide(createComponentExtension({
1262
- name: "EntityHasSubcomponentsCard",
1263
- component: {
1264
- lazy: () => import('./index-41ab53b6.esm.js').then((m) => m.HasSubcomponentsCard)
1265
- }
1266
- }));
1267
- const EntityHasResourcesCard = catalogPlugin.provide(createComponentExtension({
1268
- name: "EntityHasResourcesCard",
1269
- component: {
1270
- lazy: () => import('./index-b3ad464b.esm.js').then((m) => m.HasResourcesCard)
1271
- }
1272
- }));
1273
- const EntityDependsOnComponentsCard = catalogPlugin.provide(createComponentExtension({
1274
- name: "EntityDependsOnComponentsCard",
1275
- component: {
1276
- lazy: () => import('./index-66fdb6ad.esm.js').then((m) => m.DependsOnComponentsCard)
1277
- }
1278
- }));
1279
- const EntityDependencyOfComponentsCard = catalogPlugin.provide(createComponentExtension({
1280
- name: "EntityDependencyOfComponentsCard",
1281
- component: {
1282
- lazy: () => import('./index-390fab14.esm.js').then((m) => m.DependencyOfComponentsCard)
1283
- }
1284
- }));
1285
- const EntityDependsOnResourcesCard = catalogPlugin.provide(createComponentExtension({
1286
- name: "EntityDependsOnResourcesCard",
1287
- component: {
1288
- lazy: () => import('./index-d41abbff.esm.js').then((m) => m.DependsOnResourcesCard)
1289
- }
1290
- }));
1291
- const RelatedEntitiesCard = catalogPlugin.provide(createComponentExtension({
1292
- name: "RelatedEntitiesCard",
1293
- component: {
1294
- lazy: () => import('./index-c2914273.esm.js').then((m) => m.RelatedEntitiesCard)
1295
- }
1296
- }));
1296
+ const CatalogIndexPage = catalogPlugin.provide(
1297
+ createRoutableExtension({
1298
+ name: "CatalogIndexPage",
1299
+ component: () => import('./index-80f70ef8.esm.js').then((m) => m.CatalogPage),
1300
+ mountPoint: rootRouteRef
1301
+ })
1302
+ );
1303
+ const CatalogEntityPage = catalogPlugin.provide(
1304
+ createRoutableExtension({
1305
+ name: "CatalogEntityPage",
1306
+ component: () => import('./index-46417657.esm.js').then((m) => m.CatalogEntityPage),
1307
+ mountPoint: entityRouteRef
1308
+ })
1309
+ );
1310
+ const EntityAboutCard = catalogPlugin.provide(
1311
+ createComponentExtension({
1312
+ name: "EntityAboutCard",
1313
+ component: {
1314
+ lazy: () => import('./index-c4f1c4b9.esm.js').then((m) => m.AboutCard)
1315
+ }
1316
+ })
1317
+ );
1318
+ const EntityLinksCard = catalogPlugin.provide(
1319
+ createComponentExtension({
1320
+ name: "EntityLinksCard",
1321
+ component: {
1322
+ lazy: () => import('./index-8f06513a.esm.js').then((m) => m.EntityLinksCard)
1323
+ }
1324
+ })
1325
+ );
1326
+ const EntityHasSystemsCard = catalogPlugin.provide(
1327
+ createComponentExtension({
1328
+ name: "EntityHasSystemsCard",
1329
+ component: {
1330
+ lazy: () => import('./index-3763491b.esm.js').then((m) => m.HasSystemsCard)
1331
+ }
1332
+ })
1333
+ );
1334
+ const EntityHasComponentsCard = catalogPlugin.provide(
1335
+ createComponentExtension({
1336
+ name: "EntityHasComponentsCard",
1337
+ component: {
1338
+ lazy: () => import('./index-acb3cf04.esm.js').then((m) => m.HasComponentsCard)
1339
+ }
1340
+ })
1341
+ );
1342
+ const EntityHasSubcomponentsCard = catalogPlugin.provide(
1343
+ createComponentExtension({
1344
+ name: "EntityHasSubcomponentsCard",
1345
+ component: {
1346
+ lazy: () => import('./index-41ab53b6.esm.js').then(
1347
+ (m) => m.HasSubcomponentsCard
1348
+ )
1349
+ }
1350
+ })
1351
+ );
1352
+ const EntityHasResourcesCard = catalogPlugin.provide(
1353
+ createComponentExtension({
1354
+ name: "EntityHasResourcesCard",
1355
+ component: {
1356
+ lazy: () => import('./index-b3ad464b.esm.js').then((m) => m.HasResourcesCard)
1357
+ }
1358
+ })
1359
+ );
1360
+ const EntityDependsOnComponentsCard = catalogPlugin.provide(
1361
+ createComponentExtension({
1362
+ name: "EntityDependsOnComponentsCard",
1363
+ component: {
1364
+ lazy: () => import('./index-66fdb6ad.esm.js').then(
1365
+ (m) => m.DependsOnComponentsCard
1366
+ )
1367
+ }
1368
+ })
1369
+ );
1370
+ const EntityDependencyOfComponentsCard = catalogPlugin.provide(
1371
+ createComponentExtension({
1372
+ name: "EntityDependencyOfComponentsCard",
1373
+ component: {
1374
+ lazy: () => import('./index-390fab14.esm.js').then(
1375
+ (m) => m.DependencyOfComponentsCard
1376
+ )
1377
+ }
1378
+ })
1379
+ );
1380
+ const EntityDependsOnResourcesCard = catalogPlugin.provide(
1381
+ createComponentExtension({
1382
+ name: "EntityDependsOnResourcesCard",
1383
+ component: {
1384
+ lazy: () => import('./index-d41abbff.esm.js').then(
1385
+ (m) => m.DependsOnResourcesCard
1386
+ )
1387
+ }
1388
+ })
1389
+ );
1390
+ const RelatedEntitiesCard = catalogPlugin.provide(
1391
+ createComponentExtension({
1392
+ name: "RelatedEntitiesCard",
1393
+ component: {
1394
+ lazy: () => import('./index-c2914273.esm.js').then(
1395
+ (m) => m.RelatedEntitiesCard
1396
+ )
1397
+ }
1398
+ })
1399
+ );
1297
1400
 
1298
1401
  export { AboutCard as A, EntityListContainer as B, CatalogKindHeader as C, DefaultStarredEntitiesApi as D, EntityAboutCard as E, FilteredEntityLayout as F, LinksGridList as L, RelatedEntitiesCard as R, CatalogTable as a, AboutContent as b, createComponentRouteRef as c, AboutField as d, CatalogEntityPage as e, CatalogIndexPage as f, catalogPlugin as g, EntityDependencyOfComponentsCard as h, EntityDependsOnComponentsCard as i, EntityDependsOnResourcesCard as j, EntityHasComponentsCard as k, EntityHasResourcesCard as l, EntityHasSubcomponentsCard as m, EntityHasSystemsCard as n, EntityLinksCard as o, CatalogSearchResultListItem as p, EntityLayout as q, EntityOrphanWarning as r, isOrphan as s, EntityProcessingErrorsPanel as t, hasCatalogProcessingErrors as u, EntitySwitch as v, isKind as w, isNamespace as x, isComponentType as y, FilterContainer as z };
1299
- //# sourceMappingURL=index-b0b0b077.esm.js.map
1402
+ //# sourceMappingURL=index-7ef647a6.esm.js.map