@techdocs/cli 1.4.7-next.0 → 1.5.0-next.1

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 (42) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/{generate-d9c4c0d9.cjs.js → generate-5fb2bc8c.cjs.js} +4 -2
  3. package/dist/cjs/generate-5fb2bc8c.cjs.js.map +1 -0
  4. package/dist/embedded-app/index.html +1 -1
  5. package/dist/embedded-app/static/{1032.5be56bbf.chunk.js → 1032.f8378b05.chunk.js} +1 -1
  6. package/dist/embedded-app/static/{1032.5be56bbf.chunk.js.map → 1032.f8378b05.chunk.js.map} +1 -1
  7. package/dist/embedded-app/static/{1105.7ccea160.chunk.js → 1105.a5f2c603.chunk.js} +1 -1
  8. package/dist/embedded-app/static/{1105.7ccea160.chunk.js.map → 1105.a5f2c603.chunk.js.map} +1 -1
  9. package/dist/embedded-app/static/{184.78d680e0.chunk.js → 184.2d07d6cf.chunk.js} +1 -1
  10. package/dist/embedded-app/static/{184.78d680e0.chunk.js.map → 184.2d07d6cf.chunk.js.map} +1 -1
  11. package/dist/embedded-app/static/{2440.6a0e86dc.chunk.js → 2440.c513a311.chunk.js} +1 -1
  12. package/dist/embedded-app/static/{2440.6a0e86dc.chunk.js.map → 2440.c513a311.chunk.js.map} +1 -1
  13. package/dist/embedded-app/static/{5458.d7ed8b8e.chunk.js → 5458.f60ece35.chunk.js} +1 -1
  14. package/dist/embedded-app/static/{5458.d7ed8b8e.chunk.js.map → 5458.f60ece35.chunk.js.map} +1 -1
  15. package/dist/embedded-app/static/{732.fb0762a2.chunk.js → 732.b079cbc6.chunk.js} +1 -1
  16. package/dist/embedded-app/static/{732.fb0762a2.chunk.js.map → 732.b079cbc6.chunk.js.map} +1 -1
  17. package/dist/embedded-app/static/{7560.8ef9e30a.chunk.js → 7560.12e04146.chunk.js} +1 -1
  18. package/dist/embedded-app/static/{7560.8ef9e30a.chunk.js.map → 7560.12e04146.chunk.js.map} +1 -1
  19. package/dist/embedded-app/static/{7750.c1a4c4df.chunk.js → 7750.10e99997.chunk.js} +1 -1
  20. package/dist/embedded-app/static/{7750.c1a4c4df.chunk.js.map → 7750.10e99997.chunk.js.map} +1 -1
  21. package/dist/embedded-app/static/{8951.fea20091.chunk.js → 8951.bff6b400.chunk.js} +1 -1
  22. package/dist/embedded-app/static/{8951.fea20091.chunk.js.map → 8951.bff6b400.chunk.js.map} +1 -1
  23. package/dist/embedded-app/static/{9323.61727faa.chunk.js → 9323.dd670d43.chunk.js} +1 -1
  24. package/dist/embedded-app/static/{9323.61727faa.chunk.js.map → 9323.dd670d43.chunk.js.map} +1 -1
  25. package/dist/embedded-app/static/{9545.dea948d9.chunk.js → 9545.24f95d89.chunk.js} +1 -1
  26. package/dist/embedded-app/static/{9545.dea948d9.chunk.js.map → 9545.24f95d89.chunk.js.map} +1 -1
  27. package/dist/embedded-app/static/{9770.fbe5a663.chunk.js → 9770.2fa7c11e.chunk.js} +1 -1
  28. package/dist/embedded-app/static/{9770.fbe5a663.chunk.js.map → 9770.2fa7c11e.chunk.js.map} +1 -1
  29. package/dist/embedded-app/static/main.4dd3806f.js +522 -0
  30. package/dist/embedded-app/static/main.4dd3806f.js.map +1 -0
  31. package/dist/embedded-app/static/{runtime.e2534c23.js → runtime.4dd3806f.js} +2 -2
  32. package/dist/embedded-app/static/{runtime.e2534c23.js.map → runtime.4dd3806f.js.map} +1 -1
  33. package/dist/embedded-app/static/vendor.4dd3806f.js +213 -0
  34. package/dist/embedded-app/static/vendor.4dd3806f.js.map +1 -0
  35. package/dist/index.cjs.js +6 -2
  36. package/dist/index.cjs.js.map +1 -1
  37. package/package.json +6 -6
  38. package/dist/cjs/generate-d9c4c0d9.cjs.js.map +0 -1
  39. package/dist/embedded-app/static/main.e2534c23.js +0 -522
  40. package/dist/embedded-app/static/main.e2534c23.js.map +0 -1
  41. package/dist/embedded-app/static/vendor.e2534c23.js +0 -213
  42. package/dist/embedded-app/static/vendor.e2534c23.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"static/7750.c1a4c4df.chunk.js","mappings":"mSAqBA,MAAMA,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA,uBAUdC,KAAYC,EAAAA,GAChBC,IAAU,CACRC,KAAM,CACJC,aAAc,EACdC,OAAQH,EAAMI,QAAQ,EAAG,CAAC,EAC1BC,WACEL,EAAMM,QAAQC,OAAS,OAAS,OAASP,EAAMM,QAAQE,OAAOC,KAClE,CACF,GACA,CAAEC,KAAM,oCAAqC,CAAC,EAGzC,SAASC,GAAwB,CACtC,MAAMC,EAAUd,EAAU,EAE1B,SACE,oB,aACE,OAACe,EAAAA,EAAUA,CAACC,QAAQ,Q,SAAQ,oH,MAI5B,OAACC,MAAAA,CAAIC,UAAWJ,EAAQX,K,YACtB,OAACgB,EAAAA,GAAWA,CACVC,KAAMrB,EACNsB,SAAS,OACTC,gBAAe,GACfC,mBAAoB,CAAC,EAAG,EAAG,EAAG,C,EAC9BC,YAAa,CAAEjB,WAAY,UAAWkB,SAAU,MAAO,C,QAG3D,OAACC,EAAAA,EAAMA,CACLV,QAAQ,YACRW,MAAM,UACNC,OAAO,SACPC,KAAK,uF,SACN,W,KAKP,C,0BCxCO,MAAMC,EAAmBC,GAAAA,C,IAQhBC,EAAAA,EAPd,KAAM,CAAEC,KAAAA,EAAOC,OAAWlB,QAAAA,CAAQ,EAAIe,EAChC,CAAEC,OAAAA,CAAO,KAAIG,EAAAA,IAAU,EACvBC,KAAMC,EAAAA,IAAO,E,IAGXD,EADR,MAAME,EAAgBC,GACpBA,IAAMH,EAAAA,EAAII,cAAcD,CAAG,KAAHA,MAAlBH,IAAAA,OAAAA,EAAyCK,EAAAA,EAE3CC,GAAQV,EAAAA,KAAAA,MAAAA,IAAAA,SAAAA,EAAAA,EAAQW,YAAQ,MAAhBX,IAAAA,OAAAA,OAAAA,EAAkBU,MAEhC,SACE,OAACE,EAAAA,GAAQA,CAACC,MAAM,QAAQ7B,QAASA,E,SAC9B,CAAC0B,GAASA,EAAMI,SAAW,KAC1B,OAACjC,EAAqBA,CAAAA,CAAAA,KAEtB,OAACkC,EAAAA,EAAaA,CACZd,KAAMA,EACNe,MAAON,EAAMO,IAAI,CAAC,CAAEC,IAAAA,EAAKL,MAAAA,EAAOM,KAAAA,CAAK,KAAO,CAC1C/B,KAAMyB,GAAAA,KAAAA,EAASK,EACfrB,KAAMqB,EACNE,KAAMd,EAAaa,CAAI,CACzB,EAAE,C,IAKZ,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/EntityLinksEmptyState.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BackstageTheme } from '@backstage/theme';\nimport { Button, makeStyles, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `metadata:\n name: example\n links:\n - url: https://dashboard.example.com\n title: My Dashboard\n icon: dashboard`;\n\n/** @public */\nexport type EntityLinksEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles<BackstageTheme>(\n theme => ({\n code: {\n borderRadius: 6,\n margin: theme.spacing(2, 0),\n background:\n theme.palette.type === 'dark' ? '#444' : theme.palette.common.white,\n },\n }),\n { name: 'PluginCatalogEntityLinksEmptyState' },\n);\n\nexport function EntityLinksEmptyState() {\n const classes = useStyles();\n\n return (\n <>\n <Typography variant=\"body1\">\n No links defined for this entity. You can add links to your entity YAML\n as shown in the highlighted example below:\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional\"\n >\n Read more\n </Button>\n </>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { EntityLinksEmptyState } from './EntityLinksEmptyState';\nimport { LinksGridList } from './LinksGridList';\nimport { ColumnBreakpoints } from './types';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport { InfoCard, InfoCardVariants } from '@backstage/core-components';\n\n/** @public */\nexport interface EntityLinksCardProps {\n cols?: ColumnBreakpoints | number;\n variant?: InfoCardVariants;\n}\n\nexport const EntityLinksCard = (props: EntityLinksCardProps) => {\n const { cols = undefined, variant } = props;\n const { entity } = useEntity();\n const app = useApp();\n\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n const links = entity?.metadata?.links;\n\n return (\n <InfoCard title=\"Links\" variant={variant}>\n {!links || links.length === 0 ? (\n <EntityLinksEmptyState />\n ) : (\n <LinksGridList\n cols={cols}\n items={links.map(({ url, title, icon }) => ({\n text: title ?? url,\n href: url,\n Icon: iconResolver(icon),\n }))}\n />\n )}\n </InfoCard>\n );\n};\n"],"names":["ENTITY_YAML","useStyles","makeStyles","theme","code","borderRadius","margin","spacing","background","palette","type","common","white","name","EntityLinksEmptyState","classes","Typography","variant","div","className","CodeSnippet","text","language","showLineNumbers","highlightedNumbers","customStyle","fontSize","Button","color","target","href","EntityLinksCard","props","entity","cols","undefined","useEntity","app","useApp","iconResolver","key","getSystemIcon","LanguageIcon","links","metadata","InfoCard","title","length","LinksGridList","items","map","url","icon","Icon"],"sourceRoot":""}
