@techdocs/cli 1.8.25-next.0 → 1.8.25-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/embedded-app/.config-schema.json +1201 -235
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/index.html.tmpl +1 -1
- package/dist/embedded-app/static/{124.c9dccb21.chunk.js → 124.f02a9318.chunk.js} +2 -2
- package/dist/embedded-app/static/{124.c9dccb21.chunk.js.map → 124.f02a9318.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{1297.5286dfc5.chunk.js → 1297.39864036.chunk.js} +2 -2
- package/dist/embedded-app/static/{1297.5286dfc5.chunk.js.map → 1297.39864036.chunk.js.map} +1 -1
- package/dist/embedded-app/static/2177.89ce5c05.chunk.js +4 -0
- package/dist/embedded-app/static/2177.89ce5c05.chunk.js.map +1 -0
- package/dist/embedded-app/static/{2401.73c0abd9.chunk.js → 2401.4d69c234.chunk.js} +2 -2
- package/dist/embedded-app/static/{2401.73c0abd9.chunk.js.map → 2401.4d69c234.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{2420.f4515d6b.chunk.js → 2420.979e1d31.chunk.js} +2 -2
- package/dist/embedded-app/static/{2420.f4515d6b.chunk.js.map → 2420.979e1d31.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{287.93e12210.chunk.js → 287.e0b65890.chunk.js} +2 -2
- package/dist/embedded-app/static/{287.93e12210.chunk.js.map → 287.e0b65890.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{3182.b8a79377.chunk.js → 3182.0ac241c5.chunk.js} +2 -2
- package/dist/embedded-app/static/{3182.b8a79377.chunk.js.map → 3182.0ac241c5.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{3632.e83e9e79.chunk.js → 3632.f343436e.chunk.js} +2 -2
- package/dist/embedded-app/static/{3632.e83e9e79.chunk.js.map → 3632.f343436e.chunk.js.map} +1 -1
- package/dist/embedded-app/static/5724.a402c41f.chunk.js +4 -0
- package/dist/embedded-app/static/5724.a402c41f.chunk.js.map +1 -0
- package/dist/embedded-app/static/{6271.e3f614f0.chunk.js → 6271.020ea145.chunk.js} +2 -2
- package/dist/embedded-app/static/{6271.e3f614f0.chunk.js.map → 6271.020ea145.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{6415.dd062904.chunk.js → 6415.493349e2.chunk.js} +2 -2
- package/dist/embedded-app/static/{6415.dd062904.chunk.js.map → 6415.493349e2.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8307.a297621e.chunk.js → 8307.b0a2a85f.chunk.js} +2 -2
- package/dist/embedded-app/static/{8307.a297621e.chunk.js.map → 8307.b0a2a85f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8384.34bb2920.chunk.js → 8384.b9605cda.chunk.js} +2 -2
- package/dist/embedded-app/static/{8384.34bb2920.chunk.js.map → 8384.b9605cda.chunk.js.map} +1 -1
- package/dist/embedded-app/static/8803.20e0d00b.chunk.js +11 -0
- package/dist/embedded-app/static/8803.20e0d00b.chunk.js.map +1 -0
- package/dist/embedded-app/static/{9652.87ca2ab5.chunk.js → 9652.78fa0c73.chunk.js} +2 -2
- package/dist/embedded-app/static/{9652.87ca2ab5.chunk.js.map → 9652.78fa0c73.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{main.a90fd85d.js → main.b64c6be2.js} +5 -5
- package/dist/embedded-app/static/main.b64c6be2.js.map +1 -0
- package/dist/embedded-app/static/{module-material-ui.05c1a36a.js → module-material-ui.909829ed.js} +3 -3
- package/dist/embedded-app/static/{module-material-ui.05c1a36a.js.map → module-material-ui.909829ed.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.a90fd85d.js → runtime.b64c6be2.js} +2 -2
- package/dist/embedded-app/static/{runtime.a90fd85d.js.map → runtime.b64c6be2.js.map} +1 -1
- package/dist/embedded-app/static/vendor.b64c6be2.js +170 -0
- package/dist/embedded-app/static/vendor.b64c6be2.js.map +1 -0
- package/dist/package.json.cjs.js +1 -1
- package/package.json +6 -6
- package/dist/embedded-app/static/2177.8343b97e.chunk.js +0 -4
- package/dist/embedded-app/static/2177.8343b97e.chunk.js.map +0 -1
- package/dist/embedded-app/static/5724.a8d74000.chunk.js +0 -4
- package/dist/embedded-app/static/5724.a8d74000.chunk.js.map +0 -1
- package/dist/embedded-app/static/8803.2d9f247d.chunk.js +0 -11
- package/dist/embedded-app/static/8803.2d9f247d.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.a90fd85d.js.map +0 -1
- package/dist/embedded-app/static/vendor.a90fd85d.js +0 -170
- package/dist/embedded-app/static/vendor.a90fd85d.js.map +0 -1
package/dist/package.json.cjs.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@techdocs/cli",
|
|
3
|
-
"version": "1.8.25-next.
|
|
3
|
+
"version": "1.8.25-next.1",
|
|
4
4
|
"description": "Utility CLI for managing TechDocs sites in Backstage.",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "cli"
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"watch": "./src"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@backstage/backend-defaults": "0.7.0-next.
|
|
48
|
-
"@backstage/catalog-model": "1.7.
|
|
47
|
+
"@backstage/backend-defaults": "0.7.0-next.1",
|
|
48
|
+
"@backstage/catalog-model": "1.7.3-next.0",
|
|
49
49
|
"@backstage/cli-common": "0.1.15",
|
|
50
|
-
"@backstage/config": "1.3.
|
|
51
|
-
"@backstage/plugin-techdocs-node": "1.12.16-next.
|
|
50
|
+
"@backstage/config": "1.3.2-next.0",
|
|
51
|
+
"@backstage/plugin-techdocs-node": "1.12.16-next.1",
|
|
52
52
|
"commander": "^12.0.0",
|
|
53
53
|
"fs-extra": "^11.0.0",
|
|
54
54
|
"global-agent": "^3.0.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"winston": "^3.2.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@backstage/cli": "0.29.5-next.
|
|
61
|
+
"@backstage/cli": "0.29.5-next.1",
|
|
62
62
|
"@types/commander": "^2.12.2",
|
|
63
63
|
"@types/fs-extra": "^11.0.0",
|
|
64
64
|
"@types/http-proxy": "^1.17.4",
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[2177],{48514:(W,C,e)=>{e.d(C,{M:()=>I});var t=e(31085),d=e(58837),E=e(71677),P=e(14041),K=e(72501);const R=(0,d.A)({container:{overflow:"visible !important"},typo:{fontSize:"inherit",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box","-webkit-line-clamp":({line:v})=>v||1,"-webkit-box-orient":"vertical"}},{name:"BackstageOverflowTooltip"});function I(v){const z=R(v);return(0,t.jsx)(E.Ay,{title:v.title??(v.text||""),placement:v.placement,children:(0,t.jsx)(K.A,{className:z.typo,variant:"inherit",children:v.text})})}},35773:(W,C,e)=>{e.d(C,{C4:()=>P,tS:()=>R});var t=e(14117);const d="catalog-entity",E=(0,t.i)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:d}),P=(0,t.i)({name:"catalog.entity.create",attributes:{action:"create"}}),K=(0,t.i)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:d}),R=(0,t.i)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:d}),I=(0,t.i)({name:"catalog.entity.validate",attributes:{}}),v=(0,t.i)({name:"catalog.location.read",attributes:{action:"read"}}),z=(0,t.i)({name:"catalog.location.create",attributes:{action:"create"}}),O=(0,t.i)({name:"catalog.location.analyze",attributes:{}}),H=(0,t.i)({name:"catalog.location.delete",attributes:{action:"delete"}}),J=[E,P,K,R,I,v,z,H,O]},90759:(W,C,e)=>{e.d(C,{W:()=>d});var t=e(93184);const d=(0,t.h)({id:"catalog",messages:{indexPage:{title:"{{orgName}} Catalog",createButtonTitle:"Create",supportButtonContent:"All your software catalog entities"},aboutCard:{title:"About",refreshButtonTitle:"Schedule entity refresh",editButtonTitle:"Edit Metadata",createSimilarButtonTitle:"Create something similar",refreshScheduledMessage:"Refresh scheduled",launchTemplate:"Launch Template",viewTechdocs:"View TechDocs",viewSource:"View Source",descriptionField:{label:"Description",value:"No description"},ownerField:{label:"Owner",value:"No Owner"},domainField:{label:"Domain",value:"No Domain"},systemField:{label:"System",value:"No System"},parentComponentField:{label:"Parent Component",value:"No Parent Component"},typeField:{label:"Type"},lifecycleField:{label:"Lifecycle"},tagsField:{label:"Tags",value:"No Tags"},targetsField:{label:"Targets"}},searchResultItem:{lifecycle:"Lifecycle",Owner:"Owner"},catalogTable:{warningPanelTitle:"Could not fetch catalog entities.",viewActionTitle:"View",editActionTitle:"Edit",starActionTitle:"Add to favorites",unStarActionTitle:"Remove from favorites"},dependencyOfComponentsCard:{title:"Dependency of components",emptyMessage:"No component depends on this component"},dependsOnComponentsCard:{title:"Depends on components",emptyMessage:"No component is a dependency of this component"},dependsOnResourcesCard:{title:"Depends on resources",emptyMessage:"No resource is a dependency of this component"},entityContextMenu:{copiedMessage:"Copied!",moreButtonTitle:"More",inspectMenuTitle:"Inspect entity",copyURLMenuTitle:"Copy entity URL",unregisterMenuTitle:"Unregister entity"},entityLabelsCard:{title:"Labels",emptyDescription:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityLabels:{warningPanelTitle:"Entity not found",ownerLabel:"Owner",lifecycleLabel:"Lifecycle"},entityLinksCard:{title:"Links",emptyDescription:"No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityNotFound:{title:"Entity was not found",description:"Want to help us build this? Check out our Getting Started documentation.",docButtonTitle:"DOCS"},deleteEntity:{dialogTitle:"Are you sure you want to delete this entity?",deleteButtonTitle:"Delete",cancelButtonTitle:"Cancel",description:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."},entityProcessingErrorsDescription:"The error below originates from",entityRelationWarningDescription:`This entity has relations to other entities, which can't be found in the catalog.
|
|
2
|
-
Entities not found are: `,hasComponentsCard:{title:"Has components",emptyMessage:"No component is part of this system"},hasResourcesCard:{title:"Has resources",emptyMessage:"No resource is part of this system"},hasSubcomponentsCard:{title:"Has subcomponents",emptyMessage:"No subcomponent is part of this component"},hasSubdomainsCard:{title:"Has subdomains",emptyMessage:"No subdomain is part of this domain"},hasSystemsCard:{title:"Has systems",emptyMessage:"No system is part of this domain"},relatedEntitiesCard:{emptyHelpLinkTitle:"Learn how to change this"},systemDiagramCard:{title:"System Diagram",description:"Use pinch & zoo to move around the diagram.",edgeLabels:{partOf:"part of",provides:"provides",dependsOn:"depends on"}}}})},62177:(W,C,e)=>{e.r(C),e.d(C,{BaseCatalogPage:()=>xt,CatalogPage:()=>je,DefaultCatalogPage:()=>Tt});var t=e(31085),d=e(14041),E=e(18690),P=e(27155),K=e(26280),R=e(59428),I=e(64947),v=e(29365),z=e(5893),O=e(73657),H=e(25534);function J(n){const{title:a,to:i}=n,o=(0,z.A)(s=>s.breakpoints.down("xs"));return i?o?(0,t.jsx)(v.A,{component:O.N_,color:"primary",title:a,size:"small",to:i,children:(0,t.jsx)(H.A,{})}):(0,t.jsx)(I.A,{component:O.N_,variant:"contained",color:"primary",to:i,children:a}):null}var f=e(27586),y=e(72427),L=e(65461),F=e(9222),x=e(21405),V=e(54203),it=e(66917),ot=e(36017),Z=e(10394),N=e(92822),st=e(73466),lt=e(7341);function At(){const n=(0,y.gf)(lt.v),{error:a,loading:i,value:o}=(0,st.A)(async()=>{const{facets:s}=await n.getEntityFacets({facets:["kind"]}),l=(s.kind??[]).map(r=>r.value);return new Map(l.map(r=>[r.toLocaleLowerCase("en-US"),r]))},[n]);return{loading:i,error:a,allKinds:o??new Map}}function jt(n,a,i){let o=Array.from(n.keys());a&&(o=a.map(l=>l.toLocaleLowerCase("en-US")).filter(l=>n.has(l)));const s=new Map(o.map(l=>[l,n.get(l)||l]));return i&&!s.has(i)&&s.set(i.toLocaleLowerCase("en-US"),i),s}var U=e(64630),b=e(87849);function Et(n){const{filters:a,queryParameters:{kind:i},updateFilters:o}=(0,x.nK)(),s=(0,d.useMemo)(()=>[i].flat()[0],[i]),[l,r]=(0,d.useState)(s??a.kind?.value??n.initialFilter);(0,d.useEffect)(()=>{s&&r(s)},[s]),(0,d.useEffect)(()=>{a.kind?.value&&r(a.kind?.value)},[a.kind]);const{allKinds:u,loading:c,error:p}=At(),m=u.get(l)||l;return(0,d.useEffect)(()=>{o({kind:l?new N.gM(l,m):void 0})},[l,m,o]),{loading:c,error:p,allKinds:u,selectedKind:l,setSelectedKind:r}}const Lt=n=>{const{allowedKinds:a,hidden:i,initialFilter:o="component"}=n,{t:s}=(0,b.i)(U.j),l=(0,y.gf)(ot.k),{error:r,allKinds:u,selectedKind:c,setSelectedKind:p}=Et({initialFilter:o});if((0,d.useEffect)(()=>{r&&l.post({message:s("entityKindPicker.errorMessage"),severity:"error"})},[r,l,s]),r)return null;const T=[...jt(u,a,c).entries()].map(([h,S])=>({label:S,value:h}));return i?null:(0,t.jsx)(Z.A,{pb:1,pt:1,children:(0,t.jsx)(it.w,{label:s("entityKindPicker.title"),items:T,selected:c.toLocaleLowerCase("en-US"),onChange:h=>p(String(h))})})};var Y=e(58837),rt=e(50207);const bt=(0,Y.A)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Mt=n=>{const{initialFilter:a=[]}=n,i=bt(),{t:o}=(0,b.i)(U.j);return(0,t.jsx)(rt.y,{label:o("entityLifecyclePicker.title"),name:"lifecycles",path:"spec.lifecycle",Filter:N.I5,InputProps:{className:i.input},initialSelectedOptions:a})},Rt=(0,Y.A)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),Ot=n=>{const{initiallySelectedNamespaces:a}=n,i=Rt(),{t:o}=(0,b.i)(U.j);return(0,t.jsx)(rt.y,{label:o("entityNamespacePicker.title"),name:"namespace",path:"metadata.namespace",Filter:N.z,InputProps:{className:i.input},initialSelectedOptions:a})};var Ft=e(72987),Nt=e(69076),Bt=e(86901),Dt=e(16249),Q=e(72501),Kt=e(12398),It=e(44148),zt=e(41260),Ut=e(6924),wt=e(20577);const Wt=(0,Y.A)(n=>(0,Kt.A)({root:{},input:{backgroundColor:n.palette.background.paper},label:{textTransform:"none",fontWeight:"bold"}}),{name:"CatalogReactEntityProcessingStatusPickerPicker"}),Ht=(0,t.jsx)(zt.A,{fontSize:"small"}),Vt=(0,t.jsx)(It.A,{fontSize:"small"}),Yt=()=>{const n=Wt(),{updateFilters:a}=(0,x.nK)(),{t:i}=(0,b.i)(U.j),[o,s]=(0,d.useState)([]);function l(c){a({orphan:c?new N.Kf(c):void 0})}function r(c){a({error:c?new N.mT(c):void 0})}const u=["Is Orphan","Has Error"];return(0,t.jsx)(Z.A,{className:n.root,pb:1,pt:1,children:(0,t.jsxs)(Q.A,{className:n.label,variant:"button",component:"label",children:[i("entityProcessingStatusPicker.title"),(0,t.jsx)(wt.Ay,{PopperComponent:c=>(0,t.jsx)("div",{...c,children:c.children}),multiple:!0,disableCloseOnSelect:!0,options:u,value:o,onChange:(c,p)=>{s(p),l(p.includes("Is Orphan")),r(p.includes("Has Error"))},renderOption:(c,{selected:p})=>(0,t.jsx)(Bt.A,{control:(0,t.jsx)(Nt.A,{icon:Ht,checkedIcon:Vt,checked:p}),onClick:m=>m.preventDefault(),label:c}),size:"small",popupIcon:(0,t.jsx)(Ut.A,{"data-testid":"processing-status-picker-expand"}),renderInput:c=>(0,t.jsx)(Dt.A,{...c,className:n.input,variant:"outlined"})})]})})};var Gt=e(91035),Xt=e(46343),Jt=e.n(Xt),Qt=e(40074),kt=e.n(Qt);function $t(){const n=(0,y.gf)(lt.v),{filters:{kind:a,type:i},queryParameters:{type:o},updateFilters:s}=(0,x.nK)(),l=(0,d.useMemo)(()=>[o].flat().filter(Boolean),[o]),[r,u]=(0,d.useState)(l.length?l:i?.getTypes()??[]);(0,d.useEffect)(()=>{l.length&&u(l)},[l]);const[c,p]=(0,d.useState)([]),m=(0,d.useMemo)(()=>a?.value,[a]),{error:T,loading:h,value:S}=(0,st.A)(async()=>m?await n.getEntityFacets({filter:{kind:m},facets:["spec.type"]}).then(A=>A.facets["spec.type"]||[]):[],[m,n]),X=(0,d.useRef)(S);return(0,d.useEffect)(()=>{const w=X.current;if(X.current=S,h||!m||w===S||!S)return;const A=[...new Set(kt()(S,B=>-B.count).map(B=>B.value.toLocaleLowerCase("en-US")))];p(A);const $=r.filter(B=>A.includes(B));Jt()(r,$)||u($)},[h,m,r,u,S]),(0,d.useEffect)(()=>{s({type:r.length?new N.qA(r):void 0})},[r,s]),{loading:h,error:T,availableTypes:c,selectedTypes:r,setSelectedTypes:u}}const Zt=n=>{const{hidden:a,initialFilter:i}=n,o=(0,y.gf)(ot.k),{error:s,availableTypes:l,selectedTypes:r,setSelectedTypes:u}=$t(),{t:c}=(0,b.i)(U.j);if((0,d.useEffect)(()=>{s&&o.post({message:c("entityTypePicker.errorMessage"),severity:"error"}),i&&u([i])},[s,o,i,u,c]),l.length===0||s)return null;l.sort((m,T)=>m.toLocaleLowerCase("en-US").localeCompare(T.toLocaleLowerCase("en-US")));const p=[{value:"all",label:c("entityTypePicker.optionAllTitle")},...l.map(m=>({value:m,label:m}))];return a?null:(0,t.jsx)(Z.A,{pb:1,pt:1,children:(0,t.jsx)(it.w,{label:c("entityTypePicker.title"),items:p,selected:(p.length>1?r[0]:void 0)??"all",onChange:m=>u(m==="all"?[]:[String(m)])})})};var qt=e(67626);const _t=n=>{const{initialKind:a,initiallySelectedFilter:i,ownerPickerMode:o,initiallySelectedNamespaces:s}=n;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Lt,{initialFilter:a}),(0,t.jsx)(Zt,{}),(0,t.jsx)(qt.y,{initialFilter:i}),(0,t.jsx)(Ft.t,{mode:o}),(0,t.jsx)(Mt,{}),(0,t.jsx)(Gt.m,{}),(0,t.jsx)(Yt,{}),(0,t.jsx)(Ot,{initiallySelectedNamespaces:s})]})};var te=e(95203),ct=e(72348),dt=e(51372),ee=e(6820),ne=e(88640),ae=e(77310),q=e(14209),G=e(90184),ie=e(56889),ut=e(67871),mt=e(88654),oe=e(75625),se=e(39330),le=e(45250),re=e(65398),ce=e.n(re),de=e(8859),pt=e(34428),ft=e(67720),yt=e(48514);const g=Object.freeze({createNameColumn(n){function a(i){return i.metadata?.title||(0,G.S)(i,{defaultKind:n?.defaultKind})}return{title:"Name",field:"resolved.entityRef",highlight:!0,customSort({entity:i},{entity:o}){return a(i).localeCompare(a(o))},render:({entity:i})=>(0,t.jsx)(de.z,{entityRef:i,defaultKind:n?.defaultKind||"Component"})}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:n})=>(0,t.jsx)(pt.i,{entityRefs:n.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:n})=>(0,t.jsx)(pt.i,{entityRefs:n.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",customFilterAndSearch:(n,a)=>{let i=[];return a.entity?.spec?.targets&&Array.isArray(a.entity?.spec?.targets)?i=a.entity?.spec?.targets:a.entity?.spec?.target&&(i=[a.entity?.spec?.target]),i.join(", ").toLocaleUpperCase("en-US").includes(n.toLocaleUpperCase("en-US"))},render:({entity:n})=>(0,t.jsx)(t.Fragment,{children:(n?.spec?.targets||n?.spec?.target)&&(0,t.jsx)(yt.M,{text:(n.spec.targets||[n.spec.target]).join(", "),placement:"bottom-start"})})}},createSpecTypeColumn(n={hidden:!1}){return{title:"Type",field:"entity.spec.type",hidden:n.hidden,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:n})=>(0,t.jsx)(yt.M,{text:n.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:n})=>(0,t.jsx)(t.Fragment,{children:n.metadata.tags&&n.metadata.tags.map(a=>(0,t.jsx)(ft.A,{label:a,size:"small",variant:"outlined",style:{marginBottom:"0px"}},a))}),width:"auto"}},createTitleColumn(n){return{title:"Title",field:"entity.metadata.title",hidden:n?.hidden,searchable:!0}},createLabelColumn(n,a){function i(o,s){const l=s.metadata?.labels;return l&&l[o]||""}return{title:a?.title||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},customSort({entity:o},{entity:s}){return i(n,o).localeCompare(i(n,s))},render:({entity:o})=>{const s=o.metadata?.labels,l=s&&s[n]||a?.defaultValue;return(0,t.jsx)(t.Fragment,{children:l&&(0,t.jsx)(ft.A,{label:l,size:"small",variant:"outlined"},l)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}});var ue=e(95061),me=e(63301),gt=e(34839),ht=e(75173),pe=e(64704),fe=e(45917),ye=e(16983);const ge=(0,Y.A)(n=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),he=()=>{const n=ge(),{t:a}=(0,b.i)(U.j),{updateFilters:i,queryParameters:{text:o}}=(0,x.nK)(),s=(0,d.useMemo)(()=>[o].flat()[0],[o]),[l,r]=(0,d.useState)(s??"");return(0,ye.A)(()=>{i({text:l.length?new N.V3(l):void 0})},250,[l,i]),(0,d.useEffect)(()=>{s&&r(s)},[s]),(0,t.jsx)(ht.A,{className:n.searchToolbar,children:(0,t.jsx)(ue.A,{children:(0,t.jsx)(me.A,{"aria-label":"search",id:"input-with-icon-adornment",className:n.input,placeholder:a("entitySearchBar.placeholder"),autoComplete:"off",onChange:u=>r(u.target.value),value:l,startAdornment:(0,t.jsx)(gt.A,{position:"start",children:(0,t.jsx)(fe.A,{})}),endAdornment:(0,t.jsx)(gt.A,{position:"end",children:(0,t.jsx)(v.A,{"aria-label":"clear search",onClick:()=>r(""),edge:"end",disabled:l.length===0,children:(0,t.jsx)(pe.A,{})})})})})})},ve=(0,Y.A)(n=>({root:{paddingTop:n.spacing(1.25),paddingLeft:n.spacing(2.5),paddingBottom:n.spacing(.75),display:"flex",justifyContent:"space-between"},text:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}),{name:"PluginCatalogTableToolbar"});function _(n){const a=ve();return(0,t.jsxs)(ht.A,{className:a.root,children:[(0,t.jsx)(Q.A,{variant:"h5",className:a.text,children:n.title}),(0,t.jsx)(he,{})]})}function Ce(n){const{columns:a,data:i,options:o,...s}=n,{setLimit:l,setOffset:r,limit:u,totalItems:c,offset:p}=(0,x.nK)(),[m,T]=d.useState(p&&u?Math.floor(p/u):0);return(0,d.useEffect)(()=>{c&&m*u>=c?r(Math.max(0,c-u)):r(Math.max(0,m*u))},[r,m,u,c]),(0,t.jsx)(q.X,{columns:a,data:i,options:{paginationPosition:"both",pageSizeOptions:[5,10,20,50,100],pageSize:u,emptyRowsWhenPaging:!1,...o},components:{Toolbar:_},page:m,onPageChange:h=>{T(h)},onRowsPerPageChange:h=>{l(h)},totalCount:c,localization:{pagination:{labelDisplayedRows:""}},...s})}function xe(n){const{columns:a,data:i,next:o,prev:s,options:l,...r}=n;return(0,t.jsx)(q.X,{columns:a,data:i,options:{paginationPosition:"both",...l,pageSizeOptions:[],showFirstLastPageButtons:!1,pageSize:Number.MAX_SAFE_INTEGER,emptyRowsWhenPaging:!1},onPageChange:u=>{u>0?o?.():s?.()},components:{Toolbar:_},page:s?1:0,totalCount:o?Number.MAX_VALUE:Number.MAX_SAFE_INTEGER,localization:{pagination:{labelDisplayedRows:""}},...r})}const vt=({filters:n,entities:a})=>{const i=n.type===void 0;return[g.createTitleColumn({hidden:!0}),g.createNameColumn({defaultKind:n.kind?.value}),...o()];function o(){const s=[g.createMetadataDescriptionColumn(),g.createTagsColumn()],l=[g.createSystemColumn(),g.createOwnerColumn(),g.createSpecTypeColumn({hidden:!i}),g.createSpecLifecycleColumn()];switch(n.kind?.value){case"user":return[...s];case"domain":case"system":return[g.createOwnerColumn(),...s];case"group":case"template":return[g.createSpecTypeColumn({hidden:!i}),...s];case"location":return[g.createSpecTypeColumn({hidden:!i}),g.createSpecTargetsColumn()];default:return a.every(r=>r.metadata.namespace==="default")?[...l,...s]:[...l,g.createNamespaceColumn(),...s]}}};var Ct=e(90759),Te=e(18956);const Se=(n,a)=>{const i=o=>o.metadata.title||(0,G.S)(o,{defaultKind:"Component"});return i(n).localeCompare(i(a))},k=n=>{const{columns:a=vt,tableOptions:i,subtitle:o,emptyContent:s}=n,{isStarredEntity:l,toggleStarredEntity:r}=(0,ie.I)(),u=(0,x.nK)(),{loading:c,error:p,entities:m,filters:T,pageInfo:h,totalItems:S,paginationMode:X}=u,w=(0,d.useMemo)(()=>typeof a=="function"?a(u):a,[a,u]),{t:A}=(0,b.i)(Ct.W);if(p)return(0,t.jsx)("div",{children:(0,t.jsx)(ne.B,{severity:"error",title:A("catalogTable.warningPanelTitle"),children:(0,t.jsx)(ae.z,{language:"text",text:p.toString()})})});const $=[({entity:M})=>{const j=M.metadata.annotations?.[ct._P],D=A("catalogTable.viewActionTitle");return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Q.A,{style:mt.A,children:D}),(0,t.jsx)(se.A,{fontSize:"small"})]}),tooltip:D,disabled:!j,onClick:()=>{j&&window.open(j,"_blank")}}},({entity:M})=>{const j=M.metadata.annotations?.[ct.P],D=A("catalogTable.editActionTitle");return{icon:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Q.A,{style:mt.A,children:D}),(0,t.jsx)(oe.A,{fontSize:"small"})]}),tooltip:D,disabled:!j,onClick:()=>{j&&window.open(j,"_blank")}}},({entity:M})=>{const j=l(M),D=A(j?"catalogTable.unStarActionTitle":"catalogTable.starActionTitle");return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,t.jsx)(Te.m,{isFavorite:j}),tooltip:D,onClick:()=>r(M)}}],B=T.kind?.label||"",Ee=T.type?.value||"",Le=typeof S=="number"?`(${S})`:"",be=(0,le.capitalize)(T.user?.value??"all"),et=n.title||[be,Ee,ce()(B),Le].filter(M=>M).join(" "),nt=n.actions||$,at={actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!c,padding:"dense",...i};if(X==="cursor")return(0,t.jsx)(xe,{columns:w,emptyContent:s,isLoading:c,title:et,actions:nt,subtitle:o,options:at,data:m.map(tt),next:h?.next,prev:h?.prev});if(X==="offset")return(0,t.jsx)(Ce,{columns:w,emptyContent:s,isLoading:c,title:et,actions:nt,subtitle:o,options:at,data:m.map(tt)});const St=m.sort(Se).map(tt),Pt=20,Me=St.length>Pt;return(0,t.jsx)(q.X,{isLoading:c,columns:w,options:{paging:Me,pageSize:Pt,pageSizeOptions:[20,50,100],...at},components:{Toolbar:_},title:et,data:St,actions:nt,subtitle:o,emptyContent:s})};k.columns=g,k.defaultColumnsFunc=vt;function tt(n){const a=(0,ut.t)(n,dt.jn,{kind:"system"}),i=(0,ut.t)(n,dt.vv);return{entity:n,resolved:{name:(0,G.S)(n,{defaultKind:"Component"}),entityRef:(0,ee.U2)(n),ownedByRelationsTitle:i.map(o=>(0,G.S)(o,{defaultKind:"group"})).join(", "),ownedByRelations:i,partOfSystemRelationTitle:a.map(o=>(0,G.S)(o,{defaultKind:"system"})).join(", "),partOfSystemRelations:a}}}var Pe=e(35773),Ae=e(36989);function xt(n){const{filters:a,content:i=(0,t.jsx)(k,{}),pagination:o}=n,s=(0,y.gf)(L.U).getOptionalString("organization.name")??"Backstage",l=(0,F.S)(te.qP),{t:r}=(0,b.i)(Ct.W),{allowed:u}=(0,Ae.J)({permission:Pe.C4});return(0,t.jsx)(P.d,{title:r("indexPage.title",{orgName:s}),themeId:"home",children:(0,t.jsxs)(K.U,{children:[(0,t.jsxs)(R.d,{title:"",children:[u&&(0,t.jsx)(J,{title:r("indexPage.createButtonTitle"),to:l&&l()}),(0,t.jsx)(f.Y,{children:r("indexPage.supportButtonContent")})]}),(0,t.jsx)(x.B9,{pagination:o,children:(0,t.jsxs)(V.GI,{children:[(0,t.jsx)(V.GI.Filters,{children:a}),(0,t.jsx)(V.GI.Content,{children:i})]})})]})})}function Tt(n){const{columns:a,actions:i,initiallySelectedFilter:o="owned",initialKind:s="component",tableOptions:l={},emptyContent:r,pagination:u,ownerPickerMode:c,filters:p,initiallySelectedNamespaces:m}=n;return(0,t.jsx)(xt,{filters:p??(0,t.jsx)(_t,{initialKind:s,initiallySelectedFilter:o,ownerPickerMode:c,initiallySelectedNamespaces:m}),content:(0,t.jsx)(k,{columns:a,actions:i,tableOptions:l,emptyContent:r}),pagination:u})}function je(n){return(0,E.P1)()||(0,t.jsx)(Tt,{...n})}},14117:(W,C,e)=>{e.d(C,{i:()=>t});function t({name:d,attributes:E,resourceType:P}){return P?{type:"resource",name:d,attributes:E,resourceType:P}:{type:"basic",name:d,attributes:E}}},36989:(W,C,e)=>{e.d(C,{J:()=>J});var t=e(72427),d=e(96824);function E(f,y){return f.name===y.name}function P(f,y){return"resourceType"in f?!y||f.resourceType===y:!1}function K(f){return f.attributes.action==="create"}function R(f){return f.attributes.action==="read"}function I(f){return f.attributes.action==="update"}function v(f){return f.attributes.action==="delete"}function z(f){return{authorize:async(y,L)=>await f.authorize(y,L),authorizeConditional(y,L){const F=y;return f.authorize(F,L)}}}var O=e(54241),H=e(68721);function J(f){const y=(0,t.gf)(d.x),{data:L,error:F}=(0,H.Ay)(f,async x=>{if(P(x.permission)&&!x.resourceRef)return O.b.DENY;const{result:V}=await y.authorize(x);return V});return F?{error:F,loading:!1,allowed:!1}:L===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:L===O.b.ALLOW}}}}]);})();
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=2177.8343b97e.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-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BhB,EAAwB,CACvD,OAAOA,EAAWzc,WAAWC,SAAW,MAC1C,CAMO,SAASyd,EAAmBjB,EAAwB,CACzD,OAAOA,EAAWzc,WAAWC,SAAW,QAC1C,CAMO,SAAS0d,EAAmBlB,EAAwB,CACzD,OAAOA,EAAWzc,WAAWC,SAAW,QAC1C,CAOO,SAAS2d,EACdC,EAA0C,CAE1C,MAAO,CACLC,UAAW,MACTC,EACAlR,IAEiB,MAAMgR,EAAqBC,UAAUC,EAAUlR,CAAO,EAIzEmR,qBACED,EACAlR,EAAiC,CAEjC,MAAMoR,EACJF,EACF,OAAOF,EAAqBC,UAAUG,EAAgBpR,CAAO,CAC/D,CACF,CACF,C,0BChEO,SAAS2P,EACdlS,EAQK,CAEL,MAAM4T,KAAgB7X,EAAAA,IAAO8X,EAAAA,CAAgBA,EACvC,CAAErI,KAAAA,EAAMvP,MAAAA,CAAM,KAAI6X,EAAAA,IAAO9T,EAAO,MAAO+T,GAAAA,CAM3C,GAAId,EAAqBc,EAAK5B,UAAU,GAAK,CAAC4B,EAAKC,YACjD,OAAOC,EAAAA,EAAgBC,KAGzB,KAAM,CAAEC,OAAAA,CAAO,EAAI,MAAMP,EAAcJ,UAAUO,CAAI,EACrD,OAAOI,CACT,CAAC,EAED,OAAIlY,EACK,CAAEA,MAAAA,EAAOC,QAAS,GAAO+V,QAAS,EAAM,EAE7CzG,IAAS7M,OACJ,CAAEzC,QAAS,GAAM+V,QAAS,EAAM,EAElC,CAAE/V,QAAS,GAAO+V,QAASzG,IAASyI,EAAAA,EAAgBG,KAAM,CACnE,C","sources":["webpack://techdocs-cli-embedded-app/../core-components/src/components/OverflowTooltip/OverflowTooltip.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-common/src/permissions.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/translation.ts","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/components/EntityLifecyclePicker/EntityLifecyclePicker.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityNamespacePicker/EntityNamespacePicker.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityProcessingStatusPicker/EntityProcessingStatusPicker.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/DefaultFilters/DefaultFilters.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogTable/columns.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntitySearchBar/EntitySearchBar.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogTable/CatalogTableToolbar.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogTable/OffsetPaginatedCatalogTable.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogTable/CursorPaginatedCatalogTable.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogTable/defaultCatalogTableColumnsFunc.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogTable/CatalogTable.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogPage/CatalogPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/permission-common/src/permissions/createPermission.ts","webpack://techdocs-cli-embedded-app/../../plugins/permission-common/src/permissions/util.ts","webpack://techdocs-cli-embedded-app/../../plugins/permission-react/src/hooks/usePermission.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 { makeStyles } from '@material-ui/core/styles';\nimport Tooltip, { TooltipProps } from '@material-ui/core/Tooltip';\nimport React from 'react';\nimport Typography from '@material-ui/core/Typography';\n\ntype Props = {\n text?: string | undefined;\n title?: TooltipProps['title'];\n line?: number | undefined;\n placement?: TooltipProps['placement'];\n};\n\nexport type OverflowTooltipClassKey = 'container';\n\nconst useStyles = makeStyles(\n {\n container: {\n overflow: 'visible !important',\n },\n typo: {\n fontSize: 'inherit',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n display: '-webkit-box',\n '-webkit-line-clamp': ({ line }: Props) => line || 1,\n '-webkit-box-orient': 'vertical',\n },\n },\n { name: 'BackstageOverflowTooltip' },\n);\n\nexport function OverflowTooltip(props: Props) {\n const classes = useStyles(props);\n\n return (\n <Tooltip\n title={props.title ?? (props.text || '')}\n placement={props.placement}\n >\n <Typography className={classes.typo} variant=\"inherit\">\n {props.text}\n </Typography>\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 {\n createPermission,\n ResourcePermission,\n} from '@backstage/plugin-permission-common';\n\n/**\n * Permission resource type which corresponds to catalog entities.\n *\n * {@link https://backstage.io/docs/features/software-catalog/}\n * @alpha\n */\nexport const RESOURCE_TYPE_CATALOG_ENTITY = 'catalog-entity';\n\n/**\n * Convenience type for catalog entity\n * {@link @backstage/plugin-permission-common#ResourcePermission}s.\n * @alpha\n */\nexport type CatalogEntityPermission = ResourcePermission<\n typeof RESOURCE_TYPE_CATALOG_ENTITY\n>;\n\n/**\n * This permission is used to authorize actions that involve reading one or more\n * entities from the catalog.\n *\n * If this permission is not authorized, it will appear that the entity does not\n * exist in the catalog — both in the frontend and in API responses.\n * @alpha\n */\nexport const catalogEntityReadPermission = createPermission({\n name: 'catalog.entity.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * This permission is used to authorize actions that involve creating a new\n * catalog entity. This includes registering an existing component into the\n * catalog.\n * @alpha\n */\nexport const catalogEntityCreatePermission = createPermission({\n name: 'catalog.entity.create',\n attributes: {\n action: 'create',\n },\n});\n\n/**\n * This permission is used to designate actions that involve removing one or\n * more entities from the catalog.\n * @alpha\n */\nexport const catalogEntityDeletePermission = createPermission({\n name: 'catalog.entity.delete',\n attributes: {\n action: 'delete',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * This permission is used to designate refreshing one or more entities from the\n * catalog.\n * @alpha\n */\nexport const catalogEntityRefreshPermission = createPermission({\n name: 'catalog.entity.refresh',\n attributes: {\n action: 'update',\n },\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n});\n\n/**\n * This permission is used to authorize validating catalog entities.\n * @alpha\n */\nexport const catalogEntityValidatePermission = createPermission({\n name: 'catalog.entity.validate',\n attributes: {},\n});\n\n/**\n * This permission is used to designate actions that involve reading one or more\n * locations from the catalog.\n *\n * If this permission is not authorized, it will appear that the location does\n * not exist in the catalog — both in the frontend and in API responses.\n * @alpha\n */\nexport const catalogLocationReadPermission = createPermission({\n name: 'catalog.location.read',\n attributes: {\n action: 'read',\n },\n});\n\n/**\n * This permission is used to designate actions that involve creating catalog\n * locations.\n * @alpha\n */\nexport const catalogLocationCreatePermission = createPermission({\n name: 'catalog.location.create',\n attributes: {\n action: 'create',\n },\n});\n\n/**\n * This permission is used to authorize analyzing catalog locations.\n * @alpha\n */\nexport const catalogLocationAnalyzePermission = createPermission({\n name: 'catalog.location.analyze',\n attributes: {},\n});\n\n/**\n * This permission is used to designate actions that involve deleting locations\n * from the catalog.\n * @alpha\n */\nexport const catalogLocationDeletePermission = createPermission({\n name: 'catalog.location.delete',\n attributes: {\n action: 'delete',\n },\n});\n\n/**\n * List of all catalog permissions.\n * @alpha\n */\nexport const catalogPermissions = [\n catalogEntityReadPermission,\n catalogEntityCreatePermission,\n catalogEntityDeletePermission,\n catalogEntityRefreshPermission,\n catalogEntityValidatePermission,\n catalogLocationReadPermission,\n catalogLocationCreatePermission,\n catalogLocationDeletePermission,\n catalogLocationAnalyzePermission,\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 { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const catalogTranslationRef = createTranslationRef({\n id: 'catalog',\n messages: {\n indexPage: {\n title: `{{orgName}} Catalog`,\n createButtonTitle: 'Create',\n supportButtonContent: 'All your software catalog entities',\n },\n aboutCard: {\n title: 'About',\n refreshButtonTitle: 'Schedule entity refresh',\n editButtonTitle: 'Edit Metadata',\n createSimilarButtonTitle: 'Create something similar',\n refreshScheduledMessage: 'Refresh scheduled',\n launchTemplate: 'Launch Template',\n viewTechdocs: 'View TechDocs',\n viewSource: 'View Source',\n descriptionField: {\n label: 'Description',\n value: 'No description',\n },\n ownerField: {\n label: 'Owner',\n value: 'No Owner',\n },\n domainField: {\n label: 'Domain',\n value: 'No Domain',\n },\n systemField: {\n label: 'System',\n value: 'No System',\n },\n parentComponentField: {\n label: 'Parent Component',\n value: 'No Parent Component',\n },\n typeField: {\n label: 'Type',\n },\n lifecycleField: {\n label: 'Lifecycle',\n },\n tagsField: {\n label: 'Tags',\n value: 'No Tags',\n },\n targetsField: {\n label: 'Targets',\n },\n },\n searchResultItem: {\n lifecycle: 'Lifecycle',\n Owner: 'Owner',\n },\n catalogTable: {\n warningPanelTitle: 'Could not fetch catalog entities.',\n viewActionTitle: 'View',\n editActionTitle: 'Edit',\n starActionTitle: 'Add to favorites',\n unStarActionTitle: 'Remove from favorites',\n },\n dependencyOfComponentsCard: {\n title: 'Dependency of components',\n emptyMessage: 'No component depends on this component',\n },\n dependsOnComponentsCard: {\n title: 'Depends on components',\n emptyMessage: 'No component is a dependency of this component',\n },\n dependsOnResourcesCard: {\n title: 'Depends on resources',\n emptyMessage: 'No resource is a dependency of this component',\n },\n entityContextMenu: {\n copiedMessage: 'Copied!',\n moreButtonTitle: 'More',\n inspectMenuTitle: 'Inspect entity',\n copyURLMenuTitle: 'Copy entity URL',\n unregisterMenuTitle: 'Unregister entity',\n },\n entityLabelsCard: {\n title: 'Labels',\n emptyDescription:\n 'No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityLabels: {\n warningPanelTitle: 'Entity not found',\n ownerLabel: 'Owner',\n lifecycleLabel: 'Lifecycle',\n },\n entityLinksCard: {\n title: 'Links',\n emptyDescription:\n 'No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityNotFound: {\n title: 'Entity was not found',\n description:\n 'Want to help us build this? Check out our Getting Started documentation.',\n docButtonTitle: 'DOCS',\n },\n deleteEntity: {\n dialogTitle: 'Are you sure you want to delete this entity?',\n deleteButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n description:\n 'This entity is not referenced by any location and is therefore not receiving updates. Click here to delete.',\n },\n entityProcessingErrorsDescription: 'The error below originates from',\n entityRelationWarningDescription:\n \"This entity has relations to other entities, which can't be found in the catalog.\\n Entities not found are: \",\n hasComponentsCard: {\n title: 'Has components',\n emptyMessage: 'No component is part of this system',\n },\n hasResourcesCard: {\n title: 'Has resources',\n emptyMessage: 'No resource is part of this system',\n },\n hasSubcomponentsCard: {\n title: 'Has subcomponents',\n emptyMessage: 'No subcomponent is part of this component',\n },\n hasSubdomainsCard: {\n title: 'Has subdomains',\n emptyMessage: 'No subdomain is part of this domain',\n },\n hasSystemsCard: {\n title: 'Has systems',\n emptyMessage: 'No system is part of this domain',\n },\n relatedEntitiesCard: {\n emptyHelpLinkTitle: 'Learn how to change this',\n },\n systemDiagramCard: {\n title: 'System Diagram',\n description: 'Use pinch & zoo to move around the diagram.',\n edgeLabels: {\n partOf: 'part of',\n provides: 'provides',\n dependsOn: 'depends on',\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 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';\nimport { Theme } from '@material-ui/core/styles';\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<Theme>(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/esm/useAsync';\nimport { catalogApiRef } from '../../api';\n\n/**\n * Fetch and return all available kinds.\n */\nexport function useAllKinds(): {\n loading: boolean;\n error?: Error;\n allKinds: Map<string, string>;\n} {\n const catalogApi = useApi(catalogApiRef);\n\n const {\n error,\n loading,\n value: allKinds,\n } = useAsync(async () => {\n const { facets } = await catalogApi.getEntityFacets({ facets: ['kind'] });\n const kindFacets = (facets.kind ?? []).map(f => f.value);\n return new Map(\n kindFacets.map(kind => [kind.toLocaleLowerCase('en-US'), kind]),\n );\n }, [catalogApi]);\n\n return { loading, error, allKinds: allKinds ?? new Map() };\n}\n\n/**\n * Filter and capitalize accessible kinds.\n */\nexport function filterKinds(\n allKinds: Map<string, string>,\n allowedKinds?: string[],\n forcedKinds?: string,\n): Map<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 = Array.from(allKinds.keys());\n if (allowedKinds) {\n availableKinds = allowedKinds\n .map(k => k.toLocaleLowerCase('en-US'))\n .filter(k => allKinds.has(k));\n }\n\n const kindsMap = new Map(\n availableKinds.map(kind => [kind, allKinds.get(kind) || kind]),\n );\n\n if (forcedKinds && !kindsMap.has(forcedKinds)) {\n // this is the only time we set a label for a kind which is not properly capitalized\n kindsMap.set(forcedKinds.toLocaleLowerCase('en-US'), forcedKinds);\n }\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/Box';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { EntityKindFilter } from '../../filters';\nimport { useEntityList } from '../../hooks';\nimport { filterKinds, useAllKinds } from './kindFilterUtils';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nfunction useEntityKindFilter(opts: { initialFilter: string }): {\n loading: boolean;\n error?: Error;\n allKinds: Map<string, 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 const { allKinds, loading, error } = useAllKinds();\n const selectedKindLabel = allKinds.get(selectedKind) || selectedKind;\n\n useEffect(() => {\n updateFilters({\n kind: selectedKind\n ? new EntityKindFilter(selectedKind, selectedKindLabel)\n : undefined,\n });\n }, [selectedKind, selectedKindLabel, updateFilters]);\n\n return {\n loading,\n error,\n 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 const { t } = useTranslationRef(catalogReactTranslationRef);\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: t('entityKindPicker.errorMessage'),\n severity: 'error',\n });\n }\n }, [error, alertApi, t]);\n\n if (error) return null;\n\n const options = filterKinds(allKinds, allowedKinds, selectedKind);\n\n const items = [...options.entries()].map(([key, value]) => ({\n label: value,\n value: key,\n }));\n\n return hidden ? null : (\n <Box pb={1} pt={1}>\n <Select\n label={t('entityKindPicker.title')}\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 { makeStyles } from '@material-ui/core/styles';\nimport React from 'react';\nimport { EntityLifecycleFilter } from '../../filters';\nimport { EntityAutocompletePicker } from '../EntityAutocompletePicker';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport type CatalogReactEntityLifecyclePickerClassKey = 'input';\n\nconst useStyles = makeStyles(\n {\n input: {},\n },\n { name: 'CatalogReactEntityLifecyclePicker' },\n);\n\n/** @public */\nexport const EntityLifecyclePicker = (props: { initialFilter?: string[] }) => {\n const { initialFilter = [] } = props;\n const classes = useStyles();\n const { t } = useTranslationRef(catalogReactTranslationRef);\n\n return (\n <EntityAutocompletePicker\n label={t('entityLifecyclePicker.title')}\n name=\"lifecycles\"\n path=\"spec.lifecycle\"\n Filter={EntityLifecycleFilter}\n InputProps={{ className: classes.input }}\n initialSelectedOptions={initialFilter}\n />\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/styles';\n\nimport React from 'react';\nimport { EntityNamespaceFilter } from '../../filters';\nimport { EntityAutocompletePicker } from '../EntityAutocompletePicker';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport type CatalogReactEntityNamespacePickerClassKey = 'input';\n\nconst useStyles = makeStyles(\n {\n input: {},\n },\n {\n name: 'CatalogReactEntityNamespacePicker',\n },\n);\n\n/**\n * Props for {@link EntityNamespacePicker}.\n *\n * @public\n */\nexport interface EntityNamespacePickerProps {\n initiallySelectedNamespaces?: string[];\n}\n\n/** @public */\nexport const EntityNamespacePicker = (props: EntityNamespacePickerProps) => {\n const { initiallySelectedNamespaces } = props;\n const classes = useStyles();\n const { t } = useTranslationRef(catalogReactTranslationRef);\n\n return (\n <EntityAutocompletePicker\n label={t('entityNamespacePicker.title')}\n name=\"namespace\"\n path=\"metadata.namespace\"\n Filter={EntityNamespaceFilter}\n InputProps={{ className: classes.input }}\n initialSelectedOptions={initiallySelectedNamespaces}\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 Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport React, { useState, ReactNode } from 'react';\nimport { useEntityList } from '../../hooks';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport type CatalogReactEntityProcessingStatusPickerClassKey = 'input';\n\nconst useStyles = makeStyles(\n (theme: Theme) =>\n createStyles({\n root: {},\n input: {\n backgroundColor: theme.palette.background.paper,\n },\n label: {\n textTransform: 'none',\n fontWeight: 'bold',\n },\n }),\n { name: 'CatalogReactEntityProcessingStatusPickerPicker' },\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 const { t } = useTranslationRef(catalogReactTranslationRef);\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 className={classes.root} pb={1} pt={1}>\n <Typography className={classes.label} variant=\"button\" component=\"label\">\n {t('entityProcessingStatusPicker.title')}\n <Autocomplete<string, true>\n PopperComponent={popperProps => (\n <div {...popperProps}>{popperProps.children as ReactNode}</div>\n )}\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 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/esm/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/Box';\nimport { useEntityTypeFilter } from '../../hooks/useEntityTypeFilter';\n\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { Select } from '@backstage/core-components';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\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 const { t } = useTranslationRef(catalogReactTranslationRef);\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: t('entityTypePicker.errorMessage'),\n severity: 'error',\n });\n }\n if (initialFilter) {\n setSelectedTypes([initialFilter]);\n }\n }, [error, alertApi, initialFilter, setSelectedTypes, t]);\n\n if (availableTypes.length === 0 || error) return null;\n\n availableTypes.sort((a, b) =>\n a.toLocaleLowerCase('en-US').localeCompare(b.toLocaleLowerCase('en-US')),\n );\n\n const items = [\n { value: 'all', label: t('entityTypePicker.optionAllTitle') },\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={t('entityTypePicker.title')}\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 2024 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 { UserListFilterKind } from '../../types';\nimport { EntityKindPicker } from '../EntityKindPicker';\nimport { EntityLifecyclePicker } from '../EntityLifecyclePicker';\nimport { EntityNamespacePicker } from '../EntityNamespacePicker';\nimport {\n EntityOwnerPickerProps,\n EntityOwnerPicker,\n} from '../EntityOwnerPicker';\nimport { EntityProcessingStatusPicker } from '../EntityProcessingStatusPicker';\nimport { EntityTagPicker } from '../EntityTagPicker';\nimport { EntityTypePicker } from '../EntityTypePicker';\nimport { UserListPicker } from '../UserListPicker';\n\n/**\n * Props for default filters.\n *\n * @public\n */\nexport type DefaultFiltersProps = {\n initialKind?: string;\n initiallySelectedFilter?: UserListFilterKind;\n ownerPickerMode?: EntityOwnerPickerProps['mode'];\n initiallySelectedNamespaces?: string[];\n};\n\n/** @public */\nexport const DefaultFilters = (props: DefaultFiltersProps) => {\n const {\n initialKind,\n initiallySelectedFilter,\n ownerPickerMode,\n initiallySelectedNamespaces,\n } = props;\n return (\n <>\n <EntityKindPicker initialFilter={initialKind} />\n <EntityTypePicker />\n <UserListPicker initialFilter={initiallySelectedFilter} />\n <EntityOwnerPicker mode={ownerPickerMode} />\n <EntityLifecyclePicker />\n <EntityTagPicker />\n <EntityProcessingStatusPicker />\n <EntityNamespacePicker\n initiallySelectedNamespaces={initiallySelectedNamespaces}\n />\n </>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport {\n humanizeEntityRef,\n EntityRefLink,\n EntityRefLinks,\n} from '@backstage/plugin-catalog-react';\nimport Chip from '@material-ui/core/Chip';\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 customFilterAndSearch: (query, row) => {\n let targets: JsonArray = [];\n if (\n row.entity?.spec?.targets &&\n Array.isArray(row.entity?.spec?.targets)\n ) {\n targets = row.entity?.spec?.targets;\n } else if (row.entity?.spec?.target) {\n targets = [row.entity?.spec?.target];\n }\n return targets\n .join(', ')\n .toLocaleUpperCase('en-US')\n .includes(query.toLocaleUpperCase('en-US'));\n },\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(\n options: {\n hidden: boolean;\n } = { hidden: false },\n ): TableColumn<CatalogTableRow> {\n return {\n title: 'Type',\n field: 'entity.spec.type',\n hidden: options.hidden,\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 function formatContent(keyLabel: string, entity: Entity): string {\n const labels: Record<string, string> | undefined =\n entity.metadata?.labels;\n return (labels && labels[keyLabel]) || '';\n }\n\n return {\n title: options?.title || 'Label',\n field: 'entity.metadata.labels',\n cellStyle: {\n padding: '0px 16px 0px 20px',\n },\n customSort({ entity: entity1 }, { entity: entity2 }) {\n return formatContent(key, entity1).localeCompare(\n formatContent(key, entity2),\n );\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 */\n\nimport FormControl from '@material-ui/core/FormControl';\nimport IconButton from '@material-ui/core/IconButton';\nimport Input from '@material-ui/core/Input';\nimport InputAdornment from '@material-ui/core/InputAdornment';\nimport Toolbar from '@material-ui/core/Toolbar';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Clear from '@material-ui/icons/Clear';\nimport Search from '@material-ui/icons/Search';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport useDebounce from 'react-use/lib/useDebounce';\nimport { useEntityList } from '../../hooks/useEntityListProvider';\nimport { EntityTextFilter } from '../../filters';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport type CatalogReactEntitySearchBarClassKey = 'searchToolbar' | 'input';\n\nconst useStyles = makeStyles(\n _theme => ({\n searchToolbar: {\n paddingLeft: 0,\n paddingRight: 0,\n },\n input: {},\n }),\n { name: 'CatalogReactEntitySearchBar' },\n);\n\n/**\n * Renders search bar for filtering the entity list.\n * @public\n */\nexport const EntitySearchBar = () => {\n const classes = useStyles();\n const { t } = useTranslationRef(catalogReactTranslationRef);\n\n const {\n updateFilters,\n queryParameters: { text: textParameter },\n } = useEntityList();\n\n const queryParamTextFilter = useMemo(\n () => [textParameter].flat()[0],\n [textParameter],\n );\n\n const [search, setSearch] = useState(queryParamTextFilter ?? '');\n\n useDebounce(\n () => {\n updateFilters({\n text: search.length ? new EntityTextFilter(search) : undefined,\n });\n },\n 250,\n [search, updateFilters],\n );\n\n useEffect(() => {\n if (queryParamTextFilter) {\n setSearch(queryParamTextFilter);\n }\n }, [queryParamTextFilter]);\n\n return (\n <Toolbar className={classes.searchToolbar}>\n <FormControl>\n <Input\n aria-label=\"search\"\n id=\"input-with-icon-adornment\"\n className={classes.input}\n placeholder={t('entitySearchBar.placeholder')}\n autoComplete=\"off\"\n onChange={event => setSearch(event.target.value)}\n value={search}\n startAdornment={\n <InputAdornment position=\"start\">\n <Search />\n </InputAdornment>\n }\n endAdornment={\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"clear search\"\n onClick={() => setSearch('')}\n edge=\"end\"\n disabled={search.length === 0}\n >\n <Clear />\n </IconButton>\n </InputAdornment>\n }\n />\n </FormControl>\n </Toolbar>\n );\n};\n","/*\n * Copyright 2024 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 { EntitySearchBar } from '@backstage/plugin-catalog-react';\nimport Toolbar from '@material-ui/core/Toolbar';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\n\n/** @public */\nexport type CatalogTableToolbarClassKey = 'root' | 'text';\n\nconst useToolbarStyles = makeStyles(\n theme => ({\n root: {\n paddingTop: theme.spacing(1.25),\n paddingLeft: theme.spacing(2.5),\n paddingBottom: theme.spacing(0.75),\n display: 'flex',\n justifyContent: 'space-between',\n },\n text: {\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n }),\n { name: 'PluginCatalogTableToolbar' },\n);\n\nexport function CatalogTableToolbar(props: {\n title?: string | React.ReactElement<any>;\n}) {\n const styles = useToolbarStyles();\n return (\n <Toolbar className={styles.root}>\n <Typography variant=\"h5\" className={styles.text}>\n {props.title}\n </Typography>\n <EntitySearchBar />\n </Toolbar>\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 React, { useEffect } from 'react';\n\nimport { Table, TableProps } from '@backstage/core-components';\nimport { CatalogTableRow } from './types';\nimport { useEntityList } from '@backstage/plugin-catalog-react';\nimport { CatalogTableToolbar } from './CatalogTableToolbar';\n\n/**\n * @internal\n */\nexport function OffsetPaginatedCatalogTable(\n props: TableProps<CatalogTableRow>,\n) {\n const { columns, data, options, ...restProps } = props;\n const { setLimit, setOffset, limit, totalItems, offset } = useEntityList();\n\n const [page, setPage] = React.useState(\n offset && limit ? Math.floor(offset / limit) : 0,\n );\n\n useEffect(() => {\n if (totalItems && page * limit >= totalItems) {\n setOffset!(Math.max(0, totalItems - limit));\n } else {\n setOffset!(Math.max(0, page * limit));\n }\n }, [setOffset, page, limit, totalItems]);\n\n return (\n <Table\n columns={columns}\n data={data}\n options={{\n paginationPosition: 'both',\n pageSizeOptions: [5, 10, 20, 50, 100],\n pageSize: limit,\n emptyRowsWhenPaging: false,\n ...options,\n }}\n components={{\n Toolbar: CatalogTableToolbar,\n }}\n page={page}\n onPageChange={newPage => {\n setPage(newPage);\n }}\n onRowsPerPageChange={pageSize => {\n setLimit(pageSize);\n }}\n totalCount={totalItems}\n localization={{ pagination: { labelDisplayedRows: '' } }}\n {...restProps}\n />\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 React from 'react';\n\nimport { Table, TableProps } from '@backstage/core-components';\nimport { CatalogTableRow } from './types';\nimport { CatalogTableToolbar } from './CatalogTableToolbar';\n\ntype PaginatedCatalogTableProps = {\n prev?(): void;\n next?(): void;\n} & TableProps<CatalogTableRow>;\n\n/**\n * @internal\n */\n\nexport function CursorPaginatedCatalogTable(props: PaginatedCatalogTableProps) {\n const { columns, data, next, prev, options, ...restProps } = props;\n\n return (\n <Table\n columns={columns}\n data={data}\n options={{\n paginationPosition: 'both',\n ...options,\n // These settings are configured to force server side pagination\n pageSizeOptions: [],\n showFirstLastPageButtons: false,\n pageSize: Number.MAX_SAFE_INTEGER,\n emptyRowsWhenPaging: false,\n }}\n onPageChange={page => {\n if (page > 0) {\n next?.();\n } else {\n prev?.();\n }\n }}\n components={{\n Toolbar: CatalogTableToolbar,\n }}\n /* this will enable the prev button accordingly */\n page={prev ? 1 : 0}\n /* this will enable the next button accordingly */\n totalCount={next ? Number.MAX_VALUE : Number.MAX_SAFE_INTEGER}\n localization={{ pagination: { labelDisplayedRows: '' } }}\n {...restProps}\n />\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 { TableColumn } from '@backstage/core-components';\nimport { columnFactories } from './columns';\nimport { CatalogTableColumnsFunc, CatalogTableRow } from './types';\n\n// The defaultCatalogTableColumnsFunc symbol is not directly exported, but through the\n// CatalogTable.defaultColumnsFunc field.\n/** @public */\nexport const defaultCatalogTableColumnsFunc: CatalogTableColumnsFunc = ({\n filters,\n entities,\n}) => {\n const showTypeColumn = filters.type === undefined;\n\n return [\n columnFactories.createTitleColumn({ hidden: true }),\n columnFactories.createNameColumn({ defaultKind: filters.kind?.value }),\n ...createEntitySpecificColumns(),\n ];\n\n function createEntitySpecificColumns(): TableColumn<CatalogTableRow>[] {\n const descriptionTagColumns = [\n columnFactories.createMetadataDescriptionColumn(),\n columnFactories.createTagsColumn(),\n ];\n const baseColumns = [\n columnFactories.createSystemColumn(),\n columnFactories.createOwnerColumn(),\n columnFactories.createSpecTypeColumn({ hidden: !showTypeColumn }),\n columnFactories.createSpecLifecycleColumn(),\n ];\n switch (filters.kind?.value) {\n case 'user':\n return [...descriptionTagColumns];\n case 'domain':\n case 'system':\n return [columnFactories.createOwnerColumn(), ...descriptionTagColumns];\n case 'group':\n case 'template':\n return [\n columnFactories.createSpecTypeColumn({ hidden: !showTypeColumn }),\n ...descriptionTagColumns,\n ];\n case 'location':\n return [\n columnFactories.createSpecTypeColumn({ hidden: !showTypeColumn }),\n columnFactories.createSpecTargetsColumn(),\n ];\n default:\n return entities.every(entity => entity.metadata.namespace === 'default')\n ? [...baseColumns, ...descriptionTagColumns]\n : [\n ...baseColumns,\n columnFactories.createNamespaceColumn(),\n ...descriptionTagColumns,\n ];\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 { visuallyHidden } from '@mui/utils';\nimport Edit from '@material-ui/icons/Edit';\nimport OpenInNew from '@material-ui/icons/OpenInNew';\nimport { capitalize } from 'lodash';\nimport pluralize from 'pluralize';\nimport React, { ReactNode, useMemo } from 'react';\nimport { columnFactories } from './columns';\nimport { CatalogTableColumnsFunc, CatalogTableRow } from './types';\nimport { OffsetPaginatedCatalogTable } from './OffsetPaginatedCatalogTable';\nimport { CursorPaginatedCatalogTable } from './CursorPaginatedCatalogTable';\nimport { defaultCatalogTableColumnsFunc } from './defaultCatalogTableColumnsFunc';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { FavoriteToggleIcon } from '@backstage/core-components';\nimport { CatalogTableToolbar } from './CatalogTableToolbar';\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 /**\n * A static title to use for the table. If not provided, a title will be\n * generated based on the current Kind and Type filters and total number of items.\n */\n title?: string;\n subtitle?: string;\n}\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\n/**\n * CatalogTable is a wrapper around the Table component that is pre-configured\n * to display catalog entities.\n *\n * @remarks\n *\n * See {@link https://backstage.io/docs/features/software-catalog/catalog-customization}\n *\n * @public\n */\nexport const CatalogTable = (props: CatalogTableProps) => {\n const {\n columns = defaultCatalogTableColumnsFunc,\n tableOptions,\n subtitle,\n emptyContent,\n } = props;\n const { isStarredEntity, toggleStarredEntity } = useStarredEntities();\n const entityListContext = useEntityList();\n\n const {\n loading,\n error,\n entities,\n filters,\n pageInfo,\n totalItems,\n paginationMode,\n } = entityListContext;\n\n const tableColumns = useMemo(\n () =>\n typeof columns === 'function' ? columns(entityListContext) : columns,\n [columns, entityListContext],\n );\n const { t } = useTranslationRef(catalogTranslationRef);\n\n if (error) {\n return (\n <div>\n <WarningPanel\n severity=\"error\"\n title={t('catalogTable.warningPanelTitle')}\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 = t('catalogTable.viewActionTitle');\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 = t('catalogTable.editActionTitle');\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\n ? t('catalogTable.unStarActionTitle')\n : t('catalogTable.starActionTitle');\n\n return {\n cellStyle: { paddingLeft: '1em' },\n icon: () => <FavoriteToggleIcon isFavorite={isStarred} />,\n tooltip: title,\n onClick: () => toggleStarredEntity(entity),\n };\n },\n ];\n\n const currentKind = filters.kind?.label || '';\n const currentType = filters.type?.value || '';\n const currentCount = typeof totalItems === 'number' ? `(${totalItems})` : '';\n // TODO(timbonicus): remove the title from the CatalogTable once using EntitySearchBar\n const titlePreamble = capitalize(filters.user?.value ?? 'all');\n const title =\n props.title ||\n [titlePreamble, currentType, pluralize(currentKind), currentCount]\n .filter(s => s)\n .join(' ');\n\n const actions = props.actions || defaultActions;\n const options = {\n actionsColumnIndex: -1,\n loadingType: 'linear' as const,\n showEmptyDataSourceMessage: !loading,\n padding: 'dense' as const,\n ...tableOptions,\n };\n\n if (paginationMode === 'cursor') {\n return (\n <CursorPaginatedCatalogTable\n columns={tableColumns}\n emptyContent={emptyContent}\n isLoading={loading}\n title={title}\n actions={actions}\n subtitle={subtitle}\n options={options}\n data={entities.map(toEntityRow)}\n next={pageInfo?.next}\n prev={pageInfo?.prev}\n />\n );\n } else if (paginationMode === 'offset') {\n return (\n <OffsetPaginatedCatalogTable\n columns={tableColumns}\n emptyContent={emptyContent}\n isLoading={loading}\n title={title}\n actions={actions}\n subtitle={subtitle}\n options={options}\n data={entities.map(toEntityRow)}\n />\n );\n }\n\n const rows = entities.sort(refCompare).map(toEntityRow);\n const pageSize = 20;\n const showPagination = rows.length > pageSize;\n\n return (\n <Table<CatalogTableRow>\n isLoading={loading}\n columns={tableColumns}\n options={{\n paging: showPagination,\n pageSize: pageSize,\n pageSizeOptions: [20, 50, 100],\n ...options,\n }}\n components={{\n Toolbar: CatalogTableToolbar,\n }}\n title={title}\n data={rows}\n actions={actions}\n subtitle={subtitle}\n emptyContent={emptyContent}\n />\n );\n};\n\nCatalogTable.columns = columnFactories;\nCatalogTable.defaultColumnsFunc = defaultCatalogTableColumnsFunc;\n\nfunction toEntityRow(entity: 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 * 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 DefaultFilters,\n EntityListPagination,\n EntityListProvider,\n EntityOwnerPickerProps,\n UserListFilterKind,\n} from '@backstage/plugin-catalog-react';\nimport React, { ReactNode } from 'react';\nimport { createComponentRouteRef } from '../../routes';\nimport { CatalogTable, CatalogTableRow } from '../CatalogTable';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { CatalogTableColumnsFunc } from '../CatalogTable/types';\nimport { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';\nimport { usePermission } from '@backstage/plugin-permission-react';\n\n/** @internal */\nexport type BaseCatalogPageProps = {\n filters: ReactNode;\n content?: ReactNode;\n pagination?: EntityListPagination;\n};\n\n/** @internal */\nexport function BaseCatalogPage(props: BaseCatalogPageProps) {\n const { filters, content = <CatalogTable />, pagination } = props;\n const orgName =\n useApi(configApiRef).getOptionalString('organization.name') ?? 'Backstage';\n const createComponentLink = useRouteRef(createComponentRouteRef);\n const { t } = useTranslationRef(catalogTranslationRef);\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n\n return (\n <PageWithHeader title={t('indexPage.title', { orgName })} themeId=\"home\">\n <Content>\n <ContentHeader title=\"\">\n {allowed && (\n <CreateButton\n title={t('indexPage.createButtonTitle')}\n to={createComponentLink && createComponentLink()}\n />\n )}\n <SupportButton>{t('indexPage.supportButtonContent')}</SupportButton>\n </ContentHeader>\n <EntityListProvider pagination={pagination}>\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 filters?: ReactNode;\n initiallySelectedNamespaces?: string[];\n pagination?: EntityListPagination;\n}\n\nexport function DefaultCatalogPage(props: DefaultCatalogPageProps) {\n const {\n columns,\n actions,\n initiallySelectedFilter = 'owned',\n initialKind = 'component',\n tableOptions = {},\n emptyContent,\n pagination,\n ownerPickerMode,\n filters,\n initiallySelectedNamespaces,\n } = props;\n\n return (\n <BaseCatalogPage\n filters={\n filters ?? (\n <DefaultFilters\n initialKind={initialKind}\n initiallySelectedFilter={initiallySelectedFilter}\n ownerPickerMode={ownerPickerMode}\n initiallySelectedNamespaces={initiallySelectedNamespaces}\n />\n )\n }\n content={\n <CatalogTable\n columns={columns}\n actions={actions}\n tableOptions={tableOptions}\n emptyContent={emptyContent}\n />\n }\n pagination={pagination}\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","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n BasicPermission,\n Permission,\n PermissionAttributes,\n ResourcePermission,\n} from '../types';\n\n/**\n * Utility function for creating a valid {@link ResourcePermission}, inferring\n * the appropriate type and resource type parameter.\n *\n * @public\n */\nexport function createPermission<TResourceType extends string>(input: {\n name: string;\n attributes: PermissionAttributes;\n resourceType: TResourceType;\n}): ResourcePermission<TResourceType>;\n/**\n * Utility function for creating a valid {@link BasicPermission}.\n *\n * @public\n */\nexport function createPermission(input: {\n name: string;\n attributes: PermissionAttributes;\n}): BasicPermission;\nexport function createPermission({\n name,\n attributes,\n resourceType,\n}: {\n name: string;\n attributes: PermissionAttributes;\n resourceType?: string;\n}): Permission {\n if (resourceType) {\n return {\n type: 'resource',\n name,\n attributes,\n resourceType,\n };\n }\n\n return {\n type: 'basic',\n name,\n attributes,\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 {\n AuthorizePermissionRequest,\n AuthorizePermissionResponse,\n DefinitivePolicyDecision,\n EvaluatorRequestOptions,\n Permission,\n PermissionAuthorizer,\n PermissionEvaluator,\n QueryPermissionRequest,\n QueryPermissionResponse,\n ResourcePermission,\n} from '../types';\n\n/**\n * Check if the two parameters are equivalent permissions.\n * @public\n */\nexport function isPermission<T extends Permission>(\n permission: Permission,\n comparedPermission: T,\n): permission is T {\n return permission.name === comparedPermission.name;\n}\n\n/**\n * Check if a given permission is a {@link ResourcePermission}. When\n * `resourceType` is supplied as the second parameter, also checks if\n * the permission has the specified resource type.\n * @public\n */\nexport function isResourcePermission<T extends string = string>(\n permission: Permission,\n resourceType?: T,\n): permission is ResourcePermission<T> {\n if (!('resourceType' in permission)) {\n return false;\n }\n\n return !resourceType || permission.resourceType === resourceType;\n}\n\n/**\n * Check if a given permission is related to a create action.\n * @public\n */\nexport function isCreatePermission(permission: Permission) {\n return permission.attributes.action === 'create';\n}\n\n/**\n * Check if a given permission is related to a read action.\n * @public\n */\nexport function isReadPermission(permission: Permission) {\n return permission.attributes.action === 'read';\n}\n\n/**\n * Check if a given permission is related to an update action.\n * @public\n */\nexport function isUpdatePermission(permission: Permission) {\n return permission.attributes.action === 'update';\n}\n\n/**\n * Check if a given permission is related to a delete action.\n * @public\n */\nexport function isDeletePermission(permission: Permission) {\n return permission.attributes.action === 'delete';\n}\n\n/**\n * Convert {@link PermissionAuthorizer} to {@link PermissionEvaluator}.\n *\n * @public\n */\nexport function toPermissionEvaluator(\n permissionAuthorizer: PermissionAuthorizer,\n): PermissionEvaluator {\n return {\n authorize: async (\n requests: AuthorizePermissionRequest[],\n options?: EvaluatorRequestOptions,\n ): Promise<AuthorizePermissionResponse[]> => {\n const response = await permissionAuthorizer.authorize(requests, options);\n\n return response as DefinitivePolicyDecision[];\n },\n authorizeConditional(\n requests: QueryPermissionRequest[],\n options?: EvaluatorRequestOptions,\n ): Promise<QueryPermissionResponse[]> {\n const parsedRequests =\n requests as unknown as AuthorizePermissionRequest[];\n return permissionAuthorizer.authorize(parsedRequests, options);\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 { useApi } from '@backstage/core-plugin-api';\nimport { permissionApiRef } from '../apis';\nimport {\n AuthorizeResult,\n isResourcePermission,\n Permission,\n ResourcePermission,\n} from '@backstage/plugin-permission-common';\nimport useSWR from 'swr';\n\n/** @public */\nexport type AsyncPermissionResult = {\n loading: boolean;\n allowed: boolean;\n error?: Error;\n};\n\n/**\n * React hook utility for authorization. Given either a non-resource\n * {@link @backstage/plugin-permission-common#Permission} or a\n * {@link @backstage/plugin-permission-common#ResourcePermission} and an\n * optional resourceRef, it will return whether or not access is allowed (for\n * the given resource, if resourceRef is provided). See\n * {@link @backstage/plugin-permission-common/PermissionClient#authorize} for\n * more details.\n *\n * The resourceRef field is optional to allow calling this hook with an\n * entity that might be loading asynchronously, but when resourceRef is not\n * supplied, the value of `allowed` will always be false.\n *\n * Note: This hook uses stale-while-revalidate to help avoid flicker in UI\n * elements that would be conditionally rendered based on the `allowed` result\n * of this hook.\n * @public\n */\nexport function usePermission(\n input:\n | {\n permission: Exclude<Permission, ResourcePermission>;\n resourceRef?: never;\n }\n | {\n permission: ResourcePermission;\n resourceRef: string | undefined;\n },\n): AsyncPermissionResult {\n const permissionApi = useApi(permissionApiRef);\n const { data, error } = useSWR(input, async (args: typeof input) => {\n // We could make the resourceRef parameter required to avoid this check, but\n // it would make using this hook difficult in situations where the entity\n // must be asynchronously loaded, so instead we short-circuit to a deny when\n // no resourceRef is supplied, on the assumption that the resourceRef is\n // still loading outside the hook.\n if (isResourcePermission(args.permission) && !args.resourceRef) {\n return AuthorizeResult.DENY;\n }\n\n const { result } = await permissionApi.authorize(args);\n return result;\n });\n\n if (error) {\n return { error, loading: false, allowed: false };\n }\n if (data === undefined) {\n return { loading: true, allowed: false };\n }\n return { loading: false, allowed: data === AuthorizeResult.ALLOW };\n}\n"],"names":["useStyles","makeStyles","container","overflow","typo","fontSize","textOverflow","display","line","name","OverflowTooltip","props","classes","Tooltip","title","text","placement","Typography","className","variant","RESOURCE_TYPE_CATALOG_ENTITY","catalogEntityReadPermission","createPermission","attributes","action","resourceType","catalogEntityCreatePermission","catalogEntityDeletePermission","catalogEntityRefreshPermission","catalogEntityValidatePermission","catalogLocationReadPermission","catalogLocationCreatePermission","catalogLocationAnalyzePermission","catalogLocationDeletePermission","catalogPermissions","catalogTranslationRef","createTranslationRef","id","messages","indexPage","createButtonTitle","supportButtonContent","aboutCard","refreshButtonTitle","editButtonTitle","createSimilarButtonTitle","refreshScheduledMessage","launchTemplate","viewTechdocs","viewSource","descriptionField","label","value","ownerField","domainField","systemField","parentComponentField","typeField","lifecycleField","tagsField","targetsField","searchResultItem","lifecycle","Owner","catalogTable","warningPanelTitle","viewActionTitle","editActionTitle","starActionTitle","unStarActionTitle","dependencyOfComponentsCard","emptyMessage","dependsOnComponentsCard","dependsOnResourcesCard","entityContextMenu","copiedMessage","moreButtonTitle","inspectMenuTitle","copyURLMenuTitle","unregisterMenuTitle","entityLabelsCard","emptyDescription","readMoreButtonTitle","entityLabels","ownerLabel","lifecycleLabel","entityLinksCard","entityNotFound","description","docButtonTitle","deleteEntity","dialogTitle","deleteButtonTitle","cancelButtonTitle","entityProcessingErrorsDescription","entityRelationWarningDescription","hasComponentsCard","hasResourcesCard","hasSubcomponentsCard","hasSubdomainsCard","hasSystemsCard","relatedEntitiesCard","emptyHelpLinkTitle","systemDiagramCard","edgeLabels","partOf","provides","dependsOn","CreateButton","to","isXSScreen","useMediaQuery","theme","breakpoints","down","IconButton","component","RouterLink","color","size","AddCircleOutline","Button","useAllKinds","catalogApi","useApi","catalogApiRef","error","loading","allKinds","useAsync","facets","getEntityFacets","kindFacets","kind","map","f","Map","toLocaleLowerCase","filterKinds","allowedKinds","forcedKinds","availableKinds","Array","from","keys","k","filter","has","kindsMap","get","set","useEntityKindFilter","opts","filters","queryParameters","kindParameter","updateFilters","useEntityList","queryParamKind","useMemo","flat","selectedKind","setSelectedKind","useState","initialFilter","useEffect","selectedKindLabel","EntityKindFilter","undefined","EntityKindPicker","hidden","t","useTranslationRef","catalogReactTranslationRef","alertApi","alertApiRef","post","message","severity","items","entries","key","Box","pb","pt","Select","selected","onChange","String","input","EntityLifecyclePicker","EntityAutocompletePicker","path","Filter","EntityLifecycleFilter","InputProps","initialSelectedOptions","EntityNamespacePicker","initiallySelectedNamespaces","EntityNamespaceFilter","createStyles","root","backgroundColor","palette","background","paper","textTransform","fontWeight","icon","CheckBoxOutlineBlankIcon","checkedIcon","CheckBoxIcon","EntityProcessingStatusPicker","selectedAdvancedItems","setSelectedAdvancedItems","orphanChange","orphan","EntityOrphanFilter","errorChange","EntityErrorFilter","availableAdvancedItems","Autocomplete","PopperComponent","popperProps","div","children","multiple","disableCloseOnSelect","options","_","includes","renderOption","option","FormControlLabel","control","Checkbox","checked","onClick","event","preventDefault","popupIcon","ExpandMoreIcon","data-testid","renderInput","params","TextField","useEntityTypeFilter","kindFilter","type","typeFilter","typeParameter","flattenedQueryTypes","Boolean","selectedTypes","setSelectedTypes","length","getTypes","availableTypes","setAvailableTypes","then","response","facetsRef","useRef","oldFacets","current","newTypes","Set","sortBy","count","stillValidTypes","isEqual","EntityTypeFilter","EntityTypePicker","sort","a","b","localeCompare","DefaultFilters","initialKind","initiallySelectedFilter","ownerPickerMode","UserListPicker","EntityOwnerPicker","mode","EntityTagPicker","columnFactories","Object","freeze","createNameColumn","formatContent","entity","metadata","humanizeEntityRef","defaultKind","field","highlight","customSort","entity1","entity2","render","EntityRefLink","entityRef","createSystemColumn","resolved","EntityRefLinks","entityRefs","partOfSystemRelations","createOwnerColumn","ownedByRelations","createSpecTargetsColumn","customFilterAndSearch","query","row","targets","spec","isArray","target","join","toLocaleUpperCase","createSpecTypeColumn","width","createSpecLifecycleColumn","createMetadataDescriptionColumn","createTagsColumn","cellStyle","padding","tags","Chip","style","marginBottom","createTitleColumn","searchable","createLabelColumn","keyLabel","labels","specifiedLabelValue","defaultValue","createNamespaceColumn","_theme","searchToolbar","paddingLeft","paddingRight","EntitySearchBar","textParameter","queryParamTextFilter","search","setSearch","useDebounce","EntityTextFilter","Toolbar","FormControl","Input","aria-label","placeholder","autoComplete","startAdornment","InputAdornment","position","Search","endAdornment","edge","disabled","Clear","useToolbarStyles","paddingTop","spacing","paddingBottom","justifyContent","whiteSpace","CatalogTableToolbar","styles","OffsetPaginatedCatalogTable","columns","data","restProps","setLimit","setOffset","limit","totalItems","offset","page","setPage","React","Math","floor","max","Table","paginationPosition","pageSizeOptions","pageSize","emptyRowsWhenPaging","components","onPageChange","newPage","onRowsPerPageChange","totalCount","localization","pagination","labelDisplayedRows","CursorPaginatedCatalogTable","next","prev","showFirstLastPageButtons","Number","MAX_SAFE_INTEGER","MAX_VALUE","defaultCatalogTableColumnsFunc","entities","showTypeColumn","createEntitySpecificColumns","descriptionTagColumns","baseColumns","every","namespace","refCompare","toRef","CatalogTable","tableOptions","subtitle","emptyContent","isStarredEntity","toggleStarredEntity","useStarredEntities","entityListContext","pageInfo","paginationMode","tableColumns","WarningPanel","CodeSnippet","language","toString","defaultActions","url","annotations","ANNOTATION_VIEW_URL","visuallyHidden","OpenInNew","tooltip","window","open","ANNOTATION_EDIT_URL","Edit","isStarred","FavoriteToggleIcon","isFavorite","currentKind","currentType","currentCount","titlePreamble","capitalize","user","pluralize","s","actions","actionsColumnIndex","loadingType","showEmptyDataSourceMessage","isLoading","toEntityRow","rows","showPagination","paging","defaultColumnsFunc","getEntityRelations","RELATION_PART_OF","RELATION_OWNED_BY","stringifyEntityRef","ownedByRelationsTitle","r","partOfSystemRelationTitle","BaseCatalogPage","content","orgName","configApiRef","getOptionalString","createComponentLink","useRouteRef","createComponentRouteRef","allowed","usePermission","permission","PageWithHeader","themeId","Content","ContentHeader","SupportButton","EntityListProvider","CatalogFilterLayout","Filters","DefaultCatalogPage","CatalogPage","useOutlet","isPermission","comparedPermission","isResourcePermission","isCreatePermission","isReadPermission","isUpdatePermission","isDeletePermission","toPermissionEvaluator","permissionAuthorizer","authorize","requests","authorizeConditional","parsedRequests","permissionApi","permissionApiRef","useSWR","args","resourceRef","AuthorizeResult","DENY","result","ALLOW"],"sourceRoot":""}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[5724],{35773:(B,x,e)=>{e.d(x,{C4:()=>b,tS:()=>R});var t=e(14117);const u="catalog-entity",A=(0,t.i)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:u}),b=(0,t.i)({name:"catalog.entity.create",attributes:{action:"create"}}),L=(0,t.i)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:u}),R=(0,t.i)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:u}),O=(0,t.i)({name:"catalog.entity.validate",attributes:{}}),S=(0,t.i)({name:"catalog.location.read",attributes:{action:"read"}}),P=(0,t.i)({name:"catalog.location.create",attributes:{action:"create"}}),T=(0,t.i)({name:"catalog.location.analyze",attributes:{}}),j=(0,t.i)({name:"catalog.location.delete",attributes:{action:"delete"}}),c=[A,b,L,R,O,S,P,j,T]},99538:(B,x,e)=>{e.d(x,{T7:()=>S,TY:()=>j,tN:()=>T});var t=e(31085),u=e(6820),A=e(25862),b=e(43836),L=e(10602),R=e(14041);const O=(0,b.tK)("entity-context"),S=c=>{const{children:r,entity:m,loading:v,error:h,refresh:y}=c,g={entity:m,loading:v,error:h,refresh:y};return(0,t.jsx)(O.Provider,{value:(0,L.B)({1:g}),children:(0,t.jsx)(A.Ig,{attributes:{...m?{entityRef:(0,u.U2)(m)}:void 0},children:r})})},P=c=>_jsx(S,{entity:c.entity,loading:!c.entity,error:void 0,refresh:void 0,children:c.children});function T(){const c=(0,b.qO)("entity-context");if(!c)throw new Error("Entity context is not available");const r=c.atVersion(1);if(!r)throw new Error("EntityContext v1 not available");if(!r.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:r.entity}}function j(){const c=(0,b.qO)("entity-context");if(!c)throw new Error("Entity context is not available");const r=c.atVersion(1);if(!r)throw new Error("EntityContext v1 not available");const{entity:m,loading:v,error:h,refresh:y}=r;return{entity:m,loading:v,error:h,refresh:y}}},90759:(B,x,e)=>{e.d(x,{W:()=>u});var t=e(93184);const u=(0,t.h)({id:"catalog",messages:{indexPage:{title:"{{orgName}} Catalog",createButtonTitle:"Create",supportButtonContent:"All your software catalog entities"},aboutCard:{title:"About",refreshButtonTitle:"Schedule entity refresh",editButtonTitle:"Edit Metadata",createSimilarButtonTitle:"Create something similar",refreshScheduledMessage:"Refresh scheduled",launchTemplate:"Launch Template",viewTechdocs:"View TechDocs",viewSource:"View Source",descriptionField:{label:"Description",value:"No description"},ownerField:{label:"Owner",value:"No Owner"},domainField:{label:"Domain",value:"No Domain"},systemField:{label:"System",value:"No System"},parentComponentField:{label:"Parent Component",value:"No Parent Component"},typeField:{label:"Type"},lifecycleField:{label:"Lifecycle"},tagsField:{label:"Tags",value:"No Tags"},targetsField:{label:"Targets"}},searchResultItem:{lifecycle:"Lifecycle",Owner:"Owner"},catalogTable:{warningPanelTitle:"Could not fetch catalog entities.",viewActionTitle:"View",editActionTitle:"Edit",starActionTitle:"Add to favorites",unStarActionTitle:"Remove from favorites"},dependencyOfComponentsCard:{title:"Dependency of components",emptyMessage:"No component depends on this component"},dependsOnComponentsCard:{title:"Depends on components",emptyMessage:"No component is a dependency of this component"},dependsOnResourcesCard:{title:"Depends on resources",emptyMessage:"No resource is a dependency of this component"},entityContextMenu:{copiedMessage:"Copied!",moreButtonTitle:"More",inspectMenuTitle:"Inspect entity",copyURLMenuTitle:"Copy entity URL",unregisterMenuTitle:"Unregister entity"},entityLabelsCard:{title:"Labels",emptyDescription:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityLabels:{warningPanelTitle:"Entity not found",ownerLabel:"Owner",lifecycleLabel:"Lifecycle"},entityLinksCard:{title:"Links",emptyDescription:"No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityNotFound:{title:"Entity was not found",description:"Want to help us build this? Check out our Getting Started documentation.",docButtonTitle:"DOCS"},deleteEntity:{dialogTitle:"Are you sure you want to delete this entity?",deleteButtonTitle:"Delete",cancelButtonTitle:"Cancel",description:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."},entityProcessingErrorsDescription:"The error below originates from",entityRelationWarningDescription:`This entity has relations to other entities, which can't be found in the catalog.
|
|
2
|
-
Entities not found are: `,hasComponentsCard:{title:"Has components",emptyMessage:"No component is part of this system"},hasResourcesCard:{title:"Has resources",emptyMessage:"No resource is part of this system"},hasSubcomponentsCard:{title:"Has subcomponents",emptyMessage:"No subcomponent is part of this component"},hasSubdomainsCard:{title:"Has subdomains",emptyMessage:"No subdomain is part of this domain"},hasSystemsCard:{title:"Has systems",emptyMessage:"No system is part of this domain"},relatedEntitiesCard:{emptyHelpLinkTitle:"Learn how to change this"},systemDiagramCard:{title:"System Diagram",description:"Use pinch & zoo to move around the diagram.",edgeLabels:{partOf:"part of",provides:"provides",dependsOn:"depends on"}}}})},65724:(B,x,e)=>{e.r(x),e.d(x,{AboutCard:()=>lt,AboutContent:()=>ce,AboutField:()=>k});var t=e(31085),u=e(72348),A=e(6820),b=e(17736),L=e(40703),R=e(48653),O=e(45685),S=e(37197),P=e(29365),T=e(58837),j=e(72072),c=e(31129),r=e(14041),m=e(53373),v=e.n(m),h=e(86613),y=e(10394),g=e(72501);const f=(0,T.A)(a=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:a.palette.text.secondary,cursor:"default"},primary:{color:a.palette.primary.main},secondary:{color:a.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:a.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function I({color:a="primary",disabled:n=!1,href:o="#",icon:i=(0,t.jsx)(h.A,{}),label:s,onClick:l,title:d}){const p=f();return n?(0,t.jsxs)(y.A,{title:d,className:v()(p.link,p.disabled),children:[i,(0,t.jsx)(g.A,{variant:"caption",component:"span",className:p.label,children:s})]}):(0,t.jsxs)(j.N_,{title:d,className:v()(p.link,p[a]),to:o,onClick:l,children:[i,(0,t.jsx)(g.A,{variant:"caption",component:"span",className:p.label,children:s})]})}const V=(0,T.A)(a=>({links:{margin:a.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:a.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function J(a){const{links:n}=a,o=V();return(0,t.jsx)("nav",{className:o.links,children:n.map((i,s)=>(0,t.jsx)(I,{...i},s+1))})}var Q=e(96726),ye=e(13660),ee=e(82266);const ge=a=>{const{type:n}=a,o=(0,ee.n)(),i=ye.A,s=n?o.getSystemIcon(n)??i:i;return(0,t.jsx)(s,{})};var z=e(72427),be=e(36017),ve=e(39837),te=e(9222),ne=e(99538),ie=e(7341),ae=e(78692);function xe(a,n){const o=a.metadata.annotations?.[b.I4];if(o)try{const i=(0,ae.aY)(o),s=n.byUrl(i.target);return{locationTargetUrl:i.target,integrationType:s?.type}}catch{return}}var se=e(95203),H=e(51372),W=e(67871),K=e(34428),Ae=e(67720),oe=e(42899),Te=e(4650),Ce=e(82442);const je=(0,T.A)(a=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:a.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function k(a){const{label:n,value:o,gridSizes:i,children:s,className:l}=a,d=je(),p=(0,Ce.O)(s,w=>w.getElements()),$=p.length>0?p:(0,t.jsx)(g.A,{variant:"body2",className:d.value,children:o||"unknown"});return(0,t.jsxs)(oe.A,{item:!0,...i,className:l,children:[(0,t.jsx)(g.A,{variant:"h2",className:d.label,children:n}),$]})}var Ee=e(18750),re=e(87849),le=e(90759);const Le=(0,T.A)({description:{wordBreak:"break-word"}});function ke(a,n,o){if(n==="url"||a.includes("://"))return a;const i=o.type==="file"?`file://${o.target}`:o.target;return n==="file"||o.type==="file"?new URL(a,i).href:i}function ce(a){const{entity:n}=a,o=Le(),{t:i}=(0,re.i)(le.W),s=n.kind.toLocaleLowerCase("en-US")==="system",l=n.kind.toLocaleLowerCase("en-US")==="resource",d=n.kind.toLocaleLowerCase("en-US")==="component",p=n.kind.toLocaleLowerCase("en-US")==="api",$=n.kind.toLocaleLowerCase("en-US")==="template",w=n.kind.toLocaleLowerCase("en-US")==="location",D=n.kind.toLocaleLowerCase("en-US")==="group",M=(0,W.t)(n,H.jn,{kind:"system"}),Y=(0,W.t)(n,H.jn,{kind:"component"}),C=(0,W.t)(n,H.jn,{kind:"domain"}),G=(0,W.t)(n,H.vv);let U;try{U=(0,ae.Cr)(n)}catch{U=void 0}return(0,t.jsxs)(oe.A,{container:!0,children:[(0,t.jsx)(k,{label:i("aboutCard.descriptionField.label"),gridSizes:{xs:12},children:(0,t.jsx)(Te.h,{className:o.description,content:n?.metadata?.description||i("aboutCard.descriptionField.value")})}),(0,t.jsx)(k,{label:i("aboutCard.ownerField.label"),value:i("aboutCard.ownerField.value"),className:o.description,gridSizes:{xs:12,sm:6,lg:4},children:G.length>0&&(0,t.jsx)(K.i,{entityRefs:G,defaultKind:"group"})}),(s||C.length>0)&&(0,t.jsx)(k,{label:i("aboutCard.domainField.label"),value:i("aboutCard.domainField.value"),gridSizes:{xs:12,sm:6,lg:4},children:C.length>0&&(0,t.jsx)(K.i,{entityRefs:C,defaultKind:"domain"})}),(p||d||l||M.length>0)&&(0,t.jsx)(k,{label:i("aboutCard.systemField.label"),value:i("aboutCard.systemField.value"),gridSizes:{xs:12,sm:6,lg:4},children:M.length>0&&(0,t.jsx)(K.i,{entityRefs:M,defaultKind:"system"})}),d&&Y.length>0&&(0,t.jsx)(k,{label:i("aboutCard.parentComponentField.label"),value:i("aboutCard.parentComponentField.value"),gridSizes:{xs:12,sm:6,lg:4},children:(0,t.jsx)(K.i,{entityRefs:Y,defaultKind:"component"})}),(p||d||l||$||D||w||typeof n?.spec?.type=="string")&&(0,t.jsx)(k,{label:i("aboutCard.typeField.label"),value:n?.spec?.type,gridSizes:{xs:12,sm:6,lg:4}}),(p||d||typeof n?.spec?.lifecycle=="string")&&(0,t.jsx)(k,{label:i("aboutCard.lifecycleField.label"),value:n?.spec?.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,t.jsx)(k,{label:i("aboutCard.tagsField.label"),value:i("aboutCard.tagsField.value"),gridSizes:{xs:12,sm:6,lg:4},children:(n?.metadata?.tags||[]).map(E=>(0,t.jsx)(Ae.A,{size:"small",label:E},E))}),w&&(n?.spec?.targets||n?.spec?.target)&&(0,t.jsx)(k,{label:i("aboutCard.targetsField.label"),gridSizes:{xs:12},children:(0,t.jsx)(Ee.m,{cols:1,items:(n.spec.targets||[n.spec.target]).map(E=>E).map(E=>({text:E,href:ke(E,n?.spec?.type||"unknown",U)}))})})]})}var Se=e(74011),Pe=e(25534),we=e(82451),Re=e(75625),Oe=e(11601),Ie=e.n(Oe);const Ne=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"}}}`),De=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}}}}}'),Me=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}}}}}}'),Ue=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"}}}}}'),de=new Map,Be=[De,Ne,Me,Ue];function $e(a){if(!a?.length)throw new TypeError("Unknown error");const n=a[0];throw new TypeError(`${n.instancePath||"<root>"} ${n.message}${n.params?` - ${Object.entries(n.params).map(([o,i])=>`${o}: ${i}`).join(", ")}`:""}`)}function Fe(a,n={}){const o=n?.disableCache??!1,i=o?"":JSON.stringify(a);if(!o){const p=de.get(i);if(p)return p}const s=ze(a),l=new(Ie())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});s.length&&l.addSchema(s,void 0,void 0,!0);const d=l.compile(a);return o||de.set(i,d),d}function ze(a){if(typeof a!="object")return[];const n=new Set;a.$id&&n.add(a.$id);const o=new Array,i=[a];for(;i.length;){const s=i.pop();for(const l of Ve(s))if(!n.has(l)){n.add(l);const d=Be.find(p=>p.$id===l);d&&(o.push(d),i.push(d))}}return o}function*Ve(a){const n=[a];for(;n.length;){const o=n.pop();if(typeof o=="object"&&o)for(const[i,s]of Object.entries(o))i==="$ref"&&typeof s=="string"?yield s.split("#")[0]:n.push(s)}}function He(a){const n=Fe(a);return o=>{if(n(o)===!0)return o;const s=n.errors?.filter(l=>["/kind","/apiVersion"].includes(l.instancePath));if(s?.length&&s.every(l=>l.keyword==="enum"))return!1;throw $e(n.errors)}}const We=He(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"}}}}}}}]},"presentation":{"type":"object","description":"A way to redefine the presentation of the scaffolder.","properties":{"buttonLabels":{"type":"object","description":"A way to redefine the labels for actionable buttons.","properties":{"backButtonText":{"type":"string","description":"A button which return the user to one step back."},"createButtonText":{"type":"string","description":"A button which start the execution of the template."},"reviewButtonText":{"type":"string","description":"A button which open the review step to verify the input prior to start the execution."}}}}},"EXPERIMENTAL_recovery":{"type":"object","description":"A task recovery section.","properties":{"EXPERIMENTAL_strategy":{"type":"string","description":"Recovery strategy for your task (none or startOver). By default none"}}},"EXPERIMENTAL_formDecorators":{"type":"array","description":"A list of decorators and their inputs that the form should trigger before submitting the job","items":{"type":"object","properties":{"id":{"type":"string","description":"The form hook ID"},"input":{"type":"object","description":"A object describing the inputs to the form hook."}}}},"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"}}}}}}]}')),ft={async check(a){return We(a)===a}},Ke=a=>a.apiVersion==="scaffolder.backstage.io/v1beta3"&&a.kind==="Template";var pe=e(36989);function Ye(a){const{entity:n,loading:o,error:i}=(0,ne.TY)(),{allowed:s,loading:l,error:d}=(0,pe.J)({permission:a,resourceRef:n?(0,A.U2)(n):void 0});return o||l?{loading:!0,allowed:!1}:i?{loading:!1,allowed:!1,error:i}:{loading:!1,allowed:s,error:d}}var Ge=e(35773),Je=e(91638);const Qe="backstage.io/source-template",Xe=a=>{const n=(0,z.gf)(ie.v),{value:o}=(0,Je.A)(async()=>{const i=a.metadata.annotations?.[Qe];let s;if(i)try{const l=await n.getEntityByRef(i);return s=(0,A.KU)(i),l!==void 0?s:void 0}catch{return}},[n,a]);return o};var N=e(14117);const me="scaffolder-template",Ze=(0,N.i)({name:"scaffolder.action.execute",attributes:{},resourceType:"scaffolder-action"}),qe=(0,N.i)({name:"scaffolder.template.parameter.read",attributes:{action:"read"},resourceType:me}),_e=(0,N.i)({name:"scaffolder.template.step.read",attributes:{action:"read"},resourceType:me}),et=(0,N.i)({name:"scaffolder.task.read",attributes:{action:"read"}}),ue=(0,N.i)({name:"scaffolder.task.create",attributes:{action:"create"}}),tt=(0,N.i)({name:"scaffolder.task.cancel",attributes:{}}),nt=(0,N.i)({name:"scaffolder.template.management",attributes:{}}),it=[qe,_e],at=[Ze],st=[tt,ue,et],gt=[...it,...at,...st,nt],ot="backstage.io/techdocs-ref",X="backstage.io/techdocs-entity",rt=(0,T.A)({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 lt(a){const{variant:n}=a,o=(0,ee.n)(),i=rt(),{entity:s}=(0,ne.tN)(),l=(0,z.gf)(Q.Y),d=(0,z.gf)(ie.v),p=(0,z.gf)(be.k),$=(0,z.gf)(ve.m),w=(0,te.S)(se.UJ),D=(0,te.S)(se.Zg),M=Xe(s),{allowed:Y}=Ye(Ge.tS),{t:C}=(0,re.i)(le.W),{allowed:G}=(0,pe.J)({permission:ue}),U=xe(s,l),E=s.metadata.annotations?.[u.P];let F;if(s.metadata.annotations?.[X])try{F=(0,A.KU)(s.metadata.annotations?.[X])}catch{F=void 0}const ct={label:C("aboutCard.viewSource"),disabled:!U,icon:(0,t.jsx)(ge,{type:U?.integrationType}),href:U?.locationTargetUrl},dt={label:C("aboutCard.viewTechdocs"),disabled:!(s.metadata.annotations?.[ot]||s.metadata.annotations?.[X])||!w,icon:(0,t.jsx)(we.A,{}),href:w&&w(F?{namespace:F.namespace||u.oQ,kind:F.kind,name:F.name}:{namespace:s.metadata.namespace||u.oQ,kind:s.kind,name:s.metadata.name})},he=[ct,dt];if(Ke(s)){const _=o.getSystemIcon("scaffolder")??Pe.A,ut={label:C("aboutCard.launchTemplate"),icon:(0,t.jsx)(_,{}),disabled:!D||!G,href:D&&D({templateName:s.metadata.name,namespace:s.metadata.namespace||u.oQ})};he.push(ut)}let Z="";n==="gridItem"?Z=i.gridItemCard:n==="fullHeight"&&(Z=i.fullHeightCard);let q="";n==="gridItem"?q=i.gridItemCardContent:n==="fullHeight"&&(q=i.fullHeightCardContent);const fe=s.metadata.annotations?.[b.Eo],pt=fe?.startsWith("url:")||fe?.startsWith("file:"),mt=(0,r.useCallback)(async()=>{try{await d.refreshEntity((0,A.U2)(s)),p.post({message:C("aboutCard.refreshScheduledMessage"),severity:"info",display:"transient"})}catch(_){$.post(_)}},[d,s,p,C,$]);return(0,t.jsxs)(L.A,{className:Z,children:[(0,t.jsx)(O.A,{title:C("aboutCard.title"),action:(0,t.jsxs)(t.Fragment,{children:[pt&&Y&&(0,t.jsx)(P.A,{"aria-label":"Refresh",title:C("aboutCard.refreshButtonTitle"),onClick:mt,children:(0,t.jsx)(Se.A,{})}),(0,t.jsx)(P.A,{component:j.N_,"aria-label":"Edit",disabled:!E,title:C("aboutCard.editButtonTitle"),to:E??"#",children:(0,t.jsx)(Re.A,{})}),M&&D&&(0,t.jsx)(P.A,{component:j.N_,title:C("aboutCard.createSimilarButtonTitle"),to:D({namespace:M.namespace,templateName:M.name}),children:(0,t.jsx)(c.z9,{id:"scaffolder"})})]}),subheader:(0,t.jsx)(J,{links:he})}),(0,t.jsx)(S.A,{}),(0,t.jsx)(R.A,{className:q,children:(0,t.jsx)(ce,{entity:s})})]})}},18750:(B,x,e)=>{e.d(x,{m:()=>v});var t=e(31085),u=e(24709),A=e(44913),b=e(14041),L=e(10394),R=e(72501),O=e(58837),S=e(23127),P=e(72072);const T=(0,O.A)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function j(h){const{href:y,text:g,Icon:f}=h,I=T();return(0,t.jsxs)(L.A,{display:"flex",children:[(0,t.jsx)(L.A,{mr:1,className:I.svgIcon,children:(0,t.jsx)(R.A,{component:"div",children:f?(0,t.jsx)(f,{}):(0,t.jsx)(S.A,{})})}),(0,t.jsx)(L.A,{flexGrow:"1",children:(0,t.jsx)(P.N_,{to:y,target:"_blank",rel:"noopener",children:g||y})})]})}var c=e(5893);const r={xs:1,sm:1,md:1,lg:2,xl:3};function m(h){const y=[(0,c.A)(f=>f.breakpoints.up("xl"))?"xl":null,(0,c.A)(f=>f.breakpoints.up("lg"))?"lg":null,(0,c.A)(f=>f.breakpoints.up("md"))?"md":null,(0,c.A)(f=>f.breakpoints.up("sm"))?"sm":null,(0,c.A)(f=>f.breakpoints.up("xs"))?"xs":null];let g=1;if(typeof h=="number")g=h;else{const f=y.find(I=>I!==null)??"xs";g=h?.[f]??r[f]}return g}function v(h){const{items:y,cols:g=void 0}=h,f=m(g);return(0,t.jsx)(u.A,{rowHeight:"auto",cols:f,children:y.map(({text:I,href:V,Icon:J},Q)=>(0,t.jsx)(A.A,{children:(0,t.jsx)(j,{href:V,text:I??V,Icon:J})},Q))})}},14117:(B,x,e)=>{e.d(x,{i:()=>t});function t({name:u,attributes:A,resourceType:b}){return b?{type:"resource",name:u,attributes:A,resourceType:b}:{type:"basic",name:u,attributes:A}}},36989:(B,x,e)=>{e.d(x,{J:()=>c});var t=e(72427),u=e(96824);function A(r,m){return r.name===m.name}function b(r,m){return"resourceType"in r?!m||r.resourceType===m:!1}function L(r){return r.attributes.action==="create"}function R(r){return r.attributes.action==="read"}function O(r){return r.attributes.action==="update"}function S(r){return r.attributes.action==="delete"}function P(r){return{authorize:async(m,v)=>await r.authorize(m,v),authorizeConditional(m,v){const h=m;return r.authorize(h,v)}}}var T=e(54241),j=e(68721);function c(r){const m=(0,t.gf)(u.x),{data:v,error:h}=(0,j.Ay)(r,async y=>{if(b(y.permission)&&!y.resourceRef)return T.b.DENY;const{result:g}=await m.authorize(y);return g});return h?{error:h,loading:!1,allowed:!1}:v===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:v===T.b.ALLOW}}}}]);})();
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=5724.a8d74000.chunk.js.map
|