@backstage/plugin-catalog 1.26.1-next.1 → 1.26.2-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# @backstage/plugin-catalog
|
|
2
2
|
|
|
3
|
+
## 1.26.2-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/plugin-search-react@1.8.6-next.0
|
|
9
|
+
- @backstage/frontend-plugin-api@0.9.5-next.0
|
|
10
|
+
- @backstage/catalog-client@1.9.1
|
|
11
|
+
- @backstage/catalog-model@1.7.3
|
|
12
|
+
- @backstage/core-compat-api@0.3.6-next.0
|
|
13
|
+
- @backstage/core-components@0.16.3
|
|
14
|
+
- @backstage/core-plugin-api@1.10.3
|
|
15
|
+
- @backstage/errors@1.2.7
|
|
16
|
+
- @backstage/integration-react@1.2.3
|
|
17
|
+
- @backstage/types@1.2.1
|
|
18
|
+
- @backstage/plugin-catalog-common@1.1.3
|
|
19
|
+
- @backstage/plugin-catalog-react@1.15.2-next.0
|
|
20
|
+
- @backstage/plugin-permission-react@0.4.30
|
|
21
|
+
- @backstage/plugin-scaffolder-common@1.5.9
|
|
22
|
+
- @backstage/plugin-search-common@1.2.17
|
|
23
|
+
|
|
24
|
+
## 1.26.1
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 208e53b: Fixing spelling mistake in translation
|
|
29
|
+
- Updated dependencies
|
|
30
|
+
- @backstage/plugin-catalog-react@1.15.1
|
|
31
|
+
- @backstage/frontend-plugin-api@0.9.4
|
|
32
|
+
- @backstage/core-plugin-api@1.10.3
|
|
33
|
+
- @backstage/types@1.2.1
|
|
34
|
+
- @backstage/core-components@0.16.3
|
|
35
|
+
- @backstage/catalog-client@1.9.1
|
|
36
|
+
- @backstage/catalog-model@1.7.3
|
|
37
|
+
- @backstage/core-compat-api@0.3.5
|
|
38
|
+
- @backstage/errors@1.2.7
|
|
39
|
+
- @backstage/integration-react@1.2.3
|
|
40
|
+
- @backstage/plugin-catalog-common@1.1.3
|
|
41
|
+
- @backstage/plugin-permission-react@0.4.30
|
|
42
|
+
- @backstage/plugin-scaffolder-common@1.5.9
|
|
43
|
+
- @backstage/plugin-search-common@1.2.17
|
|
44
|
+
- @backstage/plugin-search-react@1.8.5
|
|
45
|
+
|
|
3
46
|
## 1.26.1-next.1
|
|
4
47
|
|
|
5
48
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AboutCard.esm.js","sources":["../../../src/components/AboutCard/AboutCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n ANNOTATION_EDIT_URL,\n ANNOTATION_LOCATION,\n CompoundEntityRef,\n DEFAULT_NAMESPACE,\n stringifyEntityRef,\n parseEntityRef,\n} from '@backstage/catalog-model';\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Divider from '@material-ui/core/Divider';\nimport IconButton from '@material-ui/core/IconButton';\nimport { makeStyles } from '@material-ui/core/styles';\nimport {\n AppIcon,\n HeaderIconLinkRow,\n IconLinkVerticalProps,\n InfoCardVariants,\n Link,\n} from '@backstage/core-components';\nimport React, { useCallback } from 'react';\nimport {\n ScmIntegrationIcon,\n scmIntegrationsApiRef,\n} from '@backstage/integration-react';\nimport {\n alertApiRef,\n errorApiRef,\n useApi,\n useApp,\n useRouteRef,\n} from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n getEntitySourceLocation,\n useEntity,\n} from '@backstage/plugin-catalog-react';\nimport { createFromTemplateRouteRef, viewTechDocRouteRef } from '../../routes';\n\nimport { AboutContent } from './AboutContent';\nimport CachedIcon from '@material-ui/icons/Cached';\nimport CreateComponentIcon from '@material-ui/icons/AddCircleOutline';\nimport DocsIcon from '@material-ui/icons/Description';\nimport EditIcon from '@material-ui/icons/Edit';\nimport { isTemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { useEntityPermission } from '@backstage/plugin-catalog-react/alpha';\nimport { catalogEntityRefreshPermission } from '@backstage/plugin-catalog-common/alpha';\nimport { useSourceTemplateCompoundEntityRef } from './hooks';\nimport { taskCreatePermission } from '@backstage/plugin-scaffolder-common/alpha';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst TECHDOCS_ANNOTATION = 'backstage.io/techdocs-ref';\n\nconst TECHDOCS_EXTERNAL_ANNOTATION = 'backstage.io/techdocs-entity';\n\nconst useStyles = makeStyles({\n gridItemCard: {\n display: 'flex',\n flexDirection: 'column',\n height: 'calc(100% - 10px)', // for pages without content header\n marginBottom: '10px',\n },\n fullHeightCard: {\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n },\n gridItemCardContent: {\n flex: 1,\n },\n fullHeightCardContent: {\n flex: 1,\n },\n});\n\n/**\n * Props for {@link EntityAboutCard}.\n *\n * @public\n */\nexport interface AboutCardProps {\n variant?: InfoCardVariants;\n}\n\n/**\n * Exported publicly via the EntityAboutCard\n *\n * NOTE: We generally do not accept pull requests to extend this class with more\n * props and cusomizability. If you need to tweak it, consider making a bespoke\n * card in your own repository instead, that is perfect for your own needs.\n */\nexport function AboutCard(props: AboutCardProps) {\n const { variant } = props;\n const app = useApp();\n const classes = useStyles();\n const { entity } = useEntity();\n const scmIntegrationsApi = useApi(scmIntegrationsApiRef);\n const catalogApi = useApi(catalogApiRef);\n const alertApi = useApi(alertApiRef);\n const errorApi = useApi(errorApiRef);\n const viewTechdocLink = useRouteRef(viewTechDocRouteRef);\n const templateRoute = useRouteRef(createFromTemplateRouteRef);\n const sourceTemplateRef = useSourceTemplateCompoundEntityRef(entity);\n const { allowed: canRefresh } = useEntityPermission(\n catalogEntityRefreshPermission,\n );\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const { allowed: canCreateTemplateTask } = usePermission({\n permission: taskCreatePermission,\n });\n\n const entitySourceLocation = getEntitySourceLocation(\n entity,\n scmIntegrationsApi,\n );\n const entityMetadataEditUrl =\n entity.metadata.annotations?.[ANNOTATION_EDIT_URL];\n\n let techdocsRef: CompoundEntityRef | undefined;\n\n if (entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]) {\n try {\n techdocsRef = parseEntityRef(\n entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION],\n );\n // not a fan of this but we don't care if the parseEntityRef fails\n } catch {\n techdocsRef = undefined;\n }\n }\n\n const viewInSource: IconLinkVerticalProps = {\n label: t('aboutCard.viewSource'),\n disabled: !entitySourceLocation,\n icon: <ScmIntegrationIcon type={entitySourceLocation?.integrationType} />,\n href: entitySourceLocation?.locationTargetUrl,\n };\n const viewInTechDocs: IconLinkVerticalProps = {\n label: t('aboutCard.viewTechdocs'),\n disabled:\n !(\n entity.metadata.annotations?.[TECHDOCS_ANNOTATION] ||\n entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]\n ) || !viewTechdocLink,\n icon: <DocsIcon />,\n href:\n viewTechdocLink &&\n (techdocsRef\n ? viewTechdocLink({\n namespace: techdocsRef.namespace || DEFAULT_NAMESPACE,\n kind: techdocsRef.kind,\n name: techdocsRef.name,\n })\n : viewTechdocLink({\n namespace: entity.metadata.namespace || DEFAULT_NAMESPACE,\n kind: entity.kind,\n name: entity.metadata.name,\n })),\n };\n\n const subHeaderLinks = [viewInSource, viewInTechDocs];\n\n if (isTemplateEntityV1beta3(entity)) {\n const Icon = app.getSystemIcon('scaffolder') ?? CreateComponentIcon;\n\n const launchTemplate: IconLinkVerticalProps = {\n label: t('aboutCard.launchTemplate'),\n icon: <Icon />,\n disabled: !templateRoute || !canCreateTemplateTask,\n href:\n templateRoute &&\n templateRoute({\n templateName: entity.metadata.name,\n namespace: entity.metadata.namespace || DEFAULT_NAMESPACE,\n }),\n };\n\n subHeaderLinks.push(launchTemplate);\n }\n\n let cardClass = '';\n if (variant === 'gridItem') {\n cardClass = classes.gridItemCard;\n } else if (variant === 'fullHeight') {\n cardClass = classes.fullHeightCard;\n }\n\n let cardContentClass = '';\n if (variant === 'gridItem') {\n cardContentClass = classes.gridItemCardContent;\n } else if (variant === 'fullHeight') {\n cardContentClass = classes.fullHeightCardContent;\n }\n\n const entityLocation = entity.metadata.annotations?.[ANNOTATION_LOCATION];\n // Limiting the ability to manually refresh to the less expensive locations\n const allowRefresh =\n entityLocation?.startsWith('url:') || entityLocation?.startsWith('file:');\n const refreshEntity = useCallback(async () => {\n try {\n await catalogApi.refreshEntity(stringifyEntityRef(entity));\n alertApi.post({\n message: t('aboutCard.refreshScheduledMessage'),\n severity: 'info',\n display: 'transient',\n });\n } catch (e) {\n errorApi.post(e);\n }\n }, [catalogApi, entity, alertApi, t, errorApi]);\n\n return (\n <Card className={cardClass}>\n <CardHeader\n title={t('aboutCard.title')}\n action={\n <>\n {allowRefresh && canRefresh && (\n <IconButton\n aria-label=\"Refresh\"\n title={t('aboutCard.refreshButtonTitle')}\n onClick={refreshEntity}\n >\n <CachedIcon />\n </IconButton>\n )}\n <IconButton\n component={Link}\n aria-label=\"Edit\"\n disabled={!entityMetadataEditUrl}\n title={t('aboutCard.editButtonTitle')}\n to={entityMetadataEditUrl ?? '#'}\n >\n <EditIcon />\n </IconButton>\n {sourceTemplateRef && templateRoute && (\n <IconButton\n component={Link}\n title={t('aboutCard.createSimilarButtonTitle')}\n to={templateRoute({\n namespace: sourceTemplateRef.namespace,\n templateName: sourceTemplateRef.name,\n })}\n >\n <AppIcon id=\"scaffolder\" />\n </IconButton>\n )}\n </>\n }\n subheader={<HeaderIconLinkRow links={subHeaderLinks} />}\n />\n <Divider />\n <CardContent className={cardContentClass}>\n <AboutContent entity={entity} />\n </CardContent>\n </Card>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,MAAM,mBAAsB,GAAA,2BAAA;AAE5B,MAAM,4BAA+B,GAAA,8BAAA;AAErC,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,YAAc,EAAA;AAAA,IACZ,OAAS,EAAA,MAAA;AAAA,IACT,aAAe,EAAA,QAAA;AAAA,IACf,MAAQ,EAAA,mBAAA;AAAA;AAAA,IACR,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,cAAgB,EAAA;AAAA,IACd,OAAS,EAAA,MAAA;AAAA,IACT,aAAe,EAAA,QAAA;AAAA,IACf,MAAQ,EAAA;AAAA,GACV;AAAA,EACA,mBAAqB,EAAA;AAAA,IACnB,IAAM,EAAA;AAAA,GACR;AAAA,EACA,qBAAuB,EAAA;AAAA,IACrB,IAAM,EAAA;AAAA;AAEV,CAAC,CAAA;AAkBM,SAAS,UAAU,KAAuB,EAAA;AAC/C,EAAM,MAAA,EAAE,SAAY,GAAA,KAAA;AACpB,EAAA,MAAM,MAAM,MAAO,EAAA;AACnB,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAM,MAAA,kBAAA,GAAqB,OAAO,qBAAqB,CAAA;AACvD,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA;AACvC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAM,MAAA,eAAA,GAAkB,YAAY,mBAAmB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AboutCard/AboutCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n ANNOTATION_EDIT_URL,\n ANNOTATION_LOCATION,\n CompoundEntityRef,\n DEFAULT_NAMESPACE,\n stringifyEntityRef,\n parseEntityRef,\n} from '@backstage/catalog-model';\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Divider from '@material-ui/core/Divider';\nimport IconButton from '@material-ui/core/IconButton';\nimport { makeStyles } from '@material-ui/core/styles';\nimport {\n AppIcon,\n HeaderIconLinkRow,\n IconLinkVerticalProps,\n InfoCardVariants,\n Link,\n} from '@backstage/core-components';\nimport React, { useCallback } from 'react';\nimport {\n ScmIntegrationIcon,\n scmIntegrationsApiRef,\n} from '@backstage/integration-react';\nimport {\n alertApiRef,\n errorApiRef,\n useApi,\n useApp,\n useRouteRef,\n} from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n getEntitySourceLocation,\n useEntity,\n} from '@backstage/plugin-catalog-react';\nimport { createFromTemplateRouteRef, viewTechDocRouteRef } from '../../routes';\n\nimport { AboutContent } from './AboutContent';\nimport CachedIcon from '@material-ui/icons/Cached';\nimport CreateComponentIcon from '@material-ui/icons/AddCircleOutline';\nimport DocsIcon from '@material-ui/icons/Description';\nimport EditIcon from '@material-ui/icons/Edit';\nimport { isTemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { useEntityPermission } from '@backstage/plugin-catalog-react/alpha';\nimport { catalogEntityRefreshPermission } from '@backstage/plugin-catalog-common/alpha';\nimport { useSourceTemplateCompoundEntityRef } from './hooks';\nimport { taskCreatePermission } from '@backstage/plugin-scaffolder-common/alpha';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst TECHDOCS_ANNOTATION = 'backstage.io/techdocs-ref';\n\nconst TECHDOCS_EXTERNAL_ANNOTATION = 'backstage.io/techdocs-entity';\n\nconst useStyles = makeStyles({\n gridItemCard: {\n display: 'flex',\n flexDirection: 'column',\n height: 'calc(100% - 10px)', // for pages without content header\n marginBottom: '10px',\n },\n fullHeightCard: {\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n },\n gridItemCardContent: {\n flex: 1,\n },\n fullHeightCardContent: {\n flex: 1,\n },\n});\n\n/**\n * Props for {@link EntityAboutCard}.\n *\n * @public\n */\nexport interface AboutCardProps {\n variant?: InfoCardVariants;\n}\n\n/**\n * Exported publicly via the EntityAboutCard\n *\n * NOTE: We generally do not accept pull requests to extend this class with more\n * props and customizability. If you need to tweak it, consider making a bespoke\n * card in your own repository instead, that is perfect for your own needs.\n */\nexport function AboutCard(props: AboutCardProps) {\n const { variant } = props;\n const app = useApp();\n const classes = useStyles();\n const { entity } = useEntity();\n const scmIntegrationsApi = useApi(scmIntegrationsApiRef);\n const catalogApi = useApi(catalogApiRef);\n const alertApi = useApi(alertApiRef);\n const errorApi = useApi(errorApiRef);\n const viewTechdocLink = useRouteRef(viewTechDocRouteRef);\n const templateRoute = useRouteRef(createFromTemplateRouteRef);\n const sourceTemplateRef = useSourceTemplateCompoundEntityRef(entity);\n const { allowed: canRefresh } = useEntityPermission(\n catalogEntityRefreshPermission,\n );\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const { allowed: canCreateTemplateTask } = usePermission({\n permission: taskCreatePermission,\n });\n\n const entitySourceLocation = getEntitySourceLocation(\n entity,\n scmIntegrationsApi,\n );\n const entityMetadataEditUrl =\n entity.metadata.annotations?.[ANNOTATION_EDIT_URL];\n\n let techdocsRef: CompoundEntityRef | undefined;\n\n if (entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]) {\n try {\n techdocsRef = parseEntityRef(\n entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION],\n );\n // not a fan of this but we don't care if the parseEntityRef fails\n } catch {\n techdocsRef = undefined;\n }\n }\n\n const viewInSource: IconLinkVerticalProps = {\n label: t('aboutCard.viewSource'),\n disabled: !entitySourceLocation,\n icon: <ScmIntegrationIcon type={entitySourceLocation?.integrationType} />,\n href: entitySourceLocation?.locationTargetUrl,\n };\n const viewInTechDocs: IconLinkVerticalProps = {\n label: t('aboutCard.viewTechdocs'),\n disabled:\n !(\n entity.metadata.annotations?.[TECHDOCS_ANNOTATION] ||\n entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]\n ) || !viewTechdocLink,\n icon: <DocsIcon />,\n href:\n viewTechdocLink &&\n (techdocsRef\n ? viewTechdocLink({\n namespace: techdocsRef.namespace || DEFAULT_NAMESPACE,\n kind: techdocsRef.kind,\n name: techdocsRef.name,\n })\n : viewTechdocLink({\n namespace: entity.metadata.namespace || DEFAULT_NAMESPACE,\n kind: entity.kind,\n name: entity.metadata.name,\n })),\n };\n\n const subHeaderLinks = [viewInSource, viewInTechDocs];\n\n if (isTemplateEntityV1beta3(entity)) {\n const Icon = app.getSystemIcon('scaffolder') ?? CreateComponentIcon;\n\n const launchTemplate: IconLinkVerticalProps = {\n label: t('aboutCard.launchTemplate'),\n icon: <Icon />,\n disabled: !templateRoute || !canCreateTemplateTask,\n href:\n templateRoute &&\n templateRoute({\n templateName: entity.metadata.name,\n namespace: entity.metadata.namespace || DEFAULT_NAMESPACE,\n }),\n };\n\n subHeaderLinks.push(launchTemplate);\n }\n\n let cardClass = '';\n if (variant === 'gridItem') {\n cardClass = classes.gridItemCard;\n } else if (variant === 'fullHeight') {\n cardClass = classes.fullHeightCard;\n }\n\n let cardContentClass = '';\n if (variant === 'gridItem') {\n cardContentClass = classes.gridItemCardContent;\n } else if (variant === 'fullHeight') {\n cardContentClass = classes.fullHeightCardContent;\n }\n\n const entityLocation = entity.metadata.annotations?.[ANNOTATION_LOCATION];\n // Limiting the ability to manually refresh to the less expensive locations\n const allowRefresh =\n entityLocation?.startsWith('url:') || entityLocation?.startsWith('file:');\n const refreshEntity = useCallback(async () => {\n try {\n await catalogApi.refreshEntity(stringifyEntityRef(entity));\n alertApi.post({\n message: t('aboutCard.refreshScheduledMessage'),\n severity: 'info',\n display: 'transient',\n });\n } catch (e) {\n errorApi.post(e);\n }\n }, [catalogApi, entity, alertApi, t, errorApi]);\n\n return (\n <Card className={cardClass}>\n <CardHeader\n title={t('aboutCard.title')}\n action={\n <>\n {allowRefresh && canRefresh && (\n <IconButton\n aria-label=\"Refresh\"\n title={t('aboutCard.refreshButtonTitle')}\n onClick={refreshEntity}\n >\n <CachedIcon />\n </IconButton>\n )}\n <IconButton\n component={Link}\n aria-label=\"Edit\"\n disabled={!entityMetadataEditUrl}\n title={t('aboutCard.editButtonTitle')}\n to={entityMetadataEditUrl ?? '#'}\n >\n <EditIcon />\n </IconButton>\n {sourceTemplateRef && templateRoute && (\n <IconButton\n component={Link}\n title={t('aboutCard.createSimilarButtonTitle')}\n to={templateRoute({\n namespace: sourceTemplateRef.namespace,\n templateName: sourceTemplateRef.name,\n })}\n >\n <AppIcon id=\"scaffolder\" />\n </IconButton>\n )}\n </>\n }\n subheader={<HeaderIconLinkRow links={subHeaderLinks} />}\n />\n <Divider />\n <CardContent className={cardContentClass}>\n <AboutContent entity={entity} />\n </CardContent>\n </Card>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,MAAM,mBAAsB,GAAA,2BAAA;AAE5B,MAAM,4BAA+B,GAAA,8BAAA;AAErC,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,YAAc,EAAA;AAAA,IACZ,OAAS,EAAA,MAAA;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AE5B,QAAS,EAAA,IAAA;AAAA,OACZ,EACC,qBAAqB,aACpB,oBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,SAAW,EAAA,IAAA;AAAA,UACX,KAAA,EAAO,EAAE,oCAAoC,CAAA;AAAA,UAC7C,IAAI,aAAc,CAAA;AAAA,YAChB,WAAW,iBAAkB,CAAA,SAAA;AAAA,YAC7B,cAAc,iBAAkB,CAAA;AAAA,WACjC;AAAA,SAAA;AAAA,wBAED,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,EAAA,EAAA,EAAG,YAAa,EAAA;AAAA,OAG/B,CAAA;AAAA,MAEF,SAAW,kBAAA,KAAA,CAAA,aAAA,CAAC,iBAAkB,EAAA,EAAA,KAAA,EAAO,cAAgB,EAAA;AAAA;AAAA,GAEvD,kBAAA,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,IAAA,CAAA,kBACR,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,EAAY,SAAW,EAAA,gBAAA,EAAA,kBACrB,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,EAAa,MAAgB,EAAA,CAChC,CACF,CAAA;AAEJ;;;;"}
|
package/dist/plugin.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CatalogClient } from '@backstage/catalog-client';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n catalogApiRef,\n entityPresentationApiRef,\n entityRouteRef,\n starredEntitiesApiRef,\n} from '@backstage/plugin-catalog-react';\nimport {\n createComponentRouteRef,\n createFromTemplateRouteRef,\n unregisterRedirectRouteRef,\n viewTechDocRouteRef,\n} from './routes';\nimport {\n createApiFactory,\n createComponentExtension,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n fetchApiRef,\n storageApiRef,\n} from '@backstage/core-plugin-api';\nimport {\n createSearchResultListItemExtension,\n SearchResultListItemExtensionProps,\n} from '@backstage/plugin-search-react';\nimport { DefaultStarredEntitiesApi } from './apis';\nimport { AboutCardProps } from './components/AboutCard';\nimport { DefaultCatalogPageProps } from './components/CatalogPage';\nimport { DependencyOfComponentsCardProps } from './components/DependencyOfComponentsCard';\nimport { DependsOnComponentsCardProps } from './components/DependsOnComponentsCard';\nimport { DependsOnResourcesCardProps } from './components/DependsOnResourcesCard';\nimport { HasComponentsCardProps } from './components/HasComponentsCard';\nimport { HasResourcesCardProps } from './components/HasResourcesCard';\nimport { HasSubcomponentsCardProps } from './components/HasSubcomponentsCard';\nimport { HasSubdomainsCardProps } from './components/HasSubdomainsCard';\nimport { HasSystemsCardProps } from './components/HasSystemsCard';\nimport { RelatedEntitiesCardProps } from './components/RelatedEntitiesCard';\nimport { CatalogSearchResultListItemProps } from './components/CatalogSearchResultListItem';\nimport { rootRouteRef } from './routes';\nimport { DefaultEntityPresentationApi } from './apis/EntityPresentationApi';\n\n/** @public */\nexport const catalogPlugin = createPlugin({\n id: 'catalog',\n apis: [\n createApiFactory({\n api: catalogApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new CatalogClient({ discoveryApi, fetchApi }),\n }),\n createApiFactory({\n api: starredEntitiesApiRef,\n deps: { storageApi: storageApiRef },\n factory: ({ storageApi }) =>\n new DefaultStarredEntitiesApi({ storageApi }),\n }),\n createApiFactory({\n api: entityPresentationApiRef,\n deps: { catalogApi: catalogApiRef },\n factory: ({ catalogApi }) =>\n DefaultEntityPresentationApi.create({ catalogApi }),\n }),\n ],\n routes: {\n catalogIndex: rootRouteRef,\n catalogEntity: entityRouteRef,\n },\n externalRoutes: {\n createComponent: createComponentRouteRef,\n viewTechDoc: viewTechDocRouteRef,\n createFromTemplate: createFromTemplateRouteRef,\n unregisterRedirect: unregisterRedirectRouteRef,\n },\n});\n\n/** @public */\nexport const CatalogIndexPage: (props: DefaultCatalogPageProps) => JSX.Element =\n catalogPlugin.provide(\n createRoutableExtension({\n name: 'CatalogIndexPage',\n component: () =>\n import('./components/CatalogPage').then(m => m.CatalogPage),\n mountPoint: rootRouteRef,\n }),\n );\n\n/** @public */\nexport const CatalogEntityPage: () => JSX.Element = catalogPlugin.provide(\n createRoutableExtension({\n name: 'CatalogEntityPage',\n component: () =>\n import('./components/CatalogEntityPage').then(m => m.CatalogEntityPage),\n mountPoint: entityRouteRef,\n }),\n);\n\n/**\n * An example About card to show at the top of entity pages.\n *\n * @public\n * @remarks\n *\n * This card collects some high level information about the entity, but is just\n * an example component. Many organizations will want to replace it with a\n * custom card that is more tailored to their specific needs. The card itself is\n * not extremely customizable; feel free to make a copy of it as a starting\n * point if you like.\n */\nexport const EntityAboutCard: (props: AboutCardProps) => JSX.Element =\n catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityAboutCard',\n component: {\n lazy: () => import('./components/AboutCard').then(m => m.AboutCard),\n },\n }),\n );\n\n/** @public */\nexport const EntityLinksCard = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityLinksCard',\n component: {\n lazy: () =>\n import('./components/EntityLinksCard').then(m => m.EntityLinksCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityLabelsCard = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityLabelsCard',\n component: {\n lazy: () =>\n import('./components/EntityLabelsCard').then(m => m.EntityLabelsCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityHasSystemsCard: (props: HasSystemsCardProps) => JSX.Element =\n catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityHasSystemsCard',\n component: {\n lazy: () =>\n import('./components/HasSystemsCard').then(m => m.HasSystemsCard),\n },\n }),\n );\n\n/** @public */\nexport const EntityHasComponentsCard: (\n props: HasComponentsCardProps,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityHasComponentsCard',\n component: {\n lazy: () =>\n import('./components/HasComponentsCard').then(m => m.HasComponentsCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityHasSubcomponentsCard: (\n props: HasSubcomponentsCardProps,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityHasSubcomponentsCard',\n component: {\n lazy: () =>\n import('./components/HasSubcomponentsCard').then(\n m => m.HasSubcomponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityHasSubdomainsCard: (\n props: HasSubdomainsCardProps,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityHasSubdomainsCard',\n component: {\n lazy: () =>\n import('./components/HasSubdomainsCard').then(m => m.HasSubdomainsCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityHasResourcesCard: (\n props: HasResourcesCardProps,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityHasResourcesCard',\n component: {\n lazy: () =>\n import('./components/HasResourcesCard').then(m => m.HasResourcesCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityDependsOnComponentsCard: (\n props: DependsOnComponentsCardProps,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityDependsOnComponentsCard',\n component: {\n lazy: () =>\n import('./components/DependsOnComponentsCard').then(\n m => m.DependsOnComponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityDependencyOfComponentsCard: (\n props: DependencyOfComponentsCardProps,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityDependencyOfComponentsCard',\n component: {\n lazy: () =>\n import('./components/DependencyOfComponentsCard').then(\n m => m.DependencyOfComponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityDependsOnResourcesCard: (\n props: DependsOnResourcesCardProps,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityDependsOnResourcesCard',\n component: {\n lazy: () =>\n import('./components/DependsOnResourcesCard').then(\n m => m.DependsOnResourcesCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const RelatedEntitiesCard: <T extends Entity>(\n props: RelatedEntitiesCardProps<T>,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'RelatedEntitiesCard',\n component: {\n lazy: () =>\n import('./components/RelatedEntitiesCard').then(\n m => m.RelatedEntitiesCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const CatalogSearchResultListItem: (\n props: SearchResultListItemExtensionProps<CatalogSearchResultListItemProps>,\n) => JSX.Element | null = catalogPlugin.provide(\n createSearchResultListItemExtension({\n name: 'CatalogSearchResultListItem',\n component: () =>\n import('./components/CatalogSearchResultListItem').then(\n m => m.CatalogSearchResultListItem,\n ),\n predicate: result => result.type === 'software-catalog',\n }),\n);\n"],"names":[],"mappings":";;;;;;;;AA4DO,MAAM,gBAAgB,YAAa,CAAA;AAAA,EACxC,EAAI,EAAA,SAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,aAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA;AAAA,OACZ;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,QAAA,EACxB,KAAA,IAAI,aAAc,CAAA,EAAE,YAAc,EAAA,QAAA,EAAU;AAAA,KAC/C,CAAA;AAAA,IACD,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,qBAAA;AAAA,MACL,IAAA,EAAM,EAAE,UAAA,EAAY,aAAc,EAAA;AAAA,MAClC,OAAA,EAAS,CAAC,EAAE,UAAA,OACV,IAAI,yBAAA,CA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T,IAAM,EAAA,MACJ,OAAO,+CAAkC,CAAE,CAAA,IAAA;AAAA,QACzC,OAAK,CAAE,CAAA;AAAA;AACT;AACJ,GACD;AACH;AAGO,MAAM,8BAEa,aAAc,CAAA,OAAA;AAAA,EACtC,mCAAoC,CAAA;AAAA,IAClC,IAAM,EAAA,6BAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,uDAA0C,CAAE,CAAA,IAAA;AAAA,MACjD,OAAK,CAAE,CAAA;AAAA,KACT;AAAA,IACF,SAAA,EAAW,CAAU,MAAA,KAAA,MAAA,CAAO,IAAS,KAAA;AAAA,GACtC;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CatalogClient } from '@backstage/catalog-client';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n catalogApiRef,\n entityPresentationApiRef,\n entityRouteRef,\n starredEntitiesApiRef,\n} from '@backstage/plugin-catalog-react';\nimport {\n createComponentRouteRef,\n createFromTemplateRouteRef,\n unregisterRedirectRouteRef,\n viewTechDocRouteRef,\n rootRouteRef,\n} from './routes';\nimport {\n createApiFactory,\n createComponentExtension,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n fetchApiRef,\n storageApiRef,\n} from '@backstage/core-plugin-api';\nimport {\n createSearchResultListItemExtension,\n SearchResultListItemExtensionProps,\n} from '@backstage/plugin-search-react';\nimport { DefaultStarredEntitiesApi } from './apis';\nimport { AboutCardProps } from './components/AboutCard';\nimport { DefaultCatalogPageProps } from './components/CatalogPage';\nimport { DependencyOfComponentsCardProps } from './components/DependencyOfComponentsCard';\nimport { DependsOnComponentsCardProps } from './components/DependsOnComponentsCard';\nimport { DependsOnResourcesCardProps } from './components/DependsOnResourcesCard';\nimport { HasComponentsCardProps } from './components/HasComponentsCard';\nimport { HasResourcesCardProps } from './components/HasResourcesCard';\nimport { HasSubcomponentsCardProps } from './components/HasSubcomponentsCard';\nimport { HasSubdomainsCardProps } from './components/HasSubdomainsCard';\nimport { HasSystemsCardProps } from './components/HasSystemsCard';\nimport { RelatedEntitiesCardProps } from './components/RelatedEntitiesCard';\nimport { CatalogSearchResultListItemProps } from './components/CatalogSearchResultListItem';\nimport { DefaultEntityPresentationApi } from './apis/EntityPresentationApi';\n\n/** @public */\nexport const catalogPlugin = createPlugin({\n id: 'catalog',\n apis: [\n createApiFactory({\n api: catalogApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new CatalogClient({ discoveryApi, fetchApi }),\n }),\n createApiFactory({\n api: starredEntitiesApiRef,\n deps: { storageApi: storageApiRef },\n factory: ({ storageApi }) =>\n new DefaultStarredEntitiesApi({ storageApi }),\n }),\n createApiFactory({\n api: entityPresentationApiRef,\n deps: { catalogApi: catalogApiRef },\n factory: ({ catalogApi }) =>\n DefaultEntityPresentationApi.create({ catalogApi }),\n }),\n ],\n routes: {\n catalogIndex: rootRouteRef,\n catalogEntity: entityRouteRef,\n },\n externalRoutes: {\n createComponent: createComponentRouteRef,\n viewTechDoc: viewTechDocRouteRef,\n createFromTemplate: createFromTemplateRouteRef,\n unregisterRedirect: unregisterRedirectRouteRef,\n },\n});\n\n/** @public */\nexport const CatalogIndexPage: (props: DefaultCatalogPageProps) => JSX.Element =\n catalogPlugin.provide(\n createRoutableExtension({\n name: 'CatalogIndexPage',\n component: () =>\n import('./components/CatalogPage').then(m => m.CatalogPage),\n mountPoint: rootRouteRef,\n }),\n );\n\n/** @public */\nexport const CatalogEntityPage: () => JSX.Element = catalogPlugin.provide(\n createRoutableExtension({\n name: 'CatalogEntityPage',\n component: () =>\n import('./components/CatalogEntityPage').then(m => m.CatalogEntityPage),\n mountPoint: entityRouteRef,\n }),\n);\n\n/**\n * An example About card to show at the top of entity pages.\n *\n * @public\n * @remarks\n *\n * This card collects some high level information about the entity, but is just\n * an example component. Many organizations will want to replace it with a\n * custom card that is more tailored to their specific needs. The card itself is\n * not extremely customizable; feel free to make a copy of it as a starting\n * point if you like.\n */\nexport const EntityAboutCard: (props: AboutCardProps) => JSX.Element =\n catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityAboutCard',\n component: {\n lazy: () => import('./components/AboutCard').then(m => m.AboutCard),\n },\n }),\n );\n\n/** @public */\nexport const EntityLinksCard = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityLinksCard',\n component: {\n lazy: () =>\n import('./components/EntityLinksCard').then(m => m.EntityLinksCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityLabelsCard = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityLabelsCard',\n component: {\n lazy: () =>\n import('./components/EntityLabelsCard').then(m => m.EntityLabelsCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityHasSystemsCard: (props: HasSystemsCardProps) => JSX.Element =\n catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityHasSystemsCard',\n component: {\n lazy: () =>\n import('./components/HasSystemsCard').then(m => m.HasSystemsCard),\n },\n }),\n );\n\n/** @public */\nexport const EntityHasComponentsCard: (\n props: HasComponentsCardProps,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityHasComponentsCard',\n component: {\n lazy: () =>\n import('./components/HasComponentsCard').then(m => m.HasComponentsCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityHasSubcomponentsCard: (\n props: HasSubcomponentsCardProps,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityHasSubcomponentsCard',\n component: {\n lazy: () =>\n import('./components/HasSubcomponentsCard').then(\n m => m.HasSubcomponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityHasSubdomainsCard: (\n props: HasSubdomainsCardProps,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityHasSubdomainsCard',\n component: {\n lazy: () =>\n import('./components/HasSubdomainsCard').then(m => m.HasSubdomainsCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityHasResourcesCard: (\n props: HasResourcesCardProps,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityHasResourcesCard',\n component: {\n lazy: () =>\n import('./components/HasResourcesCard').then(m => m.HasResourcesCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityDependsOnComponentsCard: (\n props: DependsOnComponentsCardProps,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityDependsOnComponentsCard',\n component: {\n lazy: () =>\n import('./components/DependsOnComponentsCard').then(\n m => m.DependsOnComponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityDependencyOfComponentsCard: (\n props: DependencyOfComponentsCardProps,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityDependencyOfComponentsCard',\n component: {\n lazy: () =>\n import('./components/DependencyOfComponentsCard').then(\n m => m.DependencyOfComponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityDependsOnResourcesCard: (\n props: DependsOnResourcesCardProps,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'EntityDependsOnResourcesCard',\n component: {\n lazy: () =>\n import('./components/DependsOnResourcesCard').then(\n m => m.DependsOnResourcesCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const RelatedEntitiesCard: <T extends Entity>(\n props: RelatedEntitiesCardProps<T>,\n) => JSX.Element = catalogPlugin.provide(\n createComponentExtension({\n name: 'RelatedEntitiesCard',\n component: {\n lazy: () =>\n import('./components/RelatedEntitiesCard').then(\n m => m.RelatedEntitiesCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const CatalogSearchResultListItem: (\n props: SearchResultListItemExtensionProps<CatalogSearchResultListItemProps>,\n) => JSX.Element | null = catalogPlugin.provide(\n createSearchResultListItemExtension({\n name: 'CatalogSearchResultListItem',\n component: () =>\n import('./components/CatalogSearchResultListItem').then(\n m => m.CatalogSearchResultListItem,\n ),\n predicate: result => result.type === 'software-catalog',\n }),\n);\n"],"names":[],"mappings":";;;;;;;;AA4DO,MAAM,gBAAgB,YAAa,CAAA;AAAA,EACxC,EAAI,EAAA,SAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,aAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA;AAAA,OACZ;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,QAAA,EACxB,KAAA,IAAI,aAAc,CAAA,EAAE,YAAc,EAAA,QAAA,EAAU;AAAA,KAC/C,CAAA;AAAA,IACD,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,qBAAA;AAAA,MACL,IAAA,EAAM,EAAE,UAAA,EAAY,aAAc,EAAA;AAAA,MAClC,OAAA,EAAS,CAAC,EAAE,UAAA,OACV,IAAI,yBAAA,CAA0B,EAAE,UAAA,EAAY;AAAA,KAC/C,CAAA;AAAA,IACD,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,wBAAA;AAAA,MACL,IAAA,EAAM,EAAE,UAAA,EAAY,aAAc,EAAA;AAAA,MAClC,OAAA,EAAS,CAAC,EAAE,UAAA,OACV,4BAA6B,CAAA,MAAA,CAAO,EAAE,UAAA,EAAY;AAAA,KACrD;AAAA,GACH;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,YAAc,EAAA,YAAA;AAAA,IACd,aAAe,EAAA;AAAA,GACjB;AAAA,EACA,cAAgB,EAAA;AAAA,IACd,eAAiB,EAAA,uBAAA;AA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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.2-next.0",
|
|
4
4
|
"description": "The Backstage plugin for browsing the Backstage catalog",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -67,21 +67,21 @@
|
|
|
67
67
|
"test": "backstage-cli package test"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@backstage/catalog-client": "1.9.1
|
|
71
|
-
"@backstage/catalog-model": "1.7.3
|
|
72
|
-
"@backstage/core-compat-api": "0.3.
|
|
73
|
-
"@backstage/core-components": "0.16.3
|
|
74
|
-
"@backstage/core-plugin-api": "1.10.3
|
|
75
|
-
"@backstage/errors": "1.2.7
|
|
76
|
-
"@backstage/frontend-plugin-api": "0.9.
|
|
77
|
-
"@backstage/integration-react": "1.2.3
|
|
78
|
-
"@backstage/plugin-catalog-common": "1.1.3
|
|
79
|
-
"@backstage/plugin-catalog-react": "1.15.
|
|
80
|
-
"@backstage/plugin-permission-react": "0.4.30
|
|
81
|
-
"@backstage/plugin-scaffolder-common": "1.5.9
|
|
82
|
-
"@backstage/plugin-search-common": "1.2.17
|
|
83
|
-
"@backstage/plugin-search-react": "1.8.
|
|
84
|
-
"@backstage/types": "1.2.1
|
|
70
|
+
"@backstage/catalog-client": "1.9.1",
|
|
71
|
+
"@backstage/catalog-model": "1.7.3",
|
|
72
|
+
"@backstage/core-compat-api": "0.3.6-next.0",
|
|
73
|
+
"@backstage/core-components": "0.16.3",
|
|
74
|
+
"@backstage/core-plugin-api": "1.10.3",
|
|
75
|
+
"@backstage/errors": "1.2.7",
|
|
76
|
+
"@backstage/frontend-plugin-api": "0.9.5-next.0",
|
|
77
|
+
"@backstage/integration-react": "1.2.3",
|
|
78
|
+
"@backstage/plugin-catalog-common": "1.1.3",
|
|
79
|
+
"@backstage/plugin-catalog-react": "1.15.2-next.0",
|
|
80
|
+
"@backstage/plugin-permission-react": "0.4.30",
|
|
81
|
+
"@backstage/plugin-scaffolder-common": "1.5.9",
|
|
82
|
+
"@backstage/plugin-search-common": "1.2.17",
|
|
83
|
+
"@backstage/plugin-search-react": "1.8.6-next.0",
|
|
84
|
+
"@backstage/types": "1.2.1",
|
|
85
85
|
"@material-ui/core": "^4.12.2",
|
|
86
86
|
"@material-ui/icons": "^4.9.1",
|
|
87
87
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
@@ -95,12 +95,12 @@
|
|
|
95
95
|
"zen-observable": "^0.10.0"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
|
-
"@backstage/cli": "0.
|
|
99
|
-
"@backstage/core-app-api": "1.15.4
|
|
100
|
-
"@backstage/dev-utils": "1.1.
|
|
101
|
-
"@backstage/frontend-test-utils": "0.2.
|
|
102
|
-
"@backstage/plugin-permission-common": "0.8.4
|
|
103
|
-
"@backstage/test-utils": "1.7.4
|
|
98
|
+
"@backstage/cli": "0.30.0-next.0",
|
|
99
|
+
"@backstage/core-app-api": "1.15.4",
|
|
100
|
+
"@backstage/dev-utils": "1.1.7-next.0",
|
|
101
|
+
"@backstage/frontend-test-utils": "0.2.6-next.0",
|
|
102
|
+
"@backstage/plugin-permission-common": "0.8.4",
|
|
103
|
+
"@backstage/test-utils": "1.7.4",
|
|
104
104
|
"@testing-library/dom": "^10.0.0",
|
|
105
105
|
"@testing-library/jest-dom": "^6.0.0",
|
|
106
106
|
"@testing-library/react": "^16.0.0",
|