@backstage/plugin-catalog 1.4.0 → 1.5.0-next.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 CHANGED
@@ -1,5 +1,30 @@
1
1
  # @backstage/plugin-catalog
2
2
 
3
+ ## 1.5.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 80da5162c7: Plugin catalog has been modified to use an experimental feature where you can customize the title of the create button.
8
+
9
+ You can modify it by doing:
10
+
11
+ ```typescript jsx
12
+ import { catalogPlugin } from '@backstage/plugin-catalog';
13
+
14
+ catalogPlugin.__experimentalReconfigure({
15
+ createButtonTitle: 'New',
16
+ });
17
+ ```
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+ - @backstage/core-plugin-api@1.0.5-next.0
23
+ - @backstage/integration-react@1.1.3-next.0
24
+ - @backstage/plugin-catalog-react@1.1.3-next.0
25
+ - @backstage/core-components@0.10.1-next.0
26
+ - @backstage/plugin-search-react@1.0.1-next.0
27
+
3
28
  ## 1.4.0
4
29
 
5
30
  ### Minor Changes
@@ -3,7 +3,7 @@ import LanguageIcon from '@material-ui/icons/Language';
3
3
  import React from 'react';
4
4
  import { makeStyles, Typography, Button } from '@material-ui/core';
5
5
  import { CodeSnippet, InfoCard } from '@backstage/core-components';
6
- import { L as LinksGridList } from './index-b0b0b077.esm.js';
6
+ import { L as LinksGridList } from './index-2bfd6ae7.esm.js';
7
7
  import { useApp } from '@backstage/core-plugin-api';
8
8
  import 'zen-observable';
9
9
  import '@backstage/catalog-model';
@@ -33,13 +33,16 @@ const ENTITY_YAML = `metadata:
33
33
  - url: https://dashboard.example.com
34
34
  title: My Dashboard
35
35
  icon: dashboard`;
