@techdocs/cli 1.5.0-next.2 → 1.5.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.
Files changed (125) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/embedded-app/.config-schema.json +45 -0
  3. package/dist/embedded-app/index.html +1 -1
  4. package/dist/embedded-app/static/1032.96cef90d.chunk.js +5 -0
  5. package/dist/embedded-app/static/1032.96cef90d.chunk.js.map +1 -0
  6. package/dist/embedded-app/static/1105.ac144a87.chunk.js +5 -0
  7. package/dist/embedded-app/static/1105.ac144a87.chunk.js.map +1 -0
  8. package/dist/embedded-app/static/184.5623ac15.chunk.js +5 -0
  9. package/dist/embedded-app/static/184.5623ac15.chunk.js.map +1 -0
  10. package/dist/embedded-app/static/2440.240e2610.chunk.js +5 -0
  11. package/dist/embedded-app/static/2440.240e2610.chunk.js.map +1 -0
  12. package/dist/embedded-app/static/2924.b757596e.chunk.js +3 -0
  13. package/dist/embedded-app/static/2924.b757596e.chunk.js.map +1 -0
  14. package/dist/embedded-app/static/3487.bf80060c.chunk.js +5 -0
  15. package/dist/embedded-app/static/3487.bf80060c.chunk.js.map +1 -0
  16. package/dist/embedded-app/static/3893.0eb40023.chunk.js +3 -0
  17. package/dist/embedded-app/static/3893.0eb40023.chunk.js.map +1 -0
  18. package/dist/embedded-app/static/4966.9cb67949.chunk.js +49 -0
  19. package/dist/embedded-app/static/4966.9cb67949.chunk.js.map +1 -0
  20. package/dist/embedded-app/static/5458.f510f1d2.chunk.js +5 -0
  21. package/dist/embedded-app/static/5458.f510f1d2.chunk.js.map +1 -0
  22. package/dist/embedded-app/static/5877.fa5d49bb.chunk.js +6 -0
  23. package/dist/embedded-app/static/5877.fa5d49bb.chunk.js.map +1 -0
  24. package/dist/embedded-app/static/5914.412625b0.chunk.js +3 -0
  25. package/dist/embedded-app/static/5914.412625b0.chunk.js.map +1 -0
  26. package/dist/embedded-app/static/6051.5b06b988.chunk.js +4 -0
  27. package/dist/embedded-app/static/{6051.9a397327.chunk.js.map → 6051.5b06b988.chunk.js.map} +1 -1
  28. package/dist/embedded-app/static/7670.dce585cd.chunk.js +3 -0
  29. package/dist/embedded-app/static/{7670.714e8960.chunk.js.map → 7670.dce585cd.chunk.js.map} +1 -1
  30. package/dist/embedded-app/static/7750.f3e35b68.chunk.js +8 -0
  31. package/dist/embedded-app/static/7750.f3e35b68.chunk.js.map +1 -0
  32. package/dist/embedded-app/static/7893.67e0b03f.chunk.js +3 -0
  33. package/dist/embedded-app/static/7893.67e0b03f.chunk.js.map +1 -0
  34. package/dist/embedded-app/static/8629.18b8b029.chunk.js +7 -0
  35. package/dist/embedded-app/static/8629.18b8b029.chunk.js.map +1 -0
  36. package/dist/embedded-app/static/8662.e8af541f.chunk.js +3 -0
  37. package/dist/embedded-app/static/8662.e8af541f.chunk.js.map +1 -0
  38. package/dist/embedded-app/static/8951.b8daca92.chunk.js +3 -0
  39. package/dist/embedded-app/static/8951.b8daca92.chunk.js.map +1 -0
  40. package/dist/embedded-app/static/9545.3ea2318c.chunk.js +5 -0
  41. package/dist/embedded-app/static/9545.3ea2318c.chunk.js.map +1 -0
  42. package/dist/embedded-app/static/9598.c8137318.chunk.js +3 -0
  43. package/dist/embedded-app/static/9598.c8137318.chunk.js.map +1 -0
  44. package/dist/embedded-app/static/967.c3c74dec.chunk.js +15 -0
  45. package/dist/embedded-app/static/967.c3c74dec.chunk.js.map +1 -0
  46. package/dist/embedded-app/static/9770.18f87a62.chunk.js +5 -0
  47. package/dist/embedded-app/static/9770.18f87a62.chunk.js.map +1 -0
  48. package/dist/embedded-app/static/main.04af2edd.js +487 -0
  49. package/dist/embedded-app/static/main.04af2edd.js.map +1 -0
  50. package/dist/embedded-app/static/module-i18next.db8a27ed.js +3 -0
  51. package/dist/embedded-app/static/{module-i18next.3eb80014.js.map → module-i18next.db8a27ed.js.map} +1 -1
  52. package/dist/embedded-app/static/module-lodash.8166f005.js +29 -0
  53. package/dist/embedded-app/static/module-lodash.8166f005.js.map +1 -0
  54. package/dist/embedded-app/static/{module-material-table.1d463a12.js → module-material-table.0f5635dd.js} +2 -2
  55. package/dist/embedded-app/static/{module-material-table.1d463a12.js.map → module-material-table.0f5635dd.js.map} +1 -1
  56. package/dist/embedded-app/static/module-material-ui.1b712255.js +24 -0
  57. package/dist/embedded-app/static/module-material-ui.1b712255.js.map +1 -0
  58. package/dist/embedded-app/static/{module-react-beautiful-dnd.ad887878.js → module-react-beautiful-dnd.62627182.js} +2 -2
  59. package/dist/embedded-app/static/{module-react-beautiful-dnd.ad887878.js.map → module-react-beautiful-dnd.62627182.js.map} +1 -1
  60. package/dist/embedded-app/static/{module-react-dom.bd3fd0c6.js → module-react-dom.07625e59.js} +1 -1
  61. package/dist/embedded-app/static/{module-react-dom.bd3fd0c6.js.map → module-react-dom.07625e59.js.map} +1 -1
  62. package/dist/embedded-app/static/module-react-router-dom.a0f835fd.js +22 -0
  63. package/dist/embedded-app/static/module-react-router-dom.a0f835fd.js.map +1 -0
  64. package/dist/embedded-app/static/module-react-router.8e9755f1.js +22 -0
  65. package/dist/embedded-app/static/module-react-router.8e9755f1.js.map +1 -0
  66. package/dist/embedded-app/static/module-zod.c74c6842.js +3 -0
  67. package/dist/embedded-app/static/module-zod.c74c6842.js.map +1 -0
  68. package/dist/embedded-app/static/{runtime.2d4c0606.js → runtime.04af2edd.js} +2 -2
  69. package/dist/embedded-app/static/runtime.04af2edd.js.map +1 -0
  70. package/dist/embedded-app/static/vendor.04af2edd.js +159 -0
  71. package/dist/embedded-app/static/vendor.04af2edd.js.map +1 -0
  72. package/dist/index.cjs.js +1 -1
  73. package/package.json +6 -6
  74. package/dist/embedded-app/static/1032.f8378b05.chunk.js +0 -3
  75. package/dist/embedded-app/static/1032.f8378b05.chunk.js.map +0 -1
  76. package/dist/embedded-app/static/1093.317a4f39.chunk.js +0 -7
  77. package/dist/embedded-app/static/1093.317a4f39.chunk.js.map +0 -1
  78. package/dist/embedded-app/static/1105.a5f2c603.chunk.js +0 -3
  79. package/dist/embedded-app/static/1105.a5f2c603.chunk.js.map +0 -1
  80. package/dist/embedded-app/static/184.2d07d6cf.chunk.js +0 -3
  81. package/dist/embedded-app/static/184.2d07d6cf.chunk.js.map +0 -1
  82. package/dist/embedded-app/static/2440.c513a311.chunk.js +0 -3
  83. package/dist/embedded-app/static/2440.c513a311.chunk.js.map +0 -1
  84. package/dist/embedded-app/static/5458.f60ece35.chunk.js +0 -3
  85. package/dist/embedded-app/static/5458.f60ece35.chunk.js.map +0 -1
  86. package/dist/embedded-app/static/5837.d9697f2a.chunk.js +0 -3
  87. package/dist/embedded-app/static/5837.d9697f2a.chunk.js.map +0 -1
  88. package/dist/embedded-app/static/6051.9a397327.chunk.js +0 -4
  89. package/dist/embedded-app/static/732.b079cbc6.chunk.js +0 -3
  90. package/dist/embedded-app/static/732.b079cbc6.chunk.js.map +0 -1
  91. package/dist/embedded-app/static/7560.f82352d7.chunk.js +0 -3
  92. package/dist/embedded-app/static/7560.f82352d7.chunk.js.map +0 -1
  93. package/dist/embedded-app/static/7670.714e8960.chunk.js +0 -3
  94. package/dist/embedded-app/static/7750.da1a67d5.chunk.js +0 -8
  95. package/dist/embedded-app/static/7750.da1a67d5.chunk.js.map +0 -1
  96. package/dist/embedded-app/static/8951.d0edcfcb.chunk.js +0 -3
  97. package/dist/embedded-app/static/8951.d0edcfcb.chunk.js.map +0 -1
  98. package/dist/embedded-app/static/9545.24f95d89.chunk.js +0 -3
  99. package/dist/embedded-app/static/9545.24f95d89.chunk.js.map +0 -1
  100. package/dist/embedded-app/static/9770.2fa7c11e.chunk.js +0 -3
  101. package/dist/embedded-app/static/9770.2fa7c11e.chunk.js.map +0 -1
  102. package/dist/embedded-app/static/main.2d4c0606.js +0 -522
  103. package/dist/embedded-app/static/main.2d4c0606.js.map +0 -1
  104. package/dist/embedded-app/static/module-ajv.be583887.js +0 -10
  105. package/dist/embedded-app/static/module-ajv.be583887.js.map +0 -1
  106. package/dist/embedded-app/static/module-i18next.3eb80014.js +0 -3
  107. package/dist/embedded-app/static/module-lodash.4c9a1319.js +0 -29
  108. package/dist/embedded-app/static/module-lodash.4c9a1319.js.map +0 -1
  109. package/dist/embedded-app/static/module-luxon.b1d74b2d.js +0 -3
  110. package/dist/embedded-app/static/module-luxon.b1d74b2d.js.map +0 -1
  111. package/dist/embedded-app/static/module-material-ui.1afbaa53.js +0 -51
  112. package/dist/embedded-app/static/module-material-ui.1afbaa53.js.map +0 -1
  113. package/dist/embedded-app/static/module-octokit.7416db07.js +0 -5
  114. package/dist/embedded-app/static/module-octokit.7416db07.js.map +0 -1
  115. package/dist/embedded-app/static/module-react-router-dom.ef191c8f.js +0 -21
  116. package/dist/embedded-app/static/module-react-router-dom.ef191c8f.js.map +0 -1
  117. package/dist/embedded-app/static/module-react-router.d2e96318.js +0 -21
  118. package/dist/embedded-app/static/module-react-router.d2e96318.js.map +0 -1
  119. package/dist/embedded-app/static/module-yaml.00a97896.js +0 -140
  120. package/dist/embedded-app/static/module-yaml.00a97896.js.map +0 -1
  121. package/dist/embedded-app/static/module-zod.49079951.js +0 -3
  122. package/dist/embedded-app/static/module-zod.49079951.js.map +0 -1
  123. package/dist/embedded-app/static/runtime.2d4c0606.js.map +0 -1
  124. package/dist/embedded-app/static/vendor.2d4c0606.js +0 -213
  125. package/dist/embedded-app/static/vendor.2d4c0606.js.map +0 -1