1
+ {"version":3,"file":"static/7750.10e99997.chunk.js","mappings":"mSAqBA,MAAMA,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA,uBAUdC,KAAYC,EAAAA,GAChBC,IAAU,CACRC,KAAM,CACJC,aAAc,EACdC,OAAQH,EAAMI,QAAQ,EAAG,CAAC,EAC1BC,WACEL,EAAMM,QAAQC,OAAS,OAAS,OAASP,EAAMM,QAAQE,OAAOC,KAClE,CACF,GACA,CAAEC,KAAM,oCAAqC,CAAC,EAGzC,SAASC,GAAwB,CACtC,MAAMC,EAAUd,EAAU,EAE1B,SACE,oB,aACE,OAACe,EAAAA,EAAUA,CAACC,QAAQ,Q,SAAQ,oH,MAI5B,OAACC,MAAAA,CAAIC,UAAWJ,EAAQX,K,YACtB,OAACgB,EAAAA,GAAWA,CACVC,KAAMrB,EACNsB,SAAS,OACTC,gBAAe,GACfC,mBAAoB,CAAC,EAAG,EAAG,EAAG,C,EAC9BC,YAAa,CAAEjB,WAAY,UAAWkB,SAAU,MAAO,C,QAG3D,OAACC,EAAAA,EAAMA,CACLV,QAAQ,YACRW,MAAM,UACNC,OAAO,SACPC,KAAK,uF,SACN,W,KAKP,C,0BCxCO,MAAMC,EAAmBC,GAAAA,C,IAQhBC,EAAAA,EAPd,KAAM,CAAEC,KAAAA,EAAOC,OAAWlB,QAAAA,CAAQ,EAAIe,EAChC,CAAEC,OAAAA,CAAO,KAAIG,EAAAA,IAAU,EACvBC,KAAMC,EAAAA,IAAO,E,IAGXD,EADR,MAAME,EAAgBC,GACpBA,IAAMH,EAAAA,EAAII,cAAcD,CAAG,KAAHA,MAAlBH,IAAAA,OAAAA,EAAyCK,EAAAA,EAE3CC,GAAQV,EAAAA,KAAAA,MAAAA,IAAAA,SAAAA,EAAAA,EAAQW,YAAQ,MAAhBX,IAAAA,OAAAA,OAAAA,EAAkBU,MAEhC,SACE,OAACE,EAAAA,GAAQA,CAACC,MAAM,QAAQ7B,QAASA,E,SAC9B,CAAC0B,GAASA,EAAMI,SAAW,KAC1B,OAACjC,EAAqBA,CAAAA,CAAAA,KAEtB,OAACkC,EAAAA,EAAaA,CACZd,KAAMA,EACNe,MAAON,EAAMO,IAAI,CAAC,CAAEC,IAAAA,EAAKL,MAAAA,EAAOM,KAAAA,CAAK,KAAO,CAC1C/B,KAAMyB,GAAAA,KAAAA,EAASK,EACfrB,KAAMqB,EACNE,KAAMd,EAAaa,CAAI,CACzB,EAAE,C,IAKZ,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/EntityLinksEmptyState.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BackstageTheme } from '@backstage/theme';\nimport { Button, makeStyles, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `metadata:\n name: example\n links:\n - url: https://dashboard.example.com\n title: My Dashboard\n icon: dashboard`;\n\n/** @public */\nexport type EntityLinksEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles<BackstageTheme>(\n theme => ({\n code: {\n borderRadius: 6,\n margin: theme.spacing(2, 0),\n background:\n theme.palette.type === 'dark' ? '#444' : theme.palette.common.white,\n },\n }),\n { name: 'PluginCatalogEntityLinksEmptyState' },\n);\n\nexport function EntityLinksEmptyState() {\n const classes = useStyles();\n\n return (\n <>\n <Typography variant=\"body1\">\n No links defined for this entity. You can add links to your entity YAML\n as shown in the highlighted example below:\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional\"\n >\n Read more\n </Button>\n </>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { EntityLinksEmptyState } from './EntityLinksEmptyState';\nimport { LinksGridList } from './LinksGridList';\nimport { ColumnBreakpoints } from './types';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport { InfoCard, InfoCardVariants } from '@backstage/core-components';\n\n/** @public */\nexport interface EntityLinksCardProps {\n cols?: ColumnBreakpoints | number;\n variant?: InfoCardVariants;\n}\n\nexport const EntityLinksCard = (props: EntityLinksCardProps) => {\n const { cols = undefined, variant } = props;\n const { entity } = useEntity();\n const app = useApp();\n\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n const links = entity?.metadata?.links;\n\n return (\n <InfoCard title=\"Links\" variant={variant}>\n {!links || links.length === 0 ? (\n <EntityLinksEmptyState />\n ) : (\n <LinksGridList\n cols={cols}\n items={links.map(({ url, title, icon }) => ({\n text: title ?? url,\n href: url,\n Icon: iconResolver(icon),\n }))}\n />\n )}\n </InfoCard>\n );\n};\n"],"names":["ENTITY_YAML","useStyles","makeStyles","theme","code","borderRadius","margin","spacing","background","palette","type","common","white","name","EntityLinksEmptyState","classes","Typography","variant","div","className","CodeSnippet","text","language","showLineNumbers","highlightedNumbers","customStyle","fontSize","Button","color","target","href","EntityLinksCard","props","entity","cols","undefined","useEntity","app","useApp","iconResolver","key","getSystemIcon","LanguageIcon","links","metadata","InfoCard","title","length","LinksGridList","items","map","url","icon","Icon"],"sourceRoot":""}
@@ -1,3 +1,3 @@
1
1
  "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[8951],{78951:function(j,o,t){t.r(o),t.d(o,{CatalogEntityPage:function(){return E}});var r=t(52322),v=t(2784),a=t(73557),e=t(39709),n=t(60871),y=t(77446);const m=()=>{const{kind:c,namespace:i,name:s}=(0,n.Oi)(e.wi),d=(0,a.s0)(),l=(0,n.h_)(n.VE),u=(0,n.h_)(e.Ah),{value:h,error:f,loading:g,retry:p}=(0,y.Z)(()=>u.getEntityByRef({kind:c,namespace:i,name:s}),[u,c,i,s]);return(0,v.useEffect)(()=>{s||(l.post(new Error("No name provided!")),d("/"))},[l,d,f,g,h,s]),{entity:h,loading:g,error:f,refresh:p}};function E(){return(0,r.jsx)(e.h$,{...m(),children:(0,r.jsx)(a.j3,{})})}}}]);})();
2
2
 
