@techdocs/cli 1.8.17-next.1 → 1.8.17-next.3

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.
Files changed (126) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/embedded-app/.config-schema.json +201 -126
  3. package/dist/embedded-app/index.html +1 -1
  4. package/dist/embedded-app/static/124.7c4c81f4.chunk.js +6 -0
  5. package/dist/embedded-app/static/124.7c4c81f4.chunk.js.map +1 -0
  6. package/dist/embedded-app/static/{1297.f8916d08.chunk.js → 1297.b4799570.chunk.js} +3 -3
  7. package/dist/embedded-app/static/1297.b4799570.chunk.js.map +1 -0
  8. package/dist/embedded-app/static/1902.6f404f8c.chunk.js +10 -0
  9. package/dist/embedded-app/static/1902.6f404f8c.chunk.js.map +1 -0
  10. package/dist/embedded-app/static/2401.14631655.chunk.js +6 -0
  11. package/dist/embedded-app/static/2401.14631655.chunk.js.map +1 -0
  12. package/dist/embedded-app/static/2420.1bc102de.chunk.js +6 -0
  13. package/dist/embedded-app/static/2420.1bc102de.chunk.js.map +1 -0
  14. package/dist/embedded-app/static/287.961ccb08.chunk.js +6 -0
  15. package/dist/embedded-app/static/287.961ccb08.chunk.js.map +1 -0
  16. package/dist/embedded-app/static/3182.3cbe56e4.chunk.js +7 -0
  17. package/dist/embedded-app/static/3182.3cbe56e4.chunk.js.map +1 -0
  18. package/dist/embedded-app/static/3632.681a005c.chunk.js +6 -0
  19. package/dist/embedded-app/static/3632.681a005c.chunk.js.map +1 -0
  20. package/dist/embedded-app/static/3720.1978cecb.chunk.js +11 -0
  21. package/dist/embedded-app/static/3720.1978cecb.chunk.js.map +1 -0
  22. package/dist/embedded-app/static/4036.32efab46.chunk.js +3 -0
  23. package/dist/embedded-app/static/4036.32efab46.chunk.js.map +1 -0
  24. package/dist/embedded-app/static/4487.f9cc6633.chunk.js +3 -0
  25. package/dist/embedded-app/static/4487.f9cc6633.chunk.js.map +1 -0
  26. package/dist/embedded-app/static/4516.b1a92d53.chunk.js +3 -0
  27. package/dist/embedded-app/static/4516.b1a92d53.chunk.js.map +1 -0
  28. package/dist/embedded-app/static/4919.e2124196.chunk.js +3 -0
  29. package/dist/embedded-app/static/4919.e2124196.chunk.js.map +1 -0
  30. package/dist/embedded-app/static/5724.8c459ffd.chunk.js +4 -0
  31. package/dist/embedded-app/static/5724.8c459ffd.chunk.js.map +1 -0
  32. package/dist/embedded-app/static/6271.d5297b21.chunk.js +6 -0
  33. package/dist/embedded-app/static/6271.d5297b21.chunk.js.map +1 -0
  34. package/dist/embedded-app/static/6415.3f0e01a6.chunk.js +6 -0
  35. package/dist/embedded-app/static/6415.3f0e01a6.chunk.js.map +1 -0
  36. package/dist/embedded-app/static/8307.fd2c3bf0.chunk.js +9 -0
  37. package/dist/embedded-app/static/8307.fd2c3bf0.chunk.js.map +1 -0
  38. package/dist/embedded-app/static/8384.bfea9665.chunk.js +6 -0
  39. package/dist/embedded-app/static/8384.bfea9665.chunk.js.map +1 -0
  40. package/dist/embedded-app/static/898.b3655147.chunk.js +4 -0
  41. package/dist/embedded-app/static/898.b3655147.chunk.js.map +1 -0
  42. package/dist/embedded-app/static/{9234.ac5ee4d5.chunk.js → 9234.ad94610e.chunk.js} +2 -2
  43. package/dist/embedded-app/static/{9234.ac5ee4d5.chunk.js.map → 9234.ad94610e.chunk.js.map} +1 -1
  44. package/dist/embedded-app/static/9605.92f660fa.chunk.js +11 -0
  45. package/dist/embedded-app/static/9605.92f660fa.chunk.js.map +1 -0
  46. package/dist/embedded-app/static/9652.aec21fe8.chunk.js +6 -0
  47. package/dist/embedded-app/static/9652.aec21fe8.chunk.js.map +1 -0
  48. package/dist/embedded-app/static/main.3d49bafb.js +509 -0
  49. package/dist/embedded-app/static/main.3d49bafb.js.map +1 -0
  50. package/dist/embedded-app/static/{module-material-table.60f080a9.js → module-material-table.e3f26578.js} +2 -2
  51. package/dist/embedded-app/static/{module-material-table.60f080a9.js.map → module-material-table.e3f26578.js.map} +1 -1
  52. package/dist/embedded-app/static/module-material-ui.f1846a3c.js +24 -0
  53. package/dist/embedded-app/static/module-material-ui.f1846a3c.js.map +1 -0
  54. package/dist/embedded-app/static/module-react-router-dom.0c2bb614.js +23 -0
  55. package/dist/embedded-app/static/module-react-router-dom.0c2bb614.js.map +1 -0
  56. package/dist/embedded-app/static/module-react-router.dac764ce.js +23 -0
  57. package/dist/embedded-app/static/module-react-router.dac764ce.js.map +1 -0
  58. package/dist/embedded-app/static/module-zod.9a0df421.js +3 -0
  59. package/dist/embedded-app/static/{module-zod.18508a39.js.map → module-zod.9a0df421.js.map} +1 -1
  60. package/dist/embedded-app/static/{react-syntax-highlighter_languages_highlight_lisp.4a81e0ae.chunk.js → react-syntax-highlighter_languages_highlight_lisp.e1c07c6d.chunk.js} +2 -2
  61. package/dist/embedded-app/static/{react-syntax-highlighter_languages_highlight_lisp.4a81e0ae.chunk.js.map → react-syntax-highlighter_languages_highlight_lisp.e1c07c6d.chunk.js.map} +1 -1
  62. package/dist/embedded-app/static/{runtime.e9838633.js → runtime.3d49bafb.js} +2 -2
  63. package/dist/embedded-app/static/runtime.3d49bafb.js.map +1 -0
  64. package/dist/embedded-app/static/vendor.3d49bafb.js +155 -0
  65. package/dist/embedded-app/static/vendor.3d49bafb.js.map +1 -0
  66. package/dist/index.cjs.js +1 -1
  67. package/package.json +5 -5
  68. package/dist/embedded-app/static/124.5ba6885f.chunk.js +0 -6
  69. package/dist/embedded-app/static/124.5ba6885f.chunk.js.map +0 -1
  70. package/dist/embedded-app/static/1297.f8916d08.chunk.js.map +0 -1
  71. package/dist/embedded-app/static/2401.d309433f.chunk.js +0 -6
  72. package/dist/embedded-app/static/2401.d309433f.chunk.js.map +0 -1
  73. package/dist/embedded-app/static/2420.037cfc15.chunk.js +0 -6
  74. package/dist/embedded-app/static/2420.037cfc15.chunk.js.map +0 -1
  75. package/dist/embedded-app/static/2745.5b1c08b3.chunk.js +0 -6
  76. package/dist/embedded-app/static/2745.5b1c08b3.chunk.js.map +0 -1
  77. package/dist/embedded-app/static/2772.bdf6f4ac.chunk.js +0 -168
  78. package/dist/embedded-app/static/2772.bdf6f4ac.chunk.js.map +0 -1
  79. package/dist/embedded-app/static/287.0d76734a.chunk.js +0 -6
  80. package/dist/embedded-app/static/287.0d76734a.chunk.js.map +0 -1
  81. package/dist/embedded-app/static/3182.690c18de.chunk.js +0 -7
  82. package/dist/embedded-app/static/3182.690c18de.chunk.js.map +0 -1
  83. package/dist/embedded-app/static/3632.c54686af.chunk.js +0 -6
  84. package/dist/embedded-app/static/3632.c54686af.chunk.js.map +0 -1
  85. package/dist/embedded-app/static/4036.6d4f48ee.chunk.js +0 -3
  86. package/dist/embedded-app/static/4036.6d4f48ee.chunk.js.map +0 -1
  87. package/dist/embedded-app/static/4400.74f2ff55.chunk.js +0 -6
  88. package/dist/embedded-app/static/4400.74f2ff55.chunk.js.map +0 -1
  89. package/dist/embedded-app/static/4943.f9ffc89d.chunk.js +0 -4
  90. package/dist/embedded-app/static/4943.f9ffc89d.chunk.js.map +0 -1
  91. package/dist/embedded-app/static/5502.59e5e2d7.chunk.js +0 -3
  92. package/dist/embedded-app/static/5502.59e5e2d7.chunk.js.map +0 -1
  93. package/dist/embedded-app/static/5580.aad136c2.chunk.js +0 -4
  94. package/dist/embedded-app/static/5580.aad136c2.chunk.js.map +0 -1
  95. package/dist/embedded-app/static/6066.c5fcf8d3.chunk.js +0 -3
  96. package/dist/embedded-app/static/6066.c5fcf8d3.chunk.js.map +0 -1
  97. package/dist/embedded-app/static/6271.50d6fc37.chunk.js +0 -6
  98. package/dist/embedded-app/static/6271.50d6fc37.chunk.js.map +0 -1
  99. package/dist/embedded-app/static/6545.2f399250.chunk.js +0 -3
  100. package/dist/embedded-app/static/6545.2f399250.chunk.js.map +0 -1
  101. package/dist/embedded-app/static/7137.9e328e07.chunk.js +0 -3
  102. package/dist/embedded-app/static/7137.9e328e07.chunk.js.map +0 -1
  103. package/dist/embedded-app/static/8307.0cba06d7.chunk.js +0 -9
  104. package/dist/embedded-app/static/8307.0cba06d7.chunk.js.map +0 -1
  105. package/dist/embedded-app/static/8384.e32c3b89.chunk.js +0 -6
  106. package/dist/embedded-app/static/8384.e32c3b89.chunk.js.map +0 -1
  107. package/dist/embedded-app/static/8721.77fdaf76.chunk.js +0 -11
  108. package/dist/embedded-app/static/8721.77fdaf76.chunk.js.map +0 -1
  109. package/dist/embedded-app/static/9605.c3d05fe5.chunk.js +0 -11
  110. package/dist/embedded-app/static/9605.c3d05fe5.chunk.js.map +0 -1
  111. package/dist/embedded-app/static/9652.f79c63a2.chunk.js +0 -6
  112. package/dist/embedded-app/static/9652.f79c63a2.chunk.js.map +0 -1
  113. package/dist/embedded-app/static/9797.047c7087.chunk.js +0 -10
  114. package/dist/embedded-app/static/9797.047c7087.chunk.js.map +0 -1
  115. package/dist/embedded-app/static/main.e9838633.js +0 -513
  116. package/dist/embedded-app/static/main.e9838633.js.map +0 -1
  117. package/dist/embedded-app/static/module-material-ui.b719b7fa.js +0 -24
  118. package/dist/embedded-app/static/module-material-ui.b719b7fa.js.map +0 -1
  119. package/dist/embedded-app/static/module-react-router-dom.473a1e8a.js +0 -22
  120. package/dist/embedded-app/static/module-react-router-dom.473a1e8a.js.map +0 -1
  121. package/dist/embedded-app/static/module-react-router.933956ac.js +0 -22
  122. package/dist/embedded-app/static/module-react-router.933956ac.js.map +0 -1
  123. package/dist/embedded-app/static/module-zod.18508a39.js +0 -3
  124. package/dist/embedded-app/static/runtime.e9838633.js.map +0 -1
  125. package/dist/embedded-app/static/vendor.e9838633.js +0 -155
  126. package/dist/embedded-app/static/vendor.e9838633.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/2745.5b1c08b3.chunk.js","mappings":"oQA4BA,MAAMA,KAAYC,EAAAA,GAChBC,IAAU,CACRC,KAAM,CACJC,WAAY,YACZC,WAAY,MACZC,UAAW,OACXC,YAAaL,EAAMM,QAAQ,CAAC,CAC9B,EACAC,QAAS,CACPC,OAAQ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edded-app/../core-components/src/components/ResponseErrorPanel/ResponseErrorPanel.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/HeaderTabs/HeaderTabs.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-common/src/permissions.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/hooks/useEntityPermission.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/TabbedLayout/RoutedTabs.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/hooks/useStarredEntity.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/FavoriteEntity/FavoriteEntity.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/UnregisterEntityDialog/useUnregisterEntityDialogState.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/UnregisterEntityDialog/UnregisterEntityDialog.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/types.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/DefaultNode.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/constants.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/Node.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/DefaultLabel.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/Edge.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/DependencyGraph.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/EntityKindIcon.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/AncestryPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/common.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/ColocatedPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/util.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/JsonPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/OverviewPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/YamlPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/InspectEntityDialog.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityContextMenu/UnregisterEntity.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLayout/EntityLayout.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/translation.ts","webpack://techdocs-cli-embedded-app/../../plugins/permission-common/src/permissions/createPermission.ts","webpack://techdocs-cli-embedded-app/../../plugins/permission-common/src/permissions/util.ts","webpack://techdocs-cli-embedded-app/../../plugins/permission-react/src/hooks/usePermission.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 { ResponseError } from '@backstage/errors';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Divider from '@material-ui/core/Divider';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport React from 'react';\nimport { CodeSnippet } from '../CodeSnippet';\nimport { CopyTextButton } from '../CopyTextButton';\nimport { ErrorPanel, ErrorPanelProps } from '../ErrorPanel';\n\nexport type ResponseErrorPanelClassKey = 'text' | 'divider';\n\nconst useStyles = makeStyles(\n theme => ({\n text: {\n fontFamily: 'monospace',\n whiteSpace: 'pre',\n overflowX: 'auto',\n marginRight: theme.spacing(2),\n },\n divider: {\n margin: theme.spacing(2),\n },\n }),\n { name: 'BackstageResponseErrorPanel' },\n);\n\n/**\n * Renders a warning panel as the effect of a failed server request.\n *\n * @remarks\n * Has special treatment for ResponseError errors, to display rich\n * server-provided information about what happened.\n */\nexport function ResponseErrorPanel(props: ErrorPanelProps) {\n const { title, error, defaultExpanded } = props;\n const classes = useStyles();\n\n if (error.name !== 'ResponseError') {\n return (\n <ErrorPanel\n title={title ?? error.message}\n defaultExpanded={defaultExpanded}\n error={error}\n />\n );\n }\n\n const { body, cause } = error as ResponseError;\n const { request, response } = body;\n\n const errorString = `${response.statusCode}: ${cause.name}`;\n const requestString = request && `${request.method} ${request.url}`;\n const messageString = cause.message.replace(/\\\\n/g, '\\n');\n const stackString = cause.stack?.replace(/\\\\n/g, '\\n');\n const jsonString = JSON.stringify(body, undefined, 2);\n\n return (\n <ErrorPanel\n title={title ?? error.message}\n defaultExpanded={defaultExpanded}\n error={{ name: errorString, message: messageString, stack: stackString }}\n >\n {requestString && (\n <ListItem alignItems=\"flex-start\">\n <ListItemText\n classes={{ secondary: classes.text }}\n primary=\"Request\"\n secondary={request ? `${requestString}` : undefined}\n />\n <CopyTextButton text={requestString} />\n </ListItem>\n )}\n <>\n <Divider component=\"li\" className={classes.divider} />\n <ListItem alignItems=\"flex-start\">\n <ListItemText\n classes={{ secondary: classes.text }}\n primary=\"Full Error as JSON\"\n />\n </ListItem>\n <CodeSnippet language=\"json\" text={jsonString} showCopyCodeButton />\n </>\n </ErrorPanel>\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 */\nimport Box from '@material-ui/core/Box';\nimport { makeStyles } from '@material-ui/core/styles';\nimport TabUI, { TabProps } from '@material-ui/core/Tab';\nimport Tabs from '@material-ui/core/Tabs';\nimport React, { useCallback, useEffect, useState } from 'react';\n\n// TODO(blam): Remove this implementation when the Tabs are ready\n// This is just a temporary solution to implementing tabs for now\n\n/** @public */\nexport type HeaderTabsClassKey =\n | 'tabsWrapper'\n | 'defaultTab'\n | 'selected'\n | 'tabRoot';\n\nconst useStyles = makeStyles(\n theme => ({\n tabsWrapper: {\n gridArea: 'pageSubheader',\n backgroundColor: theme.palette.background.paper,\n paddingLeft: theme.spacing(3),\n minWidth: 0,\n },\n defaultTab: {\n ...theme.typography.caption,\n padding: theme.spacing(3, 3),\n textTransform: 'uppercase',\n fontWeight: theme.typography.fontWeightBold,\n color: theme.palette.text.secondary,\n },\n selected: {\n color: theme.palette.text.primary,\n },\n tabRoot: {\n '&:hover': {\n backgroundColor: theme.palette.background.default,\n color: theme.palette.text.primary,\n },\n },\n }),\n { name: 'BackstageHeaderTabs' },\n);\n\nexport type Tab = {\n id: string;\n label: string;\n tabProps?: TabProps<React.ElementType, { component?: React.ElementType }>;\n};\n\ntype HeaderTabsProps = {\n tabs: Tab[];\n onChange?: (index: number) => void;\n selectedIndex?: number;\n};\n\n/**\n * Horizontal Tabs component\n *\n * @public\n *\n */\nexport function HeaderTabs(props: HeaderTabsProps) {\n const { tabs, onChange, selectedIndex } = props;\n const [selectedTab, setSelectedTab] = useState<number>(selectedIndex ?? 0);\n const styles = useStyles();\n\n const handleChange = useCallback(\n (_: React.ChangeEvent<{}>, index: number) => {\n if (selectedIndex === undefined) {\n setSelectedTab(index);\n }\n if (onChange) onChange(index);\n },\n [selectedIndex, onChange],\n );\n\n useEffect(() => {\n if (selectedIndex !== undefined) {\n setSelectedTab(selectedIndex);\n }\n }, [selectedIndex]);\n\n return (\n <Box className={styles.tabsWrapper}>\n <Tabs\n indicatorColor=\"primary\"\n textColor=\"inherit\"\n variant=\"scrollable\"\n scrollButtons=\"auto\"\n aria-label=\"tabs\"\n onChange={handleChange}\n value={selectedTab}\n >\n {tabs.map((tab, index) => (\n <TabUI\n data-testid={`header-tab-${index}`}\n label={tab.label}\n key={tab.id}\n value={index}\n className={styles.defaultTab}\n classes={{ selected: styles.selected, root: styles.tabRoot }}\n {...tab.tabProps}\n />\n ))}\n </Tabs>\n </Box>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createPermission,\n ResourcePermission,\n} from '@backstage/plugin-permission-common';\n\n/**\n * Permission resource type which corresponds to catalog entities.\n *\n * {@link https://backstage.io/docs/features/software-catalog/}\n * @alpha\n */\nexport const RESOURCE_TYPE_CATALOG_ENTITY = 'catalog-entity';\n\n/**\n * Convenience type for catalog entity\n * {@link @backstage/plugin-permission-common#ResourcePermission}s.\n * @alpha\n */\nexport type CatalogEntityPermission = ResourcePermission<\n typeof RESOURCE_TYPE_CATALOG_ENTITY\n>;\n\n/**\n * This permission is used to authorize actions that involve reading one or more\n * entities from the catalog.\n *\n * If this permission is not authorized, it will appear that the entity does not\n * exist in the catalog — both in the frontend and in API responses.\n * @alpha\n */\nexport const catalogEntityReadPermission = createPermission({\n name: 'catalog.entity.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * This permission is used to authorize actions that involve creating a new\n * catalog entity. This includes registering an existing component into the\n * catalog.\n * @alpha\n */\nexport const catalogEntityCreatePermission = createPermission({\n name: 'catalog.entity.create',\n attributes: {\n action: 'create',\n },\n});\n\n/**\n * This permission is used to designate actions that involve removing one or\n * more entities from the catalog.\n * @alpha\n */\nexport const catalogEntityDeletePermission = createPermission({\n name: 'catalog.entity.delete',\n attributes: {\n action: 'delete',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * This permission is used to designate refreshing one or more entities from the\n * catalog.\n * @alpha\n */\nexport const catalogEntityRefreshPermission = createPermission({\n name: 'catalog.entity.refresh',\n attributes: {\n action: 'update',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * This permission is used to designate actions that involve reading one or more\n * locations from the catalog.\n *\n * If this permission is not authorized, it will appear that the location does\n * not exist in the catalog — both in the frontend and in API responses.\n * @alpha\n */\nexport const catalogLocationReadPermission = createPermission({\n name: 'catalog.location.read',\n attributes: {\n action: 'read',\n },\n});\n\n/**\n * This permission is used to designate actions that involve creating catalog\n * locations.\n * @alpha\n */\nexport const catalogLocationCreatePermission = createPermission({\n name: 'catalog.location.create',\n attributes: {\n action: 'create',\n },\n});\n\n/**\n * This permission is used to designate actions that involve deleting locations\n * from the catalog.\n * @alpha\n */\nexport const catalogLocationDeletePermission = createPermission({\n name: 'catalog.location.delete',\n attributes: {\n action: 'delete',\n },\n});\n\n/**\n * List of all catalog permissions.\n * @alpha\n */\nexport const catalogPermissions = [\n catalogEntityReadPermission,\n catalogEntityCreatePermission,\n catalogEntityDeletePermission,\n catalogEntityRefreshPermission,\n catalogLocationReadPermission,\n catalogLocationCreatePermission,\n catalogLocationDeletePermission,\n];\n","/*\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 { stringifyEntityRef } from '@backstage/catalog-model';\nimport { ResourcePermission } from '@backstage/plugin-permission-common';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { useAsyncEntity } from './useEntity';\n\n/**\n * A thin wrapper around the\n * {@link @backstage/plugin-permission-react#usePermission} hook which uses the\n * current entity in context to make an authorization request for the given\n * {@link @backstage/plugin-catalog-common#CatalogEntityPermission}.\n *\n * Note: this hook blocks the permission request until the entity has loaded in\n * context. If you have the entityRef and need concurrent requests, use the\n * `usePermission` hook directly.\n * @alpha\n */\nexport function useEntityPermission(\n // TODO(joeporpeglia) Replace with `CatalogEntityPermission` when the issue described in\n // https://github.com/backstage/backstage/pull/10128 is fixed.\n permission: ResourcePermission<'catalog-entity'>,\n): {\n loading: boolean;\n allowed: boolean;\n error?: Error;\n} {\n const {\n entity,\n loading: loadingEntity,\n error: entityError,\n } = useAsyncEntity();\n const {\n allowed,\n loading: loadingPermission,\n error: permissionError,\n } = usePermission({\n permission,\n resourceRef: entity ? stringifyEntityRef(entity) : undefined,\n });\n\n if (loadingEntity || loadingPermission) {\n return { loading: true, allowed: false };\n }\n if (entityError) {\n return { loading: false, allowed: false, error: entityError };\n }\n return { loading: false, allowed, error: permissionError };\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 */\nimport React, { useMemo } from 'react';\nimport { Helmet } from 'react-helmet';\nimport { matchRoutes, useParams, useRoutes } from 'react-router-dom';\nimport { Content } from '../../layout/Content';\nimport { HeaderTabs } from '../../layout/HeaderTabs';\nimport { SubRoute } from './types';\nimport { Link } from '../Link';\n\nexport function useSelectedSubRoute(subRoutes: SubRoute[]): {\n index: number;\n route?: SubRoute;\n element?: JSX.Element;\n} {\n const params = useParams();\n\n const routes = subRoutes.map(({ path, children }) => ({\n caseSensitive: false,\n path: `${path}/*`,\n element: children,\n }));\n\n // TODO: remove once react-router updated\n const sortedRoutes = routes.sort((a, b) =>\n // remove \"/*\" symbols from path end before comparing\n b.path.replace(/\\/\\*$/, '').localeCompare(a.path.replace(/\\/\\*$/, '')),\n );\n\n const element = useRoutes(sortedRoutes) ?? subRoutes[0]?.children;\n\n // TODO(Rugvip): Once we only support v6 stable we can always prefix\n // This avoids having a double / prefix for react-router v6 beta, which in turn breaks\n // the tab highlighting when using relative paths for the tabs.\n let currentRoute = params['*'] ?? '';\n if (!currentRoute.startsWith('/')) {\n currentRoute = `/${currentRoute}`;\n }\n\n const [matchedRoute] = matchRoutes(sortedRoutes, currentRoute) ?? [];\n const foundIndex = matchedRoute\n ? subRoutes.findIndex(t => `${t.path}/*` === matchedRoute.route.path)\n : 0;\n\n return {\n index: foundIndex === -1 ? 0 : foundIndex,\n element,\n route: subRoutes[foundIndex] ?? subRoutes[0],\n };\n}\n\nexport function RoutedTabs(props: { routes: SubRoute[] }) {\n const { routes } = props;\n\n const { index, route, element } = useSelectedSubRoute(routes);\n const headerTabs = useMemo(\n () =>\n routes.map(t => {\n const { path, title, tabProps } = t;\n let to = path;\n // Remove trailing /*\n to = to.replace(/\\/\\*$/, '');\n // And remove leading / for relative navigation\n to = to.replace(/^\\//, '');\n return {\n id: path,\n label: title,\n tabProps: {\n component: Link,\n to,\n ...tabProps,\n },\n };\n }),\n [routes],\n );\n\n return (\n <>\n <HeaderTabs tabs={headerTabs} selectedIndex={index} />\n <Content>\n <Helmet title={route?.title} />\n {element}\n </Content>\n </>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { useCallback, useEffect, useState } from 'react';\nimport { starredEntitiesApiRef } from '../apis';\n\nfunction getEntityRef(\n entityOrRef: Entity | CompoundEntityRef | string,\n): string {\n return typeof entityOrRef === 'string'\n ? entityOrRef\n : stringifyEntityRef(entityOrRef);\n}\n\n/** @public */\nexport function useStarredEntity(\n entityOrRef: Entity | CompoundEntityRef | string,\n): {\n toggleStarredEntity: () => void;\n isStarredEntity: boolean;\n} {\n const starredEntitiesApi = useApi(starredEntitiesApiRef);\n\n const [isStarredEntity, setIsStarredEntity] = useState(false);\n\n useEffect(() => {\n const subscription = starredEntitiesApi.starredEntitie$().subscribe({\n next(starredEntities: Set<string>) {\n setIsStarredEntity(starredEntities.has(getEntityRef(entityOrRef)));\n },\n });\n\n return () => {\n subscription.unsubscribe();\n };\n }, [entityOrRef, starredEntitiesApi]);\n\n const toggleStarredEntity = useCallback(\n () => starredEntitiesApi.toggleStarred(getEntityRef(entityOrRef)).then(),\n [entityOrRef, starredEntitiesApi],\n );\n\n return {\n toggleStarredEntity,\n isStarredEntity,\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 { Entity } from '@backstage/catalog-model';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { withStyles } from '@material-ui/core/styles';\nimport Star from '@material-ui/icons/Star';\nimport StarBorder from '@material-ui/icons/StarBorder';\nimport React, { ComponentProps } from 'react';\nimport { useStarredEntity } from '../../hooks/useStarredEntity';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport type FavoriteEntityProps = ComponentProps<typeof IconButton> & {\n entity: Entity;\n};\n\nconst YellowStar = withStyles({\n root: {\n color: '#f3ba37',\n },\n})(Star);\n\n/**\n * IconButton for showing if a current entity is starred and adding/removing it from the favorite entities\n * @param props - MaterialUI IconButton props extended by required `entity` prop\n * @public\n */\nexport const FavoriteEntity = (props: FavoriteEntityProps) => {\n const { toggleStarredEntity, isStarredEntity } = useStarredEntity(\n props.entity,\n );\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <IconButton\n aria-label=\"favorite\"\n color=\"inherit\"\n {...props}\n onClick={() => toggleStarredEntity()}\n >\n <Tooltip\n title={\n isStarredEntity\n ? t('favoriteEntity.removeFromFavorites')\n : t('favoriteEntity.addToFavorites')\n }\n >\n {isStarredEntity ? <YellowStar /> : <StarBorder />}\n </Tooltip>\n </IconButton>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n CompoundEntityRef,\n getCompoundEntityRef,\n ANNOTATION_ORIGIN_LOCATION,\n} from '@backstage/catalog-model';\nimport { catalogApiRef } from '../../api';\nimport { useCallback } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { useApi } from '@backstage/core-plugin-api';\n\n/**\n * Each distinct state that the dialog can be in at any given time.\n */\nexport type UseUnregisterEntityDialogState =\n | {\n type: 'loading';\n }\n | {\n type: 'error';\n error: Error;\n }\n | {\n type: 'bootstrap';\n location: string;\n deleteEntity: () => Promise<void>;\n }\n | {\n type: 'unregister';\n location: string;\n colocatedEntities: CompoundEntityRef[];\n unregisterLocation: () => Promise<void>;\n deleteEntity: () => Promise<void>;\n }\n | {\n type: 'only-delete';\n deleteEntity: () => Promise<void>;\n };\n\n/**\n * Houses the main logic for unregistering entities and their locations.\n */\nexport function useUnregisterEntityDialogState(\n entity: Entity,\n): UseUnregisterEntityDialogState {\n const catalogApi = useApi(catalogApiRef);\n const locationRef = entity.metadata.annotations?.[ANNOTATION_ORIGIN_LOCATION];\n const uid = entity.metadata.uid;\n const isBootstrap = locationRef === 'bootstrap:bootstrap';\n\n // Load the prerequisite data: what entities that are colocated with us, and\n // what location that spawned us\n const prerequisites = useAsync(async () => {\n const locationPromise = catalogApi.getLocationByRef(locationRef!);\n\n let colocatedEntitiesPromise: Promise<Entity[]>;\n if (!locationRef) {\n colocatedEntitiesPromise = Promise.resolve([]);\n } else {\n const locationAnnotationFilter = `metadata.annotations.${ANNOTATION_ORIGIN_LOCATION}`;\n colocatedEntitiesPromise = catalogApi\n .getEntities({\n filter: { [locationAnnotationFilter]: locationRef },\n fields: [\n 'kind',\n 'metadata.uid',\n 'metadata.name',\n 'metadata.namespace',\n ],\n })\n .then(response => response.items);\n }\n\n return Promise.all([locationPromise, colocatedEntitiesPromise]).then(\n ([location, colocatedEntities]) => ({\n location,\n colocatedEntities,\n }),\n );\n }, [catalogApi, entity]);\n\n // Unregisters the underlying location which will remove all of the entities that are spawned from\n // it. Can only ever be called when the prerequisites have finished loading successfully, and if\n // there was a matching location.\n const unregisterLocation = useCallback(\n async function unregisterLocationFn() {\n const { location } = prerequisites.value!;\n await catalogApi.removeLocationById(location!.id);\n },\n [catalogApi, prerequisites],\n );\n\n // Just removes the entity, without affecting locations in any way.\n const deleteEntity = useCallback(\n async function deleteEntityFn() {\n await catalogApi.removeEntityByUid(uid!);\n },\n [catalogApi, uid],\n );\n\n // If this is a bootstrap location entity, don't even block on loading\n // prerequisites. We know that all that we will do is to offer to remove the\n // entity, and that doesn't require anything from the prerequisites.\n if (isBootstrap) {\n return { type: 'bootstrap', location: locationRef!, deleteEntity };\n }\n\n // Return early if prerequisites still loading or failing\n const { loading, error, value } = prerequisites;\n if (loading) {\n return { type: 'loading' };\n } else if (error) {\n return { type: 'error', error };\n }\n\n const { location, colocatedEntities } = value!;\n if (!location) {\n return { type: 'only-delete', deleteEntity };\n }\n return {\n type: 'unregister',\n location: locationRef!,\n colocatedEntities: colocatedEntities.map(getCompoundEntityRef),\n unregisterLocation,\n deleteEntity,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { EntityRefLink } from '../EntityRefLink';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Divider from '@material-ui/core/Divider';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Alert from '@material-ui/lab/Alert';\nimport React, { useCallback, useState } from 'react';\nimport { useUnregisterEntityDialogState } from './useUnregisterEntityDialogState';\n\nimport { alertApiRef, configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { assertError } from '@backstage/errors';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst useStyles = makeStyles({\n advancedButton: {\n fontSize: '0.7em',\n },\n dialogActions: {\n display: 'inline-block',\n },\n});\n\nconst Contents = ({\n entity,\n onConfirm,\n onClose,\n}: {\n entity: Entity;\n onConfirm: () => any;\n onClose: () => any;\n}) => {\n const alertApi = useApi(alertApiRef);\n const configApi = useApi(configApiRef);\n const classes = useStyles();\n const state = useUnregisterEntityDialogState(entity);\n const [showDelete, setShowDelete] = useState(false);\n const [busy, setBusy] = useState(false);\n const appTitle = configApi.getOptionalString('app.title') ?? 'Backstage';\n const { t } = useTranslationRef(catalogReactTranslationRef);\n\n const onUnregister = useCallback(\n async function onUnregisterFn() {\n if ('unregisterLocation' in state) {\n setBusy(true);\n try {\n await state.unregisterLocation();\n onConfirm();\n } catch (err) {\n assertError(err);\n alertApi.post({ message: err.message });\n } finally {\n setBusy(false);\n }\n }\n },\n [alertApi, onConfirm, state],\n );\n\n const onDelete = useCallback(\n async function onDeleteFn() {\n if ('deleteEntity' in state) {\n setBusy(true);\n try {\n await state.deleteEntity();\n const entityName = entity.metadata.title ?? entity.metadata.name;\n onConfirm();\n alertApi.post({\n message: t('unregisterEntityDialog.deleteEntitySuccessMessage', {\n entityName,\n }),\n severity: 'success',\n display: 'transient',\n });\n } catch (err) {\n assertError(err);\n alertApi.post({ message: err.message });\n } finally {\n setBusy(false);\n }\n }\n },\n [alertApi, onConfirm, state, entity, t],\n );\n\n const DialogActionsPanel = () => (\n <DialogActions className={classes.dialogActions}>\n <Button onClick={onClose} color=\"primary\">\n {t('unregisterEntityDialog.cancelButtonTitle')}\n </Button>\n </DialogActions>\n );\n\n if (state.type === 'loading') {\n return <Progress />;\n }\n\n if (state.type === 'error') {\n return <ResponseErrorPanel error={state.error} />;\n }\n\n if (state.type === 'bootstrap') {\n return (\n <>\n <Alert severity=\"info\">\n {t('unregisterEntityDialog.bootstrapState.title', {\n appTitle,\n location: state.location,\n })}\n </Alert>\n\n <Box marginTop={2}>\n {!showDelete && (\n <>\n <Button\n variant=\"text\"\n size=\"small\"\n color=\"primary\"\n className={classes.advancedButton}\n onClick={() => setShowDelete(true)}\n >\n {t('unregisterEntityDialog.bootstrapState.advancedOptions')}\n </Button>\n <DialogActionsPanel />\n </>\n )}\n\n {showDelete && (\n <>\n <DialogContentText>\n {t('unregisterEntityDialog.bootstrapState.advancedDescription')}\n </DialogContentText>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n disabled={busy}\n onClick={onDelete}\n >\n {t('unregisterEntityDialog.deleteButtonTitle')}\n </Button>\n <DialogActionsPanel />\n </>\n )}\n </Box>\n </>\n );\n }\n\n if (state.type === 'only-delete') {\n return (\n <>\n <DialogContentText>\n {t('unregisterEntityDialog.onlyDeleteStateTitle')}\n </DialogContentText>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n disabled={busy}\n onClick={onDelete}\n >\n {t('unregisterEntityDialog.deleteButtonTitle')}\n </Button>\n <DialogActionsPanel />\n </>\n );\n }\n\n if (state.type === 'unregister') {\n return (\n <>\n <DialogContentText>\n {t('unregisterEntityDialog.unregisterState.title')}\n </DialogContentText>\n <DialogContentText component=\"ul\">\n {state.colocatedEntities.map(e => (\n <li key={`${e.kind}:${e.namespace}/${e.name}`}>\n <EntityRefLink entityRef={e} />\n </li>\n ))}\n </DialogContentText>\n <DialogContentText>\n {t('unregisterEntityDialog.unregisterState.subTitle')}\n </DialogContentText>\n <DialogContentText component=\"ul\">\n <li>{state.location}</li>\n </DialogContentText>\n <DialogContentText>\n {t('unregisterEntityDialog.unregisterState.description', {\n appTitle,\n })}\n </DialogContentText>\n <Box marginTop={2}>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n disabled={busy}\n onClick={onUnregister}\n >\n {t('unregisterEntityDialog.unregisterState.unregisterButtonTitle')}\n </Button>\n {!showDelete && (\n <Box component=\"span\" marginLeft={2}>\n <Button\n variant=\"text\"\n size=\"small\"\n color=\"primary\"\n className={classes.advancedButton}\n onClick={() => setShowDelete(true)}\n >\n {t('unregisterEntityDialog.unregisterState.advancedOptions')}\n </Button>\n </Box>\n )}\n </Box>\n\n {showDelete && (\n <>\n <Box paddingTop={4} paddingBottom={4}>\n <Divider />\n </Box>\n <DialogContentText>\n {t('unregisterEntityDialog.unregisterState.advancedDescription')}\n </DialogContentText>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n disabled={busy}\n onClick={onDelete}\n >\n {t('unregisterEntityDialog.deleteButtonTitle')}\n </Button>\n </>\n )}\n </>\n );\n }\n\n return (\n <Alert severity=\"error\">\n {t('unregisterEntityDialog.errorStateTitle')}\n </Alert>\n );\n};\n\n/** @public */\nexport type UnregisterEntityDialogProps = {\n open: boolean;\n onConfirm: () => any;\n onClose: () => any;\n entity: Entity;\n};\n\n/** @public */\nexport const UnregisterEntityDialog = (props: UnregisterEntityDialogProps) => {\n const { open, onConfirm, onClose, entity } = props;\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <Dialog open={open} onClose={onClose}>\n <DialogTitle id=\"responsive-dialog-title\">\n {t('unregisterEntityDialog.title')}\n </DialogTitle>\n <DialogContent>\n <Contents entity={entity} onConfirm={onConfirm} onClose={onClose} />\n </DialogContent>\n </Dialog>\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\n/**\n * Types used to customize and provide data to {@link DependencyGraph}\n *\n * @packageDocumentation\n */\n\nimport React from 'react';\n\n/**\n * Types for the {@link DependencyGraph} component.\n *\n * @public\n */\nexport namespace DependencyGraphTypes {\n /**\n * Edge of {@link DependencyGraph}\n *\n * @public\n */\n export type DependencyEdge<T = {}> = T & {\n /**\n * ID of {@link DependencyNode} from where the Edge start\n */\n from: string;\n /**\n * ID of {@link DependencyNode} to where the Edge goes to\n */\n to: string;\n /**\n * Label assigned and rendered with the Edge\n */\n label?: string;\n };\n\n /**\n * Properties of {@link DependencyGraphTypes.RenderLabelFunction} for {@link DependencyGraphTypes.DependencyEdge}\n *\n * @public\n */\n export type RenderLabelProps<T = unknown> = { edge: DependencyEdge<T> };\n\n /**\n * Custom React component for edge labels\n *\n * @public\n */\n export type RenderLabelFunction<T = {}> = (\n props: RenderLabelProps<T>,\n ) => React.ReactNode;\n\n /**\n * Node of {@link DependencyGraph}\n *\n * @public\n */\n export type DependencyNode<T = {}> = T & {\n id: string;\n };\n\n /**\n * Properties of {@link DependencyGraphTypes.RenderNodeFunction} for {@link DependencyGraphTypes.DependencyNode}\n *\n * @public\n */\n export type RenderNodeProps<T = unknown> = { node: DependencyNode<T> };\n\n /**\n * Custom React component for graph {@link DependencyGraphTypes.DependencyNode}\n *\n * @public\n */\n export type RenderNodeFunction<T = {}> = (\n props: RenderNodeProps<T>,\n ) => React.ReactNode;\n\n /**\n * Graph direction\n *\n * @public\n */\n export enum Direction {\n /**\n * Top to Bottom\n */\n TOP_BOTTOM = 'TB',\n /**\n * Bottom to Top\n */\n BOTTOM_TOP = 'BT',\n /**\n * Left to Right\n */\n LEFT_RIGHT = 'LR',\n /**\n * Right to Left\n */\n RIGHT_LEFT = 'RL',\n }\n\n /**\n * Node alignment\n *\n * @public\n */\n export enum Alignment {\n /**\n * Up Left\n */\n UP_LEFT = 'UL',\n /**\n * Up Right\n */\n UP_RIGHT = 'UR',\n /**\n * Down Left\n */\n DOWN_LEFT = 'DL',\n /**\n * Down Right\n */\n DOWN_RIGHT = 'DR',\n }\n\n /**\n * Algorithm used to rand nodes in graph\n *\n * @public\n */\n export enum Ranker {\n /**\n * {@link https://en.wikipedia.org/wiki/Network_simplex_algorithm | Network Simplex} algorithm\n */\n NETWORK_SIMPLEX = 'network-simplex',\n /**\n * Tight Tree algorithm\n */\n TIGHT_TREE = 'tight-tree',\n /**\n * Longest path algorithm\n *\n * @remarks\n *\n * Simplest and fastest\n */\n LONGEST_PATH = 'longest-path',\n }\n\n /**\n * Position of label in relation to the edge\n *\n * @public\n */\n export enum LabelPosition {\n LEFT = 'l',\n RIGHT = 'r',\n CENTER = 'c',\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 React from 'react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { DependencyGraphTypes as Types } from './types';\n\n/** @public */\nexport type DependencyGraphDefaultNodeClassKey = 'node' | 'text';\n\nconst useStyles = makeStyles(\n theme => ({\n node: {\n fill: theme.palette.primary.light,\n stroke: theme.palette.primary.light,\n },\n text: {\n fill: theme.palette.primary.contrastText,\n },\n }),\n { name: 'BackstageDependencyGraphDefaultNode' },\n);\n\n/** @public */\nexport function DefaultNode({ node: { id } }: Types.RenderNodeProps) {\n const classes = useStyles();\n const [width, setWidth] = React.useState(0);\n const [height, setHeight] = React.useState(0);\n const idRef = React.useRef<SVGTextElement | null>(null);\n\n React.useLayoutEffect(() => {\n // set the width to the length of the ID\n if (idRef.current) {\n let { height: renderedHeight, width: renderedWidth } =\n idRef.current.getBBox();\n renderedHeight = Math.round(renderedHeight);\n renderedWidth = Math.round(renderedWidth);\n\n if (renderedHeight !== height || renderedWidth !== width) {\n setWidth(renderedWidth);\n setHeight(renderedHeight);\n }\n }\n }, [width, height]);\n\n const padding = 10;\n const paddedWidth = width + padding * 2;\n const paddedHeight = height + padding * 2;\n\n return (\n <g>\n <rect\n className={classes.node}\n width={paddedWidth}\n height={paddedHeight}\n rx={10}\n />\n <text\n ref={idRef}\n className={classes.text}\n y={paddedHeight / 2}\n x={paddedWidth / 2}\n textAnchor=\"middle\"\n alignmentBaseline=\"middle\"\n >\n {id}\n </text>\n </g>\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\nexport const ARROW_MARKER_ID = 'arrow-marker';\n\nexport const NODE_TEST_ID = 'node';\nexport const EDGE_TEST_ID = 'edge';\nexport const LABEL_TEST_ID = 'label';\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 makeStyles from '@material-ui/core/styles/makeStyles';\nimport { DefaultNode } from './DefaultNode';\nimport { DependencyGraphTypes as Types } from './types';\nimport { NODE_TEST_ID } from './constants';\nimport dagre from 'dagre';\n\n/** @public */\nexport type DependencyGraphNodeClassKey = 'node';\n\nconst useStyles = makeStyles(\n theme => ({\n node: {\n transition: `${theme.transitions.duration.shortest}ms`,\n },\n }),\n { name: 'BackstageDependencyGraphNode' },\n);\n\nexport type GraphNode<T> = dagre.Node<Types.DependencyNode<T>>;\n\nexport type NodeComponentProps<T> = {\n node: GraphNode<T>;\n render?: Types.RenderNodeFunction<T>;\n setNode: dagre.graphlib.Graph['setNode'];\n};\n\nconst renderDefault = (props: Types.RenderNodeProps) => (\n <DefaultNode {...props} />\n);\n\nexport function Node<T>({\n render = renderDefault,\n setNode,\n node,\n}: NodeComponentProps<T>) {\n const { width, height, x = 0, y = 0 } = node;\n const nodeProps: Types.DependencyNode<T> = node;\n const classes = useStyles();\n const nodeRef = React.useRef<SVGGElement | null>(null);\n\n React.useLayoutEffect(() => {\n // set the node width to the actual rendered width to properly layout graph\n if (nodeRef.current) {\n let { height: renderedHeight, width: renderedWidth } =\n nodeRef.current.getBBox();\n renderedHeight = Math.round(renderedHeight);\n renderedWidth = Math.round(renderedWidth);\n\n if (renderedHeight !== height || renderedWidth !== width) {\n setNode(node.id, {\n ...node,\n height: renderedHeight,\n width: renderedWidth,\n });\n }\n }\n }, [node, width, height, setNode]);\n\n return (\n <g\n ref={nodeRef}\n data-testid={NODE_TEST_ID}\n className={classes.node}\n transform={`translate(${x - width / 2},${y - height / 2})`}\n >\n {render({ node: nodeProps })}\n </g>\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 React from 'react';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport { DependencyGraphTypes as Types } from './types';\n\n/** @public */\nexport type DependencyGraphDefaultLabelClassKey = 'text';\n\nconst useStyles = makeStyles(\n theme => ({\n text: {\n fill: theme.palette.textContrast,\n },\n }),\n { name: 'BackstageDependencyGraphDefaultLabel' },\n);\n\n/** @public */\nexport function DefaultLabel({ edge: { label } }: Types.RenderLabelProps) {\n const classes = useStyles();\n return (\n <text className={classes.text} textAnchor=\"middle\">\n {label}\n </text>\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 React from 'react';\nimport * as d3Shape from 'd3-shape';\nimport isFinite from 'lodash/isFinite';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport { DependencyGraphTypes as Types } from './types';\nimport { ARROW_MARKER_ID, EDGE_TEST_ID, LABEL_TEST_ID } from './constants';\nimport { DefaultLabel } from './DefaultLabel';\nimport dagre from 'dagre';\n\n/* Based on: https://github.com/dagrejs/dagre/wiki#configuring-the-layout */\nexport type EdgeProperties = {\n label?: string;\n width?: number;\n height?: number;\n labeloffset?: number;\n labelpos?: Types.LabelPosition;\n minlen?: number;\n weight?: number;\n};\nexport type GraphEdge<T> = Types.DependencyEdge<T> &\n dagre.GraphEdge &\n EdgeProperties;\n\n/** @public */\nexport type DependencyGraphEdgeClassKey = 'path' | 'label';\n\nconst useStyles = makeStyles(\n theme => ({\n path: {\n strokeWidth: 1.3,\n stroke: theme.palette.textSubtle,\n fill: 'none',\n transition: `${theme.transitions.duration.shortest}ms`,\n },\n label: {\n transition: `${theme.transitions.duration.shortest}ms`,\n },\n }),\n { name: 'BackstageDependencyGraphEdge' },\n);\n\ntype EdgePoint = dagre.GraphEdge['points'][0];\n\n/** @public */\nexport type EdgeComponentProps<T = unknown> = {\n id: dagre.Edge;\n edge: GraphEdge<T>;\n render?: Types.RenderLabelFunction<T>;\n setEdge: (\n id: dagre.Edge,\n edge: Types.DependencyEdge<T>,\n ) => dagre.graphlib.Graph<{}>;\n curve: 'curveStepBefore' | 'curveMonotoneX';\n showArrowHeads?: boolean;\n};\n\nconst renderDefault = (props: Types.RenderLabelProps<unknown>) => (\n <DefaultLabel {...props} />\n);\n\nexport function Edge<EdgeData>({\n render = renderDefault,\n setEdge,\n id,\n edge,\n curve,\n showArrowHeads,\n}: EdgeComponentProps<EdgeData>) {\n const { x = 0, y = 0, width, height, points } = edge;\n const labelProps: Types.DependencyEdge<EdgeData> = edge;\n const classes = useStyles();\n\n const labelRef = React.useRef<SVGGElement>(null);\n\n React.useLayoutEffect(() => {\n // set the label width to the actual rendered width to properly layout graph\n if (labelRef.current) {\n let { height: renderedHeight, width: renderedWidth } =\n labelRef.current.getBBox();\n renderedHeight = Math.round(renderedHeight);\n renderedWidth = Math.round(renderedWidth);\n\n if (renderedHeight !== height || renderedWidth !== width) {\n setEdge(id, {\n ...edge,\n height: renderedHeight,\n width: renderedWidth,\n });\n }\n }\n }, [edge, height, width, setEdge, id]);\n\n let path: string = '';\n\n const createPath = React.useMemo(\n () =>\n d3Shape\n .line<EdgePoint>()\n .x(d => d.x)\n .y(d => d.y)\n .curve(d3Shape[curve]),\n [curve],\n );\n\n if (points) {\n const finitePoints = points.filter(\n (point: EdgePoint) => isFinite(point.x) && isFinite(point.y),\n );\n path = createPath(finitePoints) || '';\n }\n\n return (\n <>\n {path && (\n <path\n data-testid={EDGE_TEST_ID}\n className={classes.path}\n markerEnd={showArrowHeads ? `url(#${ARROW_MARKER_ID})` : undefined}\n d={path}\n />\n )}\n {labelProps.label ? (\n <g\n ref={labelRef}\n data-testid={LABEL_TEST_ID}\n className={classes.label}\n transform={`translate(${x},${y})`}\n >\n {render({ edge: labelProps })}\n </g>\n ) : null}\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 React from 'react';\nimport * as d3Zoom from 'd3-zoom';\nimport * as d3Selection from 'd3-selection';\nimport useTheme from '@material-ui/core/styles/useTheme';\nimport dagre from 'dagre';\nimport debounce from 'lodash/debounce';\nimport { DependencyGraphTypes as Types } from './types';\nimport { Node } from './Node';\nimport { Edge, GraphEdge } from './Edge';\nimport { ARROW_MARKER_ID } from './constants';\n\n/**\n * Properties of {@link DependencyGraph}\n *\n * @public\n * @remarks\n * `<NodeData>` and `<EdgeData>` are useful when rendering custom or edge labels\n */\nexport interface DependencyGraphProps<NodeData, EdgeData>\n extends React.SVGProps<SVGSVGElement> {\n /**\n * Edges of graph\n */\n edges: Types.DependencyEdge<EdgeData>[];\n /**\n * Nodes of Graph\n */\n nodes: Types.DependencyNode<NodeData>[];\n /**\n * Graph {@link DependencyGraphTypes.Direction | direction}\n *\n * @remarks\n *\n * Default: `DependencyGraphTypes.Direction.TOP_BOTTOM`\n */\n direction?: Types.Direction;\n /**\n * Node {@link DependencyGraphTypes.Alignment | alignment}\n */\n align?: Types.Alignment;\n /**\n * Margin between nodes on each rank\n *\n * @remarks\n *\n * Default: 50\n */\n nodeMargin?: number;\n /**\n * Margin between edges\n *\n * @remarks\n *\n * Default: 10\n */\n edgeMargin?: number;\n /**\n * Margin between each rank\n *\n * @remarks\n *\n * Default: 50\n */\n rankMargin?: number;\n /**\n * Margin on left and right of whole graph\n *\n * @remarks\n *\n * Default: 0\n */\n paddingX?: number;\n /**\n * Margin on top and bottom of whole graph\n *\n * @remarks\n *\n * Default: 0\n */\n paddingY?: number;\n /**\n * Heuristic used to find set of edges that will make graph acyclic\n */\n acyclicer?: 'greedy';\n /**\n * {@link DependencyGraphTypes.Ranker | Algorithm} used to rank nodes\n *\n * @remarks\n *\n * Default: `DependencyGraphTypes.Ranker.NETWORK_SIMPLEX`\n */\n ranker?: Types.Ranker;\n /**\n * {@link DependencyGraphTypes.LabelPosition | Position} of label in relation to edge\n *\n * @remarks\n *\n * Default: `DependencyGraphTypes.LabelPosition.RIGHT`\n */\n labelPosition?: Types.LabelPosition;\n /**\n * How much to move label away from edge\n *\n * @remarks\n *\n * Applies only when {@link DependencyGraphProps.labelPosition} is `DependencyGraphTypes.LabelPosition.LEFT` or\n * `DependencyGraphTypes.LabelPosition.RIGHT`\n */\n labelOffset?: number;\n /**\n * Minimum number of ranks to keep between connected nodes\n */\n edgeRanks?: number;\n /**\n * Weight applied to edges in graph\n */\n edgeWeight?: number;\n /**\n * Custom node rendering component\n */\n renderNode?: Types.RenderNodeFunction<NodeData>;\n /**\n * Custom label rendering component\n */\n renderLabel?: Types.RenderLabelFunction<EdgeData>;\n /**\n * {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs | Defs} shared by rendered SVG to be used by\n * {@link DependencyGraphProps.renderNode} and/or {@link DependencyGraphProps.renderLabel}\n */\n defs?: JSX.Element | JSX.Element[];\n /**\n * Controls zoom behavior of graph\n *\n * @remarks\n *\n * Default: `enabled`\n */\n zoom?: 'enabled' | 'disabled' | 'enable-on-click';\n /**\n * A factory for curve generators addressing both lines and areas.\n *\n * @remarks\n *\n * Default: 'curveMonotoneX'\n */\n curve?: 'curveStepBefore' | 'curveMonotoneX';\n /**\n * Controls if the arrow heads should be rendered or not.\n *\n * Default: false\n */\n showArrowHeads?: boolean;\n /**\n * Controls if the graph should be contained or grow\n *\n * @remarks\n *\n * Default: 'grow'\n */\n fit?: 'grow' | 'contain';\n}\n\nconst WORKSPACE_ID = 'workspace';\n\n/**\n * Graph component used to visualize relations between entities\n *\n * @public\n */\nexport function DependencyGraph<NodeData, EdgeData>(\n props: DependencyGraphProps<NodeData, EdgeData>,\n) {\n const {\n edges,\n nodes,\n renderNode,\n direction = Types.Direction.TOP_BOTTOM,\n align,\n nodeMargin = 50,\n edgeMargin = 10,\n rankMargin = 50,\n paddingX = 0,\n paddingY = 0,\n acyclicer,\n ranker = Types.Ranker.NETWORK_SIMPLEX,\n labelPosition = Types.LabelPosition.RIGHT,\n labelOffset = 10,\n edgeRanks = 1,\n edgeWeight = 1,\n renderLabel,\n defs,\n zoom = 'enabled',\n curve = 'curveMonotoneX',\n showArrowHeads = false,\n fit = 'grow',\n ...svgProps\n } = props;\n const theme = useTheme();\n const [containerWidth, setContainerWidth] = React.useState<number>(100);\n const [containerHeight, setContainerHeight] = React.useState<number>(100);\n\n const graph = React.useRef<\n dagre.graphlib.Graph<Types.DependencyNode<NodeData>>\n >(new dagre.graphlib.Graph());\n const [graphWidth, setGraphWidth] = React.useState<number>(\n graph.current.graph()?.width || 0,\n );\n const [graphHeight, setGraphHeight] = React.useState<number>(\n graph.current.graph()?.height || 0,\n );\n const [graphNodes, setGraphNodes] = React.useState<string[]>([]);\n const [graphEdges, setGraphEdges] = React.useState<dagre.Edge[]>([]);\n\n const maxWidth = Math.max(graphWidth, containerWidth);\n const maxHeight = Math.max(graphHeight, containerHeight);\n const minHeight = Math.min(graphHeight, containerHeight);\n\n const scalableHeight = fit === 'grow' ? maxHeight : minHeight;\n\n const containerRef = React.useMemo(\n () =>\n debounce((node: SVGSVGElement) => {\n if (!node) {\n return;\n }\n // Set up zooming + panning\n const container = d3Selection.select<SVGSVGElement, null>(node);\n const workspace = d3Selection.select(node.getElementById(WORKSPACE_ID));\n\n function enableZoom() {\n container.call(\n d3Zoom\n .zoom<SVGSVGElement, null>()\n .scaleExtent([1, Infinity])\n .on('zoom', event => {\n event.transform.x = Math.min(\n 0,\n Math.max(\n event.transform.x,\n maxWidth - maxWidth * event.transform.k,\n ),\n );\n event.transform.y = Math.min(\n 0,\n Math.max(\n event.transform.y,\n maxHeight - maxHeight * event.transform.k,\n ),\n );\n workspace.attr('transform', event.transform);\n }),\n );\n }\n\n if (zoom === 'enabled') {\n enableZoom();\n } else if (zoom === 'enable-on-click') {\n container.on('click', () => enableZoom());\n }\n\n const { width: newContainerWidth, height: newContainerHeight } =\n node.getBoundingClientRect();\n if (containerWidth !== newContainerWidth) {\n setContainerWidth(newContainerWidth);\n }\n if (containerHeight !== newContainerHeight) {\n setContainerHeight(newContainerHeight);\n }\n }, 100),\n [containerHeight, containerWidth, maxWidth, maxHeight, zoom],\n );\n\n const setNodesAndEdges = React.useCallback(() => {\n // Cleaning up lingering nodes and edges\n const currentGraphNodes = graph.current.nodes();\n const currentGraphEdges = graph.current.edges();\n\n currentGraphNodes.forEach(nodeId => {\n const remainingNode = nodes.some(node => node.id === nodeId);\n if (!remainingNode) {\n graph.current.removeNode(nodeId);\n }\n });\n\n currentGraphEdges.forEach(e => {\n const remainingEdge = edges.some(\n edge => edge.from === e.v && edge.to === e.w,\n );\n if (!remainingEdge) {\n graph.current.removeEdge(e.v, e.w);\n }\n });\n\n // Adding/updating nodes and edges\n nodes.forEach(node => {\n const existingNode = graph.current\n .nodes()\n .find(nodeId => node.id === nodeId);\n\n if (existingNode && graph.current.node(existingNode)) {\n const { width, height, x, y } = graph.current.node(existingNode);\n graph.current.setNode(existingNode, { ...node, width, height, x, y });\n } else {\n graph.current.setNode(node.id, { ...node, width: 0, height: 0 });\n }\n });\n\n edges.forEach(e => {\n graph.current.setEdge(e.from, e.to, {\n ...e,\n label: e.label,\n width: 0,\n height: 0,\n labelpos: labelPosition,\n labeloffset: labelOffset,\n weight: edgeWeight,\n minlen: edgeRanks,\n });\n });\n }, [edges, nodes, labelPosition, labelOffset, edgeWeight, edgeRanks]);\n\n const updateGraph = React.useMemo(\n () =>\n debounce(\n () => {\n dagre.layout(graph.current);\n const { height, width } = graph.current.graph();\n const newHeight = Math.max(0, height || 0);\n const newWidth = Math.max(0, width || 0);\n setGraphWidth(newWidth);\n setGraphHeight(newHeight);\n\n setGraphNodes(graph.current.nodes());\n setGraphEdges(graph.current.edges());\n },\n 250,\n { leading: true },\n ),\n [],\n );\n\n React.useEffect(() => {\n graph.current.setGraph({\n rankdir: direction,\n align,\n nodesep: nodeMargin,\n edgesep: edgeMargin,\n ranksep: rankMargin,\n marginx: paddingX,\n marginy: paddingY,\n acyclicer,\n ranker,\n });\n\n setNodesAndEdges();\n updateGraph();\n\n return updateGraph.cancel;\n }, [\n acyclicer,\n align,\n direction,\n edgeMargin,\n paddingX,\n paddingY,\n nodeMargin,\n rankMargin,\n ranker,\n setNodesAndEdges,\n updateGraph,\n ]);\n\n function setNode(id: string, node: Types.DependencyNode<NodeData>) {\n graph.current.setNode(id, node);\n updateGraph();\n return graph.current;\n }\n\n function setEdge(id: dagre.Edge, edge: Types.DependencyEdge<EdgeData>) {\n graph.current.setEdge(id, edge);\n updateGraph();\n return graph.current;\n }\n\n return (\n <svg\n ref={containerRef}\n {...svgProps}\n width=\"100%\"\n height={scalableHeight}\n viewBox={`0 0 ${maxWidth} ${maxHeight}`}\n >\n <defs>\n <marker\n id={ARROW_MARKER_ID}\n viewBox=\"0 0 24 24\"\n markerWidth=\"14\"\n markerHeight=\"14\"\n refX=\"16\"\n refY=\"12\"\n orient=\"auto\"\n markerUnits=\"strokeWidth\"\n >\n <path\n fill={theme.palette.textSubtle}\n d=\"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z\"\n />\n </marker>\n {defs}\n </defs>\n <g id={WORKSPACE_ID}>\n <svg\n width={graphWidth}\n height={graphHeight}\n y={maxHeight / 2 - graphHeight / 2}\n x={maxWidth / 2 - graphWidth / 2}\n viewBox={`0 0 ${graphWidth} ${graphHeight}`}\n >\n {graphEdges.map(e => {\n const edge = graph.current.edge(e) as GraphEdge<EdgeData>;\n if (!edge) return null;\n return (\n <Edge\n key={`${e.v}-${e.w}`}\n id={e}\n setEdge={setEdge}\n render={renderLabel}\n edge={edge}\n curve={curve}\n showArrowHeads={showArrowHeads}\n />\n );\n })}\n {graphNodes.map((id: string) => {\n const node = graph.current.node(id);\n if (!node) return null;\n return (\n <Node\n key={id}\n setNode={setNode}\n render={renderNode}\n node={node}\n />\n );\n })}\n </svg>\n </g>\n </svg>\n );\n}\n","/*\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 { parseEntityRef } from '@backstage/catalog-model';\nimport { useApp } from '@backstage/core-plugin-api';\nimport React from 'react';\nimport SvgIcon from '@material-ui/core/SvgIcon';\n\nconst DEFAULT_ICON = SvgIcon;\n\nfunction getKind(\n kind: string | undefined,\n entityRef: string | undefined,\n): string | undefined {\n if (kind) {\n return kind.toLocaleLowerCase('en-US');\n }\n\n if (entityRef) {\n try {\n return parseEntityRef(entityRef).kind.toLocaleLowerCase('en-US');\n } catch {\n return undefined;\n }\n }\n\n return undefined;\n}\n\nfunction useIcon(kind: string | undefined, entityRef: string | undefined) {\n const app = useApp();\n\n const actualKind = getKind(kind, entityRef);\n if (!actualKind) {\n return DEFAULT_ICON;\n }\n\n const icon = app.getSystemIcon(`kind:${actualKind}`);\n return icon || DEFAULT_ICON;\n}\n\nexport function EntityKindIcon(props: {\n kind?: string;\n entityRef?: string;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n className?: string;\n}) {\n const { kind, entityRef, ...otherProps } = props;\n const Icon = useIcon(kind, entityRef);\n return <Icon {...otherProps} />;\n}\n","/*\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 Entity,\n DEFAULT_NAMESPACE,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n DependencyGraph,\n DependencyGraphTypes,\n Link,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { useApi, useApp, useRouteRef } from '@backstage/core-plugin-api';\nimport Box from '@material-ui/core/Box';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogApiRef } from '../../../api';\nimport { humanizeEntityRef } from '../../EntityRefLink';\nimport { entityRouteRef } from '../../../routes';\nimport { EntityKindIcon } from './EntityKindIcon';\nimport { catalogReactTranslationRef } from '../../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst useStyles = makeStyles(theme => ({\n node: {\n fill: theme.palette.grey[300],\n stroke: theme.palette.grey[300],\n '&.primary': {\n fill: theme.palette.primary.light,\n stroke: theme.palette.primary.light,\n },\n '&.secondary': {\n fill: theme.palette.secondary.light,\n stroke: theme.palette.secondary.light,\n },\n },\n text: {\n fill: theme.palette.getContrastText(theme.palette.grey[300]),\n '&.primary': {\n fill: theme.palette.primary.contrastText,\n },\n '&.secondary': {\n fill: theme.palette.secondary.contrastText,\n },\n '&.focused': {\n fontWeight: 'bold',\n },\n },\n clickable: {\n cursor: 'pointer',\n },\n}));\n\ntype NodeType = Entity & { root: boolean };\n\nfunction useAncestry(root: Entity): {\n loading: boolean;\n error?: Error;\n nodes: DependencyGraphTypes.DependencyNode<NodeType>[];\n edges: DependencyGraphTypes.DependencyEdge[];\n} {\n const catalogClient = useApi(catalogApiRef);\n const entityRef = stringifyEntityRef(root);\n\n const { loading, error, value } = useAsync(async () => {\n const response = await catalogClient.getEntityAncestors({ entityRef });\n const nodes = new Array<DependencyGraphTypes.DependencyNode<NodeType>>();\n const edges = new Array<DependencyGraphTypes.DependencyEdge>();\n for (const current of response.items) {\n const currentRef = stringifyEntityRef(current.entity);\n const isRootNode = currentRef === response.rootEntityRef;\n nodes.push({ id: currentRef, root: isRootNode, ...current.entity });\n for (const parentRef of current.parentEntityRefs) {\n edges.push({ from: currentRef, to: parentRef });\n }\n }\n return { nodes, edges };\n }, [entityRef]);\n\n return {\n loading,\n error,\n nodes: value?.nodes || [],\n edges: value?.edges || [],\n };\n}\n\nfunction CustomNode({ node }: DependencyGraphTypes.RenderNodeProps<NodeType>) {\n const classes = useStyles();\n const navigate = useNavigate();\n const entityRoute = useRouteRef(entityRouteRef);\n const [width, setWidth] = useState(0);\n const [height, setHeight] = useState(0);\n const app = useApp();\n const idRef = useRef<SVGTextElement | null>(null);\n\n useLayoutEffect(() => {\n // set the width to the length of the ID\n if (idRef.current) {\n let { height: renderedHeight, width: renderedWidth } =\n idRef.current.getBBox();\n renderedHeight = Math.round(renderedHeight);\n renderedWidth = Math.round(renderedWidth);\n if (renderedHeight !== height || renderedWidth !== width) {\n setWidth(renderedWidth);\n setHeight(renderedHeight);\n }\n }\n }, [width, height]);\n\n const hasKindIcon = app.getSystemIcon(\n `kind:${node.kind.toLocaleLowerCase('en-US')}`,\n );\n const padding = 10;\n const iconSize = height;\n const paddedIconWidth = hasKindIcon ? iconSize + padding : 0;\n const paddedWidth = paddedIconWidth + width + padding * 2;\n const paddedHeight = height + padding * 2;\n\n const displayTitle =\n node.metadata.title ||\n (node.kind && node.metadata.name && node.metadata.namespace\n ? humanizeEntityRef({\n kind: node.kind,\n name: node.metadata.name,\n namespace: node.metadata.namespace || '',\n })\n : node.id);\n\n const onClick = () => {\n navigate(\n entityRoute({\n kind: node.kind,\n namespace: node.metadata.namespace || DEFAULT_NAMESPACE,\n name: node.metadata.name,\n }),\n );\n };\n\n return (\n <g onClick={onClick} className={classes.clickable}>\n <rect\n className={classNames(\n classes.node,\n node.root ? 'secondary' : 'primary',\n )}\n width={paddedWidth}\n height={paddedHeight}\n rx={10}\n />\n {hasKindIcon && (\n <EntityKindIcon\n kind={node.kind}\n y={padding}\n x={padding}\n width={iconSize}\n height={iconSize}\n className={classNames(\n classes.text,\n node.root ? 'secondary' : 'primary',\n )}\n />\n )}\n <text\n ref={idRef}\n className={classNames(\n classes.text,\n node.root ? 'secondary' : 'primary',\n )}\n y={paddedHeight / 2}\n x={paddedIconWidth + (width + padding * 2) / 2}\n textAnchor=\"middle\"\n alignmentBaseline=\"middle\"\n >\n {displayTitle}\n </text>\n </g>\n );\n}\n\nexport function AncestryPage(props: { entity: Entity }) {\n const { loading, error, nodes, edges } = useAncestry(props.entity);\n const { t } = useTranslationRef(catalogReactTranslationRef);\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <>\n <DialogContentText variant=\"h2\">\n {t('inspectEntityDialog.ancestryPage.title')}\n </DialogContentText>\n <DialogContentText gutterBottom>\n This is the ancestry of entities above the current one - as in, the\n chain(s) of entities down to the current one, where{' '}\n <Link to=\"https://backstage.io/docs/features/software-catalog/life-of-an-entity\">\n processors emitted\n </Link>{' '}\n child entities that ultimately led to the current one existing. Note\n that this is a completely different mechanism from relations.\n </DialogContentText>\n <Box mt={4}>\n <DependencyGraph\n nodes={nodes}\n edges={edges}\n renderNode={CustomNode}\n direction={DependencyGraphTypes.Direction.BOTTOM_TOP}\n zoom=\"enable-on-click\"\n />\n </Box>\n </>\n );\n}\n","/*\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 { Link } from '@backstage/core-components';\nimport Box from '@material-ui/core/Box';\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport MuiListItemText from '@material-ui/core/ListItemText';\nimport MuiListSubheader from '@material-ui/core/ListSubheader';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport HelpOutlineIcon from '@material-ui/icons/HelpOutline';\nimport React from 'react';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n display: 'flex',\n flexDirection: 'column',\n },\n marginTop: {\n marginTop: theme.spacing(2),\n },\n helpIcon: {\n marginLeft: theme.spacing(1),\n color: theme.palette.text.disabled,\n },\n monospace: {\n fontFamily: 'monospace',\n },\n}));\n\nexport function ListItemText(props: {\n primary: React.ReactNode;\n secondary?: React.ReactNode;\n}) {\n const classes = useStyles();\n return (\n <MuiListItemText\n {...props}\n primaryTypographyProps={{ className: classes.monospace }}\n secondaryTypographyProps={{ className: classes.monospace }}\n />\n );\n}\n\nexport function ListSubheader(props: { children?: React.ReactNode }) {\n const classes = useStyles();\n return (\n <MuiListSubheader className={classes.monospace}>\n {props.children}\n </MuiListSubheader>\n );\n}\n\nexport function Container(props: {\n title: React.ReactNode;\n helpLink?: string;\n children: React.ReactNode;\n}) {\n return (\n <Box mt={2}>\n <Card variant=\"outlined\">\n <CardContent>\n <Typography variant=\"h6\" gutterBottom>\n {props.title}\n {props.helpLink && <HelpIcon to={props.helpLink} />}\n </Typography>\n {props.children}\n </CardContent>\n </Card>\n </Box>\n );\n}\n\n// Extracts a link from a value, if possible\nfunction findLink(value: string): string | undefined {\n if (value.match(/^url:https?:\\/\\//)) {\n return value.slice('url:'.length);\n }\n if (value.match(/^https?:\\/\\//)) {\n return value;\n }\n return undefined;\n}\n\nexport function KeyValueListItem(props: {\n indent?: boolean;\n entry: [string, string];\n}) {\n const [key, value] = props.entry;\n const link = findLink(value);\n\n return (\n <ListItem>\n {props.indent && <ListItemIcon />}\n <ListItemText\n primary={key}\n secondary={link ? <Link to={link}>{value}</Link> : value}\n />\n </ListItem>\n );\n}\n\nexport function HelpIcon(props: { to: string }) {\n const classes = useStyles();\n return (\n <Link to={props.to} className={classes.helpIcon}>\n <HelpOutlineIcon fontSize=\"inherit\" />\n </Link>\n );\n}\n","/*\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 Entity,\n ANNOTATION_LOCATION,\n ANNOTATION_ORIGIN_LOCATION,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Alert from '@material-ui/lab/Alert';\nimport React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogApiRef } from '../../../api';\nimport { EntityRefLink } from '../../EntityRefLink';\nimport { KeyValueListItem, ListItemText } from './common';\nimport { catalogReactTranslationRef } from '../../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n },\n});\n\nfunction useColocated(entity: Entity): {\n loading: boolean;\n error?: Error;\n location?: string;\n originLocation?: string;\n colocatedEntities?: Entity[];\n} {\n const catalogApi = useApi(catalogApiRef);\n const currentEntityRef = stringifyEntityRef(entity);\n const location = entity.metadata.annotations?.[ANNOTATION_LOCATION];\n const origin = entity.metadata.annotations?.[ANNOTATION_ORIGIN_LOCATION];\n\n const { loading, error, value } = useAsync(async () => {\n if (!location && !origin) {\n return [];\n }\n const response = await catalogApi.getEntities({\n filter: [\n ...(location\n ? [{ [`metadata.annotations.${ANNOTATION_LOCATION}`]: location }]\n : []),\n ...(origin\n ? [{ [`metadata.annotations.${ANNOTATION_ORIGIN_LOCATION}`]: origin }]\n : []),\n ],\n });\n return response.items;\n }, [location, origin]);\n\n return {\n loading,\n error,\n location,\n originLocation: origin,\n colocatedEntities: value?.filter(\n colocated => stringifyEntityRef(colocated) !== currentEntityRef,\n ),\n };\n}\n\nfunction EntityList(props: { entities: Entity[]; header?: [string, string] }) {\n return (\n <List dense>\n {props.header && <KeyValueListItem key=\"header\" entry={props.header} />}\n {props.entities.map(entity => (\n <ListItem key={stringifyEntityRef(entity)}>\n <ListItemText primary={<EntityRefLink entityRef={entity} />} />\n </ListItem>\n ))}\n </List>\n );\n}\n\nfunction Contents(props: { entity: Entity }) {\n const { entity } = props;\n const { t } = useTranslationRef(catalogReactTranslationRef);\n\n const { loading, error, location, originLocation, colocatedEntities } =\n useColocated(entity);\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n if (!location && !originLocation) {\n return (\n <Alert severity=\"warning\">\n {t('inspectEntityDialog.colocatedPage.alertNoLocation')}\n </Alert>\n );\n } else if (!colocatedEntities?.length) {\n return (\n <Alert severity=\"info\">\n {t('inspectEntityDialog.colocatedPage.alertNoEntity')}\n </Alert>\n );\n }\n\n if (location === originLocation) {\n return <EntityList entities={colocatedEntities} />;\n }\n\n const atLocation = colocatedEntities.filter(\n e => e.metadata.annotations?.[ANNOTATION_LOCATION] === location,\n );\n const atOrigin = colocatedEntities.filter(\n e =>\n e.metadata.annotations?.[ANNOTATION_ORIGIN_LOCATION] === originLocation,\n );\n\n return (\n <>\n {atLocation.length > 0 && (\n <EntityList\n entities={atLocation}\n header={['At the same location', location!]}\n />\n )}\n {atOrigin.length > 0 && (\n <EntityList\n entities={atOrigin}\n header={['At the same origin', originLocation!]}\n />\n )}\n </>\n );\n}\n\nexport function ColocatedPage(props: { entity: Entity }) {\n const classes = useStyles();\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <>\n <DialogContentText variant=\"h2\">\n {t('inspectEntityDialog.colocatedPage.title')}\n </DialogContentText>\n <DialogContentText>\n {t('inspectEntityDialog.colocatedPage.description')}\n </DialogContentText>\n <div className={classes.root}>\n <Contents entity={props.entity} />\n </div>\n </>\n );\n}\n","/*\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 { JsonObject } from '@backstage/types';\n\nexport function sortKeys(data: JsonObject): JsonObject {\n // we could do something custom, but lexicographical sorting is actually a\n // good choice at least for the default set of keys\n return Object.fromEntries(\n [...Object.entries(data)].sort((a, b) => (a[0] < b[0] ? -1 : 1)),\n );\n}\n","/*\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 { Entity } from '@backstage/catalog-model';\nimport { CodeSnippet } from '@backstage/core-components';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport React from 'react';\nimport { sortKeys } from './util';\nimport { catalogReactTranslationRef } from '../../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport function JsonPage(props: { entity: Entity }) {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <>\n <DialogContentText variant=\"h2\">\n {t('inspectEntityDialog.jsonPage.title')}\n </DialogContentText>\n <DialogContentText>\n {t('inspectEntityDialog.jsonPage.description')}\n </DialogContentText>\n <DialogContentText>\n <div style={{ fontSize: '75%' }} data-testid=\"code-snippet\">\n <CodeSnippet\n text={JSON.stringify(sortKeys(props.entity), undefined, 2)}\n language=\"json\"\n showCopyCodeButton\n />\n </div>\n </DialogContentText>\n </>\n );\n}\n","/*\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 { AlphaEntity } from '@backstage/catalog-model/alpha';\nimport Box from '@material-ui/core/Box';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport groupBy from 'lodash/groupBy';\nimport sortBy from 'lodash/sortBy';\nimport React from 'react';\nimport { EntityRefLink } from '../../EntityRefLink';\nimport {\n Container,\n HelpIcon,\n KeyValueListItem,\n ListItemText,\n ListSubheader,\n} from './common';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { CopyTextButton } from '@backstage/core-components';\nimport { catalogReactTranslationRef } from '../../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n },\n});\n\nexport function OverviewPage(props: { entity: AlphaEntity }) {\n const classes = useStyles();\n const {\n apiVersion,\n kind,\n metadata,\n spec,\n relations = [],\n status = {},\n } = props.entity;\n\n const groupedRelations = groupBy(\n sortBy(relations, r => r.targetRef),\n 'type',\n );\n const { t } = useTranslationRef(catalogReactTranslationRef);\n\n const entityRef = stringifyEntityRef(props.entity);\n return (\n <>\n <DialogContentText variant=\"h2\">\n {t('inspectEntityDialog.overviewPage.title')}\n </DialogContentText>\n <div className={classes.root}>\n <Container title=\"Identity\">\n <List dense>\n <ListItem>\n <ListItemText primary=\"apiVersion\" secondary={apiVersion} />\n </ListItem>\n <ListItem>\n <ListItemText primary=\"kind\" secondary={kind} />\n </ListItem>\n {spec?.type && (\n <ListItem>\n <ListItemText\n primary=\"spec.type\"\n secondary={spec.type?.toString()}\n />\n </ListItem>\n )}\n {metadata.uid && (\n <ListItem>\n <ListItemText primary=\"uid\" secondary={metadata.uid} />\n <ListItemSecondaryAction>\n <CopyTextButton text={metadata.uid} />\n </ListItemSecondaryAction>\n </ListItem>\n )}\n {metadata.etag && (\n <ListItem>\n <ListItemText primary=\"etag\" secondary={metadata.etag} />\n <ListItemSecondaryAction>\n <CopyTextButton text={metadata.etag} />\n </ListItemSecondaryAction>\n </ListItem>\n )}\n <ListItem>\n <ListItemText primary=\"entityRef\" secondary={entityRef} />\n <ListItemSecondaryAction>\n <CopyTextButton text={entityRef} />\n </ListItemSecondaryAction>\n </ListItem>\n </List>\n </Container>\n\n <Container title=\"Metadata\">\n {!!Object.keys(metadata.annotations || {}).length && (\n <List\n dense\n subheader={\n <ListSubheader>\n Annotations\n <HelpIcon to=\"https://backstage.io/docs/features/software-catalog/well-known-annotations\" />\n </ListSubheader>\n }\n >\n {Object.entries(metadata.annotations!).map(entry => (\n <KeyValueListItem key={entry[0]} indent entry={entry} />\n ))}\n </List>\n )}\n {!!Object.keys(metadata.labels || {}).length && (\n <List dense subheader={<ListSubheader>Labels</ListSubheader>}>\n {Object.entries(metadata.labels!).map(entry => (\n <KeyValueListItem key={entry[0]} indent entry={entry} />\n ))}\n </List>\n )}\n {!!metadata.tags?.length && (\n <List dense subheader={<ListSubheader>Tags</ListSubheader>}>\n {metadata.tags.map((tag, index) => (\n <ListItem key={`${tag}-${index}`}>\n <ListItemIcon />\n <ListItemText primary={tag} />\n </ListItem>\n ))}\n </List>\n )}\n </Container>\n\n {!!relations.length && (\n <Container\n title=\"Relations\"\n helpLink=\"https://backstage.io/docs/features/software-catalog/well-known-relations\"\n >\n {Object.entries(groupedRelations).map(\n ([type, groupRelations], index) => (\n <div key={index}>\n <List dense subheader={<ListSubheader>{type}</ListSubheader>}>\n {groupRelations.map(group => (\n <ListItem key={group.targetRef}>\n <ListItemText\n primary={\n <EntityRefLink entityRef={group.targetRef} />\n }\n />\n </ListItem>\n ))}\n </List>\n </div>\n ),\n )}\n </Container>\n )}\n\n {!!status.items?.length && (\n <Container\n title=\"Status\"\n helpLink=\"https://backstage.io/docs/features/software-catalog/well-known-statuses\"\n >\n {status.items.map((item, index) => (\n <div key={index}>\n <Typography>\n {item.level}: {item.type}\n </Typography>\n <Box ml={2}>{item.message}</Box>\n </div>\n ))}\n </Container>\n )}\n </div>\n </>\n );\n}\n","/*\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 { Entity } from '@backstage/catalog-model';\nimport { CodeSnippet } from '@backstage/core-components';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport React from 'react';\nimport YAML from 'yaml';\nimport { sortKeys } from './util';\nimport { catalogReactTranslationRef } from '../../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport function YamlPage(props: { entity: Entity }) {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <>\n <DialogContentText variant=\"h2\">\n {t('inspectEntityDialog.yamlPage.title')}\n </DialogContentText>\n <DialogContentText>\n {t('inspectEntityDialog.yamlPage.description')}\n </DialogContentText>\n <DialogContentText>\n <div style={{ fontSize: '75%' }} data-testid=\"code-snippet\">\n <CodeSnippet\n text={YAML.stringify(sortKeys(props.entity))}\n language=\"yaml\"\n showCopyCodeButton\n />\n </div>\n </DialogContentText>\n </>\n );\n}\n","/*\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 { Entity } from '@backstage/catalog-model';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Tab from '@material-ui/core/Tab';\nimport Tabs from '@material-ui/core/Tabs';\nimport { makeStyles } from '@material-ui/core/styles';\nimport React, { useEffect } from 'react';\nimport { AncestryPage } from './components/AncestryPage';\nimport { ColocatedPage } from './components/ColocatedPage';\nimport { JsonPage } from './components/JsonPage';\nimport { OverviewPage } from './components/OverviewPage';\nimport { YamlPage } from './components/YamlPage';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst useStyles = makeStyles(theme => ({\n fullHeightDialog: {\n height: 'calc(100% - 64px)',\n },\n root: {\n display: 'flex',\n flexGrow: 1,\n width: '100%',\n backgroundColor: theme.palette.background.paper,\n },\n tabs: {\n borderRight: `1px solid ${theme.palette.divider}`,\n flexShrink: 0,\n },\n tabContents: {\n flexGrow: 1,\n overflowX: 'auto',\n },\n}));\n\nfunction TabPanel(props: {\n children?: React.ReactNode;\n index: number;\n value: number;\n}) {\n const { children, value, index, ...other } = props;\n const classes = useStyles();\n return (\n <div\n role=\"tabpanel\"\n hidden={value !== index}\n id={`vertical-tabpanel-${index}`}\n aria-labelledby={`vertical-tab-${index}`}\n className={classes.tabContents}\n {...other}\n >\n {value === index && (\n <Box pl={3} pr={3}>\n {children}\n </Box>\n )}\n </div>\n );\n}\n\nfunction a11yProps(index: number) {\n return {\n id: `vertical-tab-${index}`,\n 'aria-controls': `vertical-tabpanel-${index}`,\n };\n}\n\n/**\n * A dialog that lets users inspect the low level details of their entities.\n *\n * @public\n */\nexport function InspectEntityDialog(props: {\n open: boolean;\n entity: Entity;\n onClose: () => void;\n}) {\n const classes = useStyles();\n const [activeTab, setActiveTab] = React.useState(0);\n const { t } = useTranslationRef(catalogReactTranslationRef);\n\n useEffect(() => {\n setActiveTab(0);\n }, [props.open]);\n\n if (!props.entity) {\n return null;\n }\n\n return (\n <Dialog\n fullWidth\n maxWidth=\"xl\"\n open={props.open}\n onClose={props.onClose}\n aria-labelledby=\"entity-inspector-dialog-title\"\n PaperProps={{ className: classes.fullHeightDialog }}\n >\n <DialogTitle id=\"entity-inspector-dialog-title\">\n {t('inspectEntityDialog.title')}\n </DialogTitle>\n <DialogContent dividers>\n <div className={classes.root}>\n <Tabs\n orientation=\"vertical\"\n variant=\"scrollable\"\n value={activeTab}\n onChange={(_, newValue) => setActiveTab(newValue)}\n aria-label=\"Inspector options\"\n className={classes.tabs}\n >\n <Tab label=\"Overview\" {...a11yProps(0)} />\n <Tab label=\"Ancestry\" {...a11yProps(1)} />\n <Tab label=\"Colocated\" {...a11yProps(2)} />\n <Tab label=\"Raw JSON\" {...a11yProps(3)} />\n <Tab label=\"Raw YAML\" {...a11yProps(4)} />\n </Tabs>\n\n <TabPanel value={activeTab} index={0}>\n <OverviewPage entity={props.entity} />\n </TabPanel>\n <TabPanel value={activeTab} index={1}>\n <AncestryPage entity={props.entity} />\n </TabPanel>\n <TabPanel value={activeTab} index={2}>\n <ColocatedPage entity={props.entity} />\n </TabPanel>\n <TabPanel value={activeTab} index={3}>\n <JsonPage entity={props.entity} />\n </TabPanel>\n <TabPanel value={activeTab} index={4}>\n <YamlPage entity={props.entity} />\n </TabPanel>\n </div>\n </DialogContent>\n <DialogActions>\n <Button onClick={props.onClose} color=\"primary\">\n {t('inspectEntityDialog.closeButtonTitle')}\n </Button>\n </DialogActions>\n </Dialog>\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 React from 'react';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport CancelIcon from '@material-ui/icons/Cancel';\nimport { catalogTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\ntype VisibleType = 'visible' | 'hidden' | 'disable';\n\nexport type UnregisterEntityOptions = {\n disableUnregister: boolean | VisibleType;\n};\n\ninterface UnregisterEntityProps {\n unregisterEntityOptions?: UnregisterEntityOptions;\n isUnregisterAllowed: boolean;\n onUnregisterEntity: () => void;\n onClose: () => void;\n}\n\nexport function UnregisterEntity(props: UnregisterEntityProps) {\n const {\n unregisterEntityOptions,\n isUnregisterAllowed,\n onUnregisterEntity,\n onClose,\n } = props;\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const isBoolean =\n typeof unregisterEntityOptions?.disableUnregister === 'boolean';\n\n const isDisabled =\n (!isUnregisterAllowed ||\n (isBoolean\n ? !!unregisterEntityOptions?.disableUnregister\n : unregisterEntityOptions?.disableUnregister === 'disable')) ??\n false;\n\n let unregisterButton = <></>;\n\n if (unregisterEntityOptions?.disableUnregister !== 'hidden') {\n unregisterButton = (\n <MenuItem\n onClick={() => {\n onClose();\n onUnregisterEntity();\n }}\n disabled={isDisabled}\n >\n <ListItemIcon>\n <CancelIcon fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText primary={t('entityContextMenu.unregisterMenuTitle')} />\n </MenuItem>\n );\n }\n\n return <>{unregisterButton}</>;\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 Divider from '@material-ui/core/Divider';\nimport IconButton from '@material-ui/core/IconButton';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport MenuList from '@material-ui/core/MenuList';\nimport Popover from '@material-ui/core/Popover';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { Theme, makeStyles } from '@material-ui/core/styles';\nimport BugReportIcon from '@material-ui/icons/BugReport';\nimport MoreVert from '@material-ui/icons/MoreVert';\nimport FileCopyTwoToneIcon from '@material-ui/icons/FileCopyTwoTone';\nimport React, { useEffect, useState } from 'react';\nimport { IconComponent } from '@backstage/core-plugin-api';\nimport { useEntityPermission } from '@backstage/plugin-catalog-react/alpha';\nimport { catalogEntityDeletePermission } from '@backstage/plugin-catalog-common/alpha';\nimport { UnregisterEntity, UnregisterEntityOptions } from './UnregisterEntity';\nimport { useApi, alertApiRef } from '@backstage/core-plugin-api';\nimport useCopyToClipboard from 'react-use/esm/useCopyToClipboard';\nimport { catalogTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport type EntityContextMenuClassKey = 'button';\n\nconst useStyles = makeStyles(\n (theme: Theme) => {\n return {\n button: {\n color: theme.page.fontColor,\n },\n };\n },\n { name: 'PluginCatalogEntityContextMenu' },\n);\n\n// NOTE(freben): Intentionally not exported at this point, since it's part of\n// the unstable extra context menu items concept below\ninterface ExtraContextMenuItem {\n title: string;\n Icon: IconComponent;\n onClick: () => void;\n}\n\ninterface EntityContextMenuProps {\n UNSTABLE_extraContextMenuItems?: ExtraContextMenuItem[];\n UNSTABLE_contextMenuOptions?: UnregisterEntityOptions;\n onUnregisterEntity: () => void;\n onInspectEntity: () => void;\n}\n\nexport function EntityContextMenu(props: EntityContextMenuProps) {\n const {\n UNSTABLE_extraContextMenuItems,\n UNSTABLE_contextMenuOptions,\n onUnregisterEntity,\n onInspectEntity,\n } = props;\n const { t } = useTranslationRef(catalogTranslationRef);\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement>();\n const classes = useStyles();\n const unregisterPermission = useEntityPermission(\n catalogEntityDeletePermission,\n );\n const isAllowed = unregisterPermission.allowed;\n\n const onOpen = (event: React.SyntheticEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const onClose = () => {\n setAnchorEl(undefined);\n };\n\n const alertApi = useApi(alertApiRef);\n const [copyState, copyToClipboard] = useCopyToClipboard();\n useEffect(() => {\n if (!copyState.error && copyState.value) {\n alertApi.post({\n message: t('entityContextMenu.copiedMessage'),\n severity: 'info',\n display: 'transient',\n });\n }\n }, [copyState, alertApi, t]);\n\n const extraItems = UNSTABLE_extraContextMenuItems && [\n ...UNSTABLE_extraContextMenuItems.map(item => (\n <MenuItem\n key={item.title}\n onClick={() => {\n onClose();\n item.onClick();\n }}\n >\n <ListItemIcon>\n <item.Icon fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText primary={item.title} />\n </MenuItem>\n )),\n <Divider key=\"the divider is here!\" />,\n ];\n\n return (\n <>\n <Tooltip title={t('entityContextMenu.moreButtonTitle')} arrow>\n <IconButton\n aria-label=\"more\"\n aria-controls=\"long-menu\"\n aria-haspopup=\"true\"\n aria-expanded={!!anchorEl}\n role=\"button\"\n onClick={onOpen}\n data-testid=\"menu-button\"\n className={classes.button}\n id=\"long-menu\"\n >\n <MoreVert />\n </IconButton>\n </Tooltip>\n <Popover\n open={Boolean(anchorEl)}\n onClose={onClose}\n anchorEl={anchorEl}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n transformOrigin={{ vertical: 'top', horizontal: 'right' }}\n aria-labelledby=\"long-menu\"\n >\n <MenuList autoFocusItem={Boolean(anchorEl)}>\n {extraItems}\n <UnregisterEntity\n unregisterEntityOptions={UNSTABLE_contextMenuOptions}\n isUnregisterAllowed={isAllowed}\n onUnregisterEntity={onUnregisterEntity}\n onClose={onClose}\n />\n <MenuItem\n onClick={() => {\n onClose();\n onInspectEntity();\n }}\n >\n <ListItemIcon>\n <BugReportIcon fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText primary={t('entityContextMenu.inspectMenuTitle')} />\n </MenuItem>\n <MenuItem\n onClick={() => {\n onClose();\n copyToClipboard(window.location.toString());\n }}\n >\n <ListItemIcon>\n <FileCopyTwoToneIcon fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText primary={t('entityContextMenu.copyURLMenuTitle')} />\n </MenuItem>\n </MenuList>\n </Popover>\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 {\n Entity,\n DEFAULT_NAMESPACE,\n RELATION_OWNED_BY,\n} from '@backstage/catalog-model';\nimport {\n Content,\n Header,\n HeaderLabel,\n Link,\n Page,\n Progress,\n RoutedTabs,\n WarningPanel,\n} from '@backstage/core-components';\nimport {\n attachComponentData,\n IconComponent,\n useElementFilter,\n useRouteRef,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport {\n EntityDisplayName,\n EntityRefLinks,\n entityRouteRef,\n FavoriteEntity,\n getEntityRelations,\n InspectEntityDialog,\n UnregisterEntityDialog,\n useAsyncEntity,\n} from '@backstage/plugin-catalog-react';\nimport Box from '@material-ui/core/Box';\nimport { TabProps } from '@material-ui/core/Tab';\nimport Alert from '@material-ui/lab/Alert';\nimport React, { useEffect, useState } from 'react';\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport { EntityContextMenu } from '../EntityContextMenu/EntityContextMenu';\nimport { rootRouteRef, unregisterRedirectRouteRef } from '../../routes';\nimport { catalogTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport type EntityLayoutRouteProps = {\n path: string;\n title: string;\n children: JSX.Element;\n if?: (entity: Entity) => boolean;\n tabProps?: TabProps<React.ElementType, { component?: React.ElementType }>;\n};\n\nconst dataKey = 'plugin.catalog.entityLayoutRoute';\n\nconst Route: (props: EntityLayoutRouteProps) => null = () => null;\nattachComponentData(Route, dataKey, true);\nattachComponentData(Route, 'core.gatherMountPoints', true); // This causes all mount points that are discovered within this route to use the path of the route itself\n\nfunction EntityLayoutTitle(props: {\n title: string;\n entity: Entity | undefined;\n}) {\n const { entity, title } = props;\n return (\n <Box display=\"inline-flex\" alignItems=\"center\" height=\"1em\" maxWidth=\"100%\">\n <Box\n component=\"span\"\n textOverflow=\"ellipsis\"\n whiteSpace=\"nowrap\"\n overflow=\"hidden\"\n >\n {entity ? <EntityDisplayName entityRef={entity} hideIcon /> : title}\n </Box>\n {entity && <FavoriteEntity entity={entity} />}\n </Box>\n );\n}\n\nfunction headerProps(\n paramKind: string | undefined,\n paramNamespace: string | undefined,\n paramName: string | undefined,\n entity: Entity | undefined,\n): { headerTitle: string; headerType: string } {\n const kind = paramKind ?? entity?.kind ?? '';\n const namespace = paramNamespace ?? entity?.metadata.namespace ?? '';\n const name =\n entity?.metadata.title ?? paramName ?? entity?.metadata.name ?? '';\n return {\n headerTitle: `${name}${\n namespace && namespace !== DEFAULT_NAMESPACE ? ` in ${namespace}` : ''\n }`,\n headerType: (() => {\n let t = kind.toLocaleLowerCase('en-US');\n if (entity && entity.spec && 'type' in entity.spec) {\n t += ' — ';\n t += (entity.spec as { type: string }).type.toLocaleLowerCase('en-US');\n }\n return t;\n })(),\n };\n}\n\nfunction EntityLabels(props: { entity: Entity }) {\n const { entity } = props;\n const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);\n const { t } = useTranslationRef(catalogTranslationRef);\n return (\n <>\n {ownedByRelations.length > 0 && (\n <HeaderLabel\n label={t('entityLabels.ownerLabel')}\n contentTypograpyRootComponent=\"p\"\n value={\n <EntityRefLinks\n entityRefs={ownedByRelations}\n defaultKind=\"Group\"\n color=\"inherit\"\n />\n }\n />\n )}\n {entity.spec?.lifecycle && (\n <HeaderLabel\n label={t('entityLabels.lifecycleLabel')}\n value={entity.spec.lifecycle?.toString()}\n />\n )}\n </>\n );\n}\n\n// NOTE(freben): Intentionally not exported at this point, since it's part of\n// the unstable extra context menu items concept below\ninterface ExtraContextMenuItem {\n title: string;\n Icon: IconComponent;\n onClick: () => void;\n}\n\ntype VisibleType = 'visible' | 'hidden' | 'disable';\n\n// NOTE(blam): Intentionally not exported at this point, since it's part of\n// unstable context menu option, eg: disable the unregister entity menu\ninterface EntityContextMenuOptions {\n disableUnregister: boolean | VisibleType;\n}\n\n/** @public */\nexport interface EntityLayoutProps {\n UNSTABLE_extraContextMenuItems?: ExtraContextMenuItem[];\n UNSTABLE_contextMenuOptions?: EntityContextMenuOptions;\n children?: React.ReactNode;\n NotFoundComponent?: React.ReactNode;\n}\n\n/**\n * EntityLayout is a compound component, which allows you to define a layout for\n * entities using a sub-navigation mechanism.\n *\n * Consists of two parts: EntityLayout and EntityLayout.Route\n *\n * @example\n * ```jsx\n * <EntityLayout>\n * <EntityLayout.Route path=\"/example\" title=\"Example tab\">\n * <div>This is rendered under /example/anything-here route</div>\n * </EntityLayout.Route>\n * </EntityLayout>\n * ```\n *\n * @public\n */\nexport const EntityLayout = (props: EntityLayoutProps) => {\n const {\n UNSTABLE_extraContextMenuItems,\n UNSTABLE_contextMenuOptions,\n children,\n NotFoundComponent,\n } = props;\n const { kind, namespace, name } = useRouteRefParams(entityRouteRef);\n const { entity, loading, error } = useAsyncEntity();\n const location = useLocation();\n const routes = useElementFilter(\n children,\n elements =>\n elements\n .selectByComponentData({\n key: dataKey,\n withStrictError:\n 'Child of EntityLayout must be an EntityLayout.Route',\n })\n .getElements<EntityLayoutRouteProps>() // all nodes, element data, maintain structure or not?\n .flatMap(({ props: elementProps }) => {\n if (!entity) {\n return [];\n } else if (elementProps.if && !elementProps.if(entity)) {\n return [];\n }\n\n return [\n {\n path: elementProps.path,\n title: elementProps.title,\n children: elementProps.children,\n tabProps: elementProps.tabProps,\n },\n ];\n }),\n [entity],\n );\n\n const { headerTitle, headerType } = headerProps(\n kind,\n namespace,\n name,\n entity,\n );\n\n const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);\n const [inspectionDialogOpen, setInspectionDialogOpen] = useState(false);\n const navigate = useNavigate();\n const catalogRoute = useRouteRef(rootRouteRef);\n const unregisterRedirectRoute = useRouteRef(unregisterRedirectRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const cleanUpAfterRemoval = async () => {\n setConfirmationDialogOpen(false);\n setInspectionDialogOpen(false);\n navigate(\n unregisterRedirectRoute ? unregisterRedirectRoute() : catalogRoute(),\n );\n };\n\n // Make sure to close the dialog if the user clicks links in it that navigate\n // to another entity.\n useEffect(() => {\n setConfirmationDialogOpen(false);\n setInspectionDialogOpen(false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [location.pathname]);\n\n return (\n <Page themeId={entity?.spec?.type?.toString() ?? 'home'}>\n <Header\n title={<EntityLayoutTitle title={headerTitle} entity={entity!} />}\n pageTitleOverride={headerTitle}\n type={headerType}\n >\n {entity && (\n <>\n <EntityLabels entity={entity} />\n <EntityContextMenu\n UNSTABLE_extraContextMenuItems={UNSTABLE_extraContextMenuItems}\n UNSTABLE_contextMenuOptions={UNSTABLE_contextMenuOptions}\n onUnregisterEntity={() => setConfirmationDialogOpen(true)}\n onInspectEntity={() => setInspectionDialogOpen(true)}\n />\n </>\n )}\n </Header>\n\n {loading && <Progress />}\n\n {entity && <RoutedTabs routes={routes} />}\n\n {error && (\n <Content>\n <Alert severity=\"error\">{error.toString()}</Alert>\n </Content>\n )}\n\n {!loading && !error && !entity && (\n <Content>\n {NotFoundComponent ? (\n NotFoundComponent\n ) : (\n <WarningPanel title={t('entityLabels.warningPanelTitle')}>\n There is no {kind} with the requested{' '}\n <Link to=\"https://backstage.io/docs/features/software-catalog/references\">\n kind, namespace, and name\n </Link>\n .\n </WarningPanel>\n )}\n </Content>\n )}\n\n <UnregisterEntityDialog\n open={confirmationDialogOpen}\n entity={entity!}\n onConfirm={cleanUpAfterRemoval}\n onClose={() => setConfirmationDialogOpen(false)}\n />\n <InspectEntityDialog\n open={inspectionDialogOpen}\n entity={entity!}\n onClose={() => setInspectionDialogOpen(false)}\n />\n </Page>\n );\n};\n\nEntityLayout.Route = Route;\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const catalogTranslationRef = createTranslationRef({\n id: 'catalog',\n messages: {\n indexPage: {\n title: `{{orgName}} Catalog`,\n createButtonTitle: 'Create',\n supportButtonContent: 'All your software catalog entities',\n },\n aboutCard: {\n title: 'About',\n refreshButtonTitle: 'Schedule entity refresh',\n editButtonTitle: 'Edit Metadata',\n createSimilarButtonTitle: 'Create something similar',\n refreshScheduledMessage: 'Refresh scheduled',\n launchTemplate: 'Launch Template',\n viewTechdocs: 'View TechDocs',\n viewSource: 'View Source',\n descriptionField: {\n label: 'Description',\n value: 'No description',\n },\n ownerField: {\n label: 'Owner',\n value: 'No Owner',\n },\n domainField: {\n label: 'Domain',\n value: 'No Domain',\n },\n systemField: {\n label: 'System',\n value: 'No System',\n },\n parentComponentField: {\n label: 'Parent Component',\n value: 'No Parent Component',\n },\n typeField: {\n label: 'Type',\n },\n lifecycleField: {\n label: 'Lifecycle',\n },\n tagsField: {\n label: 'Tags',\n value: 'No Tags',\n },\n targetsField: {\n label: 'Targets',\n },\n },\n searchResultItem: {\n lifecycle: 'Lifecycle',\n Owner: 'Owner',\n },\n catalogTable: {\n warningPanelTitle: 'Could not fetch catalog entities.',\n viewActionTitle: 'View',\n editActionTitle: 'Edit',\n starActionTitle: 'Add to favorites',\n unStarActionTitle: 'Remove from favorites',\n },\n dependencyOfComponentsCard: {\n title: 'Dependency of components',\n emptyMessage: 'No component depends on this component',\n },\n dependsOnComponentsCard: {\n title: 'Depends on components',\n emptyMessage: 'No component is a dependency of this component',\n },\n dependsOnResourcesCard: {\n title: 'Depends on resources',\n emptyMessage: 'No resource is a dependency of this component',\n },\n entityContextMenu: {\n copiedMessage: 'Copied!',\n moreButtonTitle: 'More',\n inspectMenuTitle: 'Inspect entity',\n copyURLMenuTitle: 'Copy entity URL',\n unregisterMenuTitle: 'Unregister entity',\n },\n entityLabelsCard: {\n title: 'Labels',\n emptyDescription:\n 'No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityLabels: {\n warningPanelTitle: 'Entity not found',\n ownerLabel: 'Owner',\n lifecycleLabel: 'Lifecycle',\n },\n entityLinksCard: {\n title: 'Links',\n emptyDescription:\n 'No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityNotFound: {\n title: 'Entity was not found',\n description:\n 'Want to help us build this? Check out our Getting Started documentation.',\n docButtonTitle: 'DOCS',\n },\n deleteEntity: {\n dialogTitle: 'Are you sure you want to delete this entity?',\n deleteButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n description:\n 'This entity is not referenced by any location and is therefore not receiving updates. Click here to delete.',\n },\n entityProcessingErrorsDescription: 'The error below originates from',\n entityRelationWarningDescription:\n \"This entity has relations to other entities, which can't be found in the catalog.\\n Entities not found are: \",\n hasComponentsCard: {\n title: 'Has components',\n emptyMessage: 'No component is part of this system',\n },\n hasResourcesCard: {\n title: 'Has resources',\n emptyMessage: 'No resource is part of this system',\n },\n hasSubcomponentsCard: {\n title: 'Has subcomponents',\n emptyMessage: 'No subcomponent is part of this component',\n },\n hasSystemsCard: {\n title: 'Has systems',\n emptyMessage: 'No system is part of this domain',\n },\n relatedEntitiesCard: {\n emptyHelpLinkTitle: 'Learn how to change this.',\n },\n systemDiagramCard: {\n title: 'System Diagram',\n description: 'Use pinch & zoo to move around the diagram.',\n edgeLabels: {\n partOf: 'part of',\n provides: 'provides',\n dependsOn: 'depends on',\n },\n },\n },\n});\n","/*\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 BasicPermission,\n Permission,\n PermissionAttributes,\n ResourcePermission,\n} from '../types';\n\n/**\n * Utility function for creating a valid {@link ResourcePermission}, inferring\n * the appropriate type and resource type parameter.\n *\n * @public\n */\nexport function createPermission<TResourceType extends string>(input: {\n name: string;\n attributes: PermissionAttributes;\n resourceType: TResourceType;\n}): ResourcePermission<TResourceType>;\n/**\n * Utility function for creating a valid {@link BasicPermission}.\n *\n * @public\n */\nexport function createPermission(input: {\n name: string;\n attributes: PermissionAttributes;\n}): BasicPermission;\nexport function createPermission({\n name,\n attributes,\n resourceType,\n}: {\n name: string;\n attributes: PermissionAttributes;\n resourceType?: string;\n}): Permission {\n if (resourceType) {\n return {\n type: 'resource',\n name,\n attributes,\n resourceType,\n };\n }\n\n return {\n type: 'basic',\n name,\n attributes,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AuthorizePermissionRequest,\n AuthorizePermissionResponse,\n DefinitivePolicyDecision,\n EvaluatorRequestOptions,\n Permission,\n PermissionAuthorizer,\n PermissionEvaluator,\n QueryPermissionRequest,\n QueryPermissionResponse,\n ResourcePermission,\n} from '../types';\n\n/**\n * Check if the two parameters are equivalent permissions.\n * @public\n */\nexport function isPermission<T extends Permission>(\n permission: Permission,\n comparedPermission: T,\n): permission is T {\n return permission.name === comparedPermission.name;\n}\n\n/**\n * Check if a given permission is a {@link ResourcePermission}. When\n * `resourceType` is supplied as the second parameter, also checks if\n * the permission has the specified resource type.\n * @public\n */\nexport function isResourcePermission<T extends string = string>(\n permission: Permission,\n resourceType?: T,\n): permission is ResourcePermission<T> {\n if (!('resourceType' in permission)) {\n return false;\n }\n\n return !resourceType || permission.resourceType === resourceType;\n}\n\n/**\n * Check if a given permission is related to a create action.\n * @public\n */\nexport function isCreatePermission(permission: Permission) {\n return permission.attributes.action === 'create';\n}\n\n/**\n * Check if a given permission is related to a read action.\n * @public\n */\nexport function isReadPermission(permission: Permission) {\n return permission.attributes.action === 'read';\n}\n\n/**\n * Check if a given permission is related to an update action.\n * @public\n */\nexport function isUpdatePermission(permission: Permission) {\n return permission.attributes.action === 'update';\n}\n\n/**\n * Check if a given permission is related to a delete action.\n * @public\n */\nexport function isDeletePermission(permission: Permission) {\n return permission.attributes.action === 'delete';\n}\n\n/**\n * Convert {@link PermissionAuthorizer} to {@link PermissionEvaluator}.\n *\n * @public\n */\nexport function toPermissionEvaluator(\n permissionAuthorizer: PermissionAuthorizer,\n): PermissionEvaluator {\n return {\n authorize: async (\n requests: AuthorizePermissionRequest[],\n options?: EvaluatorRequestOptions,\n ): Promise<AuthorizePermissionResponse[]> => {\n const response = await permissionAuthorizer.authorize(requests, options);\n\n return response as DefinitivePolicyDecision[];\n },\n authorizeConditional(\n requests: QueryPermissionRequest[],\n options?: EvaluatorRequestOptions,\n ): Promise<QueryPermissionResponse[]> {\n const parsedRequests =\n requests as unknown as AuthorizePermissionRequest[];\n return permissionAuthorizer.authorize(parsedRequests, options);\n },\n };\n}\n","/*\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 { useApi } from '@backstage/core-plugin-api';\nimport { permissionApiRef } from '../apis';\nimport {\n AuthorizeResult,\n isResourcePermission,\n Permission,\n ResourcePermission,\n} from '@backstage/plugin-permission-common';\nimport useSWR from 'swr';\n\n/** @public */\nexport type AsyncPermissionResult = {\n loading: boolean;\n allowed: boolean;\n error?: Error;\n};\n\n/**\n * React hook utility for authorization. Given either a non-resource\n * {@link @backstage/plugin-permission-common#Permission} or a\n * {@link @backstage/plugin-permission-common#ResourcePermission} and an\n * optional resourceRef, it will return whether or not access is allowed (for\n * the given resource, if resourceRef is provided). See\n * {@link @backstage/plugin-permission-common/PermissionClient#authorize} for\n * more details.\n *\n * The resourceRef field is optional to allow calling this hook with an\n * entity that might be loading asynchronously, but when resourceRef is not\n * supplied, the value of `allowed` will always be false.\n *\n * Note: This hook uses stale-while-revalidate to help avoid flicker in UI\n * elements that would be conditionally rendered based on the `allowed` result\n * of this hook.\n * @public\n */\nexport function usePermission(\n input:\n | {\n permission: Exclude<Permission, ResourcePermission>;\n resourceRef?: never;\n }\n | {\n permission: ResourcePermission;\n resourceRef: string | undefined;\n },\n): AsyncPermissionResult {\n const permissionApi = useApi(permissionApiRef);\n const { data, error } = useSWR(input, async (args: typeof input) => {\n // We could make the resourceRef parameter required to avoid this check, but\n // it would make using this hook difficult in situations where the entity\n // must be asynchronously loaded, so instead we short-circuit to a deny when\n // no resourceRef is supplied, on the assumption that the resourceRef is\n // still loading outside the hook.\n if (isResourcePermission(args.permission) && !args.resourceRef) {\n return AuthorizeResult.DENY;\n }\n\n const { result } = await permissionApi.authorize(args);\n return result;\n });\n\n if (error) {\n return { error, loading: false, allowed: false };\n }\n if (data === undefined) {\n return { loading: true, allowed: false };\n }\n return { loading: false, allowed: data === AuthorizeResult.ALLOW };\n}\n"],"names":["useStyles","makeStyles","theme","text","fontFamily","whiteSpace","overflowX","marginRight","spacing","divider","margin","name","ResponseErrorPanel","props","title","error","defaultExpanded","classes","ErrorPanel","message","body","cause","request","response","errorString","statusCode","requestString","method","url","messageString","replace","stackString","stack","jsonString","JSON","stringify","undefined","ListItem","alignItems","ListItemText","secondary","primary","CopyTextButton","Divider","component","className","CodeSnippet","language","showCopyCodeButton","tabsWrapper","gridArea","backgroundColor","palette","background","paper","paddingLeft","minWidth","defaultTab","typography","caption","padding","textTransform","fontWeight","fontWeightBold","color","selected","tabRoot","default","HeaderTabs","tabs","onChange","selectedIndex","selectedTab","setSelectedTab","useState","styles","handleChange","useCallback","_","index","useEffect","Box","Tabs","indicatorColor","textColor","variant","scrollButtons","aria-label","value","map","tab","TabUI","data-testid","label","root","tabProps","id","RESOURCE_TYPE_CATALOG_ENTITY","catalogEntityReadPermission","createPermission","attributes","action","resourceType","catalogEntityCreatePermission","catalogEntityDeletePermission","catalogEntityRefreshPermission","catalogLocationReadPermission","catalogLocationCreatePermission","catalogLocationDeletePermission","catalogPermissions","useEntityPermission","permission","entity","loading","loadingEntity","entityError","useAsyncEntity","allowed","loadingPermission","permissionError","usePermission","resourceRef","stringifyEntityRef","useSelectedSubRoute","subRoutes","params","useParams","sortedRoutes","path","children","caseSensitive","element","sort","a","b","localeCompare","useRoutes","currentRoute","startsWith","matchedRoute","matchRoutes","foundIndex","findIndex","t","route","RoutedTabs","routes","headerTabs","useMemo","to","Link","Content","Helmet","getEntityRef","entityOrRef","useStarredEntity","starredEntitiesApi","useApi","starredEntitiesApiRef","isStarredEntity","setIsStarredEntity","subscription","starredEntitie$","subscribe","next","starredEntities","has","unsubscribe","toggleStarredEntity","toggleStarred","then","YellowStar","withStyles","Star","FavoriteEntity","useTranslationRef","catalogReactTranslationRef","IconButton","onClick","Tooltip","StarBorder","useUnregisterEntityDialogState","catalogApi","catalogApiRef","locationRef","metadata","annotations","ANNOTATION_ORIGIN_LOCATION","uid","isBootstrap","prerequisites","useAsync","locationPromise","getLocationByRef","colocatedEntitiesPromise","Promise","resolve","locationAnnotationFilter","getEntities","filter","fields","items","all","location","colocatedEntities","unregisterLocation","removeLocationById","deleteEntity","removeEntityByUid","type","getCompoundEntityRef","advancedButton","fontSize","dialogActions","display","Contents","onConfirm","onClose","alertApi","alertApiRef","configApi","configApiRef","state","showDelete","setShowDelete","busy","setBusy","appTitle","getOptionalString","onUnregister","err","assertError","post","onDelete","entityName","severity","DialogActionsPanel","DialogActions","Button","Progress","Alert","marginTop","size","DialogContentText","disabled","e","li","EntityRefLink","entityRef","kind","namespace","marginLeft","paddingTop","paddingBottom","UnregisterEntityDialog","open","Dialog","DialogTitle","DialogContent","DependencyGraphTypes","Direction","Alignment","Ranker","LabelPosition","node","fill","light","stroke","contrastText","DefaultNode","width","setWidth","React","height","setHeight","idRef","current","renderedHeight","renderedWidth","getBBox","Math","round","paddedWidth","paddedHeight","g","rect","rx","ref","y","x","textAnchor","alignmentBaseline","ARROW_MARKER_ID","NODE_TEST_ID","EDGE_TEST_ID","LABEL_TEST_ID","transition","transitions","duration","shortest","renderDefault","Node","render","setNode","nodeProps","nodeRef","transform","textContrast","DefaultLabel","edge","strokeWidth","textSubtle","Edge","setEdge","curve","showArrowHeads","points","labelProps","labelRef","createPath","d3Shape","d","finitePoints","point","isFinite","markerEnd","WORKSPACE_ID","DependencyGraph","edges","nodes","renderNode","direction","Types","TOP_BOTTOM","align","nodeMargin","edgeMargin","rankMargin","paddingX","paddingY","acyclicer","ranker","NETWORK_SIMPLEX","labelPosition","RIGHT","labelOffset","edgeRanks","edgeWeight","renderLabel","defs","zoom","fit","svgProps","useTheme","containerWidth","setContainerWidth","containerHeight","setContainerHeight","graph","dagre","Graph","graphWidth","setGraphWidth","graphHeight","setGraphHeight","graphNodes","setGraphNodes","graphEdges","setGraphEdges","maxWidth","max","maxHeight","minHeight","min","scalableHeight","containerRef","debounce","container","d3Selection","workspace","getElementById","enableZoom","call","d3Zoom","scaleExtent","Infinity","on","event","k","attr","newContainerWidth","newContainerHeight","getBoundingClientRect","setNodesAndEdges","currentGraphNodes","currentGraphEdges","forEach","nodeId","some","removeNode","from","v","w","removeEdge","existingNode","find","labelpos","labeloffset","weight","minlen","updateGraph","newHeight","newWidth","leading","setGraph","rankdir","nodesep","edgesep","ranksep","marginx","marginy","cancel","svg","viewBox","marker","markerWidth","markerHeight","refX","refY","orient","markerUnits","DEFAULT_ICON","SvgIcon","getKind","toLocaleLowerCase","parseEntityRef","useIcon","app","useApp","actualKind","getSystemIcon","EntityKindIcon","otherProps","Icon","grey","getContrastText","clickable","cursor","useAncestry","catalogClient","getEntityAncestors","Array","currentRef","isRootNode","rootEntityRef","push","parentRef","parentEntityRefs","CustomNode","navigate","useNavigate","entityRoute","useRouteRef","entityRouteRef","useRef","useLayoutEffect","hasKindIcon","iconSize","paddedIconWidth","displayTitle","humanizeEntityRef","DEFAULT_NAMESPACE","classNames","AncestryPage","gutterBottom","mt","BOTTOM_TOP","flexDirection","helpIcon","monospace","MuiListItemText","primaryTypographyProps","secondaryTypographyProps","ListSubheader","MuiListSubheader","Container","Card","CardContent","Typography","helpLink","HelpIcon","findLink","match","slice","KeyValueListItem","key","entry","link","indent","ListItemIcon","HelpOutlineIcon","useColocated","currentEntityRef","ANNOTATION_LOCATION","origin","originLocation","colocated","EntityList","List","dense","header","entities","length","atLocation","atOrigin","ColocatedPage","div","sortKeys","data","Object","fromEntries","entries","JsonPage","style","OverviewPage","apiVersion","spec","relations","status","groupedRelations","groupBy","sortBy","r","targetRef","toString","ListItemSecondaryAction","etag","keys","subheader","labels","tags","tag","groupRelations","group","item","level","ml","YamlPage","YAML","fullHeightDialog","flexGrow","borderRight","flexShrink","tabContents","TabPanel","other","role","hidden","aria-labelledby","pl","pr","a11yProps","InspectEntityDialog","activeTab","setActiveTab","fullWidth","PaperProps","dividers","orientation","newValue","Tab","UnregisterEntity","unregisterEntityOptions","isUnregisterAllowed","onUnregisterEntity","catalogTranslationRef","isBoolean","disableUnregister","isDisabled","unregisterButton","MenuItem","CancelIcon","button","page","fontColor","EntityContextMenu","UNSTABLE_extraContextMenuItems","UNSTABLE_contextMenuOptions","onInspectEntity","anchorEl","setAnchorEl","isAllowed","onOpen","currentTarget","copyState","copyToClipboard","useCopyToClipboard","extraItems","arrow","aria-controls","aria-haspopup","aria-expanded","MoreVert","Popover","Boolean","anchorOrigin","vertical","horizontal","transformOrigin","MenuList","autoFocusItem","BugReportIcon","window","FileCopyTwoToneIcon","dataKey","Route","attachComponentData","EntityLayoutTitle","textOverflow","overflow","EntityDisplayName","hideIcon","headerProps","paramKind","paramNamespace","paramName","headerTitle","headerType","EntityLabels","ownedByRelations","getEntityRelations","RELATION_OWNED_BY","HeaderLabel","contentTypograpyRootComponent","EntityRefLinks","entityRefs","defaultKind","lifecycle","EntityLayout","NotFoundComponent","useRouteRefParams","useLocation","useElementFilter","elements","selectByComponentData","withStrictError","getElements","flatMap","elementProps","if","confirmationDialogOpen","setConfirmationDialogOpen","inspectionDialogOpen","setInspectionDialogOpen","catalogRoute","rootRouteRef","unregisterRedirectRoute","unregisterRedirectRouteRef","cleanUpAfterRemoval","pathname","Page","themeId","Header","pageTitleOverride","WarningPanel","createTranslationRef","messages","indexPage","createButtonTitle","supportButtonContent","aboutCard","refreshButtonTitle","editButtonTitle","createSimilarButtonTitle","refreshScheduledMessage","launchTemplate","viewTechdocs","viewSource","descriptionField","ownerField","domainField","systemField","parentComponentField","typeField","lifecycleField","tagsField","targetsField","searchResultItem","Owner","catalogTable","warningPanelTitle","viewActionTitle","editActionTitle","starActionTitle","unStarActionTitle","dependencyOfComponentsCard","emptyMessage","dependsOnComponentsCard","dependsOnResourcesCard","entityContextMenu","copiedMessage","moreButtonTitle","inspectMenuTitle","copyURLMenuTitle","unregisterMenuTitle","entityLabelsCard","emptyDescription","readMoreButtonTitle","entityLabels","ownerLabel","lifecycleLabel","entityLinksCard","entityNotFound","description","docButtonTitle","dialogTitle","deleteButtonTitle","cancelButtonTitle","entityProcessingErrorsDescription","entityRelationWarningDescription","hasComponentsCard","hasResourcesCard","hasSubcomponentsCard","hasSystemsCard","relatedEntitiesCard","emptyHelpLinkTitle","systemDiagramCard","edgeLabels","partOf","provides","dependsOn","isPermission","comparedPermission","isResourcePermission","isCreatePermission","isReadPermission","isUpdatePermission","isDeletePermission","toPermissionEvaluator","permissionAuthorizer","authorize","requests","options","authorizeConditional","parsedRequests","input","permissionApi","permissionApiRef","useSWR","args","AuthorizeResult","DENY","result","ALLOW"],"sourceRoot":""}