@@ -1,3 +0,0 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[1105,732],{1105:function(y,i,n){n.r(i),n.d(i,{HasComponentsCard:function(){return o}});var e=n(52322),c=n(25271),t=n(2784),r=n(732);function o(a){const{variant:u="gridItem",title:l="Has components"}=a;return(0,e.jsx)(r.RelatedEntitiesCard,{variant:u,title:l,entityKind:"Component",relationType:c.aS,columns:r.componentEntityColumns,emptyMessage:"No component is part of this system",emptyHelpLink:r.componentEntityHelpLink,asRenderableEntities:r.asComponentEntities})}},732:function(y,i,n){n.r(i),n.d(i,{RelatedEntitiesCard:function(){return a},asComponentEntities:function(){return f},asResourceEntities:function(){return h},asSystemEntities:function(){return j},componentEntityColumns:function(){return u},componentEntityHelpLink:function(){return l},resourceEntityColumns:function(){return C},resourceEntityHelpLink:function(){return E},systemEntityColumns:function(){return v},systemEntityHelpLink:function(){return g}});var e=n(52322),c=n(90436),t=n(39709),r=n(2784),o=n(53974);function a(s){const{variant:m="gridItem",title:d,columns:x,entityKind:H,relationType:L,emptyMessage:R,emptyHelpLink:k,asRenderableEntities:S,tableOptions:K={}}=s,{entity:M}=(0,t.X2)(),{entities:O,loading:T,error:p}=(0,t.eK)(M,{type:L,kind:H});return T?(0,e.jsx)(o.rJ,{variant:m,title:d,children:(0,e.jsx)(o.Ex,{})}):p?(0,e.jsx)(o.rJ,{variant:m,title:d,children:(0,e.jsx)(o.Gk,{error:p})}):(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:R}),(0,e.jsx)(c.Z,{variant:"body2",children:(0,e.jsx)(o.rU,{to:k,children:"Learn how to change this."})})]}),columns:x,entities:S(O||[]),tableOptions:K})}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",f=s=>s,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=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
-
3
- //# sourceMappingURL=1105.a5f2c603.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/1105.a5f2c603.chunk.js","mappings":"0PAgCO,SAASA,EAAkBC,EAA+B,CAC/D,KAAM,CAAEC,QAAAA,EAAU,WAAYC,MAAAA,EAAQ,gBAAiB,EAAIF,EAC3D,SACE,OAACG,EAAAA,oBAAmBA,CAClBF,QAASA,EACTC,MAAOA,EACPE,WAAW,YACXC,aAAcC,EAAAA,GACdC,QAASC,EAAAA,uBACTC,aAAa,sCACbC,cAAeC,EAAAA,wBACfC,qBAAsBC,EAAAA,mB,EAG5B,C,mgBCaO,SAASV,EACdH,EAAkC,CAElC,KAAM,CACJC,QAAAA,EAAU,WACVC,MAAAA,EACAK,QAAAA,EACAH,WAAAA,EACAC,aAAAA,EACAI,aAAAA,EACAC,cAAAA,EACAE,qBAAAA,EACAE,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,SAASQ,C,MAC7B,OAACsB,EAAAA,EAAUA,CAAC9B,QAAQ,Q,YAClB,OAAC+B,EAAAA,GAAIA,CAACC,GAAIvB,E,SAAe,2B,QAI/BH,QAASA,EACTU,SAAUL,EAAqBK,GAAY,CAAC,CAAC,EAC7CH,aAAcA,C,EAGpB,CCzFO,MAAMN,EAAyD,CACpEkB,EAAAA,GAAYnB,QAAQ2B,sBAAsB,CAAEC,YAAa,WAAY,CAAC,EACtET,EAAAA,GAAYnB,QAAQ6B,kBAAkB,EACtCV,EAAAA,GAAYnB,QAAQ8B,qBAAqB,EACzCX,EAAAA,GAAYnB,QAAQ+B,0BAA0B,EAC9CZ,EAAAA,GAAYnB,QAAQgC,gCAAgC,C,EAEzC5B,EACX,uFACWE,EAAuBI,GAClCA,EAEWuB,EAAuD,CAClEd,EAAAA,GAAYnB,QAAQ2B,sBAAsB,CAAEC,YAAa,UAAW,CAAC,EACrET,EAAAA,GAAYnB,QAAQ6B,kBAAkB,EACtCV,EAAAA,GAAYnB,QAAQ8B,qBAAqB,EACzCX,EAAAA,GAAYnB,QAAQ+B,0BAA0B,EAC9CZ,EAAAA,GAAYnB,QAAQgC,gCAAgC,C,EAEzCE,EACX,sFACWC,EAAsBzB,GACjCA,EAEW0B,EAAmD,CAC9DjB,EAAAA,GAAYnB,QAAQ2B,sBAAsB,CAAEC,YAAa,QAAS,CAAC,EACnET,EAAAA,GAAYnB,QAAQ6B,kBAAkB,EACtCV,EAAAA,GAAYnB,QAAQgC,gCAAgC,C,EAEzCK,EACX,oFACWC,EAAoB5B,GAC/BA,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/HasComponentsCard/HasComponentsCard.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 asComponentEntities,\n componentEntityColumns,\n componentEntityHelpLink,\n RelatedEntitiesCard,\n} from '../RelatedEntitiesCard';\n\n/** @public */\nexport interface HasComponentsCardProps {\n variant?: InfoCardVariants;\n title?: string;\n}\n\nexport function HasComponentsCard(props: HasComponentsCardProps) {\n const { variant = 'gridItem', title = 'Has components' } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title={title}\n entityKind=\"Component\"\n relationType={RELATION_HAS_PART}\n columns={componentEntityColumns}\n emptyMessage=\"No component is part of this system\"\n emptyHelpLink={componentEntityHelpLink}\n asRenderableEntities={asComponentEntities}\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":["HasComponentsCard","props","variant","title","RelatedEntitiesCard","entityKind","relationType","RELATION_HAS_PART","columns","componentEntityColumns","emptyMessage","emptyHelpLink","componentEntityHelpLink","asRenderableEntities","asComponentEntities","tableOptions","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 +0,0 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[184,732],{40184:function(y,i,n){n.r(i),n.d(i,{DependencyOfComponentsCard: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="Dependency of components"}=a;return(0,e.jsx)(c.RelatedEntitiesCard,{variant:u,title:l,entityKind:"Component",relationType:r.w$,columns:c.componentEntityColumns,emptyMessage:"No component depends on this component",emptyHelpLink:c.componentEntityHelpLink,asRenderableEntities:c.asComponentEntities})}},732:function(y,i,n){n.r(i),n.d(i,{RelatedEntitiesCard:function(){return a},asComponentEntities:function(){return f},asResourceEntities:function(){return h},asSystemEntities:function(){return j},componentEntityColumns:function(){return u},componentEntityHelpLink:function(){return l},resourceEntityColumns:function(){return C},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:m="gridItem",title:d,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:p}=(0,t.eK)(K,{type:R,kind:L});return M?(0,e.jsx)(o.rJ,{variant:m,title:d,children:(0,e.jsx)(o.Ex,{})}):p?(0,e.jsx)(o.rJ,{variant:m,title:d,children:(0,e.jsx)(o.Gk,{error:p})}):(0,e.jsx)(t.u3,{title:d,variant:m,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",f=s=>s,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=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
-
3
- //# sourceMappingURL=184.2d07d6cf.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/184.2d07d6cf.chunk.js","mappings":"mQAgCO,SAASA,EACdC,EAAsC,CAEtC,KAAM,CAAEC,QAAAA,EAAU,WAAYC,MAAAA,EAAQ,0BAA2B,EAAIF,EACrE,SACE,OAACG,EAAAA,oBAAmBA,CAClBF,QAASA,EACTC,MAAOA,EACPE,WAAW,YACXC,aAAcC,EAAAA,GACdC,QAASC,EAAAA,uBACTC,aAAa,yCACbC,cAAeC,EAAAA,wBACfC,qBAAsBC,EAAAA,mB,EAG5B,C,mgBCWO,SAASV,EACdH,EAAkC,CAElC,KAAM,CACJC,QAAAA,EAAU,WACVC,MAAAA,EACAK,QAAAA,EACAH,WAAAA,EACAC,aAAAA,EACAI,aAAAA,EACAC,cAAAA,EACAE,qBAAAA,EACAE,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,SAASQ,C,MAC7B,OAACsB,EAAAA,EAAUA,CAAC9B,QAAQ,Q,YAClB,OAAC+B,EAAAA,GAAIA,CAACC,GAAIvB,E,SAAe,2B,QAI/BH,QAASA,EACTU,SAAUL,EAAqBK,GAAY,CAAC,CAAC,EAC7CH,aAAcA,C,EAGpB,CCzFO,MAAMN,EAAyD,CACpEkB,EAAAA,GAAYnB,QAAQ2B,sBAAsB,CAAEC,YAAa,WAAY,CAAC,EACtET,EAAAA,GAAYnB,QAAQ6B,kBAAkB,EACtCV,EAAAA,GAAYnB,QAAQ8B,qBAAqB,EACzCX,EAAAA,GAAYnB,QAAQ+B,0BAA0B,EAC9CZ,EAAAA,GAAYnB,QAAQgC,gCAAgC,C,EAEzC5B,EACX,uFACWE,EAAuBI,GAClCA,EAEWuB,EAAuD,CAClEd,EAAAA,GAAYnB,QAAQ2B,sBAAsB,CAAEC,YAAa,UAAW,CAAC,EACrET,EAAAA,GAAYnB,QAAQ6B,kBAAkB,EACtCV,EAAAA,GAAYnB,QAAQ8B,qBAAqB,EACzCX,EAAAA,GAAYnB,QAAQ+B,0BAA0B,EAC9CZ,EAAAA,GAAYnB,QAAQgC,gCAAgC,C,EAEzCE,EACX,sFACWC,EAAsBzB,GACjCA,EAEW0B,EAAmD,CAC9DjB,EAAAA,GAAYnB,QAAQ2B,sBAAsB,CAAEC,YAAa,QAAS,CAAC,EACnET,EAAAA,GAAYnB,QAAQ6B,kBAAkB,EACtCV,EAAAA,GAAYnB,QAAQgC,gCAAgC,C,EAEzCK,EACX,oFACWC,EAAoB5B,GAC/BA,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/DependencyOfComponentsCard/DependencyOfComponentsCard.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_DEPENDENCY_OF } from '@backstage/catalog-model';\nimport { InfoCardVariants } 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 DependencyOfComponentsCardProps {\n variant?: InfoCardVariants;\n title?: string;\n}\n\nexport function DependencyOfComponentsCard(\n props: DependencyOfComponentsCardProps,\n) {\n const { variant = 'gridItem', title = 'Dependency of components' } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title={title}\n entityKind=\"Component\"\n relationType={RELATION_DEPENDENCY_OF}\n columns={componentEntityColumns}\n emptyMessage=\"No component depends on this component\"\n emptyHelpLink={componentEntityHelpLink}\n asRenderableEntities={asComponentEntities}\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":["DependencyOfComponentsCard","props","variant","title","RelatedEntitiesCard","entityKind","relationType","RELATION_DEPENDENCY_OF","columns","componentEntityColumns","emptyMessage","emptyHelpLink","componentEntityHelpLink","asRenderableEntities","asComponentEntities","tableOptions","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 +0,0 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[2440,732],{82440:function(f,i,n){n.r(i),n.d(i,{HasSubcomponentsCard:function(){return o}});var e=n(52322),c=n(25271),t=n(2784),r=n(732);function o(a){const{variant:u="gridItem",tableOptions:l={},title:m="Has subcomponents"}=a;return(0,e.jsx)(r.RelatedEntitiesCard,{variant:u,title:m,entityKind:"Component",relationType:c.aS,columns:r.componentEntityColumns,asRenderableEntities:r.asComponentEntities,emptyMessage:"No subcomponent is part of this component",emptyHelpLink:"https://backstage.io/docs/features/software-catalog/descriptor-format#specsubcomponentof-optional",tableOptions:l})}},732:function(f,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 C},resourceEntityHelpLink:function(){return E},systemEntityColumns:function(){return v},systemEntityHelpLink:function(){return g}});var e=n(52322),c=n(90436),t=n(39709),r=n(2784),o=n(53974);function a(s){const{variant:d="gridItem",title:p,columns:x,entityKind:H,relationType:L,emptyMessage:R,emptyHelpLink:b,asRenderableEntities:k,tableOptions:S={}}=s,{entity:O}=(0,t.X2)(),{entities:K,loading:M,error:y}=(0,t.eK)(O,{type:L,kind:H});return M?(0,e.jsx)(o.rJ,{variant:d,title:p,children:(0,e.jsx)(o.Ex,{})}):y?(0,e.jsx)(o.rJ,{variant:d,title:p,children:(0,e.jsx)(o.Gk,{error:y})}):(0,e.jsx)(t.u3,{title:p,variant:d,emptyContent:(0,e.jsxs)("div",{style:{textAlign:"center"},children:[(0,e.jsx)(c.Z,{variant:"body1",children:R}),(0,e.jsx)(c.Z,{variant:"body2",children:(0,e.jsx)(o.rU,{to:b,children:"Learn how to change this."})})]}),columns:x,entities:k(K||[]),tableOptions:S})}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,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=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
-
3
- //# sourceMappingURL=2440.c513a311.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/2440.c513a311.chunk.js","mappings":"8PAgCO,SAASA,EAAqBC,EAAkC,CACrE,KAAM,CACJC,QAAAA,EAAU,WACVC,aAAAA,EAAe,CAAC,EAChBC,MAAAA,EAAQ,mBAAmB,EACzBH,EACJ,SACE,OAACI,EAAAA,oBAAmBA,CAClBH,QAASA,EACTE,MAAOA,EACPE,WAAW,YACXC,aAAcC,EAAAA,GACdC,QAASC,EAAAA,uBACTC,qBAAsBC,EAAAA,oBACtBC,aAAa,4CACbC,cAAc,oGACdX,aAAcA,C,EAGpB,C,mgBCQO,SAASE,EACdJ,EAAkC,CAElC,KAAM,CACJC,QAAAA,EAAU,WACVE,MAAAA,EACAK,QAAAA,EACAH,WAAAA,EACAC,aAAAA,EACAM,aAAAA,EACAC,cAAAA,EACAH,qBAAAA,EACAR,aAAAA,EAAe,CAAC,CAAC,EACfF,EAEE,CAAEc,OAAAA,CAAO,KAAIC,EAAAA,IAAU,EACvB,CAAEC,SAAAA,EAAUC,QAAAA,EAASC,MAAAA,CAAM,KAAIC,EAAAA,IAAmBL,EAAQ,CAC9DM,KAAMd,EACNe,KAAMhB,CACR,CAAC,EAED,OAAIY,KAEA,OAACK,EAAAA,GAAQA,CAACrB,QAASA,EAASE,MAAOA,E,YACjC,OAACoB,EAAAA,GAAQA,CAAAA,CAAAA,C,GAKXL,KAEA,OAACI,EAAAA,GAAQA,CAACrB,QAASA,EAASE,MAAOA,E,YACjC,OAACqB,EAAAA,GAAkBA,CAACN,MAAOA,C,QAM/B,OAACO,EAAAA,GAAWA,CACVtB,MAAOA,EACPF,QAASA,EACTyB,gBACE,QAACC,MAAAA,CAAIC,MAAO,CAAEC,UAAW,QAAS,E,aAChC,OAACC,EAAAA,EAAUA,CAAC7B,QAAQ,Q,SAASW,C,MAC7B,OAACkB,EAAAA,EAAUA,CAAC7B,QAAQ,Q,YAClB,OAAC8B,EAAAA,GAAIA,CAACC,GAAInB,E,SAAe,2B,QAI/BL,QAASA,EACTQ,SAAUN,EAAqBM,GAAY,CAAC,CAAC,EAC7Cd,aAAcA,C,EAGpB,CCzFO,MAAMO,EAAyD,CACpEgB,EAAAA,GAAYjB,QAAQyB,sBAAsB,CAAEC,YAAa,WAAY,CAAC,EACtET,EAAAA,GAAYjB,QAAQ2B,kBAAkB,EACtCV,EAAAA,GAAYjB,QAAQ4B,qBAAqB,EACzCX,EAAAA,GAAYjB,QAAQ6B,0BAA0B,EAC9CZ,EAAAA,GAAYjB,QAAQ8B,gCAAgC,C,EAEzCC,EACX,uFACW5B,EAAuBK,GAClCA,EAEWwB,EAAuD,CAClEf,EAAAA,GAAYjB,QAAQyB,sBAAsB,CAAEC,YAAa,UAAW,CAAC,EACrET,EAAAA,GAAYjB,QAAQ2B,kBAAkB,EACtCV,EAAAA,GAAYjB,QAAQ4B,qBAAqB,EACzCX,EAAAA,GAAYjB,QAAQ6B,0BAA0B,EAC9CZ,EAAAA,GAAYjB,QAAQ8B,gCAAgC,C,EAEzCG,EACX,sFACWC,EAAsB1B,GACjCA,EAEW2B,EAAmD,CAC9DlB,EAAAA,GAAYjB,QAAQyB,sBAAsB,CAAEC,YAAa,QAAS,CAAC,EACnET,EAAAA,GAAYjB,QAAQ2B,kBAAkB,EACtCV,EAAAA,GAAYjB,QAAQ8B,gCAAgC,C,EAEzCM,EACX,oFACWC,EAAoB7B,GAC/BA,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/HasSubcomponentsCard/HasSubcomponentsCard.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, TableOptions } from '@backstage/core-components';\nimport React from 'react';\nimport {\n asComponentEntities,\n componentEntityColumns,\n RelatedEntitiesCard,\n} from '../RelatedEntitiesCard';\n\n/** @public */\nexport interface HasSubcomponentsCardProps {\n variant?: InfoCardVariants;\n tableOptions?: TableOptions;\n title?: string;\n}\n\nexport function HasSubcomponentsCard(props: HasSubcomponentsCardProps) {\n const {\n variant = 'gridItem',\n tableOptions = {},\n title = 'Has subcomponents',\n } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title={title}\n entityKind=\"Component\"\n relationType={RELATION_HAS_PART}\n columns={componentEntityColumns}\n asRenderableEntities={asComponentEntities}\n emptyMessage=\"No subcomponent is part of this component\"\n emptyHelpLink=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specsubcomponentof-optional\"\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":["HasSubcomponentsCard","props","variant","tableOptions","title","RelatedEntitiesCard","entityKind","relationType","RELATION_HAS_PART","columns","componentEntityColumns","asRenderableEntities","asComponentEntities","emptyMessage","emptyHelpLink","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","componentEntityHelpLink","resourceEntityColumns","resourceEntityHelpLink","asResourceEntities","systemEntityColumns","systemEntityHelpLink","asSystemEntities"],"sourceRoot":""}
@@ -1,3 +0,0 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[5458,732],{5458:function(p,i,n){n.r(i),n.d(i,{HasSystemsCard:function(){return s}});var e=n(52322),c=n(25271),t=n(2784),r=n(732);function s(a){const{variant:u="gridItem",title:l="Has systems"}=a;return(0,e.jsx)(r.RelatedEntitiesCard,{variant:u,title:l,entityKind:"System",relationType:c.aS,columns:r.systemEntityColumns,asRenderableEntities:r.asSystemEntities,emptyMessage:"No system is part of this domain",emptyHelpLink:r.systemEntityHelpLink})}},732:function(p,i,n){n.r(i),n.d(i,{RelatedEntitiesCard:function(){return a},asComponentEntities:function(){return f},asResourceEntities:function(){return h},asSystemEntities:function(){return j},componentEntityColumns:function(){return u},componentEntityHelpLink:function(){return l},resourceEntityColumns:function(){return C},resourceEntityHelpLink:function(){return E},systemEntityColumns:function(){return v},systemEntityHelpLink:function(){return g}});var e=n(52322),c=n(90436),t=n(39709),r=n(2784),s=n(53974);function a(o){const{variant:m="gridItem",title:d,columns:x,entityKind:H,relationType:L,emptyMessage:R,emptyHelpLink:S,asRenderableEntities:k,tableOptions:K={}}=o,{entity:M}=(0,t.X2)(),{entities:O,loading:T,error:y}=(0,t.eK)(M,{type:L,kind:H});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:R}),(0,e.jsx)(c.Z,{variant:"body2",children:(0,e.jsx)(s.rU,{to:S,children:"Learn how to change this."})})]}),columns:x,entities:k(O||[]),tableOptions:K})}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",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()],g="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",j=o=>o}}]);})();
2
-
3
- //# sourceMappingURL=5458.f60ece35.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/5458.f60ece35.chunk.js","mappings":"uPAgCO,SAASA,EAAeC,EAA4B,CACzD,KAAM,CAAEC,QAAAA,EAAU,WAAYC,MAAAA,EAAQ,aAAc,EAAIF,EACxD,SACE,OAACG,EAAAA,oBAAmBA,CAClBF,QAASA,EACTC,MAAOA,EACPE,WAAW,SACXC,aAAcC,EAAAA,GACdC,QAASC,EAAAA,oBACTC,qBAAsBC,EAAAA,iBACtBC,aAAa,mCACbC,cAAeC,EAAAA,oB,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,EAEW0B,EAAuD,CAClEjB,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,EAEzCI,EACX,sFACWC,EAAsB5B,GACjCA,EAEWT,EAAmD,CAC9DkB,EAAAA,GAAYnB,QAAQ4B,sBAAsB,CAAEC,YAAa,QAAS,CAAC,EACnEV,EAAAA,GAAYnB,QAAQ8B,kBAAkB,EACtCX,EAAAA,GAAYnB,QAAQiC,gCAAgC,C,EAEzC3B,EACX,oFACWH,EAAoBO,GAC/BA,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/HasSystemsCard/HasSystemsCard.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 asSystemEntities,\n RelatedEntitiesCard,\n systemEntityColumns,\n systemEntityHelpLink,\n} from '../RelatedEntitiesCard';\n\n/** @public */\nexport interface HasSystemsCardProps {\n variant?: InfoCardVariants;\n title?: string;\n}\n\nexport function HasSystemsCard(props: HasSystemsCardProps) {\n const { variant = 'gridItem', title = 'Has systems' } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title={title}\n entityKind=\"System\"\n relationType={RELATION_HAS_PART}\n columns={systemEntityColumns}\n asRenderableEntities={asSystemEntities}\n emptyMessage=\"No system is part of this domain\"\n emptyHelpLink={systemEntityHelpLink}\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":["HasSystemsCard","props","variant","title","RelatedEntitiesCard","entityKind","relationType","RELATION_HAS_PART","columns","systemEntityColumns","asRenderableEntities","asSystemEntities","emptyMessage","emptyHelpLink","systemEntityHelpLink","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","resourceEntityColumns","resourceEntityHelpLink","asResourceEntities"],"sourceRoot":""}
@@ -1,3 +0,0 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[5837],{95837:function(D,i,s){s.r(i),s.d(i,{CatalogPage:function(){return m},DefaultCatalogPage:function(){return c}});var t=s(52322),E=s(2784),g=s(73557),l=s(53974),o=s(97456),n=s(39709),u=s(19625),x=s(86359),j=s(98527);const h=()=>(0,j.yx)();function c(a){const{columns:d,actions:C,initiallySelectedFilter:f="owned",initialKind:p="component",tableOptions:v={},emptyContent:y,ownerPickerMode:O}=a;var e;const P=(e=(0,o.h_)(o.Ds).getOptionalString("organization.name"))!==null&&e!==void 0?e:"Backstage",r=(0,o.tg)(u.yw),{createButtonTitle:F}=h();return(0,t.jsx)(l.g9,{title:`${P} Catalog`,themeId:"home",children:(0,t.jsxs)(l.VY,{children:[(0,t.jsxs)(l.yW,{title:"",children:[(0,t.jsx)(l.XF,{title:F,to:r&&r()}),(0,t.jsx)(l.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:p}),(0,t.jsx)(n.sL,{}),(0,t.jsx)(n.EW,{initialFilter:f}),(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)(x.E,{columns:d,actions:C,tableOptions:v,emptyContent:y})})]})})]})})}function m(a){return(0,g.pC)()||(0,t.jsx)(c,{...a})}}}]);})();
2
-
3
- //# sourceMappingURL=5837.d9697f2a.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/5837.d9697f2a.chunk.js","mappings":"kVA2BO,MAAMA,EAA0B,OACrCC,EAAAA,IAAgBA,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,4 +0,0 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[6051],{76051:function(xe,L,c){c.r(L),c.d(L,{RealLogViewer:function(){return me}});var u=c(52322),j=c(95544),S=c(61837),P=c(19353),U=c(72779),b=c.n(U),x=c(2784),W=c(73557),D=c(6738),G=c(50166),y=c(87612),$=c(46212);const R=(0,$.Z)(),B=/\n\r?/g,Y=Object.fromEntries(Object.entries({1:e=>({...e,bold:!0}),3:e=>({...e,italic:!0}),4:e=>({...e,underline:!0}),22:({bold:e,...t})=>t,23:({italic:e,...t})=>t,24:({underline:e,...t})=>t,30:e=>({...e,foreground:"black"}),31:e=>({...e,foreground:"red"}),32:e=>({...e,foreground:"green"}),33:e=>({...e,foreground:"yellow"}),34:e=>({...e,foreground:"blue"}),35:e=>({...e,foreground:"magenta"}),36:e=>({...e,foreground:"cyan"}),37:e=>({...e,foreground:"white"}),39:({foreground:e,...t})=>t,90:e=>({...e,foreground:"grey"}),40:e=>({...e,background:"black"}),41:e=>({...e,background:"red"}),42:e=>({...e,background:"green"}),43:e=>({...e,background:"yellow"}),44:e=>({...e,background:"blue"}),45:e=>({...e,background:"magenta"}),46:e=>({...e,background:"cyan"}),47:e=>({...e,background:"white"}),49:({background:e,...t})=>t}).map(([e,t])=>[`\x1B[${e}m`,t]));class C{lastChunk(){return this.chunks[this.chunks.length-1]}replaceLastChunk(t){t&&(this.chunks.splice(this.chunks.length-1,1,...t),this.text=this.chunks.map(n=>n.text).join("").toLocaleLowerCase("en-US"))}constructor(t=1,n=[]){(0,y._)(this,"lineNumber",void 0),(0,y._)(this,"chunks",void 0),(0,y._)(this,"text",void 0),this.lineNumber=t,this.chunks=n,this.text=n.map(o=>o.text).join("").toLocaleLowerCase("en-US")}}class J{process(t){if(this.text===t)return this.lines;if(t.startsWith(this.text)){var n,o,s,r;const l=this.lines.length>0?this.lines.length-1:0;var i;const a=(i=this.lines[l])!==null&&i!==void 0?i:new C,h=a.lastChunk();var d;const f=this.processLines(((d=(n=h)===null||n===void 0?void 0:n.text)!==null&&d!==void 0?d:"")+t.slice(this.text.length),(o=h)===null||o===void 0?void 0:o.modifiers,(s=a)===null||s===void 0?void 0:s.lineNumber);a.replaceLastChunk((r=f[0])===null||r===void 0?void 0:r.chunks),this.lines[l]=a,this.lines.push(...f.slice(1))}else this.lines=this.processLines(t);return this.text=t,this.lines}constructor(){(0,y._)(this,"text",""),(0,y._)(this,"lines",[]),(0,y._)(this,"processLines",(t,n={},o=1)=>{const s=[];let r=n,i=o,d=0;for(B.lastIndex=0;;){const a=B.exec(t);if(!a){const g=this.processText(t.slice(d),r);return s.push(new C(i,g)),s}const h=t.slice(d,a.index);d=a.index+a[0].length;const f=this.processText(h,r);s.push(new C(i,f));var l;r=(l=f[f.length-1].modifiers)!==null&&l!==void 0?l:r,i+=1}}),(0,y._)(this,"processText",(t,n)=>{const o=[];let s=n,r=0;for(R.lastIndex=0;;){const i=R.exec(t);if(!i)return o.push({text:t.slice(r),modifiers:s}),o;const d=t.slice(r,i.index);o.push({text:d,modifiers:s}),r=i.index+i[0].length,s=this.processCode(i[0],s)}}),(0,y._)(this,"processCode",(t,n)=>{var o,s,r;return(r=(o=(s=Y)[t])===null||o===void 0?void 0:o.call(s,n))!==null&&r!==void 0?r:n})}}var Q=c(74600),I=c.n(Q),X=c(63494),w=c(43909);function q(e,t){const n=new Array;if(t.bold&&n.push(e.modifierBold),t.italic&&n.push(e.modifierItalic),t.underline&&n.push(e.modifierUnderline),t.foreground){const o=`modifierForeground${I()(t.foreground)}`;n.push(e[o])}if(t.background){const o=`modifierBackground${I()(t.background)}`;n.push(e[o])}return n.length>0?n.join(" "):void 0}function _(e,t){if(!t||!e.includes(t))return;const n=new Array;let o=0;for(;;){const s=e.indexOf(t,o);if(s===-1)break;const r=s+t.length;n.push({start:s,end:r}),o=r}return n}function ee(e,t){const n=_(e.text,t);if(!n)return e.chunks;const o=new Array;let s=0,r=0,i=n[r];for(const d of e.chunks){const{text:l,modifiers:a}=d;if(!i||s+l.length<i.start){o.push(d),s+=l.length;continue}let h=0;for(;i;){const g=Math.max(i.start-s,0);if(g>l.length)break;const m=Math.min(i.end-s,l.length);if(g>h&&o.push({text:l.slice(h,g),modifiers:a}),m>g&&o.push({modifiers:a,highlight:r,text:l.slice(g,m)}),h=m,i.end-s===m)r+=1,i=n[r];else break}h<l.length&&o.push({text:l.slice(h),modifiers:a}),s+=l.length}return o}const te=({attributes:e,content:t})=>{const{href:n,...o}=e;return(0,u.jsx)(w.r,{to:n,...o,children:t})};function ne({line:e,classes:t,searchText:n,highlightResultIndex:o}){const s=(0,x.useMemo)(()=>ee(e,n),[e,n]),r=(0,x.useMemo)(()=>s.map(({text:i,modifiers:d,highlight:l},a)=>(0,u.jsx)("span",{className:b()(q(t,d),l!==void 0&&(l===o?t.textSelectedHighlight:t.textHighlight)),children:(0,u.jsx)(X.Z,{options:{render:te},children:i})},a)),[s,o,t]);return(0,u.jsx)(u.Fragment,{children:r})}var oe=c(86619),se=c(90436),re=c(48049),ie=c(51209),F=c(36444);function le(e){const{resultCount:t,resultIndexStep:n,toggleShouldFilter:o}=e;var s;const r=(s=e.resultIndex)!==null&&s!==void 0?s:0,i=d=>{d.key==="Enter"&&(d.metaKey||d.ctrlKey||d.altKey?o():n(d.shiftKey))};return(0,u.jsxs)(u.Fragment,{children:[t!==void 0&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(S.Z,{size:"small",onClick:()=>n(!0),children:(0,u.jsx)(re.Z,{})}),(0,u.jsxs)(se.Z,{children:[Math.min(r+1,t),"/",t]}),(0,u.jsx)(S.Z,{size:"small",onClick:()=>n(),children:(0,u.jsx)(ie.Z,{})})]}),(0,u.jsx)(oe.Z,{size:"small",variant:"standard",placeholder:"Search",value:e.searchInput,onKeyPress:i,onChange:d=>e.setSearchInput(d.target.value)}),(0,u.jsx)(S.Z,{size:"small",onClick:o,children:e.shouldFilter?(0,u.jsx)(F.Z,{color:"primary"}):(0,u.jsx)(F.Z,{color:"disabled"})})]})}var ce=c(79692),M=c(41128),Z=c(31754),N=c(66054),T=c(81463),z=c(34505),A=c(57186),E=c(32720),K=c(92901),H=c(45410);const O=40,de=(0,ce.Z)(e=>({root:{background:e.palette.background.paper},header:{height:O,display:"flex",alignItems:"center",justifyContent:"flex-end"},log:{fontFamily:'"Monaco", monospace',fontSize:e.typography.pxToRem(12)},line:{position:"relative",whiteSpace:"pre","&:hover":{background:e.palette.action.hover}},lineSelected:{background:e.palette.action.selected,"&:hover":{background:e.palette.action.selected}},lineCopyButton:{position:"absolute",paddingTop:0,paddingBottom:0},lineNumber:{display:"inline-block",textAlign:"end",width:60,marginRight:e.spacing(1),cursor:"pointer"},textHighlight:{background:(0,M.Fq)(e.palette.info.main,.15)},textSelectedHighlight:{background:(0,M.Fq)(e.palette.info.main,.4)},modifierBold:{fontWeight:e.typography.fontWeightBold},modifierItalic:{fontStyle:"italic"},modifierUnderline:{textDecoration:"underline"},modifierForegroundBlack:{color:Z.Z.black},modifierForegroundRed:{color:N.Z[500]},modifierForegroundGreen:{color:T.Z[500]},modifierForegroundYellow:{color:z.Z[500]},modifierForegroundBlue:{color:A.Z[500]},modifierForegroundMagenta:{color:E.Z[500]},modifierForegroundCyan:{color:K.Z[500]},modifierForegroundWhite:{color:Z.Z.white},modifierForegroundGrey:{color:H.Z[500]},modifierBackgroundBlack:{background:Z.Z.black},modifierBackgroundRed:{background:N.Z[500]},modifierBackgroundGreen:{background:T.Z[500]},modifierBackgroundYellow:{background:z.Z[500]},modifierBackgroundBlue:{background:A.Z[500]},modifierBackgroundMagenta:{background:E.Z[500]},modifierBackgroundCyan:{background:K.Z[500]},modifierBackgroundWhite:{background:Z.Z.white},modifierBackgroundGrey:{background:H.Z[500]}}),{name:"BackstageLogViewer"});var ae=c(96686);function ue(e,t){if(!t)return{lines:e};const n=[],o=[];for(const s of e)if(s.text.includes(t)){n.push(s);let r=0,i=0;for(;;){const d=s.text.indexOf(t,r);if(d===-1)break;o.push({lineNumber:s.lineNumber,lineIndex:i++}),r=d+t.length}}return{lines:n,results:o}}function he(e){var t,n,o;const[s,r]=(0,x.useState)(""),i=s.toLocaleLowerCase("en-US"),[d,l]=(0,x.useState)(0),[a,h]=(0,ae.O)(!1),f=(0,x.useMemo)(()=>ue(e,i),[e,i]),g=f.results?f.results[Math.min(d,f.results.length-1)]:void 0,m=(t=f.results)===null||t===void 0?void 0:t.length,k=v=>{if(v){if(m!==void 0){const p=Math.min(d-1,m-2);l(p<0?m-1:p)}}else if(m!==void 0){const p=d+1;l(p>=m?0:p)}};return{lines:a?f.lines:e,searchText:i,searchInput:s,setSearchInput:r,shouldFilter:a,toggleShouldFilter:h,resultCount:m,resultIndex:d,resultIndexStep:k,resultLine:(n=g)===null||n===void 0?void 0:n.lineNumber,resultLineIndex:(o=g)===null||o===void 0?void 0:o.lineIndex}}var V=c(97456),fe=c(95074);function ge(e){const t=(0,V.h_)(V.VE),[n,o]=(0,x.useState)(),s=n?Math.min(n.start,n.end):void 0,r=n?Math.max(n.start,n.end):void 0,[{error:i},d]=(0,fe.Z)();return(0,x.useEffect)(()=>{i&&t.post(i)},[i,t]),{shouldShowButton(l){return s===l||r===l},isSelected(l){return n?s<=l&&l<=r:!1},setSelection(l,a){o(a?h=>h?{start:h.start,end:l}:{start:l,end:l}:h=>{var f,g;return((f=h)===null||f===void 0?void 0:f.start)===l&&((g=h)===null||g===void 0?void 0:g.end)===l?void 0:{start:l,end:l}})},copySelection(){if(n){const l=e.slice(Math.min(n.start,n.end)-1,Math.max(n.start,n.end)).map(a=>a.chunks.map(h=>h.text).join("")).join(`
2
- `);d(l),o(void 0)}}}}function me(e){const t=de({classes:e.classes}),n=(0,x.useRef)(null),s=(0,x.useMemo)(()=>new J,[]).process(e.text),r=he(s),i=ge(s),d=(0,W.TH)();(0,x.useEffect)(()=>{r.resultLine!==void 0&&n.current&&n.current.scrollToItem(r.resultLine-1,"center")},[r.resultLine]),(0,x.useEffect)(()=>{if(d.hash){const a=parseInt(d.hash.replace(/\D/g,""),10);i.setSelection(a,!1)}},[]);const l=(a,h)=>{i.setSelection(a,h.shiftKey)};return(0,u.jsx)(D.ZP,{children:({height:a,width:h})=>(0,u.jsxs)(j.Z,{style:{width:h,height:a},className:t.root,children:[(0,u.jsx)(j.Z,{className:t.header,children:(0,u.jsx)(le,{...r})}),(0,u.jsx)(G.t7,{ref:n,className:t.log,height:(a||480)-O,width:h||640,itemData:r.lines,itemSize:20,itemCount:r.lines.length,children:({index:f,style:g,data:m})=>{const k=m[f],{lineNumber:v}=k;return(0,u.jsxs)(j.Z,{style:{...g},className:b()(t.line,{[t.lineSelected]:i.isSelected(v)}),children:[i.shouldShowButton(v)&&(0,u.jsx)(S.Z,{"data-testid":"copy-button",size:"small",className:t.lineCopyButton,onClick:()=>i.copySelection(),children:(0,u.jsx)(P.Z,{fontSize:"inherit"})}),(0,u.jsx)("a",{role:"row",target:"_self",href:`#line-${v}`,className:t.lineNumber,onClick:p=>l(v,p),onKeyPress:p=>l(v,p),children:v}),(0,u.jsx)(ne,{line:k,classes:t,searchText:r.searchText,highlightResultIndex:r.resultLine===v?r.resultLineIndex:void 0})]})}})]})})}}}]);})();
3
-
4
- //# sourceMappingURL=6051.9a397327.chunk.js.map
@@ -1,3 +0,0 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[732],{732:function(O,r,e){e.r(r),e.d(r,{RelatedEntitiesCard:function(){return l},asComponentEntities:function(){return p},asResourceEntities:function(){return C},asSystemEntities:function(){return k},componentEntityColumns:function(){return m},componentEntityHelpLink:function(){return d},resourceEntityColumns:function(){return y},resourceEntityHelpLink:function(){return f},systemEntityColumns:function(){return E},systemEntityHelpLink:function(){return h}});var n=e(52322),u=e(90436),t=e(39709),M=e(2784),s=e(53974);function l(o){const{variant:c="gridItem",title:i,columns:g,entityKind:v,relationType:x,emptyMessage:j,emptyHelpLink:L,asRenderableEntities:R,tableOptions:H={}}=o,{entity:b}=(0,t.X2)(),{entities:S,loading:K,error:a}=(0,t.eK)(b,{type:x,kind:v});return K?(0,n.jsx)(s.rJ,{variant:c,title:i,children:(0,n.jsx)(s.Ex,{})}):a?(0,n.jsx)(s.rJ,{variant:c,title:i,children:(0,n.jsx)(s.Gk,{error:a})}):(0,n.jsx)(t.u3,{title:i,variant:c,emptyContent:(0,n.jsxs)("div",{style:{textAlign:"center"},children:[(0,n.jsx)(u.Z,{variant:"body1",children:j}),(0,n.jsx)(u.Z,{variant:"body2",children:(0,n.jsx)(s.rU,{to:L,children:"Learn how to change this."})})]}),columns:g,entities:R(S||[]),tableOptions:H})}const m=[t.u3.columns.createEntityRefColumn({defaultKind:"component"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createSpecTypeColumn(),t.u3.columns.createSpecLifecycleColumn(),t.u3.columns.createMetadataDescriptionColumn()],d="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",p=o=>o,y=[t.u3.columns.createEntityRefColumn({defaultKind:"resource"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createSpecTypeColumn(),t.u3.columns.createSpecLifecycleColumn(),t.u3.columns.createMetadataDescriptionColumn()],f="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",C=o=>o,E=[t.u3.columns.createEntityRefColumn({defaultKind:"system"}),t.u3.columns.createOwnerColumn(),t.u3.columns.createMetadataDescriptionColumn()],h="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",k=o=>o}}]);})();
2
-
3
- //# sourceMappingURL=732.b079cbc6.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/732.b079cbc6.chunk.js","mappings":"6nBA2DO,SAASA,EACdC,EAAkC,CAElC,KAAM,CACJC,QAAAA,EAAU,WACVC,MAAAA,EACAC,QAAAA,EACAC,WAAAA,EACAC,aAAAA,EACAC,aAAAA,EACAC,cAAAA,EACAC,qBAAAA,EACAC,aAAAA,EAAe,CAAC,CAAC,EACfT,EAEE,CAAEU,OAAAA,CAAO,KAAIC,EAAAA,IAAU,EACvB,CAAEC,SAAAA,EAAUC,QAAAA,EAASC,MAAAA,CAAM,KAAIC,EAAAA,IAAmBL,EAAQ,CAC9DM,KAAMX,EACNY,KAAMb,CACR,CAAC,EAED,OAAIS,KAEA,OAACK,EAAAA,GAAQA,CAACjB,QAASA,EAASC,MAAOA,E,YACjC,OAACiB,EAAAA,GAAQA,CAAAA,CAAAA,C,GAKXL,KAEA,OAACI,EAAAA,GAAQA,CAACjB,QAASA,EAASC,MAAOA,E,YACjC,OAACkB,EAAAA,GAAkBA,CAACN,MAAOA,C,QAM/B,OAACO,EAAAA,GAAWA,CACVnB,MAAOA,EACPD,QAASA,EACTqB,gBACE,QAACC,MAAAA,CAAIC,MAAO,CAAEC,UAAW,QAAS,E,aAChC,OAACC,EAAAA,EAAUA,CAACzB,QAAQ,Q,SAASK,C,MAC7B,OAACoB,EAAAA,EAAUA,CAACzB,QAAQ,Q,YAClB,OAAC0B,EAAAA,GAAIA,CAACC,GAAIrB,E,SAAe,2B,QAI/BJ,QAASA,EACTS,SAAUJ,EAAqBI,GAAY,CAAC,CAAC,EAC7CH,aAAcA,C,EAGpB,CCzFO,MAAMoB,EAAyD,CACpER,EAAAA,GAAYlB,QAAQ2B,sBAAsB,CAAEC,YAAa,WAAY,CAAC,EACtEV,EAAAA,GAAYlB,QAAQ6B,kBAAkB,EACtCX,EAAAA,GAAYlB,QAAQ8B,qBAAqB,EACzCZ,EAAAA,GAAYlB,QAAQ+B,0BAA0B,EAC9Cb,EAAAA,GAAYlB,QAAQgC,gCAAgC,C,EAEzCC,EACX,uFACWC,EAAuBzB,GAClCA,EAEW0B,EAAuD,CAClEjB,EAAAA,GAAYlB,QAAQ2B,sBAAsB,CAAEC,YAAa,UAAW,CAAC,EACrEV,EAAAA,GAAYlB,QAAQ6B,kBAAkB,EACtCX,EAAAA,GAAYlB,QAAQ8B,qBAAqB,EACzCZ,EAAAA,GAAYlB,QAAQ+B,0BAA0B,EAC9Cb,EAAAA,GAAYlB,QAAQgC,gCAAgC,C,EAEzCI,EACX,sFACWC,EAAsB5B,GACjCA,EAEW6B,EAAmD,CAC9DpB,EAAAA,GAAYlB,QAAQ2B,sBAAsB,CAAEC,YAAa,QAAS,CAAC,EACnEV,EAAAA,GAAYlB,QAAQ6B,kBAAkB,EACtCX,EAAAA,GAAYlB,QAAQgC,gCAAgC,C,EAEzCO,EACX,oFACWC,EAAoB/B,GAC/BA,C","sources":["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 { 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":["RelatedEntitiesCard","props","variant","title","columns","entityKind","relationType","emptyMessage","emptyHelpLink","asRenderableEntities","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","resourceEntityColumns","resourceEntityHelpLink","asResourceEntities","systemEntityColumns","systemEntityHelpLink","asSystemEntities"],"sourceRoot":""}
@@ -1,3 +0,0 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[7560],{27560:function(g,D,e){e.r(D),e.d(D,{TechDocsCustomHome:function(){return v}});var t=e(52322),C=e(2784),p=e(64279),O=e(79692),d=e(39709),j=e(68435),x=e(85478),_=e(42081),n=e(53974),M=e(97456);const T={DocsTable:j.H,DocsCardGrid:x.f},f=({config:s,entities:i,index:r})=>{const E=(0,O.Z)({panelContainer:{marginBottom:"2rem",...s.panelCSS?s.panelCSS:{}}})(),{loading:c,isOwnedEntity:u}=(0,d.ZW)(),l=T[s.panelType],h=i.filter(a=>s.filterPredicate==="ownedByUser"?c?!1:u(a):typeof s.filterPredicate=="function"&&s.filterPredicate(a));return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.yW,{title:s.title,description:s.description,children:r===0?(0,t.jsx)(n.qt,{children:"Discover documentation in your ecosystem."}):null}),(0,t.jsx)("div",{className:E.panelContainer,children:(0,t.jsx)(l,{"data-testid":"techdocs-custom-panel",entities:h})})]})},v=s=>{const{tabsConfig:i}=s,[r,P]=(0,C.useState)(0),E=(0,M.h_)(d.Ah),{value:c,loading:u,error:l}=(0,p.default)(async()=>(await E.getEntities({filter:{"metadata.annotations.backstage.io/techdocs-ref":d.n3},fields:["apiVersion","kind","metadata","relations","spec.owner","spec.type"]})).items.filter(o=>{var m;return!!(!((m=o.metadata.annotations)===null||m===void 0)&&m["backstage.io/techdocs-ref"])})),h=i[r];return u?(0,t.jsx)(_.j,{children:(0,t.jsx)(n.VY,{children:(0,t.jsx)(n.Ex,{})})}):l?(0,t.jsx)(_.j,{children:(0,t.jsx)(n.VY,{children:(0,t.jsx)(n.GB,{severity:"error",title:"Could not load available documentation.",children:(0,t.jsx)(n.Oi,{language:"text",text:l.toString()})})})}):(0,t.jsxs)(_.j,{children:[(0,t.jsx)(n.aR,{selectedIndex:r,onChange:a=>P(a),tabs:i.map(({label:a},o)=>({id:o.toString(),label:a}))}),(0,t.jsx)(n.VY,{"data-testid":"techdocs-content",children:h.panels.map((a,o)=>(0,t.jsx)(f,{config:a,entities:c||[],index:o},o))})]})}}}]);})();
2
-
3
- //# sourceMappingURL=7560.f82352d7.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/7560.f82352d7.chunk.js","mappings":"4TA0CA,MAAMA,EAAS,CACbC,UAAWA,EAAAA,EACXC,aAAcA,EAAAA,CAChB,EAuCMC,EAAc,CAAC,CACnBC,OAAAA,EACAC,SAAAA,EACAC,MAAAA,CAAK,IAKN,CAOC,MAAMC,KANYC,EAAAA,GAAW,CAC3BC,eAAgB,CACdC,aAAc,OACd,GAAIN,EAAOO,SAAWP,EAAOO,SAAW,CAAC,CAC3C,CACF,CAAC,EACyB,EACpB,CAAEC,QAASC,EAAkBC,cAAAA,CAAc,KAAIC,EAAAA,IAAmB,EAElEC,EAAQhB,EAAOI,EAAOa,SAAS,EAE/BC,EAAgBb,EAASc,OAAOC,GAChChB,EAAOiB,kBAAoB,cACzBR,EACK,GAEFC,EAAcM,CAAM,EAI3B,OAAOhB,EAAOiB,iBAAoB,YAClCjB,EAAOiB,gBAAgBD,CAAM,CAEhC,EAED,SACE,oB,aACE,OAACE,EAAAA,GAAaA,CAACC,MAAOnB,EAAOmB,MAAOC,YAAapB,EAAOoB,Y,SACrDlB,IAAU,KACT,OAACmB,EAAAA,GAAaA,C,SAAC,2C,GAGb,I,MAEN,OAACC,MAAAA,CAAIC,UAAWpB,EAAQE,e,YACtB,OAACO,EAAAA,CAAMY,cAAY,wBAAwBvB,SAAUa,C,OAI7D,EAWaW,EAAsBC,GAAAA,CACjC,KAAM,CAAEC,WAAAA,CAAW,EAAID,EACjB,CAACE,EAAaC,CAAc,KAAIC,EAAAA,UAAiB,CAAC,EAClDC,KAAyBC,EAAAA,IAAOC,EAAAA,EAAaA,EAE7C,CACJC,MAAOjC,EACPO,QAAAA,EACA2B,MAAAA,CAAK,KACHC,EAAAA,SAAS,UACM,MAAML,EAAWM,YAAY,CAC5CtB,OAAQ,CACN,iDAAkDuB,EAAAA,EACpD,EACAC,OAAQ,CACN,aACA,OACA,WACA,YACA,aACA,W,CAEJ,CAAC,GACeC,MAAMzB,OAAQC,GAAAA,C,IACnBA,EAAT,MAAO,CAAC,EAACA,GAAAA,EAAAA,EAAOyB,SAASC,eAAW,MAA3B1B,IAAAA,SAAAA,EAA8B,2BAA2B,EACpE,CAAC,CACF,EAEK2B,EAAmBhB,EAAWC,CAAW,EAE/C,OAAIpB,KAEA,OAACoC,EAAAA,EAAmBA,C,YAClB,OAACC,EAAAA,GAAOA,C,YACN,OAACC,EAAAA,GAAQA,CAAAA,CAAAA,C,KAMbX,KAEA,OAACS,EAAAA,EAAmBA,C,YAClB,OAACC,EAAAA,GAAOA,C,YACN,OAACE,EAAAA,GAAYA,CACXC,SAAS,QACT7B,MAAM,0C,YAEN,OAAC8B,EAAAA,GAAWA,CAACC,SAAS,OAAOC,KAAMhB,EAAMiB,SAAS,C,YAQ1D,QAACR,EAAAA,EAAmBA,C,aAClB,OAACS,EAAAA,GAAUA,CACTC,cAAe1B,EACf2B,SAAUrD,GAAS2B,EAAe3B,CAAK,EACvCsD,KAAM7B,EAAW8B,IAAI,CAAC,CAAEC,MAAAA,CAAM,EAAGxD,KAAW,CAC1CyD,GAAIzD,EAAMkD,SAAS,EACnBM,MAAAA,CACF,EAAE,C,MAEJ,OAACb,EAAAA,GAAOA,CAACrB,cAAY,mB,SAClBmB,EAAiB/C,OAAO6D,IAAI,CAACzD,EAAQE,OACpC,OAACH,EAAAA,CAECC,OAAQA,EACRC,SAAYA,GAAsB,CAAC,EACnCC,MAAOA,C,EAHFA,CAAK,CAALA,C,KASjB,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/techdocs/src/home/components/TechDocsCustomHome.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { useState } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { makeStyles } from '@material-ui/core';\nimport { CSSProperties } from '@material-ui/styles';\nimport {\n CATALOG_FILTER_EXISTS,\n catalogApiRef,\n CatalogApi,\n useEntityOwnership,\n} from '@backstage/plugin-catalog-react';\nimport { Entity } from '@backstage/catalog-model';\nimport { DocsTable } from './Tables';\nimport { DocsCardGrid } from './Grids';\nimport { TechDocsPageWrapper } from './TechDocsPageWrapper';\n\nimport {\n CodeSnippet,\n Content,\n HeaderTabs,\n Progress,\n WarningPanel,\n SupportButton,\n ContentHeader,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\nconst panels = {\n DocsTable: DocsTable,\n DocsCardGrid: DocsCardGrid,\n};\n\n/**\n * Available panel types\n *\n * @public\n */\nexport type PanelType = 'DocsCardGrid' | 'DocsTable';\n\n/**\n * Type representing a TechDocsCustomHome panel.\n *\n * @public\n */\nexport interface PanelConfig {\n title: string;\n description: string;\n panelType: PanelType;\n panelCSS?: CSSProperties;\n filterPredicate: ((entity: Entity) => boolean) | string;\n}\n\n/**\n * Type representing a TechDocsCustomHome tab.\n *\n * @public\n */\nexport interface TabConfig {\n label: string;\n panels: PanelConfig[];\n}\n\n/**\n * Type representing a list of TechDocsCustomHome tabs.\n *\n * @public\n */\nexport type TabsConfig = TabConfig[];\n\nconst CustomPanel = ({\n config,\n entities,\n index,\n}: {\n config: PanelConfig;\n entities: Entity[];\n index: number;\n}) => {\n const useStyles = makeStyles({\n panelContainer: {\n marginBottom: '2rem',\n ...(config.panelCSS ? config.panelCSS : {}),\n },\n });\n const classes = useStyles();\n const { loading: loadingOwnership, isOwnedEntity } = useEntityOwnership();\n\n const Panel = panels[config.panelType];\n\n const shownEntities = entities.filter(entity => {\n if (config.filterPredicate === 'ownedByUser') {\n if (loadingOwnership) {\n return false;\n }\n return isOwnedEntity(entity);\n }\n\n return (\n typeof config.filterPredicate === 'function' &&\n config.filterPredicate(entity)\n );\n });\n\n return (\n <>\n <ContentHeader title={config.title} description={config.description}>\n {index === 0 ? (\n <SupportButton>\n Discover documentation in your ecosystem.\n </SupportButton>\n ) : null}\n </ContentHeader>\n <div className={classes.panelContainer}>\n <Panel data-testid=\"techdocs-custom-panel\" entities={shownEntities} />\n </div>\n </>\n );\n};\n\n/**\n * Props for {@link TechDocsCustomHome}\n *\n * @public\n */\nexport type TechDocsCustomHomeProps = {\n tabsConfig: TabsConfig;\n};\n\nexport const TechDocsCustomHome = (props: TechDocsCustomHomeProps) => {\n const { tabsConfig } = props;\n const [selectedTab, setSelectedTab] = useState<number>(0);\n const catalogApi: CatalogApi = useApi(catalogApiRef);\n\n const {\n value: entities,\n loading,\n error,\n } = useAsync(async () => {\n const response = await catalogApi.getEntities({\n filter: {\n 'metadata.annotations.backstage.io/techdocs-ref': CATALOG_FILTER_EXISTS,\n },\n fields: [\n 'apiVersion',\n 'kind',\n 'metadata',\n 'relations',\n 'spec.owner',\n 'spec.type',\n ],\n });\n return response.items.filter((entity: Entity) => {\n return !!entity.metadata.annotations?.['backstage.io/techdocs-ref'];\n });\n });\n\n const currentTabConfig = tabsConfig[selectedTab];\n\n if (loading) {\n return (\n <TechDocsPageWrapper>\n <Content>\n <Progress />\n </Content>\n </TechDocsPageWrapper>\n );\n }\n\n if (error) {\n return (\n <TechDocsPageWrapper>\n <Content>\n <WarningPanel\n severity=\"error\"\n title=\"Could not load available documentation.\"\n >\n <CodeSnippet language=\"text\" text={error.toString()} />\n </WarningPanel>\n </Content>\n </TechDocsPageWrapper>\n );\n }\n\n return (\n <TechDocsPageWrapper>\n <HeaderTabs\n selectedIndex={selectedTab}\n onChange={index => setSelectedTab(index)}\n tabs={tabsConfig.map(({ label }, index) => ({\n id: index.toString(),\n label,\n }))}\n />\n <Content data-testid=\"techdocs-content\">\n {currentTabConfig.panels.map((config, index) => (\n <CustomPanel\n key={index}\n config={config}\n entities={!!entities ? entities : []}\n index={index}\n />\n ))}\n </Content>\n </TechDocsPageWrapper>\n );\n};\n"],"names":["panels","DocsTable","DocsCardGrid","CustomPanel","config","entities","index","classes","makeStyles","panelContainer","marginBottom","panelCSS","loading","loadingOwnership","isOwnedEntity","useEntityOwnership","Panel","panelType","shownEntities","filter","entity","filterPredicate","ContentHeader","title","description","SupportButton","div","className","data-testid","TechDocsCustomHome","props","tabsConfig","selectedTab","setSelectedTab","useState","catalogApi","useApi","catalogApiRef","value","error","useAsync","getEntities","CATALOG_FILTER_EXISTS","fields","items","metadata","annotations","currentTabConfig","TechDocsPageWrapper","Content","Progress","WarningPanel","severity","CodeSnippet","language","text","toString","HeaderTabs","selectedIndex","onChange","tabs","map","label","id"],"sourceRoot":""}
@@ -1,3 +0,0 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[7670],{27670:function(T,o,t){t.r(o),t.d(o,{CatalogSearchResultListItem:function(){return u}});var e=t(52322),y=t(2784),h=t(79692),m=t(86136),x=t(49378),g=t(95544),d=t(7089),f=t(53974),r=t(15096);const v=(0,h.Z)({item:{display:"flex"},flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}},{name:"CatalogSearchResultListItem"});function u(i){var a,n;const l=i.result,s=i.highlight,c=v();return l?(0,e.jsxs)("div",{className:c.item,children:[i.icon&&(0,e.jsx)(m.Z,{children:typeof i.icon=="function"?i.icon(l):i.icon}),(0,e.jsxs)("div",{className:c.flexContainer,children:[(0,e.jsx)(x.Z,{className:c.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,e.jsx)(f.rU,{noTrack:!0,to:l.location,children:!((a=s)===null||a===void 0)&&a.fields.title?(0,e.jsx)(r.FA,{text:s.fields.title,preTag:s.preTag,postTag:s.postTag}):l.title}),secondary:!((n=s)===null||n===void 0)&&n.fields.text?(0,e.jsx)(r.FA,{text:s.fields.text,preTag:s.preTag,postTag:s.postTag}):l.text}),(0,e.jsxs)(g.Z,{children:[l.kind&&(0,e.jsx)(d.Z,{label:`Kind: ${l.kind}`,size:"small"}),l.lifecycle&&(0,e.jsx)(d.Z,{label:`Lifecycle: ${l.lifecycle}`,size:"small"})]})]})]}):null}}}]);})();
2
-
3
- //# sourceMappingURL=7670.714e8960.chunk.js.map
@@ -1,8 +0,0 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[7750],{17750:function(Z,r,t){t.r(r),t.d(r,{EntityLinksCard:function(){return k}});var n=t(52322),h=t(39709),c=t(52160),I=t(2784),u=t(79692),v=t(90436),g=t(77277),m=t(53974);const y=`metadata:
2
- name: example
3
- links:
4
- - url: https://dashboard.example.com
5
- title: My Dashboard
6
- icon: dashboard`,p=(0,u.Z)(a=>({code:{borderRadius:6,margin:a.spacing(2,0),background:a.palette.type==="dark"?"#444":a.palette.common.white}}),{name:"PluginCatalogEntityLinksEmptyState"});function f(){const a=p();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.Z,{variant:"body1",children:"No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:"}),(0,n.jsx)("div",{className:a.code,children:(0,n.jsx)(m.Oi,{text:y,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(g.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional",children:"Read more"})]})}var x=t(24851),L=t(97456);const k=a=>{var o,i;const{cols:j=void 0,variant:S}=a,{entity:E}=(0,h.X2)(),b=(0,L.qD)();var e;const C=s=>s&&(e=b.getSystemIcon(s))!==null&&e!==void 0?e:c.Z,d=(i=E)===null||i===void 0||(o=i.metadata)===null||o===void 0?void 0:o.links;return(0,n.jsx)(m.rJ,{title:"Links",variant:S,children:!d||d.length===0?(0,n.jsx)(f,{}):(0,n.jsx)(x.s,{cols:j,items:d.map(({url:s,title:l,icon:N})=>({text:l!=null?l:s,href:s,Icon:C(N)}))})})}}}]);})();
7
-
8
- //# sourceMappingURL=7750.da1a67d5.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/7750.da1a67d5.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 +0,0 @@
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(97456),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
-
3
- //# sourceMappingURL=8951.d0edcfcb.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/8951.d0edcfcb.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 +0,0 @@
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
-
3
- //# sourceMappingURL=9545.24f95d89.chunk.js.map
@@ -1 +0,0 @@
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 +0,0 @@
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
-
3
- //# sourceMappingURL=9770.2fa7c11e.chunk.js.map
@@ -1 +0,0 @@
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":""}