3
- //# sourceMappingURL=8951.fea20091.chunk.js.map
3
+ //# sourceMappingURL=8951.bff6b400.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static/8951.fea20091.chunk.js","mappings":"+QA8BO,MAAMA,EAAmB,KAC9B,KAAM,CAAEC,KAAAA,EAAMC,UAAAA,EAAWC,KAAAA,CAAK,KAAIC,EAAAA,IAAkBC,EAAAA,EAAcA,EAC5DC,KAAWC,EAAAA,IAAY,EACvBC,KAAWC,EAAAA,IAAOC,EAAAA,EAAWA,EAC7BC,KAAaF,EAAAA,IAAOG,EAAAA,EAAaA,EAEjC,CACJC,MAAOC,EACPC,MAAAA,EACAC,QAAAA,EACAC,MAAOC,CAAO,KACZC,EAAAA,GACF,IAAMR,EAAWS,eAAe,CAAEnB,KAAAA,EAAMC,UAAAA,EAAWC,KAAAA,CAAK,CAAC,EACzD,CAACQ,EAAYV,EAAMC,EAAWC,C,CAAK,EAGrCkB,SAAAA,EAAAA,WAAU,KACHlB,IACHK,EAASc,KAAK,IAAIC,MAAM,mBAAmB,CAAC,EAC5CjB,EAAS,GAAG,EAEhB,EAAG,CAACE,EAAUF,EAAUS,EAAOC,EAASF,EAAQX,C,CAAK,EAE9C,CAAEW,OAAAA,EAAQE,QAAAA,EAASD,MAAAA,EAAOG,QAAAA,CAAQ,CAC3C,EChCO,SAASM,GAAoB,CAClC,SACE,OAACC,EAAAA,GAAmBA,CAAE,GAAGzB,EAAiB,E,YACxC,OAAC0B,EAAAA,GAAMA,CAAAA,CAAAA,C,EAGb,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogEntityPage/useEntityFromUrl.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogEntityPage/CatalogEntityPage.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n errorApiRef,\n useApi,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n EntityLoadingStatus,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { useEffect } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport useAsyncRetry from 'react-use/lib/useAsyncRetry';\n\nexport const useEntityFromUrl = (): EntityLoadingStatus => {\n const { kind, namespace, name } = useRouteRefParams(entityRouteRef);\n const navigate = useNavigate();\n const errorApi = useApi(errorApiRef);\n const catalogApi = useApi(catalogApiRef);\n\n const {\n value: entity,\n error,\n loading,\n retry: refresh,\n } = useAsyncRetry(\n () => catalogApi.getEntityByRef({ kind, namespace, name }),\n [catalogApi, kind, namespace, name],\n );\n\n useEffect(() => {\n if (!name) {\n errorApi.post(new Error('No name provided!'));\n navigate('/');\n }\n }, [errorApi, navigate, error, loading, entity, name]);\n\n return { entity, loading, error, refresh };\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { Outlet } from 'react-router-dom';\nimport { AsyncEntityProvider } from '@backstage/plugin-catalog-react';\nimport { useEntityFromUrl } from './useEntityFromUrl';\n\n/** @public */\nexport function CatalogEntityPage() {\n return (\n <AsyncEntityProvider {...useEntityFromUrl()}>\n <Outlet />\n </AsyncEntityProvider>\n );\n}\n"],"names":["useEntityFromUrl","kind","namespace","name","useRouteRefParams","entityRouteRef","navigate","useNavigate","errorApi","useApi","errorApiRef","catalogApi","catalogApiRef","value","entity","error","loading","retry","refresh","useAsyncRetry","getEntityByRef","useEffect","post","Error","CatalogEntityPage","AsyncEntityProvider","Outlet"],"sourceRoot":""}
1
+ {"version":3,"file":"static/8951.bff6b400.chunk.js","mappings":"+QA8BO,MAAMA,EAAmB,KAC9B,KAAM,CAAEC,KAAAA,EAAMC,UAAAA,EAAWC,KAAAA,CAAK,KAAIC,EAAAA,IAAkBC,EAAAA,EAAcA,EAC5DC,KAAWC,EAAAA,IAAY,EACvBC,KAAWC,EAAAA,IAAOC,EAAAA,EAAWA,EAC7BC,KAAaF,EAAAA,IAAOG,EAAAA,EAAaA,EAEjC,CACJC,MAAOC,EACPC,MAAAA,EACAC,QAAAA,EACAC,MAAOC,CAAO,KACZC,EAAAA,GACF,IAAMR,EAAWS,eAAe,CAAEnB,KAAAA,EAAMC,UAAAA,EAAWC,KAAAA,CAAK,CAAC,EACzD,CAACQ,EAAYV,EAAMC,EAAWC,C,CAAK,EAGrCkB,SAAAA,EAAAA,WAAU,KACHlB,IACHK,EAASc,KAAK,IAAIC,MAAM,mBAAmB,CAAC,EAC5CjB,EAAS,GAAG,EAEhB,EAAG,CAACE,EAAUF,EAAUS,EAAOC,EAASF,EAAQX,C,CAAK,EAE9C,CAAEW,OAAAA,EAAQE,QAAAA,EAASD,MAAAA,EAAOG,QAAAA,CAAQ,CAC3C,EChCO,SAASM,GAAoB,CAClC,SACE,OAACC,EAAAA,GAAmBA,CAAE,GAAGzB,EAAiB,E,YACxC,OAAC0B,EAAAA,GAAMA,CAAAA,CAAAA,C,EAGb,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogEntityPage/useEntityFromUrl.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogEntityPage/CatalogEntityPage.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n errorApiRef,\n useApi,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n EntityLoadingStatus,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { useEffect } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport useAsyncRetry from 'react-use/lib/useAsyncRetry';\n\nexport const useEntityFromUrl = (): EntityLoadingStatus => {\n const { kind, namespace, name } = useRouteRefParams(entityRouteRef);\n const navigate = useNavigate();\n const errorApi = useApi(errorApiRef);\n const catalogApi = useApi(catalogApiRef);\n\n const {\n value: entity,\n error,\n loading,\n retry: refresh,\n } = useAsyncRetry(\n () => catalogApi.getEntityByRef({ kind, namespace, name }),\n [catalogApi, kind, namespace, name],\n );\n\n useEffect(() => {\n if (!name) {\n errorApi.post(new Error('No name provided!'));\n navigate('/');\n }\n }, [errorApi, navigate, error, loading, entity, name]);\n\n return { entity, loading, error, refresh };\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { Outlet } from 'react-router-dom';\nimport { AsyncEntityProvider } from '@backstage/plugin-catalog-react';\nimport { useEntityFromUrl } from './useEntityFromUrl';\n\n/** @public */\nexport function CatalogEntityPage() {\n return (\n <AsyncEntityProvider {...useEntityFromUrl()}>\n <Outlet />\n </AsyncEntityProvider>\n );\n}\n"],"names":["useEntityFromUrl","kind","namespace","name","useRouteRefParams","entityRouteRef","navigate","useNavigate","errorApi","useApi","errorApiRef","catalogApi","catalogApiRef","value","entity","error","loading","retry","refresh","useAsyncRetry","getEntityByRef","useEffect","post","Error","CatalogEntityPage","AsyncEntityProvider","Outlet"],"sourceRoot":""}
@@ -1,3 +1,3 @@
1
1
  "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[9323],{89323:function(D,a,s){s.r(a),s.d(a,{CatalogPage:function(){return m},DefaultCatalogPage:function(){return c}});var t=s(52322),E=s(2784),g=s(73557),o=s(53974),l=s(60871),n=s(39709),u=s(19625),j=s(86359),x=s(64355);const h=()=>(0,x.y)();function c(i){const{columns:d,actions:C,initiallySelectedFilter:p="owned",initialKind:f="component",tableOptions:v={},emptyContent:y,ownerPickerMode:O}=i;var e;const P=(e=(0,l.h_)(l.Ds).getOptionalString("organization.name"))!==null&&e!==void 0?e:"Backstage",r=(0,l.tg)(u.yw),{createButtonTitle:F}=h();return(0,t.jsx)(o.g9,{title:`${P} Catalog`,themeId:"home",children:(0,t.jsxs)(o.VY,{children:[(0,t.jsxs)(o.yW,{title:"",children:[(0,t.jsx)(o.XF,{title:F,to:r&&r()}),(0,t.jsx)(o.qt,{children:"All your software catalog entities"})]}),(0,t.jsx)(n.UO,{children:(0,t.jsxs)(n._i,{children:[(0,t.jsxs)(n._i.Filters,{children:[(0,t.jsx)(n.tW,{initialFilter:f}),(0,t.jsx)(n.sL,{}),(0,t.jsx)(n.EW,{initialFilter:p}),(0,t.jsx)(n.dq,{mode:O}),(0,t.jsx)(n.df,{}),(0,t.jsx)(n.xE,{}),(0,t.jsx)(n.nl,{}),(0,t.jsx)(n.ph,{})]}),(0,t.jsx)(n._i.Content,{children:(0,t.jsx)(j.E,{columns:d,actions:C,tableOptions:v,emptyContent:y})})]})})]})})}function m(i){return(0,g.pC)()||(0,t.jsx)(c,{...i})}}}]);})();
2
2
 