36
- const useStyles = makeStyles((theme) => ({
37
- code: {
38
- borderRadius: 6,
39
- margin: `${theme.spacing(2)}px 0px`,
40
- background: theme.palette.type === "dark" ? "#444" : "#fff"
41
- }
42
- }), { name: "PluginCatalogEntityLinksEmptyState" });
36
+ const useStyles = makeStyles(
37
+ (theme) => ({
38
+ code: {
39
+ borderRadius: 6,
40
+ margin: `${theme.spacing(2)}px 0px`,
41
+ background: theme.palette.type === "dark" ? "#444" : "#fff"
42
+ }
43
+ }),
44
+ { name: "PluginCatalogEntityLinksEmptyState" }
45
+ );
43
46
  function EntityLinksEmptyState() {
44
47
  const classes = useStyles();
45
48
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, {
@@ -84,4 +87,4 @@ function EntityLinksCard(props) {
84
87
  }
85
88
 
86
89
  export { EntityLinksCard };
87
- //# sourceMappingURL=index-c6279600.esm.js.map
90
+ //# sourceMappingURL=index-0550248f.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-c6279600.esm.js","sources":["../../src/components/EntityLinksCard/EntityLinksEmptyState.tsx","../../src/components/EntityLinksCard/EntityLinksCard.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 { BackstageTheme } from '@backstage/theme';\nimport { Button, makeStyles, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `metadata:\n name: example\n links:\n - url: https://dashboard.example.com\n title: My Dashboard\n icon: dashboard`;\n\n/** @public */\nexport type EntityLinksEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles<BackstageTheme>(\n theme => ({\n code: {\n borderRadius: 6,\n margin: `${theme.spacing(2)}px 0px`,\n background: theme.palette.type === 'dark' ? '#444' : '#fff',\n },\n }),\n { name: 'PluginCatalogEntityLinksEmptyState' },\n);\n\nexport function EntityLinksEmptyState() {\n const classes = useStyles();\n\n return (\n <>\n <Typography variant=\"body1\">\n No links defined for this entity. You can add links to your entity YAML\n as shown in the highlighted example below:\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional\"\n >\n Read more\n </Button>\n </>\n );\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 { useEntity } from '@backstage/plugin-catalog-react';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { EntityLinksEmptyState } from './EntityLinksEmptyState';\nimport { LinksGridList } from './LinksGridList';\nimport { ColumnBreakpoints } from './types';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport { InfoCard, InfoCardVariants } from '@backstage/core-components';\n\n/** @public */\nexport interface EntityLinksCardProps {\n cols?: ColumnBreakpoints | number;\n variant?: InfoCardVariants;\n}\n\nexport function EntityLinksCard(props: EntityLinksCardProps) {\n const { cols = undefined, variant } = props;\n const { entity } = useEntity();\n const app = useApp();\n\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n const links = entity?.metadata?.links;\n\n return (\n <InfoCard title=\"Links\" variant={variant}>\n {!links || links.length === 0 ? (\n <EntityLinksEmptyState />\n ) : (\n <LinksGridList\n cols={cols}\n items={links.map(({ url, title, icon }) => ({\n text: title ?? url,\n href: url,\n Icon: iconResolver(icon),\n }))}\n />\n )}\n </InfoCard>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM,WAAW,GAAG,CAAC;AACrB;AACA;AACA;AACA;AACA,qBAAqB,CAAC,CAAC;AACvB,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,KAAK,MAAM;AACzC,EAAE,IAAI,EAAE;AACR,IAAI,YAAY,EAAE,CAAC;AACnB,IAAI,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AACvC,IAAI,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,GAAG,MAAM,GAAG,MAAM;AAC/D,GAAG;AACH,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,oCAAoC,EAAE,CAAC,CAAC;AAC7C,SAAS,qBAAqB,GAAG;AACxC,EAAE,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;AAC9B,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,kBAAkB,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE;AACnH,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG,EAAE,oHAAoH,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE;AACvK,IAAI,SAAS,EAAE,OAAO,CAAC,IAAI;AAC3B,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,WAAW,EAAE;AACtD,IAAI,IAAI,EAAE,WAAW;AACrB,IAAI,QAAQ,EAAE,MAAM;AACpB,IAAI,eAAe,EAAE,IAAI;AACzB,IAAI,kBAAkB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACpC,IAAI,WAAW,EAAE,EA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AAE;AAC1J,IAAI,IAAI;AACR,IAAI,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM;AAChD,MAAM,IAAI,EAAE,KAAK,IAAI,IAAI,GAAG,KAAK,GAAG,GAAG;AACvC,MAAM,IAAI,EAAE,GAAG;AACf,MAAM,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC;AAC9B,KAAK,CAAC,CAAC;AACP,GAAG,CAAC,CAAC,CAAC;AACN;;;;"}
1
+ {"version":3,"file":"index-0550248f.esm.js","sources":["../../src/components/EntityLinksCard/EntityLinksEmptyState.tsx","../../src/components/EntityLinksCard/EntityLinksCard.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 { BackstageTheme } from '@backstage/theme';\nimport { Button, makeStyles, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `metadata:\n name: example\n links:\n - url: https://dashboard.example.com\n title: My Dashboard\n icon: dashboard`;\n\n/** @public */\nexport type EntityLinksEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles<BackstageTheme>(\n theme => ({\n code: {\n borderRadius: 6,\n margin: `${theme.spacing(2)}px 0px`,\n background: theme.palette.type === 'dark' ? '#444' : '#fff',\n },\n }),\n { name: 'PluginCatalogEntityLinksEmptyState' },\n);\n\nexport function EntityLinksEmptyState() {\n const classes = useStyles();\n\n return (\n <>\n <Typography variant=\"body1\">\n No links defined for this entity. You can add links to your entity YAML\n as shown in the highlighted example below:\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional\"\n >\n Read more\n </Button>\n </>\n );\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 { useEntity } from '@backstage/plugin-catalog-react';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { EntityLinksEmptyState } from './EntityLinksEmptyState';\nimport { LinksGridList } from './LinksGridList';\nimport { ColumnBreakpoints } from './types';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport { InfoCard, InfoCardVariants } from '@backstage/core-components';\n\n/** @public */\nexport interface EntityLinksCardProps {\n cols?: ColumnBreakpoints | number;\n variant?: InfoCardVariants;\n}\n\nexport function EntityLinksCard(props: EntityLinksCardProps) {\n const { cols = undefined, variant } = props;\n const { entity } = useEntity();\n const app = useApp();\n\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n const links = entity?.metadata?.links;\n\n return (\n <InfoCard title=\"Links\" variant={variant}>\n {!links || links.length === 0 ? (\n <EntityLinksEmptyState />\n ) : (\n <LinksGridList\n cols={cols}\n items={links.map(({ url, title, icon }) => ({\n text: title ?? url,\n href: url,\n Icon: iconResolver(icon),\n }))}\n />\n )}\n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AE,IAAI,EAAE,MAAM;AAChD,MAAM,IAAI,EAAE,KAAK,IAAI,IAAI,GAAG,KAAK,GAAG,GAAG;AACvC,MAAM,IAAI,EAAE,GAAG;AACf,MAAM,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC;AAC9B,KAAK,CAAC,CAAC;AACP,GAAG,CAAC,CAAC,CAAC;AACN;;;;"}
@@ -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;
@@ -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
  };
@@ -796,13 +831,16 @@ function UnregisterEntity(props) {
796
831
  return /* @__PURE__ */ React.createElement(React.Fragment, null, unregisterButton);
797
832
  }
798
833
 
799
- const useStyles = makeStyles$1((theme) => {
800
- return {
801
- button: {
802
- color: theme.page.fontColor
803
- }
804
- };
805
- }, { name: "PluginCatalogEntityContextMenu" });
834
+ const useStyles = makeStyles$1(
835
+ (theme) => {
836
+ return {
837
+ button: {
838
+ color: theme.page.fontColor
839
+ }
840
+ };
841
+ },
842
+ { name: "PluginCatalogEntityContextMenu" }
843
+ );
806
844
  function EntityContextMenu(props) {
807
845
  const {
808
846
  UNSTABLE_extraContextMenuItems,
@@ -812,7 +850,9 @@ function EntityContextMenu(props) {
812
850
  } = props;
813
851
  const [anchorEl, setAnchorEl] = useState();
814
852
  const classes = useStyles();
815
- const unregisterPermission = useEntityPermission(catalogEntityDeletePermission);
853
+ const unregisterPermission = useEntityPermission(
854
+ catalogEntityDeletePermission
855
+ );
816
856
  const isAllowed = unregisterPermission.allowed;
817
857
  const onOpen = (event) => {
818
858
  setAnchorEl(event.currentTarget);
@@ -934,25 +974,34 @@ const EntityLayout = (props) => {
934
974
  const { kind, namespace, name } = useRouteRefParams(entityRouteRef);
935
975
  const { entity, loading, error } = useAsyncEntity();
936
976
  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
977
+ const routes = useElementFilter(
978
+ children,
979
+ (elements) => elements.selectByComponentData({
980
+ key: dataKey,
981
+ withStrictError: "Child of EntityLayout must be an EntityLayout.Route"
982
+ }).getElements().flatMap(({ props: elementProps }) => {
983
+ if (!entity) {
984
+ return [];
985
+ } else if (elementProps.if && !elementProps.if(entity)) {
986
+ return [];
952
987
  }
953
- ];
954
- }), [entity]);
955
- const { headerTitle, headerType } = headerProps(kind, namespace, name, entity);
988
+ return [
989
+ {
990
+ path: elementProps.path,
991
+ title: elementProps.title,
992
+ children: elementProps.children,
993
+ tabProps: elementProps.tabProps
994
+ }
995
+ ];
996
+ }),
997
+ [entity]
998
+ );
999
+ const { headerTitle, headerType } = headerProps(
1000
+ kind,
1001
+ namespace,
1002
+ name,
1003
+ entity
1004
+ );
956
1005
  const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);
957
1006
  const [inspectionDialogOpen, setInspectionDialogOpen] = useState(false);
958
1007
  const navigate = useNavigate();
@@ -1076,7 +1125,10 @@ async function hasCatalogProcessingErrors(entity, context) {
1076
1125
  if (!catalogApi) {
1077
1126
  throw new Error(`No implementation available for ${catalogApiRef}`);
1078
1127
  }
1079
- const errors = await getOwnAndAncestorsErrors(stringifyEntityRef(entity), catalogApi);
1128
+ const errors = await getOwnAndAncestorsErrors(
1129
+ stringifyEntityRef(entity),
1130
+ catalogApi
1131
+ );
1080
1132
  return errors.items.length > 0;
1081
1133
  }
1082
1134
  function EntityProcessingErrorsPanel() {
@@ -1116,31 +1168,37 @@ const EntitySwitch = (props) => {
1116
1168
  var _a, _b;
1117
1169
  const { entity, loading } = useAsyncEntity();
1118
1170
  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) {
1171
+ const results = useElementFilter(
1172
+ props.children,
1173
+ (collection) => collection.selectByComponentData({
1174
+ key: ENTITY_SWITCH_KEY,
1175
+ withStrictError: "Child of EntitySwitch is not an EntitySwitch.Case"
1176
+ }).getElements().flatMap((element) => {
1177
+ var _a2;
1178
+ if (loading) {
1179
+ return [];
1180
+ }
1181
+ const { if: condition, children: elementsChildren } = element.props;
1182
+ if (!entity) {
1183
+ return [
1184
+ {
1185
+ if: condition === void 0,
1186
+ children: elementsChildren
1187
+ }
1188
+ ];
1189
+ }
1129
1190
  return [
1130
1191
  {
1131
- if: condition === void 0,
1192
+ if: (_a2 = condition == null ? void 0 : condition(entity, { apis })) != null ? _a2 : true,
1132
1193
  children: elementsChildren
1133
1194
  }
1134
1195
  ];
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);
1196
+ }),
1197
+ [apis, entity, loading]
1198
+ );
1199
+ const hasAsyncCases = results.some(
1200
+ (r) => typeof r.if === "object" && "then" in r.if
1201
+ );
1144
1202
  if (hasAsyncCases) {
1145
1203
  return /* @__PURE__ */ React.createElement(AsyncEntitySwitch, {
1146
1204
  results
@@ -1151,15 +1209,17 @@ const EntitySwitch = (props) => {
1151
1209
  function AsyncEntitySwitch({ results }) {
1152
1210
  const { loading, value } = useAsync(async () => {
1153
1211
  var _a;
1154
- const promises = results.map(async ({ if: condition, children: output }) => {
1155
- try {
1156
- if (await condition) {
1157
- return output;
1212
+ const promises = results.map(
1213
+ async ({ if: condition, children: output }) => {
1214
+ try {
1215
+ if (await condition) {
1216
+ return output;
1217
+ }
1218
+ } catch {
1158
1219
  }
1159
- } catch {
1220
+ return null;
1160
1221
  }
1161
- return null;
1162
- });
1222
+ );
1163
1223
  return (_a = (await Promise.all(promises)).find(Boolean)) != null ? _a : null;
1164
1224
  }, [results]);
1165
1225
  if (loading || !value) {
@@ -1170,7 +1230,9 @@ function AsyncEntitySwitch({ results }) {
1170
1230
  EntitySwitch.Case = EntitySwitchCaseComponent;
1171
1231
 
1172
1232
  function strCmp(a, b) {
1173
- return Boolean(a && (a == null ? void 0 : a.toLocaleLowerCase("en-US")) === (b == null ? void 0 : b.toLocaleLowerCase("en-US")));
1233
+ return Boolean(
1234
+ a && (a == null ? void 0 : a.toLocaleLowerCase("en-US")) === (b == null ? void 0 : b.toLocaleLowerCase("en-US"))
1235
+ );
1174
1236
  }
1175
1237
  function strCmpAll(value, cmpValues) {
1176
1238
  return typeof cmpValues === "string" ? strCmp(value, cmpValues) : cmpValues.some((cmpVal) => strCmp(value, cmpVal));
@@ -1222,78 +1284,118 @@ const catalogPlugin = createPlugin({
1222
1284
  externalRoutes: {
1223
1285
  createComponent: createComponentRouteRef,
1224
1286
  viewTechDoc: viewTechDocRouteRef
1287
+ },
1288
+ __experimentalConfigure(options) {
1289
+ const defaultOptions = {
1290
+ createButtonTitle: "Create"
1291
+ };
1292
+ return { ...defaultOptions, ...options };
1225
1293
  }
1226
1294
  });
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
- }));
1295
+ const CatalogIndexPage = catalogPlugin.provide(
1296
+ createRoutableExtension({
1297
+ name: "CatalogIndexPage",
1298
+ component: () => import('./index-543b1d23.esm.js').then((m) => m.CatalogPage),
1299
+ mountPoint: rootRouteRef
1300
+ })
1301
+ );
1302
+ const CatalogEntityPage = catalogPlugin.provide(
1303
+ createRoutableExtension({
1304
+ name: "CatalogEntityPage",
1305
+ component: () => import('./index-46417657.esm.js').then((m) => m.CatalogEntityPage),
1306
+ mountPoint: entityRouteRef
1307
+ })
1308
+ );
1309
+ const EntityAboutCard = catalogPlugin.provide(
1310
+ createComponentExtension({
1311
+ name: "EntityAboutCard",
1312
+ component: {
1313
+ lazy: () => import('./index-9cdebd35.esm.js').then((m) => m.AboutCard)
1314
+ }
1315
+ })
1316
+ );
1317
+ const EntityLinksCard = catalogPlugin.provide(
1318
+ createComponentExtension({
1319
+ name: "EntityLinksCard",
1320
+ component: {
1321
+ lazy: () => import('./index-0550248f.esm.js').then((m) => m.EntityLinksCard)
1322
+ }
1323
+ })
1324
+ );
1325
+ const EntityHasSystemsCard = catalogPlugin.provide(
1326
+ createComponentExtension({
1327
+ name: "EntityHasSystemsCard",
1328
+ component: {
1329
+ lazy: () => import('./index-3763491b.esm.js').then((m) => m.HasSystemsCard)
1330
+ }
1331
+ })
1332
+ );
1333
+ const EntityHasComponentsCard = catalogPlugin.provide(
1334
+ createComponentExtension({
1335
+ name: "EntityHasComponentsCard",
1336
+ component: {
1337
+ lazy: () => import('./index-acb3cf04.esm.js').then((m) => m.HasComponentsCard)
1338
+ }
1339
+ })
1340
+ );
1341
+ const EntityHasSubcomponentsCard = catalogPlugin.provide(
1342
+ createComponentExtension({
1343
+ name: "EntityHasSubcomponentsCard",
1344
+ component: {
1345
+ lazy: () => import('./index-41ab53b6.esm.js').then(
1346
+ (m) => m.HasSubcomponentsCard
1347
+ )
1348
+ }
1349
+ })
1350
+ );
1351
+ const EntityHasResourcesCard = catalogPlugin.provide(
1352
+ createComponentExtension({
1353
+ name: "EntityHasResourcesCard",
1354
+ component: {
1355
+ lazy: () => import('./index-b3ad464b.esm.js').then((m) => m.HasResourcesCard)
1356
+ }
1357
+ })
1358
+ );
1359
+ const EntityDependsOnComponentsCard = catalogPlugin.provide(
1360
+ createComponentExtension({
1361
+ name: "EntityDependsOnComponentsCard",
1362
+ component: {
1363
+ lazy: () => import('./index-66fdb6ad.esm.js').then(
1364
+ (m) => m.DependsOnComponentsCard
1365
+ )
1366
+ }
1367
+ })
1368
+ );
1369
+ const EntityDependencyOfComponentsCard = catalogPlugin.provide(
1370
+ createComponentExtension({
1371
+ name: "EntityDependencyOfComponentsCard",
1372
+ component: {
1373
+ lazy: () => import('./index-390fab14.esm.js').then(
1374
+ (m) => m.DependencyOfComponentsCard
1375
+ )
1376
+ }
1377
+ })
1378
+ );
1379
+ const EntityDependsOnResourcesCard = catalogPlugin.provide(
1380
+ createComponentExtension({
1381
+ name: "EntityDependsOnResourcesCard",
1382
+ component: {
1383
+ lazy: () => import('./index-d41abbff.esm.js').then(
1384
+ (m) => m.DependsOnResourcesCard
1385
+ )
1386
+ }
1387
+ })
1388
+ );
1389
+ const RelatedEntitiesCard = catalogPlugin.provide(
1390
+ createComponentExtension({
1391
+ name: "RelatedEntitiesCard",
1392
+ component: {
1393
+ lazy: () => import('./index-c2914273.esm.js').then(
1394
+ (m) => m.RelatedEntitiesCard
1395
+ )
1396
+ }
1397
+ })
1398
+ );
1297
1399
 
1298
1400
  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
1401
+ //# sourceMappingURL=index-2bfd6ae7.esm.js.map