@techdocs/cli 1.4.7 → 1.5.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -8
- package/dist/cjs/{generate-d9c4c0d9.cjs.js → generate-5fb2bc8c.cjs.js} +4 -2
- package/dist/cjs/generate-5fb2bc8c.cjs.js.map +1 -0
- package/dist/embedded-app/.config-schema.json +43 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{1032.5be56bbf.chunk.js → 1032.f8378b05.chunk.js} +1 -1
- package/dist/embedded-app/static/{1032.5be56bbf.chunk.js.map → 1032.f8378b05.chunk.js.map} +1 -1
- package/dist/embedded-app/static/1093.317a4f39.chunk.js +7 -0
- package/dist/embedded-app/static/1093.317a4f39.chunk.js.map +1 -0
- package/dist/embedded-app/static/1105.a5f2c603.chunk.js +3 -0
- package/dist/embedded-app/static/1105.a5f2c603.chunk.js.map +1 -0
- package/dist/embedded-app/static/{184.78d680e0.chunk.js → 184.2d07d6cf.chunk.js} +1 -1
- package/dist/embedded-app/static/{184.78d680e0.chunk.js.map → 184.2d07d6cf.chunk.js.map} +1 -1
- package/dist/embedded-app/static/2440.c513a311.chunk.js +3 -0
- package/dist/embedded-app/static/2440.c513a311.chunk.js.map +1 -0
- package/dist/embedded-app/static/5458.f60ece35.chunk.js +3 -0
- package/dist/embedded-app/static/5458.f60ece35.chunk.js.map +1 -0
- package/dist/embedded-app/static/5837.d9697f2a.chunk.js +3 -0
- package/dist/embedded-app/static/{9323.61727faa.chunk.js.map → 5837.d9697f2a.chunk.js.map} +1 -1
- package/dist/embedded-app/static/6051.9a397327.chunk.js +4 -0
- package/dist/embedded-app/static/{6051.e6ab645f.chunk.js.map → 6051.9a397327.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{732.fb0762a2.chunk.js → 732.b079cbc6.chunk.js} +1 -1
- package/dist/embedded-app/static/{732.fb0762a2.chunk.js.map → 732.b079cbc6.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7560.8ef9e30a.chunk.js → 7560.f82352d7.chunk.js} +2 -2
- package/dist/embedded-app/static/{7560.8ef9e30a.chunk.js.map → 7560.f82352d7.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7750.c1a4c4df.chunk.js → 7750.da1a67d5.chunk.js} +2 -2
- package/dist/embedded-app/static/{7750.c1a4c4df.chunk.js.map → 7750.da1a67d5.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8951.fea20091.chunk.js → 8951.d0edcfcb.chunk.js} +2 -2
- package/dist/embedded-app/static/{8951.fea20091.chunk.js.map → 8951.d0edcfcb.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9545.dea948d9.chunk.js → 9545.24f95d89.chunk.js} +1 -1
- package/dist/embedded-app/static/{9545.dea948d9.chunk.js.map → 9545.24f95d89.chunk.js.map} +1 -1
- package/dist/embedded-app/static/9770.2fa7c11e.chunk.js +3 -0
- package/dist/embedded-app/static/9770.2fa7c11e.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.2d4c0606.js +522 -0
- package/dist/embedded-app/static/main.2d4c0606.js.map +1 -0
- package/dist/embedded-app/static/module-i18next.3eb80014.js +3 -0
- package/dist/embedded-app/static/module-i18next.3eb80014.js.map +1 -0
- package/dist/embedded-app/static/module-luxon.b1d74b2d.js +3 -0
- package/dist/embedded-app/static/module-luxon.b1d74b2d.js.map +1 -0
- package/dist/embedded-app/static/{module-yaml.aace0584.js → module-yaml.00a97896.js} +6 -5
- package/dist/embedded-app/static/module-yaml.00a97896.js.map +1 -0
- package/dist/embedded-app/static/{runtime.4b61d1bd.js → runtime.2d4c0606.js} +2 -2
- package/dist/embedded-app/static/{runtime.4b61d1bd.js.map → runtime.2d4c0606.js.map} +1 -1
- package/dist/embedded-app/static/vendor.2d4c0606.js +213 -0
- package/dist/embedded-app/static/vendor.2d4c0606.js.map +1 -0
- package/dist/index.cjs.js +6 -2
- package/dist/index.cjs.js.map +1 -1
- package/package.json +6 -6
- package/dist/cjs/generate-d9c4c0d9.cjs.js.map +0 -1
- package/dist/embedded-app/static/1049.e59b8f46.chunk.js +0 -7
- package/dist/embedded-app/static/1049.e59b8f46.chunk.js.map +0 -1
- package/dist/embedded-app/static/1105.cbd84f5c.chunk.js +0 -3
- package/dist/embedded-app/static/1105.cbd84f5c.chunk.js.map +0 -1
- package/dist/embedded-app/static/2440.8f7574d6.chunk.js +0 -3
- package/dist/embedded-app/static/2440.8f7574d6.chunk.js.map +0 -1
- package/dist/embedded-app/static/5458.4a158b26.chunk.js +0 -3
- package/dist/embedded-app/static/5458.4a158b26.chunk.js.map +0 -1
- package/dist/embedded-app/static/6051.e6ab645f.chunk.js +0 -4
- package/dist/embedded-app/static/9323.61727faa.chunk.js +0 -3
- package/dist/embedded-app/static/9770.1e5df227.chunk.js +0 -3
- package/dist/embedded-app/static/9770.1e5df227.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.4b61d1bd.js +0 -522
- package/dist/embedded-app/static/main.4b61d1bd.js.map +0 -1
- package/dist/embedded-app/static/module-luxon.a1854eb9.js +0 -3
- package/dist/embedded-app/static/module-luxon.a1854eb9.js.map +0 -1
- package/dist/embedded-app/static/module-yaml.aace0584.js.map +0 -1
- package/dist/embedded-app/static/vendor.4b61d1bd.js +0 -213
- package/dist/embedded-app/static/vendor.4b61d1bd.js.map +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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 +1,3 @@
|
|
|
1
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
2
|
|
|
3
|
-
//# sourceMappingURL=184.
|
|
3
|
+
//# sourceMappingURL=184.2d07d6cf.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static/184.78d680e0.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,EACf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+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
|
+
{"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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AQ6B,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":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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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BzB,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":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static/
|
|
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":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static/6051.e6ab645f.chunk.js","mappings":"6UAkBA,MAAMA,KAAYC,EAAAA,GAAe,EAC3BC,EAAe,SAGfC,EAAgBC,OAAOC,YAC3BD,OAAOE,QAAQ,CACb,EAAGC,IAAM,CAAE,GAAGA,EAAGC,KAAM,EAAK,GAC5B,EAAGD,IAAM,CAAE,GAAGA,EAAGE,OAAQ,EAAK,GAC9B,EAAGF,IAAM,CAAE,GAAGA,EAAGG,UAAW,EAAK,GACjC,GAAI,CAAC,CAAEF,KAAMG,EAAG,GAAGJ,CAAE,IAAMA,EAC3B,GAAI,CAAC,CAAEE,OAAQE,EAAG,GAAGJ,CAAE,IAAMA,EAC7B,GAAI,CAAC,CAAEG,UAAWC,EAAG,GAAGJ,CAAE,IAAMA,EAChC,GAAIA,IAAM,CAAE,GAAGA,EAAGK,WAAY,OAAQ,GACtC,GAAIL,IAAM,CAAE,GAAGA,EAAGK,WAAY,KAAM,GACpC,GAAIL,IAAM,CAAE,GAAGA,EAAGK,WAAY,OAAQ,GACtC,GAAIL,IAAM,CAAE,GAAGA,EAAGK,WAAY,QAAS,GACvC,GAAIL,IAAM,CAAE,GAAGA,EAAGK,WAAY,MAAO,GACrC,GAAIL,IAAM,CAAE,GAAGA,EAAGK,WAAY,SAAU,GACxC,GAAIL,IAAM,CAAE,GAAGA,EAAGK,WAAY,MAAO,GACrC,GAAIL,IAAM,CAAE,GAAGA,EAAGK,WAAY,OAAQ,GACtC,GAAI,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A,EACTU,WAAYmK,EAAOnK,WACnB4B,qBACEuI,EAAOvB,aAAe/K,EAClBsM,EAAOtB,gBACP/I,M,KAKd,C,OAMZ,C","sources":["webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/AnsiProcessor.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/LogLine.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/LogViewerControls.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/styles.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/useLogViewerSearch.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/useLogViewerSelection.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/RealLogViewer.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 ansiRegexMaker from 'ansi-regex';\n\nconst ansiRegex = ansiRegexMaker();\nconst newlineRegex = /\\n\\r?/g;\n\n// A mapping of how each escape code changes the modifiers\nconst codeModifiers = Object.fromEntries(\n Object.entries({\n 1: m => ({ ...m, bold: true }),\n 3: m => ({ ...m, italic: true }),\n 4: m => ({ ...m, underline: true }),\n 22: ({ bold: _, ...m }) => m,\n 23: ({ italic: _, ...m }) => m,\n 24: ({ underline: _, ...m }) => m,\n 30: m => ({ ...m, foreground: 'black' }),\n 31: m => ({ ...m, foreground: 'red' }),\n 32: m => ({ ...m, foreground: 'green' }),\n 33: m => ({ ...m, foreground: 'yellow' }),\n 34: m => ({ ...m, foreground: 'blue' }),\n 35: m => ({ ...m, foreground: 'magenta' }),\n 36: m => ({ ...m, foreground: 'cyan' }),\n 37: m => ({ ...m, foreground: 'white' }),\n 39: ({ foreground: _, ...m }) => m,\n 90: m => ({ ...m, foreground: 'grey' }),\n 40: m => ({ ...m, background: 'black' }),\n 41: m => ({ ...m, background: 'red' }),\n 42: m => ({ ...m, background: 'green' }),\n 43: m => ({ ...m, background: 'yellow' }),\n 44: m => ({ ...m, background: 'blue' }),\n 45: m => ({ ...m, background: 'magenta' }),\n 46: m => ({ ...m, background: 'cyan' }),\n 47: m => ({ ...m, background: 'white' }),\n 49: ({ background: _, ...m }) => m,\n } as Record<string, (m: ChunkModifiers) => ChunkModifiers>).map(\n ([code, modifier]) => [`\\x1b[${code}m`, modifier],\n ),\n);\n\nexport type AnsiColor =\n | 'black'\n | 'red'\n | 'green'\n | 'yellow'\n | 'blue'\n | 'magenta'\n | 'cyan'\n | 'white'\n | 'grey';\n\nexport interface ChunkModifiers {\n foreground?: AnsiColor;\n background?: AnsiColor;\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n}\n\nexport interface AnsiChunk {\n text: string;\n modifiers: ChunkModifiers;\n}\n\nexport class AnsiLine {\n text: string;\n\n constructor(\n readonly lineNumber: number = 1,\n readonly chunks: AnsiChunk[] = [],\n ) {\n this.text = chunks\n .map(c => c.text)\n .join('')\n .toLocaleLowerCase('en-US');\n }\n\n lastChunk(): AnsiChunk | undefined {\n return this.chunks[this.chunks.length - 1];\n }\n\n replaceLastChunk(newChunks?: AnsiChunk[]) {\n if (newChunks) {\n this.chunks.splice(this.chunks.length - 1, 1, ...newChunks);\n this.text = this.chunks\n .map(c => c.text)\n .join('')\n .toLocaleLowerCase('en-US');\n }\n }\n}\n\nexport class AnsiProcessor {\n private text: string = '';\n private lines: AnsiLine[] = [];\n\n /**\n * Processes a chunk of text while keeping internal state that optimizes\n * subsequent processing that appends to the text.\n */\n process(text: string): AnsiLine[] {\n if (this.text === text) {\n return this.lines;\n }\n\n if (text.startsWith(this.text)) {\n const lastLineIndex = this.lines.length > 0 ? this.lines.length - 1 : 0;\n const lastLine = this.lines[lastLineIndex] ?? new AnsiLine();\n const lastChunk = lastLine.lastChunk();\n\n const newLines = this.processLines(\n (lastChunk?.text ?? '') + text.slice(this.text.length),\n lastChunk?.modifiers,\n lastLine?.lineNumber,\n );\n lastLine.replaceLastChunk(newLines[0]?.chunks);\n\n this.lines[lastLineIndex] = lastLine;\n this.lines.push(...newLines.slice(1));\n } else {\n this.lines = this.processLines(text);\n }\n this.text = text;\n\n return this.lines;\n }\n\n // Split a chunk of text up into lines and process each line individually\n private processLines = (\n text: string,\n modifiers: ChunkModifiers = {},\n startingLineNumber: number = 1,\n ): AnsiLine[] => {\n const lines: AnsiLine[] = [];\n\n let currentModifiers = modifiers;\n let currentLineNumber = startingLineNumber;\n\n let prevIndex = 0;\n newlineRegex.lastIndex = 0;\n for (;;) {\n const match = newlineRegex.exec(text);\n if (!match) {\n const chunks = this.processText(\n text.slice(prevIndex),\n currentModifiers,\n );\n lines.push(new AnsiLine(currentLineNumber, chunks));\n return lines;\n }\n\n const line = text.slice(prevIndex, match.index);\n prevIndex = match.index + match[0].length;\n\n const chunks = this.processText(line, currentModifiers);\n lines.push(new AnsiLine(currentLineNumber, chunks));\n\n // Modifiers that are active in the last chunk are carried over to the next line\n currentModifiers =\n chunks[chunks.length - 1].modifiers ?? currentModifiers;\n currentLineNumber += 1;\n }\n };\n\n // Processing of a one individual text chunk\n private processText = (\n fullText: string,\n modifiers: ChunkModifiers,\n ): AnsiChunk[] => {\n const chunks: AnsiChunk[] = [];\n\n let currentModifiers = modifiers;\n\n let prevIndex = 0;\n ansiRegex.lastIndex = 0;\n for (;;) {\n const match = ansiRegex.exec(fullText);\n if (!match) {\n chunks.push({\n text: fullText.slice(prevIndex),\n modifiers: currentModifiers,\n });\n return chunks;\n }\n\n const text = fullText.slice(prevIndex, match.index);\n chunks.push({ text, modifiers: currentModifiers });\n\n // For every escape code that we encounter we keep track of where the\n // next chunk of text starts, and what modifiers it has\n prevIndex = match.index + match[0].length;\n currentModifiers = this.processCode(match[0], currentModifiers);\n }\n };\n\n private processCode = (\n code: string,\n modifiers: ChunkModifiers,\n ): ChunkModifiers => {\n return codeModifiers[code]?.(modifiers) ?? modifiers;\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, { useMemo } from 'react';\nimport { AnsiChunk, AnsiLine, ChunkModifiers } from './AnsiProcessor';\nimport startCase from 'lodash/startCase';\nimport classnames from 'classnames';\nimport { useStyles } from './styles';\nimport Linkify from 'linkify-react';\nimport { Link } from '../Link';\n\nexport function getModifierClasses(\n classes: ReturnType<typeof useStyles>,\n modifiers: ChunkModifiers,\n) {\n const classNames = new Array<string>();\n if (modifiers.bold) {\n classNames.push(classes.modifierBold);\n }\n if (modifiers.italic) {\n classNames.push(classes.modifierItalic);\n }\n if (modifiers.underline) {\n classNames.push(classes.modifierUnderline);\n }\n if (modifiers.foreground) {\n const key = `modifierForeground${startCase(\n modifiers.foreground,\n )}` as keyof typeof classes;\n classNames.push(classes[key]);\n }\n if (modifiers.background) {\n const key = `modifierBackground${startCase(\n modifiers.background,\n )}` as keyof typeof classes;\n classNames.push(classes[key]);\n }\n return classNames.length > 0 ? classNames.join(' ') : undefined;\n}\n\nexport function findSearchResults(text: string, searchText: string) {\n if (!searchText || !text.includes(searchText)) {\n return undefined;\n }\n const searchResults = new Array<{ start: number; end: number }>();\n let offset = 0;\n for (;;) {\n const start = text.indexOf(searchText, offset);\n if (start === -1) {\n break;\n }\n const end = start + searchText.length;\n searchResults.push({ start, end });\n offset = end;\n }\n return searchResults;\n}\n\nexport interface HighlightAnsiChunk extends AnsiChunk {\n highlight?: number;\n}\n\nexport function calculateHighlightedChunks(\n line: AnsiLine,\n searchText: string,\n): HighlightAnsiChunk[] {\n const results = findSearchResults(line.text, searchText);\n if (!results) {\n return line.chunks;\n }\n\n const chunks = new Array<HighlightAnsiChunk>();\n\n let lineOffset = 0;\n let resultIndex = 0;\n let result = results[resultIndex];\n for (const chunk of line.chunks) {\n const { text, modifiers } = chunk;\n if (!result || lineOffset + text.length < result.start) {\n chunks.push(chunk);\n lineOffset += text.length;\n continue;\n }\n\n let localOffset = 0;\n while (result) {\n const localStart = Math.max(result.start - lineOffset, 0);\n if (localStart > text.length) {\n break; // The next result is not in this chunk\n }\n\n const localEnd = Math.min(result.end - lineOffset, text.length);\n\n const hasTextBeforeResult = localStart > localOffset;\n if (hasTextBeforeResult) {\n chunks.push({ text: text.slice(localOffset, localStart), modifiers });\n }\n const hasResultText = localEnd > localStart;\n if (hasResultText) {\n chunks.push({\n modifiers,\n highlight: resultIndex,\n text: text.slice(localStart, localEnd),\n });\n }\n\n localOffset = localEnd;\n\n const foundCompleteResult = result.end - lineOffset === localEnd;\n if (foundCompleteResult) {\n resultIndex += 1;\n result = results[resultIndex];\n } else {\n break; // The rest of the result is in the following chunks\n }\n }\n\n const hasTextAfterResult = localOffset < text.length;\n if (hasTextAfterResult) {\n chunks.push({ text: text.slice(localOffset), modifiers });\n }\n\n lineOffset += text.length;\n }\n\n return chunks;\n}\n\nconst renderLink = ({\n attributes,\n content,\n}: {\n attributes: { [attr: string]: any };\n content: string;\n}) => {\n const { href, ...props } = attributes;\n return (\n <Link to={href} {...props}>\n {content}\n </Link>\n );\n};\n\nexport interface LogLineProps {\n line: AnsiLine;\n classes: ReturnType<typeof useStyles>;\n searchText: string;\n highlightResultIndex?: number;\n}\n\nexport function LogLine({\n line,\n classes,\n searchText,\n highlightResultIndex,\n}: LogLineProps) {\n const chunks = useMemo(\n () => calculateHighlightedChunks(line, searchText),\n [line, searchText],\n );\n\n const elements = useMemo(\n () =>\n chunks.map(({ text, modifiers, highlight }, index) => (\n // eslint-disable-next-line react/forbid-elements\n <span\n key={index}\n className={classnames(\n getModifierClasses(classes, modifiers),\n highlight !== undefined &&\n (highlight === highlightResultIndex\n ? classes.textSelectedHighlight\n : classes.textHighlight),\n )}\n >\n <Linkify options={{ render: renderLink }}>{text}</Linkify>\n </span>\n )),\n [chunks, highlightResultIndex, classes],\n );\n\n return <>{elements}</>;\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 IconButton from '@material-ui/core/IconButton';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport ChevronLeftIcon from '@material-ui/icons/ChevronLeft';\nimport ChevronRightIcon from '@material-ui/icons/ChevronRight';\nimport FilterListIcon from '@material-ui/icons/FilterList';\nimport { LogViewerSearch } from './useLogViewerSearch';\n\nexport interface LogViewerControlsProps extends LogViewerSearch {}\n\nexport function LogViewerControls(props: LogViewerControlsProps) {\n const { resultCount, resultIndexStep, toggleShouldFilter } = props;\n const resultIndex = props.resultIndex ?? 0;\n\n const handleKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n if (event.metaKey || event.ctrlKey || event.altKey) {\n toggleShouldFilter();\n } else {\n resultIndexStep(event.shiftKey);\n }\n }\n };\n\n return (\n <>\n {resultCount !== undefined && (\n <>\n <IconButton size=\"small\" onClick={() => resultIndexStep(true)}>\n <ChevronLeftIcon />\n </IconButton>\n <Typography>\n {Math.min(resultIndex + 1, resultCount)}/{resultCount}\n </Typography>\n <IconButton size=\"small\" onClick={() => resultIndexStep()}>\n <ChevronRightIcon />\n </IconButton>\n </>\n )}\n <TextField\n size=\"small\"\n variant=\"standard\"\n placeholder=\"Search\"\n value={props.searchInput}\n onKeyPress={handleKeyPress}\n onChange={e => props.setSearchInput(e.target.value)}\n />\n <IconButton size=\"small\" onClick={toggleShouldFilter}>\n {props.shouldFilter ? (\n <FilterListIcon color=\"primary\" />\n ) : (\n <FilterListIcon color=\"disabled\" />\n )}\n </IconButton>\n </>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { alpha, makeStyles } from '@material-ui/core/styles';\nimport * as colors from '@material-ui/core/colors';\n\nexport const HEADER_SIZE = 40;\n\n/** @public Class keys for overriding LogViewer styles */\nexport type LogViewerClassKey =\n | 'root'\n | 'header'\n | 'log'\n | 'line'\n | 'lineSelected'\n | 'lineCopyButton'\n | 'lineNumber'\n | 'textHighlight'\n | 'textSelectedHighlight'\n | 'modifierBold'\n | 'modifierItalic'\n | 'modifierUnderline'\n | 'modifierForegroundBlack'\n | 'modifierForegroundRed'\n | 'modifierForegroundGreen'\n | 'modifierForegroundYellow'\n | 'modifierForegroundBlue'\n | 'modifierForegroundMagenta'\n | 'modifierForegroundCyan'\n | 'modifierForegroundWhite'\n | 'modifierForegroundGrey'\n | 'modifierBackgroundBlack'\n | 'modifierBackgroundRed'\n | 'modifierBackgroundGreen'\n | 'modifierBackgroundYellow'\n | 'modifierBackgroundBlue'\n | 'modifierBackgroundMagenta'\n | 'modifierBackgroundCyan'\n | 'modifierBackgroundWhite'\n | 'modifierBackgroundGrey';\n\nexport const useStyles = makeStyles(\n theme => ({\n root: {\n background: theme.palette.background.paper,\n },\n header: {\n height: HEADER_SIZE,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n },\n log: {\n fontFamily: '\"Monaco\", monospace',\n fontSize: theme.typography.pxToRem(12),\n },\n line: {\n position: 'relative',\n whiteSpace: 'pre',\n\n '&:hover': {\n background: theme.palette.action.hover,\n },\n },\n lineSelected: {\n background: theme.palette.action.selected,\n\n '&:hover': {\n background: theme.palette.action.selected,\n },\n },\n lineCopyButton: {\n position: 'absolute',\n paddingTop: 0,\n paddingBottom: 0,\n },\n lineNumber: {\n display: 'inline-block',\n textAlign: 'end',\n width: 60,\n marginRight: theme.spacing(1),\n cursor: 'pointer',\n },\n textHighlight: {\n background: alpha(theme.palette.info.main, 0.15),\n },\n textSelectedHighlight: {\n background: alpha(theme.palette.info.main, 0.4),\n },\n modifierBold: {\n fontWeight: theme.typography.fontWeightBold,\n },\n modifierItalic: {\n fontStyle: 'italic',\n },\n modifierUnderline: {\n textDecoration: 'underline',\n },\n modifierForegroundBlack: {\n color: colors.common.black,\n },\n modifierForegroundRed: {\n color: colors.red[500],\n },\n modifierForegroundGreen: {\n color: colors.green[500],\n },\n modifierForegroundYellow: {\n color: colors.yellow[500],\n },\n modifierForegroundBlue: {\n color: colors.blue[500],\n },\n modifierForegroundMagenta: {\n color: colors.purple[500],\n },\n modifierForegroundCyan: {\n color: colors.cyan[500],\n },\n modifierForegroundWhite: {\n color: colors.common.white,\n },\n modifierForegroundGrey: {\n color: colors.grey[500],\n },\n modifierBackgroundBlack: {\n background: colors.common.black,\n },\n modifierBackgroundRed: {\n background: colors.red[500],\n },\n modifierBackgroundGreen: {\n background: colors.green[500],\n },\n modifierBackgroundYellow: {\n background: colors.yellow[500],\n },\n modifierBackgroundBlue: {\n background: colors.blue[500],\n },\n modifierBackgroundMagenta: {\n background: colors.purple[500],\n },\n modifierBackgroundCyan: {\n background: colors.cyan[500],\n },\n modifierBackgroundWhite: {\n background: colors.common.white,\n },\n modifierBackgroundGrey: {\n background: colors.grey[500],\n },\n }),\n { name: 'BackstageLogViewer' },\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 { useMemo, useState } from 'react';\nimport { useToggle } from '@react-hookz/web';\nimport { AnsiLine } from './AnsiProcessor';\n\nexport function applySearchFilter(lines: AnsiLine[], searchText: string) {\n if (!searchText) {\n return { lines };\n }\n\n const matchingLines = [];\n const searchResults = [];\n for (const line of lines) {\n if (line.text.includes(searchText)) {\n matchingLines.push(line);\n\n let offset = 0;\n let lineResultIndex = 0;\n for (;;) {\n const start = line.text.indexOf(searchText, offset);\n if (start === -1) {\n break;\n }\n searchResults.push({\n lineNumber: line.lineNumber,\n lineIndex: lineResultIndex++,\n });\n offset = start + searchText.length;\n }\n }\n }\n\n return {\n lines: matchingLines,\n results: searchResults,\n };\n}\n\nexport interface LogViewerSearch {\n lines: AnsiLine[];\n\n searchText: string;\n searchInput: string;\n setSearchInput: (searchInput: string) => void;\n\n shouldFilter: boolean;\n toggleShouldFilter: () => void;\n\n resultCount: number | undefined;\n resultIndex: number | undefined;\n resultIndexStep: (decrement?: boolean) => void;\n\n resultLine: number | undefined;\n resultLineIndex: number | undefined;\n}\n\nexport function useLogViewerSearch(lines: AnsiLine[]): LogViewerSearch {\n const [searchInput, setSearchInput] = useState('');\n const searchText = searchInput.toLocaleLowerCase('en-US');\n\n const [resultIndex, setResultIndex] = useState<number>(0);\n\n const [shouldFilter, toggleShouldFilter] = useToggle(false);\n\n const filter = useMemo(\n () => applySearchFilter(lines, searchText),\n [lines, searchText],\n );\n\n const searchResult = filter.results\n ? filter.results[Math.min(resultIndex, filter.results.length - 1)]\n : undefined;\n const resultCount = filter.results?.length;\n\n const resultIndexStep = (decrement?: boolean) => {\n if (decrement) {\n if (resultCount !== undefined) {\n const next = Math.min(resultIndex - 1, resultCount - 2);\n setResultIndex(next < 0 ? resultCount - 1 : next);\n }\n } else {\n if (resultCount !== undefined) {\n const next = resultIndex + 1;\n setResultIndex(next >= resultCount ? 0 : next);\n }\n }\n };\n\n return {\n lines: shouldFilter ? filter.lines : lines,\n searchText,\n searchInput,\n setSearchInput,\n shouldFilter,\n toggleShouldFilter,\n resultCount,\n resultIndex,\n resultIndexStep,\n resultLine: searchResult?.lineNumber,\n resultLineIndex: searchResult?.lineIndex,\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 { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useEffect, useState } from 'react';\nimport useCopyToClipboard from 'react-use/lib/useCopyToClipboard';\nimport { AnsiLine } from './AnsiProcessor';\n\nexport function useLogViewerSelection(lines: AnsiLine[]) {\n const errorApi = useApi(errorApiRef);\n const [sel, setSelection] = useState<{ start: number; end: number }>();\n const start = sel ? Math.min(sel.start, sel.end) : undefined;\n const end = sel ? Math.max(sel.start, sel.end) : undefined;\n\n const [{ error }, copyToClipboard] = useCopyToClipboard();\n\n useEffect(() => {\n if (error) {\n errorApi.post(error);\n }\n }, [error, errorApi]);\n\n return {\n shouldShowButton(line: number) {\n return start === line || end === line;\n },\n isSelected(line: number) {\n if (!sel) {\n return false;\n }\n return start! <= line && line <= end!;\n },\n setSelection(line: number, add: boolean) {\n if (add) {\n setSelection(s =>\n s ? { start: s.start, end: line } : { start: line, end: line },\n );\n } else {\n setSelection(s =>\n s?.start === line && s?.end === line\n ? undefined\n : { start: line, end: line },\n );\n }\n },\n copySelection() {\n if (sel) {\n const copyText = lines\n .slice(Math.min(sel.start, sel.end) - 1, Math.max(sel.start, sel.end))\n .map(l => l.chunks.map(c => c.text).join(''))\n .join('\\n');\n copyToClipboard(copyText);\n setSelection(undefined);\n }\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 Box from '@material-ui/core/Box';\nimport IconButton from '@material-ui/core/IconButton';\nimport CopyIcon from '@material-ui/icons/FileCopy';\nimport classnames from 'classnames';\nimport React, { useEffect, useMemo, useRef } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport AutoSizer from 'react-virtualized-auto-sizer';\nimport { FixedSizeList } from 'react-window';\n\nimport { AnsiProcessor } from './AnsiProcessor';\nimport { LogLine } from './LogLine';\nimport { LogViewerControls } from './LogViewerControls';\nimport { HEADER_SIZE, useStyles } from './styles';\nimport { useLogViewerSearch } from './useLogViewerSearch';\nimport { useLogViewerSelection } from './useLogViewerSelection';\n\nexport interface RealLogViewerProps {\n text: string;\n classes?: { root?: string };\n}\n\nexport function RealLogViewer(props: RealLogViewerProps) {\n const classes = useStyles({ classes: props.classes });\n const listRef = useRef<FixedSizeList | null>(null);\n\n // The processor keeps state that optimizes appending to the text\n const processor = useMemo(() => new AnsiProcessor(), []);\n const lines = processor.process(props.text);\n\n const search = useLogViewerSearch(lines);\n const selection = useLogViewerSelection(lines);\n const location = useLocation();\n\n useEffect(() => {\n if (search.resultLine !== undefined && listRef.current) {\n listRef.current.scrollToItem(search.resultLine - 1, 'center');\n }\n }, [search.resultLine]);\n\n useEffect(() => {\n if (location.hash) {\n // #line-6 -> 6\n const line = parseInt(location.hash.replace(/\\D/g, ''), 10);\n selection.setSelection(line, false);\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n const handleSelectLine = (\n line: number,\n event: { shiftKey: boolean; preventDefault: () => void },\n ) => {\n selection.setSelection(line, event.shiftKey);\n };\n\n return (\n <AutoSizer>\n {({ height, width }) => (\n <Box style={{ width, height }} className={classes.root}>\n <Box className={classes.header}>\n <LogViewerControls {...search} />\n </Box>\n <FixedSizeList\n ref={listRef}\n className={classes.log}\n height={(height || 480) - HEADER_SIZE}\n width={width || 640}\n itemData={search.lines}\n itemSize={20}\n itemCount={search.lines.length}\n >\n {({ index, style, data }) => {\n const line = data[index];\n const { lineNumber } = line;\n return (\n <Box\n style={{ ...style }}\n className={classnames(classes.line, {\n [classes.lineSelected]: selection.isSelected(lineNumber),\n })}\n >\n {selection.shouldShowButton(lineNumber) && (\n <IconButton\n data-testid=\"copy-button\"\n size=\"small\"\n className={classes.lineCopyButton}\n onClick={() => selection.copySelection()}\n >\n <CopyIcon fontSize=\"inherit\" />\n </IconButton>\n )}\n <a\n role=\"row\"\n target=\"_self\"\n href={`#line-${lineNumber}`}\n className={classes.lineNumber}\n onClick={event => handleSelectLine(lineNumber, event)}\n onKeyPress={event => handleSelectLine(lineNumber, event)}\n >\n {lineNumber}\n </a>\n <LogLine\n line={line}\n classes={classes}\n searchText={search.searchText}\n highlightResultIndex={\n search.resultLine === lineNumber\n ? search.resultLineIndex\n : undefined\n }\n />\n </Box>\n );\n }}\n </FixedSizeList>\n </Box>\n )}\n </AutoSizer>\n );\n}\n"],"names":["ansiRegex","ansiRegexMaker","newlineRegex","codeModifiers","Object","fromEntries","entries","m","bold","italic","underline","_","foreground","background","map","code","modifier","AnsiLine","lastChunk","chunks","length","replaceLastChunk","newChunks","splice","text","c","join","toLocaleLowerCase","constructor","lineNumber","AnsiProcessor","process","lines","startsWith","lastLine","newLines","lastLineIndex","processLines","slice","modifiers","push","startingLineNumber","currentModifiers","currentLineNumber","prevIndex","lastIndex","match","exec","processText","line","index","fullText","processCode","getModifierClasses","classes","classNames","Array","modifierBold","modifierItalic","modifierUnderline","key","startCase","undefined","findSearchResults","searchText","includes","searchResults","offset","start","indexOf","end","calculateHighlightedChunks","results","lineOffset","resultIndex","result","chunk","localOffset","localStart","Math","max","localEnd","min","highlight","renderLink","attributes","content","href","props","Link","to","LogLine","highlightResultIndex","useMemo","elements","span","className","classnames","textSelectedHighlight","textHighlight","Linkify","options","render","LogViewerControls","resultCount","resultIndexStep","toggleShouldFilter","handleKeyPress","event","metaKey","ctrlKey","altKey","shiftKey","IconButton","size","onClick","ChevronLeftIcon","Typography","ChevronRightIcon","TextField","variant","placeholder","value","searchInput","onKeyPress","onChange","e","setSearchInput","target","shouldFilter","FilterListIcon","color","HEADER_SIZE","useStyles","makeStyles","theme","root","palette","paper","header","height","display","alignItems","justifyContent","log","fontFamily","fontSize","typography","pxToRem","position","whiteSpace","action","hover","lineSelected","selected","lineCopyButton","paddingTop","paddingBottom","textAlign","width","marginRight","spacing","cursor","alpha","info","main","fontWeight","fontWeightBold","fontStyle","textDecoration","modifierForegroundBlack","colors","black","modifierForegroundRed","modifierForegroundGreen","modifierForegroundYellow","modifierForegroundBlue","modifierForegroundMagenta","modifierForegroundCyan","modifierForegroundWhite","white","modifierForegroundGrey","modifierBackgroundBlack","modifierBackgroundRed","modifierBackgroundGreen","modifierBackgroundYellow","modifierBackgroundBlue","modifierBackgroundMagenta","modifierBackgroundCyan","modifierBackgroundWhite","modifierBackgroundGrey","name","applySearchFilter","matchingLines","lineResultIndex","lineIndex","useLogViewerSearch","filter","searchResult","useState","setResultIndex","useToggle","decrement","next","resultLine","resultLineIndex","useLogViewerSelection","errorApi","useApi","errorApiRef","sel","setSelection","error","copyToClipboard","useCopyToClipboard","useEffect","post","shouldShowButton","isSelected","add","s","copySelection","copyText","l","RealLogViewer","listRef","useRef","search","selection","location","useLocation","current","scrollToItem","hash","parseInt","replace","handleSelectLine","AutoSizer","Box","style","FixedSizeList","ref","itemData","itemSize","itemCount","data","data-testid","CopyIcon","a","role"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"static/6051.9a397327.chunk.js","mappings":"4UAkBA,MAAMA,KAAYC,EAAAA,GAAe,EAC3BC,EAAe,SAGfC,EAAgBC,OAAOC,YAC3BD,OAAOE,QAAQ,CACb,EAAGC,IAAM,CAAE,GAAGA,EAAGC,KAAM,EAAK,GAC5B,EAAGD,IAAM,CAAE,GAAGA,EAAGE,OAAQ,EAAK,GAC9B,EAAGF,IAAM,CAAE,GAAGA,EAAGG,UAAW,EAAK,GACjC,GAAI,CAAC,CAAEF,KAAMG,EAAG,GAAGJ,CAAE,IAAMA,EAC3B,GAAI,CAAC,CAAEE,OAAQE,EAAG,GAAGJ,CAAE,IAAMA,EAC7B,GAAI,CAAC,CAAEG,UAAWC,EAAG,GAAGJ,CAAE,IAAMA,EAChC,GAAIA,IAAM,CAAE,GAAGA,EAAGK,WAAY,OAAQ,GACtC,GAAIL,IAAM,CAAE,GAAGA,EAAGK,WAAY,KAAM,GACpC,GAAIL,IAAM,CAAE,GAAGA,EAAGK,WAAY,OAAQ,GACtC,GAAIL,IAAM,CAAE,GAAGA,EAAGK,WAAY,QAAS,GACvC,GAAIL,IAAM,CAAE,GAAGA,EAAGK,WAAY,MAAO,GACrC,GAAIL,IAAM,CAAE,GAAGA,EAAGK,WAAY,SAAU,GACxC,GAAIL,IAAM,CAAE,GAAGA,EAAGK,WAAY,MAAO,GACrC,GAAIL,IAAM,CAAE,GAAGA,EAAGK,WAAY,OAAQ,GACtC,GAAI,CAAC,CAAEA,WAAYD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OnK,WACnB4B,qBACEuI,EAAOvB,aAAe/K,EAClBsM,EAAOtB,gBACP/I,M,KAKd,C,OAMZ,C","sources":["webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/AnsiProcessor.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/LogLine.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/LogViewerControls.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/styles.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/useLogViewerSearch.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/useLogViewerSelection.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/RealLogViewer.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 ansiRegexMaker from 'ansi-regex';\n\nconst ansiRegex = ansiRegexMaker();\nconst newlineRegex = /\\n\\r?/g;\n\n// A mapping of how each escape code changes the modifiers\nconst codeModifiers = Object.fromEntries(\n Object.entries({\n 1: m => ({ ...m, bold: true }),\n 3: m => ({ ...m, italic: true }),\n 4: m => ({ ...m, underline: true }),\n 22: ({ bold: _, ...m }) => m,\n 23: ({ italic: _, ...m }) => m,\n 24: ({ underline: _, ...m }) => m,\n 30: m => ({ ...m, foreground: 'black' }),\n 31: m => ({ ...m, foreground: 'red' }),\n 32: m => ({ ...m, foreground: 'green' }),\n 33: m => ({ ...m, foreground: 'yellow' }),\n 34: m => ({ ...m, foreground: 'blue' }),\n 35: m => ({ ...m, foreground: 'magenta' }),\n 36: m => ({ ...m, foreground: 'cyan' }),\n 37: m => ({ ...m, foreground: 'white' }),\n 39: ({ foreground: _, ...m }) => m,\n 90: m => ({ ...m, foreground: 'grey' }),\n 40: m => ({ ...m, background: 'black' }),\n 41: m => ({ ...m, background: 'red' }),\n 42: m => ({ ...m, background: 'green' }),\n 43: m => ({ ...m, background: 'yellow' }),\n 44: m => ({ ...m, background: 'blue' }),\n 45: m => ({ ...m, background: 'magenta' }),\n 46: m => ({ ...m, background: 'cyan' }),\n 47: m => ({ ...m, background: 'white' }),\n 49: ({ background: _, ...m }) => m,\n } as Record<string, (m: ChunkModifiers) => ChunkModifiers>).map(\n ([code, modifier]) => [`\\x1b[${code}m`, modifier],\n ),\n);\n\nexport type AnsiColor =\n | 'black'\n | 'red'\n | 'green'\n | 'yellow'\n | 'blue'\n | 'magenta'\n | 'cyan'\n | 'white'\n | 'grey';\n\nexport interface ChunkModifiers {\n foreground?: AnsiColor;\n background?: AnsiColor;\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n}\n\nexport interface AnsiChunk {\n text: string;\n modifiers: ChunkModifiers;\n}\n\nexport class AnsiLine {\n text: string;\n\n constructor(\n readonly lineNumber: number = 1,\n readonly chunks: AnsiChunk[] = [],\n ) {\n this.text = chunks\n .map(c => c.text)\n .join('')\n .toLocaleLowerCase('en-US');\n }\n\n lastChunk(): AnsiChunk | undefined {\n return this.chunks[this.chunks.length - 1];\n }\n\n replaceLastChunk(newChunks?: AnsiChunk[]) {\n if (newChunks) {\n this.chunks.splice(this.chunks.length - 1, 1, ...newChunks);\n this.text = this.chunks\n .map(c => c.text)\n .join('')\n .toLocaleLowerCase('en-US');\n }\n }\n}\n\nexport class AnsiProcessor {\n private text: string = '';\n private lines: AnsiLine[] = [];\n\n /**\n * Processes a chunk of text while keeping internal state that optimizes\n * subsequent processing that appends to the text.\n */\n process(text: string): AnsiLine[] {\n if (this.text === text) {\n return this.lines;\n }\n\n if (text.startsWith(this.text)) {\n const lastLineIndex = this.lines.length > 0 ? this.lines.length - 1 : 0;\n const lastLine = this.lines[lastLineIndex] ?? new AnsiLine();\n const lastChunk = lastLine.lastChunk();\n\n const newLines = this.processLines(\n (lastChunk?.text ?? '') + text.slice(this.text.length),\n lastChunk?.modifiers,\n lastLine?.lineNumber,\n );\n lastLine.replaceLastChunk(newLines[0]?.chunks);\n\n this.lines[lastLineIndex] = lastLine;\n this.lines.push(...newLines.slice(1));\n } else {\n this.lines = this.processLines(text);\n }\n this.text = text;\n\n return this.lines;\n }\n\n // Split a chunk of text up into lines and process each line individually\n private processLines = (\n text: string,\n modifiers: ChunkModifiers = {},\n startingLineNumber: number = 1,\n ): AnsiLine[] => {\n const lines: AnsiLine[] = [];\n\n let currentModifiers = modifiers;\n let currentLineNumber = startingLineNumber;\n\n let prevIndex = 0;\n newlineRegex.lastIndex = 0;\n for (;;) {\n const match = newlineRegex.exec(text);\n if (!match) {\n const chunks = this.processText(\n text.slice(prevIndex),\n currentModifiers,\n );\n lines.push(new AnsiLine(currentLineNumber, chunks));\n return lines;\n }\n\n const line = text.slice(prevIndex, match.index);\n prevIndex = match.index + match[0].length;\n\n const chunks = this.processText(line, currentModifiers);\n lines.push(new AnsiLine(currentLineNumber, chunks));\n\n // Modifiers that are active in the last chunk are carried over to the next line\n currentModifiers =\n chunks[chunks.length - 1].modifiers ?? currentModifiers;\n currentLineNumber += 1;\n }\n };\n\n // Processing of a one individual text chunk\n private processText = (\n fullText: string,\n modifiers: ChunkModifiers,\n ): AnsiChunk[] => {\n const chunks: AnsiChunk[] = [];\n\n let currentModifiers = modifiers;\n\n let prevIndex = 0;\n ansiRegex.lastIndex = 0;\n for (;;) {\n const match = ansiRegex.exec(fullText);\n if (!match) {\n chunks.push({\n text: fullText.slice(prevIndex),\n modifiers: currentModifiers,\n });\n return chunks;\n }\n\n const text = fullText.slice(prevIndex, match.index);\n chunks.push({ text, modifiers: currentModifiers });\n\n // For every escape code that we encounter we keep track of where the\n // next chunk of text starts, and what modifiers it has\n prevIndex = match.index + match[0].length;\n currentModifiers = this.processCode(match[0], currentModifiers);\n }\n };\n\n private processCode = (\n code: string,\n modifiers: ChunkModifiers,\n ): ChunkModifiers => {\n return codeModifiers[code]?.(modifiers) ?? modifiers;\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, { useMemo } from 'react';\nimport { AnsiChunk, AnsiLine, ChunkModifiers } from './AnsiProcessor';\nimport startCase from 'lodash/startCase';\nimport classnames from 'classnames';\nimport { useStyles } from './styles';\nimport Linkify from 'linkify-react';\nimport { Link } from '../Link';\n\nexport function getModifierClasses(\n classes: ReturnType<typeof useStyles>,\n modifiers: ChunkModifiers,\n) {\n const classNames = new Array<string>();\n if (modifiers.bold) {\n classNames.push(classes.modifierBold);\n }\n if (modifiers.italic) {\n classNames.push(classes.modifierItalic);\n }\n if (modifiers.underline) {\n classNames.push(classes.modifierUnderline);\n }\n if (modifiers.foreground) {\n const key = `modifierForeground${startCase(\n modifiers.foreground,\n )}` as keyof typeof classes;\n classNames.push(classes[key]);\n }\n if (modifiers.background) {\n const key = `modifierBackground${startCase(\n modifiers.background,\n )}` as keyof typeof classes;\n classNames.push(classes[key]);\n }\n return classNames.length > 0 ? classNames.join(' ') : undefined;\n}\n\nexport function findSearchResults(text: string, searchText: string) {\n if (!searchText || !text.includes(searchText)) {\n return undefined;\n }\n const searchResults = new Array<{ start: number; end: number }>();\n let offset = 0;\n for (;;) {\n const start = text.indexOf(searchText, offset);\n if (start === -1) {\n break;\n }\n const end = start + searchText.length;\n searchResults.push({ start, end });\n offset = end;\n }\n return searchResults;\n}\n\nexport interface HighlightAnsiChunk extends AnsiChunk {\n highlight?: number;\n}\n\nexport function calculateHighlightedChunks(\n line: AnsiLine,\n searchText: string,\n): HighlightAnsiChunk[] {\n const results = findSearchResults(line.text, searchText);\n if (!results) {\n return line.chunks;\n }\n\n const chunks = new Array<HighlightAnsiChunk>();\n\n let lineOffset = 0;\n let resultIndex = 0;\n let result = results[resultIndex];\n for (const chunk of line.chunks) {\n const { text, modifiers } = chunk;\n if (!result || lineOffset + text.length < result.start) {\n chunks.push(chunk);\n lineOffset += text.length;\n continue;\n }\n\n let localOffset = 0;\n while (result) {\n const localStart = Math.max(result.start - lineOffset, 0);\n if (localStart > text.length) {\n break; // The next result is not in this chunk\n }\n\n const localEnd = Math.min(result.end - lineOffset, text.length);\n\n const hasTextBeforeResult = localStart > localOffset;\n if (hasTextBeforeResult) {\n chunks.push({ text: text.slice(localOffset, localStart), modifiers });\n }\n const hasResultText = localEnd > localStart;\n if (hasResultText) {\n chunks.push({\n modifiers,\n highlight: resultIndex,\n text: text.slice(localStart, localEnd),\n });\n }\n\n localOffset = localEnd;\n\n const foundCompleteResult = result.end - lineOffset === localEnd;\n if (foundCompleteResult) {\n resultIndex += 1;\n result = results[resultIndex];\n } else {\n break; // The rest of the result is in the following chunks\n }\n }\n\n const hasTextAfterResult = localOffset < text.length;\n if (hasTextAfterResult) {\n chunks.push({ text: text.slice(localOffset), modifiers });\n }\n\n lineOffset += text.length;\n }\n\n return chunks;\n}\n\nconst renderLink = ({\n attributes,\n content,\n}: {\n attributes: { [attr: string]: any };\n content: string;\n}) => {\n const { href, ...props } = attributes;\n return (\n <Link to={href} {...props}>\n {content}\n </Link>\n );\n};\n\nexport interface LogLineProps {\n line: AnsiLine;\n classes: ReturnType<typeof useStyles>;\n searchText: string;\n highlightResultIndex?: number;\n}\n\nexport function LogLine({\n line,\n classes,\n searchText,\n highlightResultIndex,\n}: LogLineProps) {\n const chunks = useMemo(\n () => calculateHighlightedChunks(line, searchText),\n [line, searchText],\n );\n\n const elements = useMemo(\n () =>\n chunks.map(({ text, modifiers, highlight }, index) => (\n // eslint-disable-next-line react/forbid-elements\n <span\n key={index}\n className={classnames(\n getModifierClasses(classes, modifiers),\n highlight !== undefined &&\n (highlight === highlightResultIndex\n ? classes.textSelectedHighlight\n : classes.textHighlight),\n )}\n >\n <Linkify options={{ render: renderLink }}>{text}</Linkify>\n </span>\n )),\n [chunks, highlightResultIndex, classes],\n );\n\n return <>{elements}</>;\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 IconButton from '@material-ui/core/IconButton';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport ChevronLeftIcon from '@material-ui/icons/ChevronLeft';\nimport ChevronRightIcon from '@material-ui/icons/ChevronRight';\nimport FilterListIcon from '@material-ui/icons/FilterList';\nimport { LogViewerSearch } from './useLogViewerSearch';\n\nexport interface LogViewerControlsProps extends LogViewerSearch {}\n\nexport function LogViewerControls(props: LogViewerControlsProps) {\n const { resultCount, resultIndexStep, toggleShouldFilter } = props;\n const resultIndex = props.resultIndex ?? 0;\n\n const handleKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n if (event.metaKey || event.ctrlKey || event.altKey) {\n toggleShouldFilter();\n } else {\n resultIndexStep(event.shiftKey);\n }\n }\n };\n\n return (\n <>\n {resultCount !== undefined && (\n <>\n <IconButton size=\"small\" onClick={() => resultIndexStep(true)}>\n <ChevronLeftIcon />\n </IconButton>\n <Typography>\n {Math.min(resultIndex + 1, resultCount)}/{resultCount}\n </Typography>\n <IconButton size=\"small\" onClick={() => resultIndexStep()}>\n <ChevronRightIcon />\n </IconButton>\n </>\n )}\n <TextField\n size=\"small\"\n variant=\"standard\"\n placeholder=\"Search\"\n value={props.searchInput}\n onKeyPress={handleKeyPress}\n onChange={e => props.setSearchInput(e.target.value)}\n />\n <IconButton size=\"small\" onClick={toggleShouldFilter}>\n {props.shouldFilter ? (\n <FilterListIcon color=\"primary\" />\n ) : (\n <FilterListIcon color=\"disabled\" />\n )}\n </IconButton>\n </>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { alpha, makeStyles } from '@material-ui/core/styles';\nimport * as colors from '@material-ui/core/colors';\n\nexport const HEADER_SIZE = 40;\n\n/** @public Class keys for overriding LogViewer styles */\nexport type LogViewerClassKey =\n | 'root'\n | 'header'\n | 'log'\n | 'line'\n | 'lineSelected'\n | 'lineCopyButton'\n | 'lineNumber'\n | 'textHighlight'\n | 'textSelectedHighlight'\n | 'modifierBold'\n | 'modifierItalic'\n | 'modifierUnderline'\n | 'modifierForegroundBlack'\n | 'modifierForegroundRed'\n | 'modifierForegroundGreen'\n | 'modifierForegroundYellow'\n | 'modifierForegroundBlue'\n | 'modifierForegroundMagenta'\n | 'modifierForegroundCyan'\n | 'modifierForegroundWhite'\n | 'modifierForegroundGrey'\n | 'modifierBackgroundBlack'\n | 'modifierBackgroundRed'\n | 'modifierBackgroundGreen'\n | 'modifierBackgroundYellow'\n | 'modifierBackgroundBlue'\n | 'modifierBackgroundMagenta'\n | 'modifierBackgroundCyan'\n | 'modifierBackgroundWhite'\n | 'modifierBackgroundGrey';\n\nexport const useStyles = makeStyles(\n theme => ({\n root: {\n background: theme.palette.background.paper,\n },\n header: {\n height: HEADER_SIZE,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n },\n log: {\n fontFamily: '\"Monaco\", monospace',\n fontSize: theme.typography.pxToRem(12),\n },\n line: {\n position: 'relative',\n whiteSpace: 'pre',\n\n '&:hover': {\n background: theme.palette.action.hover,\n },\n },\n lineSelected: {\n background: theme.palette.action.selected,\n\n '&:hover': {\n background: theme.palette.action.selected,\n },\n },\n lineCopyButton: {\n position: 'absolute',\n paddingTop: 0,\n paddingBottom: 0,\n },\n lineNumber: {\n display: 'inline-block',\n textAlign: 'end',\n width: 60,\n marginRight: theme.spacing(1),\n cursor: 'pointer',\n },\n textHighlight: {\n background: alpha(theme.palette.info.main, 0.15),\n },\n textSelectedHighlight: {\n background: alpha(theme.palette.info.main, 0.4),\n },\n modifierBold: {\n fontWeight: theme.typography.fontWeightBold,\n },\n modifierItalic: {\n fontStyle: 'italic',\n },\n modifierUnderline: {\n textDecoration: 'underline',\n },\n modifierForegroundBlack: {\n color: colors.common.black,\n },\n modifierForegroundRed: {\n color: colors.red[500],\n },\n modifierForegroundGreen: {\n color: colors.green[500],\n },\n modifierForegroundYellow: {\n color: colors.yellow[500],\n },\n modifierForegroundBlue: {\n color: colors.blue[500],\n },\n modifierForegroundMagenta: {\n color: colors.purple[500],\n },\n modifierForegroundCyan: {\n color: colors.cyan[500],\n },\n modifierForegroundWhite: {\n color: colors.common.white,\n },\n modifierForegroundGrey: {\n color: colors.grey[500],\n },\n modifierBackgroundBlack: {\n background: colors.common.black,\n },\n modifierBackgroundRed: {\n background: colors.red[500],\n },\n modifierBackgroundGreen: {\n background: colors.green[500],\n },\n modifierBackgroundYellow: {\n background: colors.yellow[500],\n },\n modifierBackgroundBlue: {\n background: colors.blue[500],\n },\n modifierBackgroundMagenta: {\n background: colors.purple[500],\n },\n modifierBackgroundCyan: {\n background: colors.cyan[500],\n },\n modifierBackgroundWhite: {\n background: colors.common.white,\n },\n modifierBackgroundGrey: {\n background: colors.grey[500],\n },\n }),\n { name: 'BackstageLogViewer' },\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 { useMemo, useState } from 'react';\nimport { useToggle } from '@react-hookz/web';\nimport { AnsiLine } from './AnsiProcessor';\n\nexport function applySearchFilter(lines: AnsiLine[], searchText: string) {\n if (!searchText) {\n return { lines };\n }\n\n const matchingLines = [];\n const searchResults = [];\n for (const line of lines) {\n if (line.text.includes(searchText)) {\n matchingLines.push(line);\n\n let offset = 0;\n let lineResultIndex = 0;\n for (;;) {\n const start = line.text.indexOf(searchText, offset);\n if (start === -1) {\n break;\n }\n searchResults.push({\n lineNumber: line.lineNumber,\n lineIndex: lineResultIndex++,\n });\n offset = start + searchText.length;\n }\n }\n }\n\n return {\n lines: matchingLines,\n results: searchResults,\n };\n}\n\nexport interface LogViewerSearch {\n lines: AnsiLine[];\n\n searchText: string;\n searchInput: string;\n setSearchInput: (searchInput: string) => void;\n\n shouldFilter: boolean;\n toggleShouldFilter: () => void;\n\n resultCount: number | undefined;\n resultIndex: number | undefined;\n resultIndexStep: (decrement?: boolean) => void;\n\n resultLine: number | undefined;\n resultLineIndex: number | undefined;\n}\n\nexport function useLogViewerSearch(lines: AnsiLine[]): LogViewerSearch {\n const [searchInput, setSearchInput] = useState('');\n const searchText = searchInput.toLocaleLowerCase('en-US');\n\n const [resultIndex, setResultIndex] = useState<number>(0);\n\n const [shouldFilter, toggleShouldFilter] = useToggle(false);\n\n const filter = useMemo(\n () => applySearchFilter(lines, searchText),\n [lines, searchText],\n );\n\n const searchResult = filter.results\n ? filter.results[Math.min(resultIndex, filter.results.length - 1)]\n : undefined;\n const resultCount = filter.results?.length;\n\n const resultIndexStep = (decrement?: boolean) => {\n if (decrement) {\n if (resultCount !== undefined) {\n const next = Math.min(resultIndex - 1, resultCount - 2);\n setResultIndex(next < 0 ? resultCount - 1 : next);\n }\n } else {\n if (resultCount !== undefined) {\n const next = resultIndex + 1;\n setResultIndex(next >= resultCount ? 0 : next);\n }\n }\n };\n\n return {\n lines: shouldFilter ? filter.lines : lines,\n searchText,\n searchInput,\n setSearchInput,\n shouldFilter,\n toggleShouldFilter,\n resultCount,\n resultIndex,\n resultIndexStep,\n resultLine: searchResult?.lineNumber,\n resultLineIndex: searchResult?.lineIndex,\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 { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useEffect, useState } from 'react';\nimport useCopyToClipboard from 'react-use/lib/useCopyToClipboard';\nimport { AnsiLine } from './AnsiProcessor';\n\nexport function useLogViewerSelection(lines: AnsiLine[]) {\n const errorApi = useApi(errorApiRef);\n const [sel, setSelection] = useState<{ start: number; end: number }>();\n const start = sel ? Math.min(sel.start, sel.end) : undefined;\n const end = sel ? Math.max(sel.start, sel.end) : undefined;\n\n const [{ error }, copyToClipboard] = useCopyToClipboard();\n\n useEffect(() => {\n if (error) {\n errorApi.post(error);\n }\n }, [error, errorApi]);\n\n return {\n shouldShowButton(line: number) {\n return start === line || end === line;\n },\n isSelected(line: number) {\n if (!sel) {\n return false;\n }\n return start! <= line && line <= end!;\n },\n setSelection(line: number, add: boolean) {\n if (add) {\n setSelection(s =>\n s ? { start: s.start, end: line } : { start: line, end: line },\n );\n } else {\n setSelection(s =>\n s?.start === line && s?.end === line\n ? undefined\n : { start: line, end: line },\n );\n }\n },\n copySelection() {\n if (sel) {\n const copyText = lines\n .slice(Math.min(sel.start, sel.end) - 1, Math.max(sel.start, sel.end))\n .map(l => l.chunks.map(c => c.text).join(''))\n .join('\\n');\n copyToClipboard(copyText);\n setSelection(undefined);\n }\n },\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport IconButton from '@material-ui/core/IconButton';\nimport CopyIcon from '@material-ui/icons/FileCopy';\nimport classnames from 'classnames';\nimport React, { useEffect, useMemo, useRef } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport AutoSizer from 'react-virtualized-auto-sizer';\nimport { FixedSizeList } from 'react-window';\n\nimport { AnsiProcessor } from './AnsiProcessor';\nimport { LogLine } from './LogLine';\nimport { LogViewerControls } from './LogViewerControls';\nimport { HEADER_SIZE, useStyles } from './styles';\nimport { useLogViewerSearch } from './useLogViewerSearch';\nimport { useLogViewerSelection } from './useLogViewerSelection';\n\nexport interface RealLogViewerProps {\n text: string;\n classes?: { root?: string };\n}\n\nexport function RealLogViewer(props: RealLogViewerProps) {\n const classes = useStyles({ classes: props.classes });\n const listRef = useRef<FixedSizeList | null>(null);\n\n // The processor keeps state that optimizes appending to the text\n const processor = useMemo(() => new AnsiProcessor(), []);\n const lines = processor.process(props.text);\n\n const search = useLogViewerSearch(lines);\n const selection = useLogViewerSelection(lines);\n const location = useLocation();\n\n useEffect(() => {\n if (search.resultLine !== undefined && listRef.current) {\n listRef.current.scrollToItem(search.resultLine - 1, 'center');\n }\n }, [search.resultLine]);\n\n useEffect(() => {\n if (location.hash) {\n // #line-6 -> 6\n const line = parseInt(location.hash.replace(/\\D/g, ''), 10);\n selection.setSelection(line, false);\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n const handleSelectLine = (\n line: number,\n event: { shiftKey: boolean; preventDefault: () => void },\n ) => {\n selection.setSelection(line, event.shiftKey);\n };\n\n return (\n <AutoSizer>\n {({ height, width }: { height?: number; width?: number }) => (\n <Box style={{ width, height }} className={classes.root}>\n <Box className={classes.header}>\n <LogViewerControls {...search} />\n </Box>\n <FixedSizeList\n ref={listRef}\n className={classes.log}\n height={(height || 480) - HEADER_SIZE}\n width={width || 640}\n itemData={search.lines}\n itemSize={20}\n itemCount={search.lines.length}\n >\n {({ index, style, data }) => {\n const line = data[index];\n const { lineNumber } = line;\n return (\n <Box\n style={{ ...style }}\n className={classnames(classes.line, {\n [classes.lineSelected]: selection.isSelected(lineNumber),\n })}\n >\n {selection.shouldShowButton(lineNumber) && (\n <IconButton\n data-testid=\"copy-button\"\n size=\"small\"\n className={classes.lineCopyButton}\n onClick={() => selection.copySelection()}\n >\n <CopyIcon fontSize=\"inherit\" />\n </IconButton>\n )}\n <a\n role=\"row\"\n target=\"_self\"\n href={`#line-${lineNumber}`}\n className={classes.lineNumber}\n onClick={event => handleSelectLine(lineNumber, event)}\n onKeyPress={event => handleSelectLine(lineNumber, event)}\n >\n {lineNumber}\n </a>\n <LogLine\n line={line}\n classes={classes}\n searchText={search.searchText}\n highlightResultIndex={\n search.resultLine === lineNumber\n ? search.resultLineIndex\n : undefined\n }\n />\n </Box>\n );\n }}\n </FixedSizeList>\n </Box>\n )}\n </AutoSizer>\n );\n}\n"],"names":["ansiRegex","ansiRegexMaker","newlineRegex","codeModifiers","Object","fromEntries","entries","m","bold","italic","underline","_","foreground","background","map","code","modifier","AnsiLine","lastChunk","chunks","length","replaceLastChunk","newChunks","splice","text","c","join","toLocaleLowerCase","constructor","lineNumber","AnsiProcessor","process","lines","startsWith","lastLine","newLines","lastLineIndex","processLines","slice","modifiers","push","startingLineNumber","currentModifiers","currentLineNumber","prevIndex","lastIndex","match","exec","processText","line","index","fullText","processCode","getModifierClasses","classes","classNames","Array","modifierBold","modifierItalic","modifierUnderline","key","startCase","undefined","findSearchResults","searchText","includes","searchResults","offset","start","indexOf","end","calculateHighlightedChunks","results","lineOffset","resultIndex","result","chunk","localOffset","localStart","Math","max","localEnd","min","highlight","renderLink","attributes","content","href","props","Link","to","LogLine","highlightResultIndex","useMemo","elements","span","className","classnames","textSelectedHighlight","textHighlight","Linkify","options","render","LogViewerControls","resultCount","resultIndexStep","toggleShouldFilter","handleKeyPress","event","metaKey","ctrlKey","altKey","shiftKey","IconButton","size","onClick","ChevronLeftIcon","Typography","ChevronRightIcon","TextField","variant","placeholder","value","searchInput","onKeyPress","onChange","e","setSearchInput","target","shouldFilter","FilterListIcon","color","HEADER_SIZE","useStyles","makeStyles","theme","root","palette","paper","header","height","display","alignItems","justifyContent","log","fontFamily","fontSize","typography","pxToRem","position","whiteSpace","action","hover","lineSelected","selected","lineCopyButton","paddingTop","paddingBottom","textAlign","width","marginRight","spacing","cursor","alpha","info","main","fontWeight","fontWeightBold","fontStyle","textDecoration","modifierForegroundBlack","colors","black","modifierForegroundRed","modifierForegroundGreen","modifierForegroundYellow","modifierForegroundBlue","modifierForegroundMagenta","modifierForegroundCyan","modifierForegroundWhite","white","modifierForegroundGrey","modifierBackgroundBlack","modifierBackgroundRed","modifierBackgroundGreen","modifierBackgroundYellow","modifierBackgroundBlue","modifierBackgroundMagenta","modifierBackgroundCyan","modifierBackgroundWhite","modifierBackgroundGrey","name","applySearchFilter","matchingLines","lineResultIndex","lineIndex","useLogViewerSearch","filter","searchResult","useState","setResultIndex","useToggle","decrement","next","resultLine","resultLineIndex","useLogViewerSelection","errorApi","useApi","errorApiRef","sel","setSelection","error","copyToClipboard","useCopyToClipboard","useEffect","post","shouldShowButton","isSelected","add","s","copySelection","copyText","l","RealLogViewer","listRef","useRef","search","selection","location","useLocation","current","scrollToItem","hash","parseInt","replace","handleSelectLine","AutoSizer","Box","style","FixedSizeList","ref","itemData","itemSize","itemCount","data","data-testid","CopyIcon","a","role"],"sourceRoot":""}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
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
2
|
|
|
3
|
-
//# sourceMappingURL=732.
|
|
3
|
+
//# sourceMappingURL=732.b079cbc6.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static/732.
|
|
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/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ded-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":""}
|