3
- //# sourceMappingURL=9323.61727faa.chunk.js.map
3
+ //# sourceMappingURL=9323.dd670d43.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static/9323.61727faa.chunk.js","mappings":"kVA2BO,MAAMA,EAA0B,OACrCC,EAAAA,GAAgBA,ECgCX,SAASC,EAAmBC,EAAgC,CACjE,KAAM,CACJC,QAAAA,EACAC,QAAAA,EACAC,wBAAAA,EAA0B,QAC1BC,YAAAA,EAAc,YACdC,aAAAA,EAAe,CAAC,EAChBC,aAAAA,EACAC,gBAAAA,CAAe,EACbP,E,IAEFQ,EADF,MAAMC,GACJD,KAAAA,EAAAA,IAAOE,EAAAA,EAAYA,EAAEC,kBAAkB,mBAAmB,KAAnB,MAAvCH,IAAAA,OAAAA,EAA+D,YAC3DI,KAAsBC,EAAAA,IAAYC,EAAAA,EAAuBA,EAEzD,CAAEC,kBAAAA,CAAkB,EAAIlB,EAAwB,EAEtD,SACE,OAACmB,EAAAA,GAAcA,CAACC,MAAO,GAAGR,YAAmBS,QAAQ,O,YACnD,QAACC,EAAAA,GAAOA,C,aACN,QAACC,EAAAA,GAAaA,CAACH,MAAM,G,aACnB,OAACI,EAAAA,GAAYA,CACXJ,MAAOF,EACPO,GAAIV,GAAuBA,EAAoB,C,MAEjD,OAACW,EAAAA,GAAaA,C,SAAC,oC,SAEjB,OAACC,EAAAA,GAAkBA,C,YACjB,QAACC,EAAAA,GAAmBA,C,aAClB,QAACA,EAAAA,GAAoBC,QAAO,C,aAC1B,OAACC,EAAAA,GAAgBA,CAACC,cAAexB,C,MACjC,OAACyB,EAAAA,GAAgBA,CAAAA,CAAAA,KACjB,OAACC,EAAAA,GAAcA,CAACF,cAAezB,C,MAC/B,OAAC4B,EAAAA,GAAiBA,CAACC,KAAMzB,C,MACzB,OAAC0B,EAAAA,GAAqBA,CAAAA,CAAAA,KACtB,OAACC,EAAAA,GAAeA,CAAAA,CAAAA,KAChB,OAACC,EAAAA,GAA4BA,CAAAA,CAAAA,KAC7B,OAACC,EAAAA,GAAqBA,CAAAA,CAAAA,C,OAExB,OAACX,EAAAA,GAAoBN,QAAO,C,YAC1B,OAACkB,EAAAA,EAAYA,CACXpC,QAASA,EACTC,QAASA,EACTG,aAAcA,EACdC,aAAcA,C,cAQ9B,CCxFO,SAASgC,EAAYtC,EAAgC,CAG1D,SAFeuC,EAAAA,IAAU,MAER,OAACxC,EAAkBA,CAAE,GAAGC,C,EAC3C,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/options.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogPage/CatalogPage.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { usePluginOptions } from '@backstage/core-plugin-api/alpha';\n\nexport type CatalogPluginOptions = {\n createButtonTitle: string;\n};\n\n/** @ignore */\nexport type CatalogInputPluginOptions = {\n createButtonTitle: string;\n};\n\nexport const useCatalogPluginOptions = () =>\n usePluginOptions<CatalogPluginOptions>();\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 Content,\n ContentHeader,\n CreateButton,\n PageWithHeader,\n SupportButton,\n TableColumn,\n TableProps,\n} from '@backstage/core-components';\nimport { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n CatalogFilterLayout,\n EntityLifecyclePicker,\n EntityListProvider,\n EntityProcessingStatusPicker,\n EntityOwnerPicker,\n EntityTagPicker,\n EntityTypePicker,\n UserListFilterKind,\n UserListPicker,\n EntityKindPicker,\n EntityNamespacePicker,\n EntityOwnerPickerProps,\n} from '@backstage/plugin-catalog-react';\nimport React, { ReactNode } from 'react';\nimport { createComponentRouteRef } from '../../routes';\nimport { CatalogTable, CatalogTableRow } from '../CatalogTable';\nimport { useCatalogPluginOptions } from '../../options';\n\n/**\n * Props for root catalog pages.\n *\n * @public\n */\nexport interface DefaultCatalogPageProps {\n initiallySelectedFilter?: UserListFilterKind;\n columns?: TableColumn<CatalogTableRow>[];\n actions?: TableProps<CatalogTableRow>['actions'];\n initialKind?: string;\n tableOptions?: TableProps<CatalogTableRow>['options'];\n emptyContent?: ReactNode;\n ownerPickerMode?: EntityOwnerPickerProps['mode'];\n}\n\nexport function DefaultCatalogPage(props: DefaultCatalogPageProps) {\n const {\n columns,\n actions,\n initiallySelectedFilter = 'owned',\n initialKind = 'component',\n tableOptions = {},\n emptyContent,\n ownerPickerMode,\n } = props;\n const orgName =\n useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage';\n const createComponentLink = useRouteRef(createComponentRouteRef);\n\n const { createButtonTitle } = useCatalogPluginOptions();\n\n return (\n <PageWithHeader title={`${orgName} Catalog`} themeId=\"home\">\n <Content>\n <ContentHeader title=\"\">\n <CreateButton\n title={createButtonTitle}\n to={createComponentLink && createComponentLink()}\n />\n <SupportButton>All your software catalog entities</SupportButton>\n </ContentHeader>\n <EntityListProvider>\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>\n <EntityKindPicker initialFilter={initialKind} />\n <EntityTypePicker />\n <UserListPicker initialFilter={initiallySelectedFilter} />\n <EntityOwnerPicker mode={ownerPickerMode} />\n <EntityLifecyclePicker />\n <EntityTagPicker />\n <EntityProcessingStatusPicker />\n <EntityNamespacePicker />\n </CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>\n <CatalogTable\n columns={columns}\n actions={actions}\n tableOptions={tableOptions}\n emptyContent={emptyContent}\n />\n </CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </EntityListProvider>\n </Content>\n </PageWithHeader>\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 React from 'react';\nimport { useOutlet } from 'react-router-dom';\nimport {\n DefaultCatalogPage,\n DefaultCatalogPageProps,\n} from './DefaultCatalogPage';\n\nexport function CatalogPage(props: DefaultCatalogPageProps) {\n const outlet = useOutlet();\n\n return outlet || <DefaultCatalogPage {...props} />;\n}\n"],"names":["useCatalogPluginOptions","usePluginOptions","DefaultCatalogPage","props","columns","actions","initiallySelectedFilter","initialKind","tableOptions","emptyContent","ownerPickerMode","useApi","orgName","configApiRef","getOptionalString","createComponentLink","useRouteRef","createComponentRouteRef","createButtonTitle","PageWithHeader","title","themeId","Content","ContentHeader","CreateButton","to","SupportButton","EntityListProvider","CatalogFilterLayout","Filters","EntityKindPicker","initialFilter","EntityTypePicker","UserListPicker","EntityOwnerPicker","mode","EntityLifecyclePicker","EntityTagPicker","EntityProcessingStatusPicker","EntityNamespacePicker","CatalogTable","CatalogPage","useOutlet"],"sourceRoot":""}
1
+ {"version":3,"file":"static/9323.dd670d43.chunk.js","mappings":"kVA2BO,MAAMA,EAA0B,OACrCC,EAAAA,GAAgBA,ECgCX,SAASC,EAAmBC,EAAgC,CACjE,KAAM,CACJC,QAAAA,EACAC,QAAAA,EACAC,wBAAAA,EAA0B,QAC1BC,YAAAA,EAAc,YACdC,aAAAA,EAAe,CAAC,EAChBC,aAAAA,EACAC,gBAAAA,CAAe,EACbP,E,IAEFQ,EADF,MAAMC,GACJD,KAAAA,EAAAA,IAAOE,EAAAA,EAAYA,EAAEC,kBAAkB,mBAAmB,KAAnB,MAAvCH,IAAAA,OAAAA,EAA+D,YAC3DI,KAAsBC,EAAAA,IAAYC,EAAAA,EAAuBA,EAEzD,CAAEC,kBAAAA,CAAkB,EAAIlB,EAAwB,EAEtD,SACE,OAACmB,EAAAA,GAAcA,CAACC,MAAO,GAAGR,YAAmBS,QAAQ,O,YACnD,QAACC,EAAAA,GAAOA,C,aACN,QAACC,EAAAA,GAAaA,CAACH,MAAM,G,aACnB,OAACI,EAAAA,GAAYA,CACXJ,MAAOF,EACPO,GAAIV,GAAuBA,EAAoB,C,MAEjD,OAACW,EAAAA,GAAaA,C,SAAC,oC,SAEjB,OAACC,EAAAA,GAAkBA,C,YACjB,QAACC,EAAAA,GAAmBA,C,aAClB,QAACA,EAAAA,GAAoBC,QAAO,C,aAC1B,OAACC,EAAAA,GAAgBA,CAACC,cAAexB,C,MACjC,OAACyB,EAAAA,GAAgBA,CAAAA,CAAAA,KACjB,OAACC,EAAAA,GAAcA,CAACF,cAAezB,C,MAC/B,OAAC4B,EAAAA,GAAiBA,CAACC,KAAMzB,C,MACzB,OAAC0B,EAAAA,GAAqBA,CAAAA,CAAAA,KACtB,OAACC,EAAAA,GAAeA,CAAAA,CAAAA,KAChB,OAACC,EAAAA,GAA4BA,CAAAA,CAAAA,KAC7B,OAACC,EAAAA,GAAqBA,CAAAA,CAAAA,C,OAExB,OAACX,EAAAA,GAAoBN,QAAO,C,YAC1B,OAACkB,EAAAA,EAAYA,CACXpC,QAASA,EACTC,QAASA,EACTG,aAAcA,EACdC,aAAcA,C,cAQ9B,CCxFO,SAASgC,EAAYtC,EAAgC,CAG1D,SAFeuC,EAAAA,IAAU,MAER,OAACxC,EAAkBA,CAAE,GAAGC,C,EAC3C,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/options.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogPage/CatalogPage.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { usePluginOptions } from '@backstage/core-plugin-api/alpha';\n\nexport type CatalogPluginOptions = {\n createButtonTitle: string;\n};\n\n/** @ignore */\nexport type CatalogInputPluginOptions = {\n createButtonTitle: string;\n};\n\nexport const useCatalogPluginOptions = () =>\n usePluginOptions<CatalogPluginOptions>();\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 Content,\n ContentHeader,\n CreateButton,\n PageWithHeader,\n SupportButton,\n TableColumn,\n TableProps,\n} from '@backstage/core-components';\nimport { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n CatalogFilterLayout,\n EntityLifecyclePicker,\n EntityListProvider,\n EntityProcessingStatusPicker,\n EntityOwnerPicker,\n EntityTagPicker,\n EntityTypePicker,\n UserListFilterKind,\n UserListPicker,\n EntityKindPicker,\n EntityNamespacePicker,\n EntityOwnerPickerProps,\n} from '@backstage/plugin-catalog-react';\nimport React, { ReactNode } from 'react';\nimport { createComponentRouteRef } from '../../routes';\nimport { CatalogTable, CatalogTableRow } from '../CatalogTable';\nimport { useCatalogPluginOptions } from '../../options';\n\n/**\n * Props for root catalog pages.\n *\n * @public\n */\nexport interface DefaultCatalogPageProps {\n initiallySelectedFilter?: UserListFilterKind;\n columns?: TableColumn<CatalogTableRow>[];\n actions?: TableProps<CatalogTableRow>['actions'];\n initialKind?: string;\n tableOptions?: TableProps<CatalogTableRow>['options'];\n emptyContent?: ReactNode;\n ownerPickerMode?: EntityOwnerPickerProps['mode'];\n}\n\nexport function DefaultCatalogPage(props: DefaultCatalogPageProps) {\n const {\n columns,\n actions,\n initiallySelectedFilter = 'owned',\n initialKind = 'component',\n tableOptions = {},\n emptyContent,\n ownerPickerMode,\n } = props;\n const orgName =\n useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage';\n const createComponentLink = useRouteRef(createComponentRouteRef);\n\n const { createButtonTitle } = useCatalogPluginOptions();\n\n return (\n <PageWithHeader title={`${orgName} Catalog`} themeId=\"home\">\n <Content>\n <ContentHeader title=\"\">\n <CreateButton\n title={createButtonTitle}\n to={createComponentLink && createComponentLink()}\n />\n <SupportButton>All your software catalog entities</SupportButton>\n </ContentHeader>\n <EntityListProvider>\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>\n <EntityKindPicker initialFilter={initialKind} />\n <EntityTypePicker />\n <UserListPicker initialFilter={initiallySelectedFilter} />\n <EntityOwnerPicker mode={ownerPickerMode} />\n <EntityLifecyclePicker />\n <EntityTagPicker />\n <EntityProcessingStatusPicker />\n <EntityNamespacePicker />\n </CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>\n <CatalogTable\n columns={columns}\n actions={actions}\n tableOptions={tableOptions}\n emptyContent={emptyContent}\n />\n </CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </EntityListProvider>\n </Content>\n </PageWithHeader>\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 React from 'react';\nimport { useOutlet } from 'react-router-dom';\nimport {\n DefaultCatalogPage,\n DefaultCatalogPageProps,\n} from './DefaultCatalogPage';\n\nexport function CatalogPage(props: DefaultCatalogPageProps) {\n const outlet = useOutlet();\n\n return outlet || <DefaultCatalogPage {...props} />;\n}\n"],"names":["useCatalogPluginOptions","usePluginOptions","DefaultCatalogPage","props","columns","actions","initiallySelectedFilter","initialKind","tableOptions","emptyContent","ownerPickerMode","useApi","orgName","configApiRef","getOptionalString","createComponentLink","useRouteRef","createComponentRouteRef","createButtonTitle","PageWithHeader","title","themeId","Content","ContentHeader","CreateButton","to","SupportButton","EntityListProvider","CatalogFilterLayout","Filters","EntityKindPicker","initialFilter","EntityTypePicker","UserListPicker","EntityOwnerPicker","mode","EntityLifecyclePicker","EntityTagPicker","EntityProcessingStatusPicker","EntityNamespacePicker","CatalogTable","CatalogPage","useOutlet"],"sourceRoot":""}
@@ -1,3 +1,3 @@
1
1
  "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[9545,732],{19545:function(C,i,n){n.r(i),n.d(i,{DependsOnComponentsCard:function(){return o}});var e=n(52322),r=n(25271),t=n(2784),c=n(732);function o(a){const{variant:u="gridItem",title:l="Depends on components",columns:m=c.componentEntityColumns,tableOptions:d={}}=a;return(0,e.jsx)(c.RelatedEntitiesCard,{variant:u,title:l,entityKind:"Component",relationType:r.nP,columns:m,emptyMessage:"No component is a dependency of this component",emptyHelpLink:c.componentEntityHelpLink,asRenderableEntities:c.asComponentEntities,tableOptions:d})}},732:function(C,i,n){n.r(i),n.d(i,{RelatedEntitiesCard:function(){return a},asComponentEntities:function(){return m},asResourceEntities:function(){return h},asSystemEntities:function(){return j},componentEntityColumns:function(){return u},componentEntityHelpLink:function(){return l},resourceEntityColumns:function(){return d},resourceEntityHelpLink:function(){return E},systemEntityColumns:function(){return v},systemEntityHelpLink:function(){return g}});var e=n(52322),r=n(90436),t=n(39709),c=n(2784),o=n(53974);function a(s){const{variant:p="gridItem",title:y,columns:x,entityKind:L,relationType:R,emptyMessage:k,emptyHelpLink:H,asRenderableEntities:O,tableOptions:D={}}=s,{entity:K}=(0,t.X2)(),{entities:S,loading:M,error:f}=(0,t.eK)(K,{type:R,kind:L});return M?(0,e.jsx)(o.rJ,{variant:p,title:y,children:(0,e.jsx)(o.Ex,{})}):f?(0,e.jsx)(o.rJ,{variant:p,title:y,children:(0,e.jsx)(o.Gk,{error:f})}):(0,e.jsx)(t.u3,{title:y,variant:p,emptyContent:(0,e.jsxs)("div",{style:{textAlign:"center"},children:[(0,e.jsx)(r.Z,{variant:"body1",children:k}),(0,e.jsx)(r.Z,{variant:"body2",children:(0,e.jsx)(o.rU,{to:H,children:"Learn how to change this."})})]}),columns:x,entities:O(S||[]),tableOptions:D})}const u=[t.u3.columns.createEntityRefColumn({defaultKind:"component"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createSpecTypeColumn(),t.u3.columns.createSpecLifecycleColumn(),t.u3.columns.createMetadataDescriptionColumn()],l="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",m=s=>s,d=[t.u3.columns.createEntityRefColumn({defaultKind:"resource"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createSpecTypeColumn(),t.u3.columns.createSpecLifecycleColumn(),t.u3.columns.createMetadataDescriptionColumn()],E="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",h=s=>s,v=[t.u3.columns.createEntityRefColumn({defaultKind:"system"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createMetadataDescriptionColumn()],g="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",j=s=>s}}]);})();
