@techdocs/cli 0.0.0-nightly-20231120021609 → 0.0.0-nightly-20231121021721
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 +7 -3
- package/dist/cjs/{generate-5fb2bc8c.cjs.js → generate-f9a039d6.cjs.js} +3 -2
- package/dist/cjs/{generate-5fb2bc8c.cjs.js.map → generate-f9a039d6.cjs.js.map} +1 -1
- package/dist/embedded-app/.config-schema.json +22 -22
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/1600.a5f04dd3.chunk.js +3 -0
- package/dist/embedded-app/static/1600.a5f04dd3.chunk.js.map +1 -0
- package/dist/embedded-app/static/{3510.6d8cb98c.chunk.js → 3510.3082d0d9.chunk.js} +1 -1
- package/dist/embedded-app/static/{3510.6d8cb98c.chunk.js.map → 3510.3082d0d9.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{main.aca7118f.js → main.1c79ec84.js} +7 -7
- package/dist/embedded-app/static/main.1c79ec84.js.map +1 -0
- package/dist/embedded-app/static/{module-material-ui.263ce9b5.js → module-material-ui.0420d68d.js} +2 -2
- package/dist/embedded-app/static/{module-material-ui.263ce9b5.js.map → module-material-ui.0420d68d.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.aca7118f.js → runtime.1c79ec84.js} +2 -2
- package/dist/embedded-app/static/{runtime.aca7118f.js.map → runtime.1c79ec84.js.map} +1 -1
- package/dist/embedded-app/static/vendor.1c79ec84.js +159 -0
- package/dist/embedded-app/static/vendor.1c79ec84.js.map +1 -0
- package/dist/index.cjs.js +5 -1
- package/dist/index.cjs.js.map +1 -1
- package/package.json +4 -4
- package/dist/embedded-app/static/1600.951887bd.chunk.js +0 -3
- package/dist/embedded-app/static/1600.951887bd.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.aca7118f.js.map +0 -1
- package/dist/embedded-app/static/vendor.aca7118f.js +0 -207
- package/dist/embedded-app/static/vendor.aca7118f.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
# @techdocs/cli
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20231121021721
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d15d483a4928: Add command `--runAsDefaultUser` for `@techdocs/cli generate` to bypass running the docker builds as host user for macOS and Linux.
|
|
4
8
|
|
|
5
9
|
### Patch Changes
|
|
6
10
|
|
|
7
11
|
- Updated dependencies
|
|
8
|
-
- @backstage/backend-common@0.0.0-nightly-
|
|
9
|
-
- @backstage/plugin-techdocs-node@0.0.0-nightly-
|
|
12
|
+
- @backstage/backend-common@0.0.0-nightly-20231121021721
|
|
13
|
+
- @backstage/plugin-techdocs-node@0.0.0-nightly-20231121021721
|
|
10
14
|
- @backstage/catalog-model@1.4.3
|
|
11
15
|
- @backstage/cli-common@0.1.13
|
|
12
16
|
- @backstage/config@1.1.1
|
|
@@ -75,7 +75,8 @@ async function generate(opts) {
|
|
|
75
75
|
logger,
|
|
76
76
|
etag: opts.etag,
|
|
77
77
|
logStream: utility.getLogStream(logger),
|
|
78
|
-
siteOptions: { name: opts.siteName }
|
|
78
|
+
siteOptions: { name: opts.siteName },
|
|
79
|
+
runAsDefaultUser: opts.runAsDefaultUser
|
|
79
80
|
});
|
|
80
81
|
if (configIsTemporary) {
|
|
81
82
|
process.on("exit", async () => {
|
|
@@ -86,4 +87,4 @@ async function generate(opts) {
|
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
exports["default"] = generate;
|
|
89
|
-
//# sourceMappingURL=generate-
|
|
90
|
+
//# sourceMappingURL=generate-f9a039d6.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-
|
|
1
|
+
{"version":3,"file":"generate-f9a039d6.cjs.js","sources":["../../src/commands/generate/generate.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 { resolve } from 'path';\nimport { OptionValues } from 'commander';\nimport fs from 'fs-extra';\nimport Docker from 'dockerode';\nimport {\n TechdocsGenerator,\n ParsedLocationAnnotation,\n getMkdocsYml,\n} from '@backstage/plugin-techdocs-node';\nimport {\n ContainerRunner,\n DockerContainerRunner,\n} from '@backstage/backend-common';\nimport { ConfigReader } from '@backstage/config';\nimport {\n convertTechDocsRefToLocationAnnotation,\n createLogger,\n getLogStream,\n} from '../../lib/utility';\n\nexport default async function generate(opts: OptionValues) {\n // Use techdocs-node package to generate docs. Keep consistency between Backstage and CI generating docs.\n // Docs can be prepared using actions/checkout or git clone, or similar paradigms on CI. The TechDocs CI workflow\n // will run on the CI pipeline containing the documentation files.\n\n const logger = createLogger({ verbose: opts.verbose });\n\n const sourceDir = resolve(opts.sourceDir);\n const outputDir = resolve(opts.outputDir);\n const omitTechdocsCorePlugin = opts.omitTechdocsCoreMkdocsPlugin;\n const dockerImage = opts.dockerImage;\n const pullImage = opts.pull;\n const legacyCopyReadmeMdToIndexMd = opts.legacyCopyReadmeMdToIndexMd;\n const defaultPlugins = opts.defaultPlugin;\n\n logger.info(`Using source dir ${sourceDir}`);\n logger.info(`Will output generated files in ${outputDir}`);\n\n logger.verbose('Creating output directory if it does not exist.');\n\n await fs.ensureDir(outputDir);\n\n const { path: mkdocsYmlPath, configIsTemporary } = await getMkdocsYml(\n sourceDir,\n );\n\n const config = new ConfigReader({\n techdocs: {\n generator: {\n runIn: opts.docker ? 'docker' : 'local',\n dockerImage,\n pullImage,\n mkdocs: {\n legacyCopyReadmeMdToIndexMd,\n omitTechdocsCorePlugin,\n defaultPlugins,\n },\n },\n },\n });\n\n // Docker client (conditionally) used by the generators, based on techdocs.generators config.\n let containerRunner: ContainerRunner | undefined;\n\n if (opts.docker) {\n const dockerClient = new Docker();\n containerRunner = new DockerContainerRunner({ dockerClient });\n }\n\n let parsedLocationAnnotation = {} as ParsedLocationAnnotation;\n if (opts.techdocsRef) {\n try {\n parsedLocationAnnotation = convertTechDocsRefToLocationAnnotation(\n opts.techdocsRef,\n );\n } catch (err) {\n logger.error(err.message);\n }\n }\n\n // Generate docs using @backstage/plugin-techdocs-node\n const techdocsGenerator = await TechdocsGenerator.fromConfig(config, {\n logger,\n containerRunner,\n });\n\n logger.info('Generating documentation...');\n\n await techdocsGenerator.run({\n inputDir: sourceDir,\n outputDir,\n ...(opts.techdocsRef\n ? {\n parsedLocationAnnotation,\n }\n : {}),\n logger,\n etag: opts.etag,\n logStream: getLogStream(logger),\n siteOptions: { name: opts.siteName },\n runAsDefaultUser: opts.runAsDefaultUser,\n });\n\n if (configIsTemporary) {\n process.on('exit', async () => {\n fs.rmSync(mkdocsYmlPath, {});\n });\n }\n\n logger.info('Done!');\n}\n"],"names":["createLogger","resolve","fs","getMkdocsYml","config","ConfigReader","Docker","DockerContainerRunner","convertTechDocsRefToLocationAnnotation","TechdocsGenerator","getLogStream"],"mappings":";;;;;;;;;;;;;;;;;;AAoCA,eAA8B,SAAS,IAAoB,EAAA;AAKzD,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,SAAA,GAAYC,YAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACxC,EAAM,MAAA,SAAA,GAAYA,YAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACxC,EAAA,MAAM,yBAAyB,IAAK,CAAA,4BAAA,CAAA;AACpC,EAAA,MAAM,cAAc,IAAK,CAAA,WAAA,CAAA;AACzB,EAAA,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A,WAAA;AAAA,OACP,CAAA;AAAA,aACO,GAAK,EAAA;AACZ,MAAO,MAAA,CAAA,KAAA,CAAM,IAAI,OAAO,CAAA,CAAA;AAAA,KAC1B;AAAA,GACF;AAGA,EAAA,MAAM,iBAAoB,GAAA,MAAMC,oCAAkB,CAAA,UAAA,CAAWL,QAAQ,EAAA;AAAA,IACnE,MAAA;AAAA,IACA,eAAA;AAAA,GACD,CAAA,CAAA;AAED,EAAA,MAAA,CAAO,KAAK,6BAA6B,CAAA,CAAA;AAEzC,EAAA,MAAM,kBAAkB,GAAI,CAAA;AAAA,IAC1B,QAAU,EAAA,SAAA;AAAA,IACV,SAAA;AAAA,IACA,GAAI,KAAK,WACL,GAAA;AAAA,MACE,wBAAA;AAAA,QAEF,EAAC;AAAA,IACL,MAAA;AAAA,IACA,MAAM,IAAK,CAAA,IAAA;AAAA,IACX,SAAA,EAAWM,qBAAa,MAAM,CAAA;AAAA,IAC9B,WAAa,EAAA,EAAE,IAAM,EAAA,IAAA,CAAK,QAAS,EAAA;AAAA,IACnC,kBAAkB,IAAK,CAAA,gBAAA;AAAA,GACxB,CAAA,CAAA;AAED,EAAA,IAAI,iBAAmB,EAAA;AACrB,IAAQ,OAAA,CAAA,EAAA,CAAG,QAAQ,YAAY;AAC7B,MAAGR,sBAAA,CAAA,MAAA,CAAO,aAAe,EAAA,EAAE,CAAA,CAAA;AAAA,KAC5B,CAAA,CAAA;AAAA,GACH;AAEA,EAAA,MAAA,CAAO,KAAK,OAAO,CAAA,CAAA;AACrB;;;;"}
|
|
@@ -931,28 +931,6 @@
|
|
|
931
931
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
932
932
|
}
|
|
933
933
|
},
|
|
934
|
-
{
|
|
935
|
-
"path": "../../plugins/stackstorm/config.d.ts",
|
|
936
|
-
"value": {
|
|
937
|
-
"type": "object",
|
|
938
|
-
"properties": {
|
|
939
|
-
"stackstorm": {
|
|
940
|
-
"type": "object",
|
|
941
|
-
"properties": {
|
|
942
|
-
"webUrl": {
|
|
943
|
-
"description": "StackStorm Web UI url\nUsed in links to StackStorm web UI",
|
|
944
|
-
"visibility": "frontend",
|
|
945
|
-
"type": "string"
|
|
946
|
-
}
|
|
947
|
-
},
|
|
948
|
-
"required": [
|
|
949
|
-
"webUrl"
|
|
950
|
-
]
|
|
951
|
-
}
|
|
952
|
-
},
|
|
953
|
-
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
954
|
-
}
|
|
955
|
-
},
|
|
956
934
|
{
|
|
957
935
|
"path": "../../node_modules/@oriflame/backstage-plugin-score-card/config.d.ts",
|
|
958
936
|
"value": {
|
|
@@ -981,6 +959,28 @@
|
|
|
981
959
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
982
960
|
}
|
|
983
961
|
},
|
|
962
|
+
{
|
|
963
|
+
"path": "../../plugins/stackstorm/config.d.ts",
|
|
964
|
+
"value": {
|
|
965
|
+
"type": "object",
|
|
966
|
+
"properties": {
|
|
967
|
+
"stackstorm": {
|
|
968
|
+
"type": "object",
|
|
969
|
+
"properties": {
|
|
970
|
+
"webUrl": {
|
|
971
|
+
"description": "StackStorm Web UI url\nUsed in links to StackStorm web UI",
|
|
972
|
+
"visibility": "frontend",
|
|
973
|
+
"type": "string"
|
|
974
|
+
}
|
|
975
|
+
},
|
|
976
|
+
"required": [
|
|
977
|
+
"webUrl"
|
|
978
|
+
]
|
|
979
|
+
}
|
|
980
|
+
},
|
|
981
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
982
|
+
}
|
|
983
|
+
},
|
|
984
984
|
{
|
|
985
985
|
"path": "../backend-common/config.d.ts",
|
|
986
986
|
"value": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open platform for building developer portals"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open platform for building developer portals"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.1c79ec84.js"></script><script defer="defer" src="/static/module-material-ui.0420d68d.js"></script><script defer="defer" src="/static/module-lodash.fa492ce2.js"></script><script defer="defer" src="/static/module-date-fns.b8b6c380.js"></script><script defer="defer" src="/static/module-material-table.3c68edc1.js"></script><script defer="defer" src="/static/module-react-dom.f7ae1c8b.js"></script><script defer="defer" src="/static/module-react-router.67245b2c.js"></script><script defer="defer" src="/static/module-react-router-dom.48ea1f60.js"></script><script defer="defer" src="/static/module-zod.9e0f365e.js"></script><script defer="defer" src="/static/module-i18next.db8a27ed.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.71ae82d9.js"></script><script defer="defer" src="/static/vendor.1c79ec84.js"></script><script defer="defer" src="/static/main.1c79ec84.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[1600],{59119:function(ft,B,t){t.d(B,{O:function(){return W}});var n=t(52322),m=t(79692),I=t(80030),z=t(2784),U=t(15277),N=t.n(U),$=t(29862);const H=(0,m.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function W(E){const[V,Q]=(0,z.useState)(!1),b=(0,$.t)(),x=H(),G=P=>{b()&&Q(P)};var Z;return(0,n.jsx)(I.ZP,{title:(Z=E.title)!==null&&Z!==void 0?Z:E.text||"",placement:E.placement,disableHoverListener:!V,children:(0,n.jsx)(N(),{text:E.text,line:E.line,onToggled:G,containerClassName:x.container})})}},51600:function(ft,B,t){t.r(B),t.d(B,{BaseCatalogPage:function(){return dt},CatalogPage:function(){return me},DefaultCatalogPage:function(){return ut}});var n=t(52322),m=t(2784),I=t(73557),z=t(32166),U=t(42398),N=t(30706),$=t(77277),H=t(61837),W=t(41156),E=t(71597),V=t(88188);function Q(e){const{title:l,to:a}=e,s=(0,W.Z)(r=>r.breakpoints.down("xs"));return a?s?(0,n.jsx)(H.Z,{component:E.rU,color:"primary",title:l,size:"small",to:a,children:(0,n.jsx)(V.Z,{})}):(0,n.jsx)($.Z,{component:E.rU,variant:"contained",color:"primary",to:a,children:l}):null}var b=t(13788),x=t(44394),G=t(6542),Z=t(37321),P=t(25942),X=t(30389),q=t(35879),_=t(78847),Y=t(62774),F=t(4967),tt=t(64279),et=t(88624);function pt(){const e=(0,x.h_)(et.A),{error:l,loading:a,value:s}=(0,tt.default)(async()=>await e.getEntityFacets({facets:["kind"]}).then(o=>{var c;return((c=o.facets.kind)===null||c===void 0?void 0:c.map(i=>i.value).sort())||[]}),[e]);return{loading:a,error:l,allKinds:s!=null?s:[]}}function yt(e,l,a){let s=e;return l&&(s=s.filter(o=>l.some(c=>c.toLocaleLowerCase("en-US")===o.toLocaleLowerCase("en-US")))),a&&!e.some(o=>o.toLocaleLowerCase("en-US")===a.toLocaleLowerCase("en-US"))&&(s=s.concat([a])),s.sort().reduce((o,c)=>(o[c.toLocaleLowerCase("en-US")]=c,o),{})}function gt(e){var l;const{filters:a,queryParameters:{kind:s},updateFilters:r}=(0,P.wp)(),o=(0,m.useMemo)(()=>[s].flat()[0],[s]);var c;const[i,d]=(0,m.useState)((c=o!=null?o:(l=a.kind)===null||l===void 0?void 0:l.value)!==null&&c!==void 0?c:e.initialFilter);(0,m.useEffect)(()=>{o&&d(o)},[o]),(0,m.useEffect)(()=>{var T;if(!((T=a.kind)===null||T===void 0)&&T.value){var C;d((C=a.kind)===null||C===void 0?void 0:C.value)}},[a.kind]),(0,m.useEffect)(()=>{r({kind:i?new F.zo(i):void 0})},[i,r]);const{allKinds:u,loading:v,error:f}=pt();return{loading:v,error:f,allKinds:u!=null?u:[],selectedKind:i,setSelectedKind:d}}const ht=e=>{const{allowedKinds:l,hidden:a,initialFilter:s="component"}=e,r=(0,x.h_)(_.$),{error:o,allKinds:c,selectedKind:i,setSelectedKind:d}=gt({initialFilter:s});if((0,m.useEffect)(()=>{o&&r.post({message:"Failed to load entity kinds",severity:"error"})},[o,r]),o)return null;const u=yt(c,l,i),v=Object.keys(u).map(f=>({value:f,label:u[f]}));return a?null:(0,n.jsx)(Y.Z,{pb:1,pt:1,children:(0,n.jsx)(q.H,{label:"Kind",items:v,selected:i.toLocaleLowerCase("en-US"),onChange:f=>d(String(f))})})};var Ct=t(18149),xt=t.n(Ct),St=t(829),jt=t.n(St);function Et(){const e=(0,x.h_)(et.A),{filters:{kind:l,type:a},queryParameters:{type:s},updateFilters:r}=(0,P.wp)(),o=(0,m.useMemo)(()=>[s].flat().filter(Boolean),[s]);var c;const[i,d]=(0,m.useState)(o.length?o:(c=a==null?void 0:a.getTypes())!==null&&c!==void 0?c:[]);(0,m.useEffect)(()=>{o.length&&d(o)},[o]);const[u,v]=(0,m.useState)([]),f=(0,m.useMemo)(()=>l==null?void 0:l.value,[l]),{error:T,loading:C,value:S}=(0,tt.default)(async()=>f?await e.getEntityFacets({filter:{kind:f},facets:["spec.type"]}).then(A=>A.facets["spec.type"]||[]):[],[f,e]),O=(0,m.useRef)(S);return(0,m.useEffect)(()=>{const M=O.current;if(O.current=S,C||!f||M===S||!S)return;const A=[...new Set(jt()(S,L=>-L.count).map(L=>L.value.toLocaleLowerCase("en-US")))];v(A);const K=i.filter(L=>A.includes(L));xt()(i,K)||d(K)},[C,f,i,d,S]),(0,m.useEffect)(()=>{r({type:i.length?new F.Bf(i):void 0})},[i,r]),{loading:C,error:T,availableTypes:u,selectedTypes:i,setSelectedTypes:d}}const Tt=e=>{const{hidden:l,initialFilter:a}=e,s=(0,x.h_)(_.$),{error:r,availableTypes:o,selectedTypes:c,setSelectedTypes:i}=Et();if((0,m.useEffect)(()=>{r&&s.post({message:"Failed to load entity types",severity:"error"}),a&&i([a])},[r,s,a,i]),o.length===0||r)return null;const d=[{value:"all",label:"all"},...o.map(v=>({value:v,label:v}))];var u;return l?null:(0,n.jsx)(Y.Z,{pb:1,pt:1,children:(0,n.jsx)(q.H,{label:"Type",items:d,selected:(u=d.length>1?c[0]:void 0)!==null&&u!==void 0?u:"all",onChange:v=>i(v==="all"?[]:[String(v)])})})};var Pt=t(32494),Ot=t(63833),J=t(79692),nt=t(77605);const Lt=(0,J.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Ft=e=>{const{initialFilter:l=[]}=e,a=Lt();return(0,n.jsx)(nt.K,{label:"Lifecycle",name:"lifecycles",path:"spec.lifecycle",Filter:F.zH,InputProps:{className:a.input},initialSelectedOptions:l})};var At=t(97894),D=t(90436),Kt=t(5806),Zt=t(21324),Rt=t(86619),Mt=t(19996),Bt=t(25505),Dt=t(38016),It=t(88013);const zt=(0,J.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Ut=(0,n.jsx)(Bt.Z,{fontSize:"small"}),Nt=(0,n.jsx)(Mt.Z,{fontSize:"small"}),$t=()=>{const e=zt(),{updateFilters:l}=(0,P.wp)(),[a,s]=(0,m.useState)([]);function r(i){l({orphan:i?new F.mM(i):void 0})}function o(i){l({error:i?new F.A5(i):void 0})}const c=["Is Orphan","Has Error"];return(0,n.jsx)(Y.Z,{pb:1,pt:1,children:(0,n.jsxs)(D.Z,{variant:"button",component:"label",children:["Processing Status",(0,n.jsx)(It.ZP,{multiple:!0,disableCloseOnSelect:!0,options:c,value:a,onChange:(i,d)=>{s(d),r(d.includes("Is Orphan")),o(d.includes("Has Error"))},renderOption:(i,{selected:d})=>(0,n.jsx)(Kt.Z,{control:(0,n.jsx)(Zt.Z,{icon:Ut,checkedIcon:Nt,checked:d}),onClick:u=>u.preventDefault(),label:i}),size:"small",popupIcon:(0,n.jsx)(Dt.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:i=>(0,n.jsx)(Rt.Z,{...i,className:e.input,variant:"outlined"})})]})})},Ht=(0,J.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),Wt=()=>{const e=Ht();return(0,n.jsx)(nt.K,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:F.Qe,InputProps:{className:e.input}})};var Vt=t(65524),at=t(34106),lt=t(8709),Qt=t(74314),bt=t(538),Gt=t(9791),Xt=t(84462),R=t(86540),Yt=t(42870),st=t(75435),Jt=t(15459),k=t(93750),kt=t(27604),wt=t(2997),qt=t(11640),_t=t(28347),te=t(76635),ee=t(19928),ne=t.n(ee),ae=t(84719),ot=t(51194),it=t(7089),rt=t(59119);const y=Object.freeze({createNameColumn(e){function l(a){var s;return((s=a.metadata)===null||s===void 0?void 0:s.title)||(0,R.$)(a,{defaultKind:e==null?void 0:e.defaultKind})}return{title:"Name",field:"resolved.entityRef",highlight:!0,customSort({entity:a},{entity:s}){return l(a).localeCompare(l(s))},render:({entity:a})=>(0,n.jsx)(ae.d,{entityRef:a,defaultKind:(e==null?void 0:e.defaultKind)||"Component"})}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:e})=>(0,n.jsx)(ot.r,{entityRefs:e.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:e})=>(0,n.jsx)(ot.r,{entityRefs:e.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:e})=>{var l,a;return(0,n.jsx)(n.Fragment,{children:((e==null||(l=e.spec)===null||l===void 0?void 0:l.targets)||(e==null||(a=e.spec)===null||a===void 0?void 0:a.target))&&(0,n.jsx)(rt.O,{text:(e.spec.targets||[e.spec.target]).join(", "),placement:"bottom-start"})})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:e})=>(0,n.jsx)(rt.O,{text:e.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:e})=>(0,n.jsx)(n.Fragment,{children:e.metadata.tags&&e.metadata.tags.map(l=>(0,n.jsx)(it.Z,{label:l,size:"small",variant:"outlined",style:{marginBottom:"0px"}},l))}),width:"auto"}},createTitleColumn(e){return{title:"Title",field:"entity.metadata.title",hidden:e==null?void 0:e.hidden,searchable:!0}},createLabelColumn(e,l){return{title:(l==null?void 0:l.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:a})=>{var s;const r=(s=a.metadata)===null||s===void 0?void 0:s.labels,o=r&&r[e]||(l==null?void 0:l.defaultValue);return(0,n.jsx)(n.Fragment,{children:o&&(0,n.jsx)(it.Z,{label:o,size:"small",variant:"outlined"},o)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}}),le=(0,Jt.Z)({root:{color:"#f3ba37"}})(qt.Z),se=(e,l)=>{const a=s=>s.metadata.title||(0,R.$)(s,{defaultKind:"Component"});return a(e).localeCompare(a(l))},oe=({filters:e,entities:l})=>{var a;return[y.createTitleColumn({hidden:!0}),y.createNameColumn({defaultKind:(a=e.kind)===null||a===void 0?void 0:a.value}),...s(),y.createMetadataDescriptionColumn(),y.createTagsColumn()];function s(){var r;const o=[y.createSystemColumn(),y.createOwnerColumn(),y.createSpecTypeColumn(),y.createSpecLifecycleColumn()];switch((r=e.kind)===null||r===void 0?void 0:r.value){case"user":return[];case"domain":case"system":return[y.createOwnerColumn()];case"group":case"template":return[y.createSpecTypeColumn()];case"location":return[y.createSpecTypeColumn(),y.createSpecTargetsColumn()];default:return l.every(c=>c.metadata.namespace==="default")?o:[...o,y.createNamespaceColumn()]}}},w=e=>{var l,a,s;const{columns:r=oe,actions:o,tableOptions:c,subtitle:i,emptyContent:d}=e,{isStarredEntity:u,toggleStarredEntity:v}=(0,Yt.C)(),f=(0,P.wp)(),{loading:T,error:C,entities:S,filters:O}=f,M=(0,m.useMemo)(()=>typeof r=="function"?r(f):r,[r,f]),A=O.type===void 0;var K;const L=(0,te.capitalize)((K=(l=O.user)===null||l===void 0?void 0:l.value)!==null&&K!==void 0?K:"all");if(C)return(0,n.jsx)("div",{children:(0,n.jsx)(bt.G,{severity:"error",title:"Could not fetch catalog entities.",children:(0,n.jsx)(Gt.O,{language:"text",text:C.toString()})})});const ve=[({entity:p})=>{var g;const h=(g=p.metadata.annotations)===null||g===void 0?void 0:g[at.l2],j="View";return{icon:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(D.Z,{style:k.Z,children:j}),(0,n.jsx)(wt.Z,{fontSize:"small"})]}),tooltip:j,disabled:!h,onClick:()=>{h&&window.open(h,"_blank")}}},({entity:p})=>{var g;const h=(g=p.metadata.annotations)===null||g===void 0?void 0:g[at.Tf],j="Edit";return{icon:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(D.Z,{style:k.Z,children:j}),(0,n.jsx)(kt.Z,{fontSize:"small"})]}),tooltip:j,disabled:!h,onClick:()=>{h&&window.open(h,"_blank")}}},({entity:p})=>{const g=u(p),h=g?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(D.Z,{style:k.Z,children:h}),g?(0,n.jsx)(le,{}):(0,n.jsx)(_t.Z,{})]}),tooltip:h,onClick:()=>v(p)}}],mt=S.sort(se).map(p=>{const g=(0,st.h)(p,lt.cz,{kind:"system"}),h=(0,st.h)(p,lt.S4);return{entity:p,resolved:{name:(0,R.$)(p,{defaultKind:"Component"}),entityRef:(0,Qt.eE)(p),ownedByRelationsTitle:h.map(j=>(0,R.$)(j,{defaultKind:"group"})).join(", "),ownedByRelations:h,partOfSystemRelationTitle:g.map(j=>(0,R.$)(j,{defaultKind:"system"})).join(", "),partOfSystemRelations:g}}}),vt=M.find(p=>p.title==="Type");vt&&(vt.hidden=!A);const fe=mt.length>20,pe=((a=O.kind)===null||a===void 0?void 0:a.value)||"",ye=((s=O.type)===null||s===void 0?void 0:s.value)||"",ge=[L,ye,ne()(pe)].filter(p=>p).join(" ");return(0,n.jsx)(Xt.i,{isLoading:T,columns:M,options:{paging:fe,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!T,padding:"dense",pageSizeOptions:[20,50,100],...c},title:`${ge} (${S.length})`,data:mt,actions:o||ve,subtitle:i,emptyContent:d})};w.columns=y;var ie=t(35304);const re=(0,ie.F)({id:"catalog",messages:{catalog_page_title:"{{orgName}} Catalog",catalog_page_create_button_title:"Create"}});var ce=t(58513),de=t(96253);const ct=new WeakSet,ue=e=>{const l=(0,x.h_)(ce.V),a=(0,x.h_)(de.o),[s,r]=(0,m.useState)(()=>a.getTranslation(e)),o=(0,m.useMemo)(()=>a.translation$(e),[a,e]),c=(0,m.useCallback)(d=>{if(!ct.has(e)){const u=`Failed to load translation resource '${e.id}'; caused by ${d}`;console.error(u),l.post(new Error(u)),ct.add(e)}},[l,e]);(0,m.useEffect)(()=>{const d=o.subscribe({next(u){u.ready&&r(u)},error(u){c(u)}});return()=>{d.unsubscribe()}},[o,c]);const i=(0,m.useRef)(!0);if((0,m.useEffect)(()=>{i.current?i.current=!1:r(a.getTranslation(e))},[a,e]),!s.ready)throw new Promise(d=>{const u=o.subscribe({next(v){v.ready&&(u.unsubscribe(),d())},error(v){u.unsubscribe(),c(v),d()}})});return{t:s.t}};function dt(e){const{filters:l,content:a=(0,n.jsx)(w,{})}=e;var s;const r=(s=(0,x.h_)(G.D).getOptionalString("organization.name"))!==null&&s!==void 0?s:"Backstage",o=(0,Z.t)(Vt.yw),{t:c}=ue(re);return(0,n.jsx)(z.g,{title:c("catalog_page_title",{orgName:r}),themeId:"home",children:(0,n.jsxs)(U.V,{children:[(0,n.jsxs)(N.y,{title:"",children:[(0,n.jsx)(Q,{title:c("catalog_page_create_button_title"),to:o&&o()}),(0,n.jsx)(b.q,{children:"All your software catalog entities"})]}),(0,n.jsx)(P.UO,{children:(0,n.jsxs)(X._i,{children:[(0,n.jsx)(X._i.Filters,{children:l}),(0,n.jsx)(X._i.Content,{children:a})]})})]})})}function ut(e){const{columns:l,actions:a,initiallySelectedFilter:s="owned",initialKind:r="component",tableOptions:o={},emptyContent:c,ownerPickerMode:i}=e;return(0,n.jsx)(dt,{filters:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ht,{initialFilter:r}),(0,n.jsx)(Tt,{}),(0,n.jsx)(Pt.E,{initialFilter:s}),(0,n.jsx)(Ot.d,{mode:i}),(0,n.jsx)(Ft,{}),(0,n.jsx)(At.x,{}),(0,n.jsx)($t,{}),(0,n.jsx)(Wt,{})]}),content:(0,n.jsx)(w,{columns:l,actions:a,tableOptions:o,emptyContent:c})})}function me(e){return(0,I.pC)()||(0,n.jsx)(ut,{...e})}}}]);})();
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=1600.a5f04dd3.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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CAiBO,SAASe,GAAmBtV,EAAgC,CACjE,KAAM,CACJwO,QAAAA,EACAC,QAAAA,EACA8G,wBAAAA,EAA0B,QAC1BC,YAAAA,EAAc,YACd9G,aAAAA,EAAe,CAAC,EAChBE,aAAAA,EACA6G,gBAAAA,CAAe,EACbzV,EAEJ,SACE,OAACsU,GAAAA,CACCtQ,WACE,oB,aACE,OAACc,GAAgBA,CAACJ,cAAe8Q,C,MACjC,OAAC7N,GAAgBA,CAAAA,CAAAA,KACjB,OAAC+N,GAAAA,EAAcA,CAAChR,cAAe6Q,C,MAC/B,OAACI,GAAAA,EAAiBA,CAACC,KAAMH,C,MACzB,OAAC5N,GAAqBA,CAAAA,CAAAA,KACtB,OAACgO,GAAAA,EAAeA,CAAAA,CAAAA,KAChB,OAACnN,GAA4BA,CAAAA,CAAAA,KAC7B,OAAC6B,GAAqBA,CAAAA,CAAAA,C,IAG1BgK,WACE,OAAChG,EAAYA,CACXC,QAASA,EACTC,QAASA,EACTC,aAAcA,EACdE,aAAcA,C,IAKxB,CC9GO,SAASkH,GAAY9V,EAAgC,CAG1D,SAFe+V,EAAAA,IAAU,MAER,OAACT,GAAkBA,CAAE,GAAGtV,C,EAC3C,C","sources":["webpack://techdocs-cli-embedded-app/../core-components/src/components/OverflowTooltip/OverflowTooltip.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/CreateButton/CreateButton.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityKindPicker/kindFilterUtils.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityKindPicker/EntityKindPicker.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/hooks/useEntityTypeFilter.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityLifecyclePicker/EntityLifecyclePicker.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityProcessingStatusPicker/EntityProcessingStatusPicker.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityNamespacePicker/EntityNamespacePicker.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogTable/columns.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogTable/CatalogTable.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/translation.ts","webpack://techdocs-cli-embedded-app/../core-plugin-api/src/translation/useTranslationRef.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 { makeStyles } from '@material-ui/core/styles';\nimport Tooltip, { TooltipProps } from '@material-ui/core/Tooltip';\nimport React, { useState } from 'react';\nimport TextTruncate, { TextTruncateProps } from 'react-text-truncate';\nimport { useIsMounted } from '@react-hookz/web';\n\ntype Props = {\n text: TextTruncateProps['text'];\n line?: TextTruncateProps['line'];\n element?: TextTruncateProps['element'];\n title?: TooltipProps['title'];\n placement?: TooltipProps['placement'];\n};\n\nexport type OverflowTooltipClassKey = 'container';\n\nconst useStyles = makeStyles(\n {\n container: {\n overflow: 'visible !important',\n },\n },\n { name: 'BackstageOverflowTooltip' },\n);\n\nexport function OverflowTooltip(props: Props) {\n const [hover, setHover] = useState(false);\n const isMounted = useIsMounted();\n const classes = useStyles();\n\n const handleToggled = (truncated: boolean) => {\n if (isMounted()) {\n setHover(truncated);\n }\n };\n\n return (\n <Tooltip\n title={props.title ?? (props.text || '')}\n placement={props.placement}\n disableHoverListener={!hover}\n >\n <TextTruncate\n text={props.text}\n line={props.line}\n onToggled={handleToggled}\n containerClassName={classes.container}\n />\n </Tooltip>\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 { BackstageTheme } from '@backstage/theme';\nimport Button from '@material-ui/core/Button';\nimport IconButton from '@material-ui/core/IconButton';\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport React from 'react';\nimport { Link as RouterLink, LinkProps } from 'react-router-dom';\nimport AddCircleOutline from '@material-ui/icons/AddCircleOutline';\n\n/**\n * Properties for {@link CreateButton}\n *\n * @public\n */\nexport type CreateButtonProps = {\n title: string;\n} & Partial<Pick<LinkProps, 'to'>>;\n\n/**\n * Responsive Button giving consistent UX for creation of different things\n *\n * @public\n */\nexport function CreateButton(props: CreateButtonProps) {\n const { title, to } = props;\n const isXSScreen = useMediaQuery<BackstageTheme>(theme =>\n theme.breakpoints.down('xs'),\n );\n\n if (!to) {\n return null;\n }\n\n return isXSScreen ? (\n <IconButton\n component={RouterLink}\n color=\"primary\"\n title={title}\n size=\"small\"\n to={to}\n >\n <AddCircleOutline />\n </IconButton>\n ) : (\n <Button component={RouterLink} variant=\"contained\" color=\"primary\" to={to}>\n {title}\n </Button>\n );\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/lib/useAsync';\nimport { catalogApiRef } from '../../api';\n\n/**\n * Fetch and return all availible kinds.\n */\nexport function useAllKinds(): {\n loading: boolean;\n error?: Error;\n allKinds: string[];\n} {\n const catalogApi = useApi(catalogApiRef);\n\n const {\n error,\n loading,\n value: allKinds,\n } = useAsync(async () => {\n const items = await catalogApi\n .getEntityFacets({ facets: ['kind'] })\n .then(response => response.facets.kind?.map(f => f.value).sort() || []);\n return items;\n }, [catalogApi]);\n\n return { loading, error, allKinds: allKinds ?? [] };\n}\n\n/**\n * Filter and capitalize accessible kinds.\n */\nexport function filterKinds(\n allKinds: string[],\n allowedKinds?: string[],\n forcedKinds?: string,\n): Record<string, string> {\n // Before allKinds is loaded, or when a kind is entered manually in the URL, selectedKind may not\n // be present in allKinds. It should still be shown in the dropdown, but may not have the nice\n // enforced casing from the catalog-backend. This makes a key/value record for the Select options,\n // including selectedKind if it's unknown - but allows the selectedKind to get clobbered by the\n // more proper catalog kind if it exists.\n let availableKinds = allKinds;\n if (allowedKinds) {\n availableKinds = availableKinds.filter(k =>\n allowedKinds.some(\n a => a.toLocaleLowerCase('en-US') === k.toLocaleLowerCase('en-US'),\n ),\n );\n }\n if (\n forcedKinds &&\n !allKinds.some(\n a =>\n a.toLocaleLowerCase('en-US') === forcedKinds.toLocaleLowerCase('en-US'),\n )\n ) {\n availableKinds = availableKinds.concat([forcedKinds]);\n }\n\n const kindsMap = availableKinds.sort().reduce((acc, kind) => {\n acc[kind.toLocaleLowerCase('en-US')] = kind;\n return acc;\n }, {} as Record<string, string>);\n\n return kindsMap;\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 { Select } from '@backstage/core-components';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { Box } from '@material-ui/core';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { EntityKindFilter } from '../../filters';\nimport { useEntityList } from '../../hooks';\nimport { filterKinds, useAllKinds } from './kindFilterUtils';\n\nfunction useEntityKindFilter(opts: { initialFilter: string }): {\n loading: boolean;\n error?: Error;\n allKinds: string[];\n selectedKind: string;\n setSelectedKind: (kind: string) => void;\n} {\n const {\n filters,\n queryParameters: { kind: kindParameter },\n updateFilters,\n } = useEntityList();\n\n const queryParamKind = useMemo(\n () => [kindParameter].flat()[0],\n [kindParameter],\n );\n\n const [selectedKind, setSelectedKind] = useState(\n queryParamKind ?? filters.kind?.value ?? opts.initialFilter,\n );\n\n // Set selected kinds on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (queryParamKind) {\n setSelectedKind(queryParamKind);\n }\n }, [queryParamKind]);\n\n // Set selected kind from filters; this happens when the kind filter is\n // updated from another component\n useEffect(() => {\n if (filters.kind?.value) {\n setSelectedKind(filters.kind?.value);\n }\n }, [filters.kind]);\n\n useEffect(() => {\n updateFilters({\n kind: selectedKind ? new EntityKindFilter(selectedKind) : undefined,\n });\n }, [selectedKind, updateFilters]);\n\n const { allKinds, loading, error } = useAllKinds();\n\n return {\n loading,\n error,\n allKinds: allKinds ?? [],\n selectedKind,\n setSelectedKind,\n };\n}\n\n/**\n * Props for {@link EntityKindPicker}.\n *\n * @public\n */\nexport interface EntityKindPickerProps {\n /**\n * Entity kinds to show in the dropdown; by default all kinds are fetched from the catalog and\n * displayed.\n */\n allowedKinds?: string[];\n initialFilter?: string;\n hidden?: boolean;\n}\n\n/** @public */\nexport const EntityKindPicker = (props: EntityKindPickerProps) => {\n const { allowedKinds, hidden, initialFilter = 'component' } = props;\n\n const alertApi = useApi(alertApiRef);\n\n const { error, allKinds, selectedKind, setSelectedKind } =\n useEntityKindFilter({\n initialFilter: initialFilter,\n });\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: `Failed to load entity kinds`,\n severity: 'error',\n });\n }\n }, [error, alertApi]);\n\n if (error) return null;\n\n const options = filterKinds(allKinds, allowedKinds, selectedKind);\n\n const items = Object.keys(options).map(key => ({\n value: key,\n label: options[key],\n }));\n\n return hidden ? null : (\n <Box pb={1} pt={1}>\n <Select\n label=\"Kind\"\n items={items}\n selected={selectedKind.toLocaleLowerCase('en-US')}\n onChange={value => setSelectedKind(String(value))}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport isEqual from 'lodash/isEqual';\nimport sortBy from 'lodash/sortBy';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '../api';\nimport { useEntityList } from './useEntityListProvider';\nimport { EntityTypeFilter } from '../filters';\n\n/**\n * A hook built on top of `useEntityList` for enabling selection of valid `spec.type` values\n * based on the selected EntityKindFilter.\n * @public\n */\nexport function useEntityTypeFilter(): {\n loading: boolean;\n error?: Error;\n availableTypes: string[];\n selectedTypes: string[];\n setSelectedTypes: (types: string[]) => void;\n} {\n const catalogApi = useApi(catalogApiRef);\n const {\n filters: { kind: kindFilter, type: typeFilter },\n queryParameters: { type: typeParameter },\n updateFilters,\n } = useEntityList();\n\n const flattenedQueryTypes = useMemo(\n () => [typeParameter].flat().filter(Boolean) as string[],\n [typeParameter],\n );\n\n const [selectedTypes, setSelectedTypes] = useState(\n flattenedQueryTypes.length\n ? flattenedQueryTypes\n : typeFilter?.getTypes() ?? [],\n );\n\n // Set selected types on query parameter updates; this happens at initial page load and from\n // external updates to the page location.\n useEffect(() => {\n if (flattenedQueryTypes.length) {\n setSelectedTypes(flattenedQueryTypes);\n }\n }, [flattenedQueryTypes]);\n\n const [availableTypes, setAvailableTypes] = useState<string[]>([]);\n const kind = useMemo(() => kindFilter?.value, [kindFilter]);\n\n // Load all valid spec.type values straight from the catalogApi, paying attention to only the\n // kind filter for a complete list.\n const {\n error,\n loading,\n value: facets,\n } = useAsync(async () => {\n if (kind) {\n const items = await catalogApi\n .getEntityFacets({\n filter: { kind },\n facets: ['spec.type'],\n })\n .then(response => response.facets['spec.type'] || []);\n return items;\n }\n return [];\n }, [kind, catalogApi]);\n\n const facetsRef = useRef(facets);\n useEffect(() => {\n const oldFacets = facetsRef.current;\n facetsRef.current = facets;\n // Delay processing hook until kind and facets load updates have settled to generate list of types;\n // This prevents resetting the type filter due to saved type value from query params not matching the\n // empty set of type values while values are still being loaded; also only run this hook on changes\n // to facets\n if (loading || !kind || oldFacets === facets || !facets) {\n return;\n }\n\n // Sort by facet count descending, so the most common types appear on top\n const newTypes = [\n ...new Set(\n sortBy(facets, f => -f.count).map(f =>\n f.value.toLocaleLowerCase('en-US'),\n ),\n ),\n ];\n setAvailableTypes(newTypes);\n\n // Update type filter to only valid values when the list of available types has changed\n const stillValidTypes = selectedTypes.filter(value =>\n newTypes.includes(value),\n );\n if (!isEqual(selectedTypes, stillValidTypes)) {\n setSelectedTypes(stillValidTypes);\n }\n }, [loading, kind, selectedTypes, setSelectedTypes, facets]);\n\n useEffect(() => {\n updateFilters({\n type: selectedTypes.length\n ? new EntityTypeFilter(selectedTypes)\n : undefined,\n });\n }, [selectedTypes, updateFilters]);\n\n return {\n loading,\n error,\n availableTypes,\n selectedTypes,\n setSelectedTypes,\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, { useEffect } from 'react';\nimport { Box } from '@material-ui/core';\nimport { useEntityTypeFilter } from '../../hooks/useEntityTypeFilter';\n\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { Select } from '@backstage/core-components';\n\n/**\n * Props for {@link EntityTypePicker}.\n *\n * @public\n */\nexport interface EntityTypePickerProps {\n initialFilter?: string;\n hidden?: boolean;\n}\n\n/** @public */\nexport const EntityTypePicker = (props: EntityTypePickerProps) => {\n const { hidden, initialFilter } = props;\n const alertApi = useApi(alertApiRef);\n const { error, availableTypes, selectedTypes, setSelectedTypes } =\n useEntityTypeFilter();\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: `Failed to load entity types`,\n severity: 'error',\n });\n }\n if (initialFilter) {\n setSelectedTypes([initialFilter]);\n }\n }, [error, alertApi, initialFilter, setSelectedTypes]);\n\n if (availableTypes.length === 0 || error) return null;\n\n const items = [\n { value: 'all', label: 'all' },\n ...availableTypes.map((type: string) => ({\n value: type,\n label: type,\n })),\n ];\n\n return hidden ? null : (\n <Box pb={1} pt={1}>\n <Select\n label=\"Type\"\n items={items}\n selected={(items.length > 1 ? selectedTypes[0] : undefined) ?? 'all'}\n onChange={value =>\n setSelectedTypes(value === 'all' ? [] : [String(value)])\n }\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeStyles } from '@material-ui/core';\nimport React from 'react';\nimport { EntityLifecycleFilter } from '../../filters';\nimport { EntityAutocompletePicker } from '../EntityAutocompletePicker';\n\n/** @public */\nexport type CatalogReactEntityLifecyclePickerClassKey = 'input';\n\nconst useStyles = makeStyles(\n {\n input: {},\n },\n {\n name: 'CatalogReactEntityLifecyclePicker',\n },\n);\n\n/** @public */\nexport const EntityLifecyclePicker = (props: { initialFilter?: string[] }) => {\n const { initialFilter = [] } = props;\n const classes = useStyles();\n\n return (\n <EntityAutocompletePicker\n label=\"Lifecycle\"\n name=\"lifecycles\"\n path=\"spec.lifecycle\"\n Filter={EntityLifecycleFilter}\n InputProps={{ className: classes.input }}\n initialSelectedOptions={initialFilter}\n />\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EntityErrorFilter, EntityOrphanFilter } from '../../filters';\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport React, { useState } from 'react';\nimport { useEntityList } from '../../hooks';\nimport { Autocomplete } from '@material-ui/lab';\n\n/** @public */\nexport type CatalogReactEntityProcessingStatusPickerClassKey = 'input';\n\nconst useStyles = makeStyles(\n {\n input: {},\n },\n {\n name: 'CatalogReactEntityProcessingStatusPickerPicker',\n },\n);\n\nconst icon = <CheckBoxOutlineBlankIcon fontSize=\"small\" />;\nconst checkedIcon = <CheckBoxIcon fontSize=\"small\" />;\n\n/** @public */\nexport const EntityProcessingStatusPicker = () => {\n const classes = useStyles();\n const { updateFilters } = useEntityList();\n\n const [selectedAdvancedItems, setSelectedAdvancedItems] = useState<string[]>(\n [],\n );\n\n function orphanChange(value: boolean) {\n updateFilters({\n orphan: value ? new EntityOrphanFilter(value) : undefined,\n });\n }\n\n function errorChange(value: boolean) {\n updateFilters({\n error: value ? new EntityErrorFilter(value) : undefined,\n });\n }\n\n const availableAdvancedItems = ['Is Orphan', 'Has Error'];\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\" component=\"label\">\n Processing Status\n <Autocomplete<string, true>\n multiple\n disableCloseOnSelect\n options={availableAdvancedItems}\n value={selectedAdvancedItems}\n onChange={(_: object, value: string[]) => {\n setSelectedAdvancedItems(value);\n orphanChange(value.includes('Is Orphan'));\n errorChange(value.includes('Has Error'));\n }}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={icon}\n checkedIcon={checkedIcon}\n checked={selected}\n />\n }\n onClick={event => event.preventDefault()}\n label={option}\n />\n )}\n size=\"small\"\n popupIcon={\n <ExpandMoreIcon data-testid=\"processing-status-picker-expand\" />\n }\n renderInput={params => (\n <TextField\n {...params}\n className={classes.input}\n variant=\"outlined\"\n />\n )}\n />\n </Typography>\n </Box>\n );\n};\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeStyles } from '@material-ui/core';\n\nimport React from 'react';\nimport { EntityNamespaceFilter } from '../../filters';\nimport { EntityAutocompletePicker } from '../EntityAutocompletePicker';\n\n/** @public */\nexport type CatalogReactEntityNamespacePickerClassKey = 'input';\n\nconst useStyles = makeStyles(\n {\n input: {},\n },\n {\n name: 'CatalogReactEntityNamespacePicker',\n },\n);\n\n/** @public */\nexport const EntityNamespacePicker = () => {\n const classes = useStyles();\n return (\n <EntityAutocompletePicker\n label=\"Namespace\"\n name=\"namespace\"\n path=\"metadata.namespace\"\n Filter={EntityNamespaceFilter}\n InputProps={{ className: classes.input }}\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 React from 'react';\nimport {\n humanizeEntityRef,\n EntityRefLink,\n EntityRefLinks,\n} from '@backstage/plugin-catalog-react';\nimport { Chip } from '@material-ui/core';\nimport { CatalogTableRow } from './types';\nimport { OverflowTooltip, TableColumn } from '@backstage/core-components';\nimport { Entity } from '@backstage/catalog-model';\nimport { JsonArray } from '@backstage/types';\n\n// The columnFactories symbol is not directly exported, but through the\n// CatalogTable.columns field.\n/** @public */\nexport const columnFactories = Object.freeze({\n createNameColumn(options?: {\n defaultKind?: string;\n }): TableColumn<CatalogTableRow> {\n function formatContent(entity: Entity): string {\n return (\n entity.metadata?.title ||\n humanizeEntityRef(entity, {\n defaultKind: options?.defaultKind,\n })\n );\n }\n\n return {\n title: 'Name',\n field: 'resolved.entityRef',\n highlight: true,\n customSort({ entity: entity1 }, { entity: entity2 }) {\n // TODO: We could implement this more efficiently by comparing field by field.\n // This has similar issues as above.\n return formatContent(entity1).localeCompare(formatContent(entity2));\n },\n render: ({ entity }) => (\n <EntityRefLink\n entityRef={entity}\n defaultKind={options?.defaultKind || 'Component'}\n />\n ),\n };\n },\n createSystemColumn(): TableColumn<CatalogTableRow> {\n return {\n title: 'System',\n field: 'resolved.partOfSystemRelationTitle',\n render: ({ resolved }) => (\n <EntityRefLinks\n entityRefs={resolved.partOfSystemRelations}\n defaultKind=\"system\"\n />\n ),\n };\n },\n createOwnerColumn(): TableColumn<CatalogTableRow> {\n return {\n title: 'Owner',\n field: 'resolved.ownedByRelationsTitle',\n render: ({ resolved }) => (\n <EntityRefLinks\n entityRefs={resolved.ownedByRelations}\n defaultKind=\"group\"\n />\n ),\n };\n },\n createSpecTargetsColumn(): TableColumn<CatalogTableRow> {\n return {\n title: 'Targets',\n field: 'entity.spec.targets',\n render: ({ entity }) => (\n <>\n {(entity?.spec?.targets || entity?.spec?.target) && (\n <OverflowTooltip\n text={(\n (entity!.spec!.targets as JsonArray) || [entity.spec.target]\n ).join(', ')}\n placement=\"bottom-start\"\n />\n )}\n </>\n ),\n };\n },\n createSpecTypeColumn(): TableColumn<CatalogTableRow> {\n return {\n title: 'Type',\n field: 'entity.spec.type',\n hidden: true,\n width: 'auto',\n };\n },\n createSpecLifecycleColumn(): TableColumn<CatalogTableRow> {\n return {\n title: 'Lifecycle',\n field: 'entity.spec.lifecycle',\n };\n },\n createMetadataDescriptionColumn(): TableColumn<CatalogTableRow> {\n return {\n title: 'Description',\n field: 'entity.metadata.description',\n render: ({ entity }) => (\n <OverflowTooltip\n text={entity.metadata.description}\n placement=\"bottom-start\"\n />\n ),\n width: 'auto',\n };\n },\n createTagsColumn(): TableColumn<CatalogTableRow> {\n return {\n title: 'Tags',\n field: 'entity.metadata.tags',\n cellStyle: {\n padding: '0px 16px 0px 20px',\n },\n render: ({ entity }) => (\n <>\n {entity.metadata.tags &&\n entity.metadata.tags.map(t => (\n <Chip\n key={t}\n label={t}\n size=\"small\"\n variant=\"outlined\"\n style={{ marginBottom: '0px' }}\n />\n ))}\n </>\n ),\n width: 'auto',\n };\n },\n createTitleColumn(options?: {\n hidden?: boolean;\n }): TableColumn<CatalogTableRow> {\n return {\n title: 'Title',\n field: 'entity.metadata.title',\n hidden: options?.hidden,\n searchable: true,\n };\n },\n createLabelColumn(\n key: string,\n options?: { title?: string; defaultValue?: string },\n ): TableColumn<CatalogTableRow> {\n return {\n title: options?.title || 'Label',\n field: 'entity.metadata.labels',\n cellStyle: {\n padding: '0px 16px 0px 20px',\n },\n render: ({ entity }: { entity: Entity }) => {\n const labels: Record<string, string> | undefined =\n entity.metadata?.labels;\n const specifiedLabelValue =\n (labels && labels[key]) || options?.defaultValue;\n return (\n <>\n {specifiedLabelValue && (\n <Chip\n key={specifiedLabelValue}\n label={specifiedLabelValue}\n size=\"small\"\n variant=\"outlined\"\n />\n )}\n </>\n );\n },\n width: 'auto',\n };\n },\n createNamespaceColumn(): TableColumn<CatalogTableRow> {\n return {\n title: 'Namespace',\n field: 'entity.metadata.namespace',\n width: 'auto',\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 */\nimport {\n ANNOTATION_EDIT_URL,\n ANNOTATION_VIEW_URL,\n Entity,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n CodeSnippet,\n Table,\n TableColumn,\n TableProps,\n WarningPanel,\n} from '@backstage/core-components';\nimport {\n getEntityRelations,\n humanizeEntityRef,\n useEntityList,\n useStarredEntities,\n} from '@backstage/plugin-catalog-react';\nimport Typography from '@material-ui/core/Typography';\nimport { withStyles } from '@material-ui/core/styles';\nimport { visuallyHidden } from '@mui/utils';\nimport Edit from '@material-ui/icons/Edit';\nimport OpenInNew from '@material-ui/icons/OpenInNew';\nimport Star from '@material-ui/icons/Star';\nimport StarBorder from '@material-ui/icons/StarBorder';\nimport { capitalize } from 'lodash';\nimport pluralize from 'pluralize';\nimport React, { ReactNode, useMemo } from 'react';\nimport { columnFactories } from './columns';\nimport { CatalogTableColumnsFunc, CatalogTableRow } from './types';\n\n/**\n * Props for {@link CatalogTable}.\n *\n * @public\n */\nexport interface CatalogTableProps {\n columns?: TableColumn<CatalogTableRow>[] | CatalogTableColumnsFunc;\n actions?: TableProps<CatalogTableRow>['actions'];\n tableOptions?: TableProps<CatalogTableRow>['options'];\n emptyContent?: ReactNode;\n subtitle?: string;\n}\n\nconst YellowStar = withStyles({\n root: {\n color: '#f3ba37',\n },\n})(Star);\n\nconst refCompare = (a: Entity, b: Entity) => {\n const toRef = (entity: Entity) =>\n entity.metadata.title ||\n humanizeEntityRef(entity, {\n defaultKind: 'Component',\n });\n\n return toRef(a).localeCompare(toRef(b));\n};\n\nconst defaultColumnsFunc: CatalogTableColumnsFunc = ({ filters, entities }) => {\n return [\n columnFactories.createTitleColumn({ hidden: true }),\n columnFactories.createNameColumn({ defaultKind: filters.kind?.value }),\n ...createEntitySpecificColumns(),\n columnFactories.createMetadataDescriptionColumn(),\n columnFactories.createTagsColumn(),\n ];\n\n function createEntitySpecificColumns(): TableColumn<CatalogTableRow>[] {\n const baseColumns = [\n columnFactories.createSystemColumn(),\n columnFactories.createOwnerColumn(),\n columnFactories.createSpecTypeColumn(),\n columnFactories.createSpecLifecycleColumn(),\n ];\n switch (filters.kind?.value) {\n case 'user':\n return [];\n case 'domain':\n case 'system':\n return [columnFactories.createOwnerColumn()];\n case 'group':\n case 'template':\n return [columnFactories.createSpecTypeColumn()];\n case 'location':\n return [\n columnFactories.createSpecTypeColumn(),\n columnFactories.createSpecTargetsColumn(),\n ];\n default:\n return entities.every(entity => entity.metadata.namespace === 'default')\n ? baseColumns\n : [...baseColumns, columnFactories.createNamespaceColumn()];\n }\n }\n};\n\n/** @public */\nexport const CatalogTable = (props: CatalogTableProps) => {\n const {\n columns = defaultColumnsFunc,\n actions,\n tableOptions,\n subtitle,\n emptyContent,\n } = props;\n const { isStarredEntity, toggleStarredEntity } = useStarredEntities();\n const entityListContext = useEntityList();\n const { loading, error, entities, filters } = entityListContext;\n\n const tableColumns = useMemo(\n () =>\n typeof columns === 'function' ? columns(entityListContext) : columns,\n [columns, entityListContext],\n );\n\n const showTypeColumn = filters.type === undefined;\n // TODO(timbonicus): remove the title from the CatalogTable once using EntitySearchBar\n const titlePreamble = capitalize(filters.user?.value ?? 'all');\n\n if (error) {\n return (\n <div>\n <WarningPanel\n severity=\"error\"\n title=\"Could not fetch catalog entities.\"\n >\n <CodeSnippet language=\"text\" text={error.toString()} />\n </WarningPanel>\n </div>\n );\n }\n\n const defaultActions: TableProps<CatalogTableRow>['actions'] = [\n ({ entity }) => {\n const url = entity.metadata.annotations?.[ANNOTATION_VIEW_URL];\n const title = 'View';\n\n return {\n icon: () => (\n <>\n <Typography style={visuallyHidden}>{title}</Typography>\n <OpenInNew fontSize=\"small\" />\n </>\n ),\n tooltip: title,\n disabled: !url,\n onClick: () => {\n if (!url) return;\n window.open(url, '_blank');\n },\n };\n },\n ({ entity }) => {\n const url = entity.metadata.annotations?.[ANNOTATION_EDIT_URL];\n const title = 'Edit';\n\n return {\n icon: () => (\n <>\n <Typography style={visuallyHidden}>{title}</Typography>\n <Edit fontSize=\"small\" />\n </>\n ),\n tooltip: title,\n disabled: !url,\n onClick: () => {\n if (!url) return;\n window.open(url, '_blank');\n },\n };\n },\n ({ entity }) => {\n const isStarred = isStarredEntity(entity);\n const title = isStarred ? 'Remove from favorites' : 'Add to favorites';\n\n return {\n cellStyle: { paddingLeft: '1em' },\n icon: () => (\n <>\n <Typography style={visuallyHidden}>{title}</Typography>\n {isStarred ? <YellowStar /> : <StarBorder />}\n </>\n ),\n tooltip: title,\n onClick: () => toggleStarredEntity(entity),\n };\n },\n ];\n\n const rows = entities.sort(refCompare).map(entity => {\n const partOfSystemRelations = getEntityRelations(entity, RELATION_PART_OF, {\n kind: 'system',\n });\n const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);\n\n return {\n entity,\n resolved: {\n // This name is here for backwards compatibility mostly; the\n // presentation of refs in the table should in general be handled with\n // EntityRefLink / EntityName components\n name: humanizeEntityRef(entity, {\n defaultKind: 'Component',\n }),\n entityRef: stringifyEntityRef(entity),\n ownedByRelationsTitle: ownedByRelations\n .map(r => humanizeEntityRef(r, { defaultKind: 'group' }))\n .join(', '),\n ownedByRelations,\n partOfSystemRelationTitle: partOfSystemRelations\n .map(r =>\n humanizeEntityRef(r, {\n defaultKind: 'system',\n }),\n )\n .join(', '),\n partOfSystemRelations,\n },\n };\n });\n\n const typeColumn = tableColumns.find(c => c.title === 'Type');\n if (typeColumn) {\n typeColumn.hidden = !showTypeColumn;\n }\n const showPagination = rows.length > 20;\n const currentKind = filters.kind?.value || '';\n const currentType = filters.type?.value || '';\n const titleDisplay = [titlePreamble, currentType, pluralize(currentKind)]\n .filter(s => s)\n .join(' ');\n\n return (\n <Table<CatalogTableRow>\n isLoading={loading}\n columns={tableColumns}\n options={{\n paging: showPagination,\n pageSize: 20,\n actionsColumnIndex: -1,\n loadingType: 'linear',\n showEmptyDataSourceMessage: !loading,\n padding: 'dense',\n pageSizeOptions: [20, 50, 100],\n ...tableOptions,\n }}\n title={`${titleDisplay} (${entities.length})`}\n data={rows}\n actions={actions || defaultActions}\n subtitle={subtitle}\n emptyContent={emptyContent}\n />\n );\n};\n\nCatalogTable.columns = columnFactories;\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const catalogTranslationRef = createTranslationRef({\n id: 'catalog',\n messages: {\n catalog_page_title: `{{orgName}} Catalog`,\n catalog_page_create_button_title: 'Create',\n },\n});\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { errorApiRef, useApi } from '../apis';\nimport {\n translationApiRef,\n TranslationFunction,\n TranslationSnapshot,\n} from '../apis/alpha';\nimport { TranslationRef } from './TranslationRef';\n\n// Make sure we don't fill the logs with loading errors for the same ref\nconst loggedRefs = new WeakSet<TranslationRef<string, {}>>();\n\n/** @alpha */\nexport const useTranslationRef = <\n TMessages extends { [key in string]: string },\n>(\n translationRef: TranslationRef<string, TMessages>,\n): { t: TranslationFunction<TMessages> } => {\n const errorApi = useApi(errorApiRef);\n const translationApi = useApi(translationApiRef);\n\n const [snapshot, setSnapshot] = useState<TranslationSnapshot<TMessages>>(() =>\n translationApi.getTranslation(translationRef),\n );\n const observable = useMemo(\n () => translationApi.translation$(translationRef),\n [translationApi, translationRef],\n );\n\n const onError = useCallback(\n (error: Error) => {\n if (!loggedRefs.has(translationRef)) {\n const errMsg = `Failed to load translation resource '${translationRef.id}'; caused by ${error}`;\n // eslint-disable-next-line no-console\n console.error(errMsg);\n errorApi.post(new Error(errMsg));\n loggedRefs.add(translationRef);\n }\n },\n [errorApi, translationRef],\n );\n\n useEffect(() => {\n const subscription = observable.subscribe({\n next(next) {\n if (next.ready) {\n setSnapshot(next);\n }\n },\n error(error) {\n onError(error);\n },\n });\n\n return () => {\n subscription.unsubscribe();\n };\n }, [observable, onError]);\n\n // Keep track of if the provided translation ref changes, and in that case update the snapshot\n const initialRenderRef = useRef(true);\n useEffect(() => {\n if (initialRenderRef.current) {\n initialRenderRef.current = false;\n } else {\n setSnapshot(translationApi.getTranslation(translationRef));\n }\n }, [translationApi, translationRef]);\n\n if (!snapshot.ready) {\n throw new Promise<void>(resolve => {\n const subscription = observable.subscribe({\n next(next) {\n if (next.ready) {\n subscription.unsubscribe();\n resolve();\n }\n },\n error(error) {\n subscription.unsubscribe();\n onError(error);\n resolve();\n },\n });\n });\n }\n\n return { t: snapshot.t };\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n 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 { catalogTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nimport { CatalogTableColumnsFunc } from '../CatalogTable/types';\n\n/** @internal */\nexport interface BaseCatalogPageProps {\n filters: ReactNode;\n content?: ReactNode;\n}\n\n/** @internal */\nexport function BaseCatalogPage(props: BaseCatalogPageProps) {\n const { filters, content = <CatalogTable /> } = props;\n const orgName =\n useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage';\n const createComponentLink = useRouteRef(createComponentRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <PageWithHeader title={t('catalog_page_title', { orgName })} themeId=\"home\">\n <Content>\n <ContentHeader title=\"\">\n <CreateButton\n title={t('catalog_page_create_button_title')}\n to={createComponentLink && createComponentLink()}\n />\n <SupportButton>All your software catalog entities</SupportButton>\n </ContentHeader>\n <EntityListProvider>\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>{filters}</CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>{content}</CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </EntityListProvider>\n </Content>\n </PageWithHeader>\n );\n}\n\n/**\n * Props for root catalog pages.\n *\n * @public\n */\nexport interface DefaultCatalogPageProps {\n initiallySelectedFilter?: UserListFilterKind;\n columns?: TableColumn<CatalogTableRow>[] | CatalogTableColumnsFunc;\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\n return (\n <BaseCatalogPage\n filters={\n <>\n <EntityKindPicker initialFilter={initialKind} />\n <EntityTypePicker />\n <UserListPicker initialFilter={initiallySelectedFilter} />\n <EntityOwnerPicker mode={ownerPickerMode} />\n <EntityLifecyclePicker />\n <EntityTagPicker />\n <EntityProcessingStatusPicker />\n <EntityNamespacePicker />\n </>\n }\n content={\n <CatalogTable\n columns={columns}\n actions={actions}\n tableOptions={tableOptions}\n emptyContent={emptyContent}\n />\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 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":["useStyles","makeStyles","container","overflow","name","OverflowTooltip","props","hover","setHover","useState","isMounted","useIsMounted","classes","handleToggled","truncated","Tooltip","title","text","placement","disableHoverListener","TextTruncate","line","onToggled","containerClassName","CreateButton","to","isXSScreen","useMediaQuery","theme","breakpoints","down","IconButton","component","RouterLink","color","size","AddCircleOutline","Button","variant","useAllKinds","catalogApi","useApi","catalogApiRef","error","loading","value","allKinds","useAsync","getEntityFacets","facets","then","response","kind","map","f","sort","filterKinds","allowedKinds","forcedKinds","availableKinds","filter","k","some","a","toLocaleLowerCase","concat","reduce","acc","useEntityKindFilter","opts","filters","queryParameters","kindParameter","updateFilters","useEntityList","queryParamKind","useMemo","flat","selectedKind","setSelectedKind","initialFilter","useEffect","EntityKindFilter","undefined","EntityKindPicker","hidden","alertApi","alertApiRef","post","message","severity","options","items","Object","keys","key","label","Box","pb","pt","Select","selected","onChange","String","useEntityTypeFilter","kindFilter","type","typeFilter","typeParameter","flattenedQueryTypes","Boolean","selectedTypes","setSelectedTypes","length","getTypes","availableTypes","setAvailableTypes","facetsRef","useRef","oldFacets","current","newTypes","Set","sortBy","count","stillValidTypes","includes","isEqual","EntityTypeFilter","EntityTypePicker","input","EntityLifecyclePicker","EntityAutocompletePicker","path","Filter","EntityLifecycleFilter","InputProps","className","initialSelectedOptions","icon","CheckBoxOutlineBlankIcon","fontSize","checkedIcon","CheckBoxIcon","EntityProcessingStatusPicker","selectedAdvancedItems","setSelectedAdvancedItems","orphanChange","orphan","EntityOrphanFilter","errorChange","EntityErrorFilter","availableAdvancedItems","Typography","Autocomplete","multiple","disableCloseOnSelect","_","renderOption","option","FormControlLabel","control","Checkbox","checked","onClick","event","preventDefault","popupIcon","ExpandMoreIcon","data-testid","renderInput","params","TextField","EntityNamespacePicker","EntityNamespaceFilter","columnFactories","freeze","createNameColumn","formatContent","entity","metadata","humanizeEntityRef","defaultKind","field","highlight","customSort","entity1","entity2","localeCompare","render","EntityRefLink","entityRef","createSystemColumn","resolved","EntityRefLinks","entityRefs","partOfSystemRelations","createOwnerColumn","ownedByRelations","createSpecTargetsColumn","spec","targets","target","join","createSpecTypeColumn","width","createSpecLifecycleColumn","createMetadataDescriptionColumn","description","createTagsColumn","cellStyle","padding","tags","t","Chip","style","marginBottom","createTitleColumn","searchable","createLabelColumn","labels","specifiedLabelValue","defaultValue","createNamespaceColumn","YellowStar","withStyles","root","Star","refCompare","b","toRef","defaultColumnsFunc","entities","createEntitySpecificColumns","baseColumns","every","namespace","CatalogTable","columns","actions","tableOptions","subtitle","emptyContent","isStarredEntity","toggleStarredEntity","useStarredEntities","entityListContext","tableColumns","showTypeColumn","titlePreamble","capitalize","user","div","WarningPanel","CodeSnippet","language","toString","defaultActions","url","annotations","ANNOTATION_VIEW_URL","visuallyHidden","OpenInNew","tooltip","disabled","window","open","ANNOTATION_EDIT_URL","Edit","isStarred","paddingLeft","StarBorder","rows","getEntityRelations","RELATION_PART_OF","RELATION_OWNED_BY","stringifyEntityRef","ownedByRelationsTitle","r","partOfSystemRelationTitle","typeColumn","find","c","showPagination","currentKind","currentType","titleDisplay","pluralize","s","Table","isLoading","paging","pageSize","actionsColumnIndex","loadingType","showEmptyDataSourceMessage","pageSizeOptions","data","catalogTranslationRef","createTranslationRef","id","messages","catalog_page_title","catalog_page_create_button_title","loggedRefs","WeakSet","useTranslationRef","translationRef","errorApi","errorApiRef","translationApi","translationApiRef","snapshot","setSnapshot","getTranslation","observable","translation$","onError","useCallback","has","errMsg","console","Error","add","subscription","subscribe","next","ready","unsubscribe","initialRenderRef","Promise","resolve","BaseCatalogPage","content","orgName","configApiRef","getOptionalString","createComponentLink","useRouteRef","createComponentRouteRef","PageWithHeader","themeId","Content","ContentHeader","SupportButton","EntityListProvider","CatalogFilterLayout","Filters","DefaultCatalogPage","initiallySelectedFilter","initialKind","ownerPickerMode","UserListPicker","EntityOwnerPicker","mode","EntityTagPicker","CatalogPage","useOutlet"],"sourceRoot":""}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[3510],{96641:function(se,$,e){e.d($,{X2:function(){return z},h$:function(){return S}});var n=e(52322),C=e(74314),R=e(72388),U=e(29651),A=e(68993),P=e(2784);const V=(0,U.CT)("entity-context"),S=c=>{const{children:f,entity:x,loading:I,error:h,refresh:u}=c,v={entity:x,loading:I,error:h,refresh:u};return(0,n.jsx)(V.Provider,{value:(0,A.E)({1:v}),children:(0,n.jsx)(R.fC,{attributes:{...x?{entityRef:(0,C.eE)(x)}:void 0},children:f})})},F=c=>_jsx(S,{entity:c.entity,loading:!Boolean(c.entity),error:void 0,refresh:void 0,children:c.children});function z(){const c=(0,U.Vt)("entity-context");if(!c)throw new Error("Entity context is not available");const f=c.atVersion(1);if(!f)throw new Error("EntityContext v1 not available");if(!f.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:f.entity}}function B(){const c=useVersionedContext("entity-context");if(!c)throw new Error("Entity context is not available");const f=c.atVersion(1);if(!f)throw new Error("EntityContext v1 not available");const{entity:x,loading:I,error:h,refresh:u}=f;return{entity:x,loading:I,error:h,refresh:u}}},43510:function(se,$,e){e.r($),e.d($,{AboutCard:function(){return Fe},AboutContent:function(){return pe},AboutField:function(){return L}});var n=e(52322),C=e(34106),R=e(90663),U=e(74314),A=e(79692),P=e(94339),V=e(32552),S=e(61837),F=e(85256),z=e(24579),B=e(98864),c=e(2784),f=e(72779),x=e.n(f),I=e(35292),h=e(62774),u=e(90436);const v=(0,A.Z)(i=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:i.palette.text.secondary,cursor:"default"},primary:{color:i.palette.primary.main},secondary:{color:i.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:i.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function j({color:i="primary",disabled:a=!1,href:s="#",icon:o=(0,n.jsx)(I.Z,{}),label:r,onClick:l,title:d}){const p=v();return a?(0,n.jsxs)(h.Z,{title:d,className:x()(p.link,p.disabled),children:[o,(0,n.jsx)(u.Z,{variant:"caption",component:"span",className:p.label,children:r})]}):(0,n.jsxs)(B.rU,{title:d,className:x()(p.link,p[i]),to:s,onClick:l,children:[o,(0,n.jsx)(u.Z,{variant:"caption",component:"span",className:p.label,children:r})]})}const b=(0,A.Z)(i=>({links:{margin:i.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:i.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function m(i){const{links:a}=i,s=b();return(0,n.jsx)("nav",{className:s.links,children:a.map((o,r)=>(0,n.jsx)(j,{...o},r+1))})}var H=e(91657),ee=e(73250),oe=e(80851);const he=i=>{const{type:a}=i,s=(0,oe.q)(),o=ee.Z;var r;const l=a&&(r=s.getSystemIcon(a))!==null&&r!==void 0?r:o;return(0,n.jsx)(l,{})};var J=e(44394),ue=e(78847),ye=e(58513),re=e(37321),fe=e(96641),ge=e(88624),le=e(51547);function ve(i,a){var s;const o=(s=i.metadata.annotations)===null||s===void 0?void 0:s[R.M6];if(o)try{const r=(0,le.Ou)(o),l=a.byUrl(r.target);return{locationTargetUrl:r.target,integrationType:l==null?void 0:l.type}}catch{return}}var de=e(65524),X=e(8709),Q=e(75435),Y=e(51194),ce=e(60905),be=e(7089),xe=e(78527),je=e(2532);const Le=(0,A.Z)(i=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:i.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function L(i){const{label:a,value:s,gridSizes:o,children:r}=i,l=Le(),d=(0,je.v)(r,y=>y.getElements()),p=d.length>0?d:(0,n.jsx)(u.Z,{variant:"body2",className:l.value,children:s||"unknown"});return(0,n.jsxs)(ce.Z,{item:!0,...o,children:[(0,n.jsx)(u.Z,{variant:"h2",className:l.label,children:a}),p]})}var Te=e(24851);const ke=(0,A.Z)({description:{wordBreak:"break-word"}});function Ae(i,a,s){if(a==="url"||i.includes("://"))return i;const o=s.type==="file"?`file://${s.target}`:s.target;return a==="file"||s.type==="file"?new URL(i,o).href:o}function pe(i){var a,s,o,r,l,d,p,y;const{entity:t}=i,ne=ke(),q=t.kind.toLocaleLowerCase("en-US")==="system",G=t.kind.toLocaleLowerCase("en-US")==="resource",w=t.kind.toLocaleLowerCase("en-US")==="component",E=t.kind.toLocaleLowerCase("en-US")==="api",K=t.kind.toLocaleLowerCase("en-US")==="template",T=t.kind.toLocaleLowerCase("en-US")==="location",Z=t.kind.toLocaleLowerCase("en-US")==="group",k=(0,Q.h)(t,X.cz,{kind:"system"}),N=(0,Q.h)(t,X.cz,{kind:"component"}),W=(0,Q.h)(t,X.cz,{kind:"domain"}),_=(0,Q.h)(t,X.S4);let D;try{D=(0,le.CV)(t)}catch{D=void 0}return(0,n.jsxs)(ce.Z,{container:!0,children:[(0,n.jsx)(L,{label:"Description",gridSizes:{xs:12},children:(0,n.jsx)(xe.S,{className:ne.description,content:(t==null||(a=t.metadata)===null||a===void 0?void 0:a.description)||"No description"})}),(0,n.jsx)(L,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:_.length>0&&(0,n.jsx)(Y.r,{entityRefs:_,defaultKind:"group"})}),(q||W.length>0)&&(0,n.jsx)(L,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:W.length>0&&(0,n.jsx)(Y.r,{entityRefs:W,defaultKind:"domain"})}),(E||w||G||k.length>0)&&(0,n.jsx)(L,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:k.length>0&&(0,n.jsx)(Y.r,{entityRefs:k,defaultKind:"system"})}),w&&N.length>0&&(0,n.jsx)(L,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,n.jsx)(Y.r,{entityRefs:N,defaultKind:"component"})}),(E||w||G||K||Z||T||typeof(t==null||(s=t.spec)===null||s===void 0?void 0:s.type)=="string")&&(0,n.jsx)(L,{label:"Type",value:t==null||(o=t.spec)===null||o===void 0?void 0:o.type,gridSizes:{xs:12,sm:6,lg:4}}),(E||w||typeof(t==null||(r=t.spec)===null||r===void 0?void 0:r.lifecycle)=="string")&&(0,n.jsx)(L,{label:"Lifecycle",value:t==null||(l=t.spec)===null||l===void 0?void 0:l.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,n.jsx)(L,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((t==null||(d=t.metadata)===null||d===void 0?void 0:d.tags)||[]).map(g=>(0,n.jsx)(be.Z,{size:"small",label:g},g))}),T&&((t==null||(p=t.spec)===null||p===void 0?void 0:p.targets)||(t==null||(y=t.spec)===null||y===void 0?void 0:y.target))&&(0,n.jsx)(L,{label:"Targets",gridSizes:{xs:12},children:(0,n.jsx)(Te.s,{cols:1,items:(t.spec.targets||[t.spec.target]).map(g=>g).map(g=>{var O;return{text:g,href:Ae(g,(t==null||(O=t.spec)===null||O===void 0?void 0:O.type)||"unknown",D)}})})})]})}var Ce=e(52866),Ee=e(88188),Se=e(30254),Ie=e(27604),we=e(27991),Oe=e.n(we),$e=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"Entity","description":"The parts of the format that's common to all versions/kinds of entity.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":false,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"$ref":"EntityMeta"},"spec":{"type":"object","description":"The specification data describing the entity itself."},"relations":{"type":"array","description":"The relations that this entity has with other entities.","items":{"$ref":"common#relation"}},"status":{"$ref":"common#status"}}}`),Re=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),Ue=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),Pe=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","targetRef"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference","deprecated":true},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const me=new Map,Ze=[Re,$e,Ue,Pe];function Ne(i){if(!(i!=null&&i.length))throw new TypeError("Unknown error");const a=i[0];throw new TypeError(`${a.instancePath||"<root>"} ${a.message}${a.params?` - ${Object.entries(a.params).map(([s,o])=>`${s}: ${o}`).join(", ")}`:""}`)}function De(i,a={}){var s;const o=(s=a==null?void 0:a.disableCache)!==null&&s!==void 0?s:!1,r=o?"":JSON.stringify(i);if(!o){const y=me.get(r);if(y)return y}const l=Me(i),d=new(Oe())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});l.length&&d.addSchema(l,void 0,void 0,!0);const p=d.compile(i);return o||me.set(r,p),p}function Me(i){if(typeof i!="object")return[];const a=new Set;i.$id&&a.add(i.$id);const s=new Array,o=[i];for(;o.length;){const r=o.pop();for(const l of Ve(r))if(!a.has(l)){a.add(l);const d=Ze.find(p=>p.$id===l);d&&(s.push(d),o.push(d))}}return s}function*Ve(i){const a=[i];for(;a.length;){const s=a.pop();if(typeof s=="object"&&s)for(const[o,r]of Object.entries(s))o==="$ref"&&typeof r=="string"?yield r.split("#")[0]:a.push(r)}}function ze(i){const a=De(i);return s=>{var o;if(a(s)===!0)return s;const l=(o=a.errors)===null||o===void 0?void 0:o.filter(d=>["/kind","/apiVersion"].includes(d.instancePath));if(l!=null&&l.length&&l.every(d=>d.keyword==="enum"))return!1;throw Ne(a.errors)}}var Be=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"TemplateV1beta3","description":"A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.","examples":[{"apiVersion":"scaffolder.backstage.io/v1beta3","kind":"Template","metadata":{"name":"react-ssr-template","title":"React SSR Template","description":"Next.js application skeleton for creating isomorphic web applications.","tags":["recommended","react"]},"spec":{"owner":"artist-relations-team","type":"website","parameters":{"required":["name","description","repoUrl"],"backstage:permissions":{"tags":["one","two"]},"properties":{"name":{"title":"Name","type":"string","description":"Unique name of the component"},"description":{"title":"Description","type":"string","description":"Description of the component"},"repoUrl":{"title":"Pick a repository","type":"string","ui:field":"RepoUrlPicker"}}},"steps":[{"id":"fetch","name":"Fetch","action":"fetch:plain","parameters":{"url":"./template"},"backstage:permissions":{"tags":["one","two"]}},{"id":"publish","name":"Publish to GitHub","action":"publish:github","parameters":{"repoUrl":"${{ parameters.repoUrl }}"},"if":"${{ parameters.repoUrl }}"}],"output":{"catalogInfoUrl":"${{ steps.publish.output.catalogInfoUrl }}"}}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["scaffolder.backstage.io/v1beta3"]},"kind":{"enum":["Template"]},"spec":{"type":"object","required":["type","steps"],"properties":{"type":{"type":"string","description":"The type of component created by the template. The software catalog accepts any type value, but an organization should take great care to establish a proper taxonomy for these. Tools including Backstage itself may read this field and behave differently depending on its value. For example, a website type component may present tooling in the Backstage interface that is specific to just websites.","examples":["service","website","library"],"minLength":1},"owner":{"type":"string","description":"The user (or group) owner of the template","minLength":1},"parameters":{"oneOf":[{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}},{"type":"array","description":"A list of separate forms to collect parameters.","items":{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}}]},"steps":{"type":"array","description":"A list of steps to execute.","items":{"type":"object","description":"A description of the step to execute.","required":["action"],"properties":{"id":{"type":"string","description":"The ID of the step, which can be used to refer to its outputs."},"name":{"type":"string","description":"The name of the step, which will be displayed in the UI during the scaffolding process."},"action":{"type":"string","description":"The name of the action to execute."},"input":{"type":"object","description":"A templated object describing the inputs to the action."},"if":{"type":["string","boolean"],"description":"A templated condition that skips the step when evaluated to false. If the condition is true or not defined, the step is executed. The condition is true, if the input is not `false`, `undefined`, `null`, `\\"\\"`, `0`, or `[]`."},"backstage:permissions":{"type":"object","description":"Object used for authorizing the step","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"output":{"type":"object","description":"A templated object describing the outputs of the scaffolding task.","properties":{"links":{"type":"array","description":"A list of external hyperlinks, typically pointing to resources created or updated by the template","items":{"type":"object","required":[],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://github.com/my-org/my-new-repo"],"minLength":1},"entityRef":{"type":"string","description":"An entity reference to an entity in the catalog.","examples":["Component:default/my-app"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["View new repo"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1}}}},"text":{"type":"array","description":"A list of Markdown text blobs, like output data from the template.","items":{"type":"object","required":[],"properties":{"title":{"type":"string","description":"A user friendly display name for the text.","examples":["Output Content"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"content":{"type":"string","description":"The text blob to display in the UI, rendered as Markdown.","examples":["**hey** _I\'m_ Markdown"]}}}}},"additionalProperties":{"type":"string"}}}}}}]}');const He=ze(Be),Ye={async check(i){return He(i)===i}},Ge=i=>i.apiVersion==="scaffolder.backstage.io/v1beta3"&&i.kind==="Template",Ke="backstage.io/techdocs-ref",te="backstage.io/techdocs-entity",We=(0,A.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function Fe(i){var a,s,o,r,l;const{variant:d}=i,p=(0,oe.q)(),y=We(),{entity:t}=(0,fe.X2)(),ne=(0,J.h_)(H.q),q=(0,J.h_)(ge.A),G=(0,J.h_)(ue.$),w=(0,J.h_)(ye.V),E=(0,re.t)(de.jU),K=(0,re.t)(de.ql),T=ve(t,ne),Z=(a=t.metadata.annotations)===null||a===void 0?void 0:a[C.Tf];let k;if(!((s=t.metadata.annotations)===null||s===void 0)&&s[te])try{var N;k=(0,U.of)((N=t.metadata.annotations)===null||N===void 0?void 0:N[te])}catch{k=void 0}const W={label:"View Source",disabled:!T,icon:(0,n.jsx)(he,{type:T==null?void 0:T.integrationType}),href:T==null?void 0:T.locationTargetUrl},_={label:"View TechDocs",disabled:!(!((o=t.metadata.annotations)===null||o===void 0)&&o[Ke]||!((r=t.metadata.annotations)===null||r===void 0)&&r[te])||!E,icon:(0,n.jsx)(Se.Z,{}),href:E&&E(k?{namespace:k.namespace||C.zG,kind:k.kind,name:k.name}:{namespace:t.metadata.namespace||C.zG,kind:t.kind,name:t.metadata.name})},D=[W,_];if(Ge(t)){var g;const ae=(g=p.getSystemIcon("scaffolder"))!==null&&g!==void 0?g:Ee.Z,Qe={label:"Launch Template",icon:(0,n.jsx)(ae,{}),disabled:!K,href:K&&K({templateName:t.metadata.name,namespace:t.metadata.namespace||C.zG})};D.push(Qe)}let O="";d==="gridItem"?O=y.gridItemCard:d==="fullHeight"&&(O=y.fullHeightCard);let ie="";d==="gridItem"?ie=y.gridItemCardContent:d==="fullHeight"&&(ie=y.fullHeightCardContent);const M=(l=t.metadata.annotations)===null||l===void 0?void 0:l[R.P1],Je=(M==null?void 0:M.startsWith("url:"))||(M==null?void 0:M.startsWith("file:")),Xe=(0,c.useCallback)(async()=>{try{await q.refreshEntity((0,U.eE)(t)),G.post({message:"Refresh scheduled",severity:"info",display:"transient"})}catch(ae){w.post(ae)}},[q,G,w,t]);return(0,n.jsxs)(P.Z,{className:O,children:[(0,n.jsx)(V.Z,{title:"About",action:(0,n.jsxs)(n.Fragment,{children:[Je&&(0,n.jsx)(S.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:Xe,children:(0,n.jsx)(Ce.Z,{})}),(0,n.jsx)(S.Z,{component:B.rU,"aria-label":"Edit",disabled:!Z,title:"Edit Metadata",to:Z!=null?Z:"#",children:(0,n.jsx)(Ie.Z,{})})]}),subheader:(0,n.jsx)(m,{links:D})}),(0,n.jsx)(F.Z,{}),(0,n.jsx)(z.Z,{className:ie,children:(0,n.jsx)(pe,{entity:t})})]})}},24851:function(se,$,e){e.d($,{s:function(){return I}});var n=e(52322),C=e(90348),R=e(11861),U=e(2784),A=e(79692),P=e(62774),V=e(90436),S=e(52160),F=e(98864);const z=(0,A.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function B(h){const{href:u,text:v,Icon:j}=h,b=z();return(0,n.jsxs)(P.Z,{display:"flex",children:[(0,n.jsx)(P.Z,{mr:1,className:b.svgIcon,children:(0,n.jsx)(V.Z,{component:"div",children:j?(0,n.jsx)(j,{}):(0,n.jsx)(S.Z,{})})}),(0,n.jsx)(P.Z,{flexGrow:"1",children:(0,n.jsx)(F.rU,{to:u,target:"_blank",rel:"noopener",children:v||u})})]})}var c=e(41156);const f={xs:1,sm:1,md:1,lg:2,xl:3};function x(h){const u=[(0,c.Z)(m=>m.breakpoints.up("xl"))?"xl":null,(0,c.Z)(m=>m.breakpoints.up("lg"))?"lg":null,(0,c.Z)(m=>m.breakpoints.up("md"))?"md":null,(0,c.Z)(m=>m.breakpoints.up("sm"))?"sm":null,(0,c.Z)(m=>m.breakpoints.up("xs"))?"xs":null];let v=1;if(typeof h=="number")v=h;else{var j;const m=(j=u.find(H=>H!==null))!==null&&j!==void 0?j:"xs";var b;v=(b=h==null?void 0:h[m])!==null&&b!==void 0?b:f[m]}return v}function I(h){const{items:u,cols:v=void 0}=h,j=x(v);return(0,n.jsx)(C.Z,{rowHeight:"auto",cols:j,children:u.map(({text:b,href:m,Icon:H},ee)=>(0,n.jsx)(R.Z,{children:(0,n.jsx)(B,{href:m,text:b!=null?b:m,Icon:H})},ee))})}}}]);})();
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=3510.
|
|
3
|
+
//# sourceMappingURL=3510.3082d0d9.chunk.js.map
|