2
2
 
3
- //# sourceMappingURL=9545.dea948d9.chunk.js.map
3
+ //# sourceMappingURL=9545.24f95d89.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static/9545.dea948d9.chunk.js","mappings":"iQAsCO,SAASA,EAAwBC,EAAqC,CAC3E,KAAM,CACJC,QAAAA,EAAU,WACVC,MAAAA,EAAQ,wBACRC,QAAAA,EAAUC,EAAAA,uBACVC,aAAAA,EAAe,CAAC,CAAC,EACfL,EACJ,SACE,OAACM,EAAAA,oBAAmBA,CAClBL,QAASA,EACTC,MAAOA,EACPK,WAAW,YACXC,aAAcC,EAAAA,GACdN,QAASA,EACTO,aAAa,iDACbC,cAAeC,EAAAA,wBACfC,qBAAsBC,EAAAA,oBACtBT,aAAcA,C,EAGpB,C,mgBCCO,SAASC,EACdN,EAAkC,CAElC,KAAM,CACJC,QAAAA,EAAU,WACVC,MAAAA,EACAC,QAAAA,EACAI,WAAAA,EACAC,aAAAA,EACAE,aAAAA,EACAC,cAAAA,EACAE,qBAAAA,EACAR,aAAAA,EAAe,CAAC,CAAC,EACfL,EAEE,CAAEe,OAAAA,CAAO,KAAIC,EAAAA,IAAU,EACvB,CAAEC,SAAAA,EAAUC,QAAAA,EAASC,MAAAA,CAAM,KAAIC,EAAAA,IAAmBL,EAAQ,CAC9DM,KAAMb,EACNc,KAAMf,CACR,CAAC,EAED,OAAIW,KAEA,OAACK,EAAAA,GAAQA,CAACtB,QAASA,EAASC,MAAOA,E,YACjC,OAACsB,EAAAA,GAAQA,CAAAA,CAAAA,C,GAKXL,KAEA,OAACI,EAAAA,GAAQA,CAACtB,QAASA,EAASC,MAAOA,E,YACjC,OAACuB,EAAAA,GAAkBA,CAACN,MAAOA,C,QAM/B,OAACO,EAAAA,GAAWA,CACVxB,MAAOA,EACPD,QAASA,EACT0B,gBACE,QAACC,MAAAA,CAAIC,MAAO,CAAEC,UAAW,QAAS,E,aAChC,OAACC,EAAAA,EAAUA,CAAC9B,QAAQ,Q,SAASS,C,MAC7B,OAACqB,EAAAA,EAAUA,CAAC9B,QAAQ,Q,YAClB,OAAC+B,EAAAA,GAAIA,CAACC,GAAItB,E,SAAe,2B,QAI/BR,QAASA,EACTc,SAAUJ,EAAqBI,GAAY,CAAC,CAAC,EAC7CZ,aAAcA,C,EAGpB,CCzFO,MAAMD,EAAyD,CACpEsB,EAAAA,GAAYvB,QAAQ+B,sBAAsB,CAAEC,YAAa,WAAY,CAAC,EACtET,EAAAA,GAAYvB,QAAQiC,kBAAkB,EACtCV,EAAAA,GAAYvB,QAAQkC,qBAAqB,EACzCX,EAAAA,GAAYvB,QAAQmC,0BAA0B,EAC9CZ,EAAAA,GAAYvB,QAAQoC,gCAAgC,C,EAEzC3B,EACX,uFACWE,EAAuBG,GAClCA,EAEWuB,EAAuD,CAClEd,EAAAA,GAAYvB,QAAQ+B,sBAAsB,CAAEC,YAAa,UAAW,CAAC,EACrET,EAAAA,GAAYvB,QAAQiC,kBAAkB,EACtCV,EAAAA,GAAYvB,QAAQkC,qBAAqB,EACzCX,EAAAA,GAAYvB,QAAQmC,0BAA0B,EAC9CZ,EAAAA,GAAYvB,QAAQoC,gCAAgC,C,EAEzCE,EACX,sFACWC,EAAsBzB,GACjCA,EAEW0B,EAAmD,CAC9DjB,EAAAA,GAAYvB,QAAQ+B,sBAAsB,CAAEC,YAAa,QAAS,CAAC,EACnET,EAAAA,GAAYvB,QAAQiC,kBAAkB,EACtCV,EAAAA,GAAYvB,QAAQoC,gCAAgC,C,EAEzCK,EACX,oFACWC,EAAoB5B,GAC/BA,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/DependsOnComponentsCard/DependsOnComponentsCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/presets.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 { RELATION_DEPENDS_ON, ComponentEntity } from '@backstage/catalog-model';\nimport {\n InfoCardVariants,\n TableColumn,\n TableOptions,\n} from '@backstage/core-components';\nimport React from 'react';\nimport {\n asComponentEntities,\n componentEntityColumns,\n componentEntityHelpLink,\n RelatedEntitiesCard,\n} from '../RelatedEntitiesCard';\n\n/** @public */\nexport interface DependsOnComponentsCardProps {\n variant?: InfoCardVariants;\n title?: string;\n columns?: TableColumn<ComponentEntity>[];\n tableOptions?: TableOptions;\n}\n\nexport function DependsOnComponentsCard(props: DependsOnComponentsCardProps) {\n const {\n variant = 'gridItem',\n title = 'Depends on components',\n columns = componentEntityColumns,\n tableOptions = {},\n } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title={title}\n entityKind=\"Component\"\n relationType={RELATION_DEPENDS_ON}\n columns={columns}\n emptyMessage=\"No component is a dependency of this component\"\n emptyHelpLink={componentEntityHelpLink}\n asRenderableEntities={asComponentEntities}\n tableOptions={tableOptions}\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 { Entity } from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport {\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n ResponseErrorPanel,\n TableColumn,\n TableOptions,\n} from '@backstage/core-components';\n\n/** @public */\nexport type RelatedEntitiesCardProps<T extends Entity> = {\n variant?: InfoCardVariants;\n title: string;\n columns: TableColumn<T>[];\n entityKind?: string;\n relationType: string;\n emptyMessage: string;\n emptyHelpLink: string;\n asRenderableEntities: (entities: Entity[]) => T[];\n tableOptions?: TableOptions;\n};\n\n/**\n * A low level card component that can be used as a building block for more\n * specific cards.\n *\n * @remarks\n *\n * You probably want to make a dedicated component for your needs, which renders\n * this card as its implementation with some of the props set to the appropriate\n * values.\n *\n * @public\n */\nexport function RelatedEntitiesCard<T extends Entity>(\n props: RelatedEntitiesCardProps<T>,\n) {\n const {\n variant = 'gridItem',\n title,\n columns,\n entityKind,\n relationType,\n emptyMessage,\n emptyHelpLink,\n asRenderableEntities,\n tableOptions = {},\n } = props;\n\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: relationType,\n kind: entityKind,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error) {\n return (\n <InfoCard variant={variant} title={title}>\n <ResponseErrorPanel error={error} />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">{emptyMessage}</Typography>\n <Typography variant=\"body2\">\n <Link to={emptyHelpLink}>Learn how to change this.</Link>\n </Typography>\n </div>\n }\n columns={columns}\n entities={asRenderableEntities(entities || [])}\n tableOptions={tableOptions}\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 */\nimport {\n ComponentEntity,\n Entity,\n ResourceEntity,\n SystemEntity,\n} from '@backstage/catalog-model';\nimport { EntityTable } from '@backstage/plugin-catalog-react';\nimport { TableColumn } from '@backstage/core-components';\n\nexport const componentEntityColumns: TableColumn<ComponentEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'component' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const componentEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component';\nexport const asComponentEntities = (entities: Entity[]): ComponentEntity[] =>\n entities as ComponentEntity[];\n\nexport const resourceEntityColumns: TableColumn<ResourceEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'resource' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const resourceEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource';\nexport const asResourceEntities = (entities: Entity[]): ResourceEntity[] =>\n entities as ResourceEntity[];\n\nexport const systemEntityColumns: TableColumn<SystemEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'system' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const systemEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system';\nexport const asSystemEntities = (entities: Entity[]): SystemEntity[] =>\n entities as SystemEntity[];\n"],"names":["DependsOnComponentsCard","props","variant","title","columns","componentEntityColumns","tableOptions","RelatedEntitiesCard","entityKind","relationType","RELATION_DEPENDS_ON","emptyMessage","emptyHelpLink","componentEntityHelpLink","asRenderableEntities","asComponentEntities","entity","useEntity","entities","loading","error","useRelatedEntities","type","kind","InfoCard","Progress","ResponseErrorPanel","EntityTable","emptyContent","div","style","textAlign","Typography","Link","to","createEntityRefColumn","defaultKind","createOwnerColumn","createSpecTypeColumn","createSpecLifecycleColumn","createMetadataDescriptionColumn","resourceEntityColumns","resourceEntityHelpLink","asResourceEntities","systemEntityColumns","systemEntityHelpLink","asSystemEntities"],"sourceRoot":""}
1
+ {"version":3,"file":"static/9545.24f95d89.chunk.js","mappings":"iQAsCO,SAASA,EAAwBC,EAAqC,CAC3E,KAAM,CACJC,QAAAA,EAAU,WACVC,MAAAA,EAAQ,wBACRC,QAAAA,EAAUC,EAAAA,uBACVC,aAAAA,EAAe,CAAC,CAAC,EACfL,EACJ,SACE,OAACM,EAAAA,oBAAmBA,CAClBL,QAASA,EACTC,MAAOA,EACPK,WAAW,YACXC,aAAcC,EAAAA,GACdN,QAASA,EACTO,aAAa,iDACbC,cAAeC,EAAAA,wBACfC,qBAAsBC,EAAAA,oBACtBT,aAAcA,C,EAGpB,C,mgBCCO,SAASC,EACdN,EAAkC,CAElC,KAAM,CACJC,QAAAA,EAAU,WACVC,MAAAA,EACAC,QAAAA,EACAI,WAAAA,EACAC,aAAAA,EACAE,aAAAA,EACAC,cAAAA,EACAE,qBAAAA,EACAR,aAAAA,EAAe,CAAC,CAAC,EACfL,EAEE,CAAEe,OAAAA,CAAO,KAAIC,EAAAA,IAAU,EACvB,CAAEC,SAAAA,EAAUC,QAAAA,EAASC,MAAAA,CAAM,KAAIC,EAAAA,IAAmBL,EAAQ,CAC9DM,KAAMb,EACNc,KAAMf,CACR,CAAC,EAED,OAAIW,KAEA,OAACK,EAAAA,GAAQA,CAACtB,QAASA,EAASC,MAAOA,E,YACjC,OAACsB,EAAAA,GAAQA,CAAAA,CAAAA,C,GAKXL,KAEA,OAACI,EAAAA,GAAQA,CAACtB,QAASA,EAASC,MAAOA,E,YACjC,OAACuB,EAAAA,GAAkBA,CAACN,MAAOA,C,QAM/B,OAACO,EAAAA,GAAWA,CACVxB,MAAOA,EACPD,QAASA,EACT0B,gBACE,QAACC,MAAAA,CAAIC,MAAO,CAAEC,UAAW,QAAS,E,aAChC,OAACC,EAAAA,EAAUA,CAAC9B,QAAQ,Q,SAASS,C,MAC7B,OAACqB,EAAAA,EAAUA,CAAC9B,QAAQ,Q,YAClB,OAAC+B,EAAAA,GAAIA,CAACC,GAAItB,E,SAAe,2B,QAI/BR,QAASA,EACTc,SAAUJ,EAAqBI,GAAY,CAAC,CAAC,EAC7CZ,aAAcA,C,EAGpB,CCzFO,MAAMD,EAAyD,CACpEsB,EAAAA,GAAYvB,QAAQ+B,sBAAsB,CAAEC,YAAa,WAAY,CAAC,EACtET,EAAAA,GAAYvB,QAAQiC,kBAAkB,EACtCV,EAAAA,GAAYvB,QAAQkC,qBAAqB,EACzCX,EAAAA,GAAYvB,QAAQmC,0BAA0B,EAC9CZ,EAAAA,GAAYvB,QAAQoC,gCAAgC,C,EAEzC3B,EACX,uFACWE,EAAuBG,GAClCA,EAEWuB,EAAuD,CAClEd,EAAAA,GAAYvB,QAAQ+B,sBAAsB,CAAEC,YAAa,UAAW,CAAC,EACrET,EAAAA,GAAYvB,QAAQiC,kBAAkB,EACtCV,EAAAA,GAAYvB,QAAQkC,qBAAqB,EACzCX,EAAAA,GAAYvB,QAAQmC,0BAA0B,EAC9CZ,EAAAA,GAAYvB,QAAQoC,gCAAgC,C,EAEzCE,EACX,sFACWC,EAAsBzB,GACjCA,EAEW0B,EAAmD,CAC9DjB,EAAAA,GAAYvB,QAAQ+B,sBAAsB,CAAEC,YAAa,QAAS,CAAC,EACnET,EAAAA,GAAYvB,QAAQiC,kBAAkB,EACtCV,EAAAA,GAAYvB,QAAQoC,gCAAgC,C,EAEzCK,EACX,oFACWC,EAAoB5B,GAC/BA,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/DependsOnComponentsCard/DependsOnComponentsCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/presets.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 { RELATION_DEPENDS_ON, ComponentEntity } from '@backstage/catalog-model';\nimport {\n InfoCardVariants,\n TableColumn,\n TableOptions,\n} from '@backstage/core-components';\nimport React from 'react';\nimport {\n asComponentEntities,\n componentEntityColumns,\n componentEntityHelpLink,\n RelatedEntitiesCard,\n} from '../RelatedEntitiesCard';\n\n/** @public */\nexport interface DependsOnComponentsCardProps {\n variant?: InfoCardVariants;\n title?: string;\n columns?: TableColumn<ComponentEntity>[];\n tableOptions?: TableOptions;\n}\n\nexport function DependsOnComponentsCard(props: DependsOnComponentsCardProps) {\n const {\n variant = 'gridItem',\n title = 'Depends on components',\n columns = componentEntityColumns,\n tableOptions = {},\n } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title={title}\n entityKind=\"Component\"\n relationType={RELATION_DEPENDS_ON}\n columns={columns}\n emptyMessage=\"No component is a dependency of this component\"\n emptyHelpLink={componentEntityHelpLink}\n asRenderableEntities={asComponentEntities}\n tableOptions={tableOptions}\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 { Entity } from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport {\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n ResponseErrorPanel,\n TableColumn,\n TableOptions,\n} from '@backstage/core-components';\n\n/** @public */\nexport type RelatedEntitiesCardProps<T extends Entity> = {\n variant?: InfoCardVariants;\n title: string;\n columns: TableColumn<T>[];\n entityKind?: string;\n relationType: string;\n emptyMessage: string;\n emptyHelpLink: string;\n asRenderableEntities: (entities: Entity[]) => T[];\n tableOptions?: TableOptions;\n};\n\n/**\n * A low level card component that can be used as a building block for more\n * specific cards.\n *\n * @remarks\n *\n * You probably want to make a dedicated component for your needs, which renders\n * this card as its implementation with some of the props set to the appropriate\n * values.\n *\n * @public\n */\nexport function RelatedEntitiesCard<T extends Entity>(\n props: RelatedEntitiesCardProps<T>,\n) {\n const {\n variant = 'gridItem',\n title,\n columns,\n entityKind,\n relationType,\n emptyMessage,\n emptyHelpLink,\n asRenderableEntities,\n tableOptions = {},\n } = props;\n\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: relationType,\n kind: entityKind,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error) {\n return (\n <InfoCard variant={variant} title={title}>\n <ResponseErrorPanel error={error} />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">{emptyMessage}</Typography>\n <Typography variant=\"body2\">\n <Link to={emptyHelpLink}>Learn how to change this.</Link>\n </Typography>\n </div>\n }\n columns={columns}\n entities={asRenderableEntities(entities || [])}\n tableOptions={tableOptions}\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 */\nimport {\n ComponentEntity,\n Entity,\n ResourceEntity,\n SystemEntity,\n} from '@backstage/catalog-model';\nimport { EntityTable } from '@backstage/plugin-catalog-react';\nimport { TableColumn } from '@backstage/core-components';\n\nexport const componentEntityColumns: TableColumn<ComponentEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'component' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const componentEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component';\nexport const asComponentEntities = (entities: Entity[]): ComponentEntity[] =>\n entities as ComponentEntity[];\n\nexport const resourceEntityColumns: TableColumn<ResourceEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'resource' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const resourceEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource';\nexport const asResourceEntities = (entities: Entity[]): ResourceEntity[] =>\n entities as ResourceEntity[];\n\nexport const systemEntityColumns: TableColumn<SystemEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'system' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const systemEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system';\nexport const asSystemEntities = (entities: Entity[]): SystemEntity[] =>\n entities as SystemEntity[];\n"],"names":["DependsOnComponentsCard","props","variant","title","columns","componentEntityColumns","tableOptions","RelatedEntitiesCard","entityKind","relationType","RELATION_DEPENDS_ON","emptyMessage","emptyHelpLink","componentEntityHelpLink","asRenderableEntities","asComponentEntities","entity","useEntity","entities","loading","error","useRelatedEntities","type","kind","InfoCard","Progress","ResponseErrorPanel","EntityTable","emptyContent","div","style","textAlign","Typography","Link","to","createEntityRefColumn","defaultKind","createOwnerColumn","createSpecTypeColumn","createSpecLifecycleColumn","createMetadataDescriptionColumn","resourceEntityColumns","resourceEntityHelpLink","asResourceEntities","systemEntityColumns","systemEntityHelpLink","asSystemEntities"],"sourceRoot":""}
@@ -1,3 +1,3 @@
1
1
  "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[9770,732],{79770:function(p,i,n){n.r(i),n.d(i,{HasResourcesCard:function(){return s}});var e=n(52322),c=n(25271),t=n(2784),r=n(732);function s(u){const{variant:a="gridItem",title:l="Has resources"}=u;return(0,e.jsx)(r.RelatedEntitiesCard,{variant:a,title:l,entityKind:"Resource",relationType:c.aS,columns:r.resourceEntityColumns,asRenderableEntities:r.asResourceEntities,emptyMessage:"No resource is part of this system",emptyHelpLink:r.resourceEntityHelpLink})}},732:function(p,i,n){n.r(i),n.d(i,{RelatedEntitiesCard:function(){return u},asComponentEntities:function(){return f},asResourceEntities:function(){return h},asSystemEntities:function(){return g},componentEntityColumns:function(){return a},componentEntityHelpLink:function(){return l},resourceEntityColumns:function(){return C},resourceEntityHelpLink:function(){return E},systemEntityColumns:function(){return v},systemEntityHelpLink:function(){return R}});var e=n(52322),c=n(90436),t=n(39709),r=n(2784),s=n(53974);function u(o){const{variant:m="gridItem",title:d,columns:j,entityKind:x,relationType:H,emptyMessage:L,emptyHelpLink:k,asRenderableEntities:S,tableOptions:K={}}=o,{entity:M}=(0,t.X2)(),{entities:O,loading:T,error:y}=(0,t.eK)(M,{type:H,kind:x});return T?(0,e.jsx)(s.rJ,{variant:m,title:d,children:(0,e.jsx)(s.Ex,{})}):y?(0,e.jsx)(s.rJ,{variant:m,title:d,children:(0,e.jsx)(s.Gk,{error:y})}):(0,e.jsx)(t.u3,{title:d,variant:m,emptyContent:(0,e.jsxs)("div",{style:{textAlign:"center"},children:[(0,e.jsx)(c.Z,{variant:"body1",children:L}),(0,e.jsx)(c.Z,{variant:"body2",children:(0,e.jsx)(s.rU,{to:k,children:"Learn how to change this."})})]}),columns:j,entities:S(O||[]),tableOptions:K})}const a=[t.u3.columns.createEntityRefColumn({defaultKind:"component"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createSpecTypeColumn(),t.u3.columns.createSpecLifecycleColumn(),t.u3.columns.createMetadataDescriptionColumn()],l="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",f=o=>o,C=[t.u3.columns.createEntityRefColumn({defaultKind:"resource"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createSpecTypeColumn(),t.u3.columns.createSpecLifecycleColumn(),t.u3.columns.createMetadataDescriptionColumn()],E="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",h=o=>o,v=[t.u3.columns.createEntityRefColumn({defaultKind:"system"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createMetadataDescriptionColumn()],R="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",g=o=>o}}]);})();
2
2
 
3
- //# sourceMappingURL=9770.fbe5a663.chunk.js.map
3
+ //# sourceMappingURL=9770.2fa7c11e.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static/9770.fbe5a663.chunk.js","mappings":"0PAgCO,SAASA,EAAiBC,EAA8B,CAC7D,KAAM,CAAEC,QAAAA,EAAU,WAAYC,MAAAA,EAAQ,eAAgB,EAAIF,EAC1D,SACE,OAACG,EAAAA,oBAAmBA,CAClBF,QAASA,EACTC,MAAOA,EACPE,WAAW,WACXC,aAAcC,EAAAA,GACdC,QAASC,EAAAA,sBACTC,qBAAsBC,EAAAA,mBACtBC,aAAa,qCACbC,cAAeC,EAAAA,sB,EAGrB,C,mgBCaO,SAASV,EACdH,EAAkC,CAElC,KAAM,CACJC,QAAAA,EAAU,WACVC,MAAAA,EACAK,QAAAA,EACAH,WAAAA,EACAC,aAAAA,EACAM,aAAAA,EACAC,cAAAA,EACAH,qBAAAA,EACAK,aAAAA,EAAe,CAAC,CAAC,EACfd,EAEE,CAAEe,OAAAA,CAAO,KAAIC,EAAAA,IAAU,EACvB,CAAEC,SAAAA,EAAUC,QAAAA,EAASC,MAAAA,CAAM,KAAIC,EAAAA,IAAmBL,EAAQ,CAC9DM,KAAMhB,EACNiB,KAAMlB,CACR,CAAC,EAED,OAAIc,KAEA,OAACK,EAAAA,GAAQA,CAACtB,QAASA,EAASC,MAAOA,E,YACjC,OAACsB,EAAAA,GAAQA,CAAAA,CAAAA,C,GAKXL,KAEA,OAACI,EAAAA,GAAQA,CAACtB,QAASA,EAASC,MAAOA,E,YACjC,OAACuB,EAAAA,GAAkBA,CAACN,MAAOA,C,QAM/B,OAACO,EAAAA,GAAWA,CACVxB,MAAOA,EACPD,QAASA,EACT0B,gBACE,QAACC,MAAAA,CAAIC,MAAO,CAAEC,UAAW,QAAS,E,aAChC,OAACC,EAAAA,EAAUA,CAAC9B,QAAQ,Q,SAASU,C,MAC7B,OAACoB,EAAAA,EAAUA,CAAC9B,QAAQ,Q,YAClB,OAAC+B,EAAAA,GAAIA,CAACC,GAAIrB,E,SAAe,2B,QAI/BL,QAASA,EACTU,SAAUR,EAAqBQ,GAAY,CAAC,CAAC,EAC7CH,aAAcA,C,EAGpB,CCzFO,MAAMoB,EAAyD,CACpER,EAAAA,GAAYnB,QAAQ4B,sBAAsB,CAAEC,YAAa,WAAY,CAAC,EACtEV,EAAAA,GAAYnB,QAAQ8B,kBAAkB,EACtCX,EAAAA,GAAYnB,QAAQ+B,qBAAqB,EACzCZ,EAAAA,GAAYnB,QAAQgC,0BAA0B,EAC9Cb,EAAAA,GAAYnB,QAAQiC,gCAAgC,C,EAEzCC,EACX,uFACWC,EAAuBzB,GAClCA,EAEWT,EAAuD,CAClEkB,EAAAA,GAAYnB,QAAQ4B,sBAAsB,CAAEC,YAAa,UAAW,CAAC,EACrEV,EAAAA,GAAYnB,QAAQ8B,kBAAkB,EACtCX,EAAAA,GAAYnB,QAAQ+B,qBAAqB,EACzCZ,EAAAA,GAAYnB,QAAQgC,0BAA0B,EAC9Cb,EAAAA,GAAYnB,QAAQiC,gCAAgC,C,EAEzC3B,EACX,sFACWH,EAAsBO,GACjCA,EAEW0B,EAAmD,CAC9DjB,EAAAA,GAAYnB,QAAQ4B,sBAAsB,CAAEC,YAAa,QAAS,CAAC,EACnEV,EAAAA,GAAYnB,QAAQ8B,kBAAkB,EACtCX,EAAAA,GAAYnB,QAAQiC,gCAAgC,C,EAEzCI,EACX,oFACWC,EAAoB5B,GAC/BA,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/HasResourcesCard/HasResourcesCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/presets.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 { RELATION_HAS_PART } from '@backstage/catalog-model';\nimport { InfoCardVariants } from '@backstage/core-components';\nimport React from 'react';\nimport {\n asResourceEntities,\n RelatedEntitiesCard,\n resourceEntityColumns,\n resourceEntityHelpLink,\n} from '../RelatedEntitiesCard';\n\n/** @public */\nexport interface HasResourcesCardProps {\n variant?: InfoCardVariants;\n title?: string;\n}\n\nexport function HasResourcesCard(props: HasResourcesCardProps) {\n const { variant = 'gridItem', title = 'Has resources' } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title={title}\n entityKind=\"Resource\"\n relationType={RELATION_HAS_PART}\n columns={resourceEntityColumns}\n asRenderableEntities={asResourceEntities}\n emptyMessage=\"No resource is part of this system\"\n emptyHelpLink={resourceEntityHelpLink}\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 { Entity } from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport {\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n ResponseErrorPanel,\n TableColumn,\n TableOptions,\n} from '@backstage/core-components';\n\n/** @public */\nexport type RelatedEntitiesCardProps<T extends Entity> = {\n variant?: InfoCardVariants;\n title: string;\n columns: TableColumn<T>[];\n entityKind?: string;\n relationType: string;\n emptyMessage: string;\n emptyHelpLink: string;\n asRenderableEntities: (entities: Entity[]) => T[];\n tableOptions?: TableOptions;\n};\n\n/**\n * A low level card component that can be used as a building block for more\n * specific cards.\n *\n * @remarks\n *\n * You probably want to make a dedicated component for your needs, which renders\n * this card as its implementation with some of the props set to the appropriate\n * values.\n *\n * @public\n */\nexport function RelatedEntitiesCard<T extends Entity>(\n props: RelatedEntitiesCardProps<T>,\n) {\n const {\n variant = 'gridItem',\n title,\n columns,\n entityKind,\n relationType,\n emptyMessage,\n emptyHelpLink,\n asRenderableEntities,\n tableOptions = {},\n } = props;\n\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: relationType,\n kind: entityKind,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error) {\n return (\n <InfoCard variant={variant} title={title}>\n <ResponseErrorPanel error={error} />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">{emptyMessage}</Typography>\n <Typography variant=\"body2\">\n <Link to={emptyHelpLink}>Learn how to change this.</Link>\n </Typography>\n </div>\n }\n columns={columns}\n entities={asRenderableEntities(entities || [])}\n tableOptions={tableOptions}\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 */\nimport {\n ComponentEntity,\n Entity,\n ResourceEntity,\n SystemEntity,\n} from '@backstage/catalog-model';\nimport { EntityTable } from '@backstage/plugin-catalog-react';\nimport { TableColumn } from '@backstage/core-components';\n\nexport const componentEntityColumns: TableColumn<ComponentEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'component' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const componentEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component';\nexport const asComponentEntities = (entities: Entity[]): ComponentEntity[] =>\n entities as ComponentEntity[];\n\nexport const resourceEntityColumns: TableColumn<ResourceEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'resource' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const resourceEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource';\nexport const asResourceEntities = (entities: Entity[]): ResourceEntity[] =>\n entities as ResourceEntity[];\n\nexport const systemEntityColumns: TableColumn<SystemEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'system' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const systemEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system';\nexport const asSystemEntities = (entities: Entity[]): SystemEntity[] =>\n entities as SystemEntity[];\n"],"names":["HasResourcesCard","props","variant","title","RelatedEntitiesCard","entityKind","relationType","RELATION_HAS_PART","columns","resourceEntityColumns","asRenderableEntities","asResourceEntities","emptyMessage","emptyHelpLink","resourceEntityHelpLink","tableOptions","entity","useEntity","entities","loading","error","useRelatedEntities","type","kind","InfoCard","Progress","ResponseErrorPanel","EntityTable","emptyContent","div","style","textAlign","Typography","Link","to","componentEntityColumns","createEntityRefColumn","defaultKind","createOwnerColumn","createSpecTypeColumn","createSpecLifecycleColumn","createMetadataDescriptionColumn","componentEntityHelpLink","asComponentEntities","systemEntityColumns","systemEntityHelpLink","asSystemEntities"],"sourceRoot":""}
1
+ {"version":3,"file":"static/9770.2fa7c11e.chunk.js","mappings":"0PAgCO,SAASA,EAAiBC,EAA8B,CAC7D,KAAM,CAAEC,QAAAA,EAAU,WAAYC,MAAAA,EAAQ,eAAgB,EAAIF,EAC1D,SACE,OAACG,EAAAA,oBAAmBA,CAClBF,QAASA,EACTC,MAAOA,EACPE,WAAW,WACXC,aAAcC,EAAAA,GACdC,QAASC,EAAAA,sBACTC,qBAAsBC,EAAAA,mBACtBC,aAAa,qCACbC,cAAeC,EAAAA,sB,EAGrB,C,mgBCaO,SAASV,EACdH,EAAkC,CAElC,KAAM,CACJC,QAAAA,EAAU,WACVC,MAAAA,EACAK,QAAAA,EACAH,WAAAA,EACAC,aAAAA,EACAM,aAAAA,EACAC,cAAAA,EACAH,qBAAAA,EACAK,aAAAA,EAAe,CAAC,CAAC,EACfd,EAEE,CAAEe,OAAAA,CAAO,KAAIC,EAAAA,IAAU,EACvB,CAAEC,SAAAA,EAAUC,QAAAA,EAASC,MAAAA,CAAM,KAAIC,EAAAA,IAAmBL,EAAQ,CAC9DM,KAAMhB,EACNiB,KAAMlB,CACR,CAAC,EAED,OAAIc,KAEA,OAACK,EAAAA,GAAQA,CAACtB,QAASA,EAASC,MAAOA,E,YACjC,OAACsB,EAAAA,GAAQA,CAAAA,CAAAA,C,GAKXL,KAEA,OAACI,EAAAA,GAAQA,CAACtB,QAASA,EAASC,MAAOA,E,YACjC,OAACuB,EAAAA,GAAkBA,CAACN,MAAOA,C,QAM/B,OAACO,EAAAA,GAAWA,CACVxB,MAAOA,EACPD,QAASA,EACT0B,gBACE,QAACC,MAAAA,CAAIC,MAAO,CAAEC,UAAW,QAAS,E,aAChC,OAACC,EAAAA,EAAUA,CAAC9B,QAAQ,Q,SAASU,C,MAC7B,OAACoB,EAAAA,EAAUA,CAAC9B,QAAQ,Q,YAClB,OAAC+B,EAAAA,GAAIA,CAACC,GAAIrB,E,SAAe,2B,QAI/BL,QAASA,EACTU,SAAUR,EAAqBQ,GAAY,CAAC,CAAC,EAC7CH,aAAcA,C,EAGpB,CCzFO,MAAMoB,EAAyD,CACpER,EAAAA,GAAYnB,QAAQ4B,sBAAsB,CAAEC,YAAa,WAAY,CAAC,EACtEV,EAAAA,GAAYnB,QAAQ8B,kBAAkB,EACtCX,EAAAA,GAAYnB,QAAQ+B,qBAAqB,EACzCZ,EAAAA,GAAYnB,QAAQgC,0BAA0B,EAC9Cb,EAAAA,GAAYnB,QAAQiC,gCAAgC,C,EAEzCC,EACX,uFACWC,EAAuBzB,GAClCA,EAEWT,EAAuD,CAClEkB,EAAAA,GAAYnB,QAAQ4B,sBAAsB,CAAEC,YAAa,UAAW,CAAC,EACrEV,EAAAA,GAAYnB,QAAQ8B,kBAAkB,EACtCX,EAAAA,GAAYnB,QAAQ+B,qBAAqB,EACzCZ,EAAAA,GAAYnB,QAAQgC,0BAA0B,EAC9Cb,EAAAA,GAAYnB,QAAQiC,gCAAgC,C,EAEzC3B,EACX,sFACWH,EAAsBO,GACjCA,EAEW0B,EAAmD,CAC9DjB,EAAAA,GAAYnB,QAAQ4B,sBAAsB,CAAEC,YAAa,QAAS,CAAC,EACnEV,EAAAA,GAAYnB,QAAQ8B,kBAAkB,EACtCX,EAAAA,GAAYnB,QAAQiC,gCAAgC,C,EAEzCI,EACX,oFACWC,EAAoB5B,GAC/BA,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/HasResourcesCard/HasResourcesCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/presets.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 { RELATION_HAS_PART } from '@backstage/catalog-model';\nimport { InfoCardVariants } from '@backstage/core-components';\nimport React from 'react';\nimport {\n asResourceEntities,\n RelatedEntitiesCard,\n resourceEntityColumns,\n resourceEntityHelpLink,\n} from '../RelatedEntitiesCard';\n\n/** @public */\nexport interface HasResourcesCardProps {\n variant?: InfoCardVariants;\n title?: string;\n}\n\nexport function HasResourcesCard(props: HasResourcesCardProps) {\n const { variant = 'gridItem', title = 'Has resources' } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title={title}\n entityKind=\"Resource\"\n relationType={RELATION_HAS_PART}\n columns={resourceEntityColumns}\n asRenderableEntities={asResourceEntities}\n emptyMessage=\"No resource is part of this system\"\n emptyHelpLink={resourceEntityHelpLink}\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 { Entity } from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport {\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n ResponseErrorPanel,\n TableColumn,\n TableOptions,\n} from '@backstage/core-components';\n\n/** @public */\nexport type RelatedEntitiesCardProps<T extends Entity> = {\n variant?: InfoCardVariants;\n title: string;\n columns: TableColumn<T>[];\n entityKind?: string;\n relationType: string;\n emptyMessage: string;\n emptyHelpLink: string;\n asRenderableEntities: (entities: Entity[]) => T[];\n tableOptions?: TableOptions;\n};\n\n/**\n * A low level card component that can be used as a building block for more\n * specific cards.\n *\n * @remarks\n *\n * You probably want to make a dedicated component for your needs, which renders\n * this card as its implementation with some of the props set to the appropriate\n * values.\n *\n * @public\n */\nexport function RelatedEntitiesCard<T extends Entity>(\n props: RelatedEntitiesCardProps<T>,\n) {\n const {\n variant = 'gridItem',\n title,\n columns,\n entityKind,\n relationType,\n emptyMessage,\n emptyHelpLink,\n asRenderableEntities,\n tableOptions = {},\n } = props;\n\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: relationType,\n kind: entityKind,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error) {\n return (\n <InfoCard variant={variant} title={title}>\n <ResponseErrorPanel error={error} />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">{emptyMessage}</Typography>\n <Typography variant=\"body2\">\n <Link to={emptyHelpLink}>Learn how to change this.</Link>\n </Typography>\n </div>\n }\n columns={columns}\n entities={asRenderableEntities(entities || [])}\n tableOptions={tableOptions}\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 */\nimport {\n ComponentEntity,\n Entity,\n ResourceEntity,\n SystemEntity,\n} from '@backstage/catalog-model';\nimport { EntityTable } from '@backstage/plugin-catalog-react';\nimport { TableColumn } from '@backstage/core-components';\n\nexport const componentEntityColumns: TableColumn<ComponentEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'component' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const componentEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component';\nexport const asComponentEntities = (entities: Entity[]): ComponentEntity[] =>\n entities as ComponentEntity[];\n\nexport const resourceEntityColumns: TableColumn<ResourceEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'resource' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const resourceEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource';\nexport const asResourceEntities = (entities: Entity[]): ResourceEntity[] =>\n entities as ResourceEntity[];\n\nexport const systemEntityColumns: TableColumn<SystemEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'system' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const systemEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system';\nexport const asSystemEntities = (entities: Entity[]): SystemEntity[] =>\n entities as SystemEntity[];\n"],"names":["HasResourcesCard","props","variant","title","RelatedEntitiesCard","entityKind","relationType","RELATION_HAS_PART","columns","resourceEntityColumns","asRenderableEntities","asResourceEntities","emptyMessage","emptyHelpLink","resourceEntityHelpLink","tableOptions","entity","useEntity","entities","loading","error","useRelatedEntities","type","kind","InfoCard","Progress","ResponseErrorPanel","EntityTable","emptyContent","div","style","textAlign","Typography","Link","to","componentEntityColumns","createEntityRefColumn","defaultKind","createOwnerColumn","createSpecTypeColumn","createSpecLifecycleColumn","createMetadataDescriptionColumn","componentEntityHelpLink","asComponentEntities","systemEntityColumns","systemEntityHelpLink","asSystemEntities"],"sourceRoot":""}