UNPKG

@techdocs/cli

Version:

Utility CLI for managing TechDocs sites in Backstage.

4 lines (3 loc) • 21.1 kB
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[2177],{48514:(z,h,t)=>{t.d(h,{M:()=>E});var e=t(31085),y=t(58837),S=t(71677),C=t(72501);const O=(0,y.A)({container:{overflow:"visible !important"},typo:{fontSize:"inherit",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box","-webkit-line-clamp":({line:g})=>g||1,"-webkit-box-orient":"vertical"}},{name:"BackstageOverflowTooltip"});function E(g){const M=O(g);return(0,e.jsx)(S.Ay,{title:g.title??(g.text||""),placement:g.placement,children:(0,e.jsx)(C.A,{className:M.typo,variant:"inherit",children:g.text})})}},35773:(z,h,t)=>{t.d(h,{C4:()=>C,tS:()=>E});var e=t(14117);const y="catalog-entity",S=(0,e.i)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:y}),C=(0,e.i)({name:"catalog.entity.create",attributes:{action:"create"}}),O=(0,e.i)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:y}),E=(0,e.i)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:y}),g=(0,e.i)({name:"catalog.entity.validate",attributes:{}}),M=(0,e.i)({name:"catalog.location.read",attributes:{action:"read"}}),b=(0,e.i)({name:"catalog.location.create",attributes:{action:"create"}}),K=(0,e.i)({name:"catalog.location.analyze",attributes:{}}),R=(0,e.i)({name:"catalog.location.delete",attributes:{action:"delete"}}),Y=[S,C,O,E,g,M,b,R,K]},90759:(z,h,t)=>{t.d(h,{W:()=>y});var e=t(93184);const y=(0,e.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. 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 & zoom to move around the diagram.",edgeLabels:{partOf:"part of",provides:"provides",dependsOn:"depends on"}}}})},62177:(z,h,t)=>{t.r(h),t.d(h,{BaseCatalogPage:()=>Ce,CatalogPage:()=>xt,DefaultCatalogPage:()=>ve});var e=t(31085),y=t(18690),S=t(27155),C=t(26280),O=t(59428),E=t(64947),g=t(29365),M=t(5893),b=t(73657),K=t(25534);function R(n){const{title:a,to:s}=n,i=(0,M.A)(o=>o.breakpoints.down("xs"));return s?i?(0,e.jsx)(g.A,{component:b.N_,color:"primary",title:a,size:"small",to:s,children:(0,e.jsx)(K.A,{})}):(0,e.jsx)(E.A,{component:b.N_,variant:"contained",color:"primary",to:s,children:a}):null}var Y=t(27586),w=t(72427),xe=t(65461),Pe=t(9222),F=t(21405),k=t(54203),te=t(66917),ne=t(36017),Q=t(10394),m=t(14041),N=t(92822),ae=t(73466),se=t(7341);function Ae(){const n=(0,w.gf)(se.v),{error:a,loading:s,value:i}=(0,ae.A)(async()=>{const{facets:o}=await n.getEntityFacets({facets:["kind"]}),l=(o.kind??[]).map(r=>r.value);return new Map(l.map(r=>[r.toLocaleLowerCase("en-US"),r]))},[n]);return{loading:s,error:a,allKinds:i??new Map}}function Ee(n,a,s){let i=Array.from(n.keys());a&&(i=a.map(l=>l.toLocaleLowerCase("en-US")).filter(l=>n.has(l)));const o=new Map(i.map(l=>[l,n.get(l)||l]));return s&&!o.has(s)&&o.set(s.toLocaleLowerCase("en-US"),s),o}var I=t(64630),j=t(87849);function je(n){const{filters:a,queryParameters:{kind:s},updateFilters:i}=(0,F.nK)(),o=(0,m.useMemo)(()=>[s].flat()[0],[s]),[l,r]=(0,m.useState)(o??a.kind?.value??n.initialFilter);(0,m.useEffect)(()=>{o&&r(o)},[o]),(0,m.useEffect)(()=>{a.kind?.value&&r(a.kind?.value)},[a.kind]);const{allKinds:c,loading:d,error:p}=Ae(),u=c.get(l)||l;return(0,m.useEffect)(()=>{i({kind:l?new N.gM(l,u):void 0})},[l,u,i]),{loading:d,error:p,allKinds:c,selectedKind:l,setSelectedKind:r}}const Le=n=>{const{allowedKinds:a,hidden:s,initialFilter:i="component"}=n,{t:o}=(0,j.i)(I.j),l=(0,w.gf)(ne.k),{error:r,allKinds:c,selectedKind:d,setSelectedKind:p}=je({initialFilter:i});if((0,m.useEffect)(()=>{r&&l.post({message:o("entityKindPicker.errorMessage"),severity:"error"})},[r,l,o]),r)return null;const v=[...Ee(c,a,d).entries()].map(([x,T])=>({label:T,value:x}));return s?null:(0,e.jsx)(Q.A,{pb:1,pt:1,children:(0,e.jsx)(te.w,{label:o("entityKindPicker.title"),items:v,selected:d.toLocaleLowerCase("en-US"),onChange:x=>p(String(x))})})};var W=t(58837),oe=t(47144);const Oe=(0,W.A)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Me=n=>{const{initialFilter:a=[]}=n,s=Oe(),{t:i}=(0,j.i)(I.j);return(0,e.jsx)(oe.y,{label:i("entityLifecyclePicker.title"),name:"lifecycles",path:"spec.lifecycle",Filter:N.I5,InputProps:{className:s.input},initialSelectedOptions:a})},be=(0,W.A)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),Re=n=>{const{initiallySelectedNamespaces:a}=n,s=be(),{t:i}=(0,j.i)(I.j);return(0,e.jsx)(oe.y,{label:i("entityNamespacePicker.title"),name:"namespace",path:"metadata.namespace",Filter:N.z,InputProps:{className:s.input},initialSelectedOptions:a})};var Fe=t(72987),Ne=t(69076),Be=t(86901),De=t(44148),Ke=t(41260),Ie=t(22995);const Ue=(0,W.A)({root:{},input:{},label:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),ze=(0,e.jsx)(Ke.A,{fontSize:"small"}),we=(0,e.jsx)(De.A,{fontSize:"small"}),We=()=>{const n=Ue(),{updateFilters:a}=(0,F.nK)(),{t:s}=(0,j.i)(I.j),[i,o]=(0,m.useState)([]);function l(d){a({orphan:d?new N.Kf(d):void 0})}function r(d){a({error:d?new N.mT(d):void 0})}const c=["Is Orphan","Has Error"];return(0,e.jsx)(Q.A,{className:n.root,pb:1,pt:1,children:(0,e.jsx)(Ie.Q,{label:s("entityProcessingStatusPicker.title"),multiple:!0,disableCloseOnSelect:!0,options:c,value:i,onChange:(d,p)=>{o(p),l(p.includes("Is Orphan")),r(p.includes("Has Error"))},renderOption:(d,{selected:p})=>(0,e.jsx)(Be.A,{control:(0,e.jsx)(Ne.A,{icon:ze,checkedIcon:we,checked:p}),onClick:u=>u.preventDefault(),label:d}),name:"processing-status-picker",LabelProps:{className:n.label},TextFieldProps:{className:n.input}})})};var He=t(91035),Ve=t(46343),Ye=t.n(Ve),Ge=t(40074),Xe=t.n(Ge);function ke(){const n=(0,w.gf)(se.v),{filters:{kind:a,type:s},queryParameters:{type:i},updateFilters:o}=(0,F.nK)(),l=(0,m.useMemo)(()=>[i].flat().filter(Boolean),[i]),[r,c]=(0,m.useState)(l.length?l:s?.getTypes()??[]);(0,m.useEffect)(()=>{l.length&&c(l)},[l]);const[d,p]=(0,m.useState)([]),u=(0,m.useMemo)(()=>a?.value,[a]),{error:v,loading:x,value:T}=(0,ae.A)(async()=>u?await n.getEntityFacets({filter:{kind:u},facets:["spec.type"]}).then(P=>P.facets["spec.type"]||[]):[],[u,n]),V=(0,m.useRef)(T);return(0,m.useEffect)(()=>{const U=V.current;if(V.current=T,x||!u||U===T||!T)return;const P=[...new Set(Xe()(T,B=>-B.count).map(B=>B.value.toLocaleLowerCase("en-US")))];p(P);const X=r.filter(B=>P.includes(B));Ye()(r,X)||c(X)},[x,u,r,c,T]),(0,m.useEffect)(()=>{o({type:r.length?new N.qA(r):void 0})},[r,o]),{loading:x,error:v,availableTypes:d,selectedTypes:r,setSelectedTypes:c}}const Qe=n=>{const{hidden:a,initialFilter:s}=n,i=(0,w.gf)(ne.k),{error:o,availableTypes:l,selectedTypes:r,setSelectedTypes:c}=ke(),{t:d}=(0,j.i)(I.j);if((0,m.useEffect)(()=>{o&&i.post({message:d("entityTypePicker.errorMessage"),severity:"error"}),s&&c([s])},[o,i,s,c,d]),l.length===0||o)return null;l.sort((u,v)=>u.toLocaleLowerCase("en-US").localeCompare(v.toLocaleLowerCase("en-US")));const p=[{value:"all",label:d("entityTypePicker.optionAllTitle")},...l.map(u=>({value:u,label:u}))];return a?null:(0,e.jsx)(Q.A,{pb:1,pt:1,children:(0,e.jsx)(te.w,{label:d("entityTypePicker.title"),items:p,selected:(p.length>1?r[0]:void 0)??"all",onChange:u=>c(u==="all"?[]:[String(u)])})})};var Je=t(67626);const $e=n=>{const{initialKind:a,initiallySelectedFilter:s,ownerPickerMode:i,initiallySelectedNamespaces:o}=n;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Le,{initialFilter:a}),(0,e.jsx)(Qe,{}),(0,e.jsx)(Je.y,{initialFilter:s}),(0,e.jsx)(Fe.t,{mode:i}),(0,e.jsx)(Me,{}),(0,e.jsx)(He.m,{}),(0,e.jsx)(We,{}),(0,e.jsx)(Re,{initiallySelectedNamespaces:o})]})};var Ze=t(95203),ie=t(72348),le=t(51372),qe=t(6820),_e=t(88640),et=t(77310),J=t(14209),H=t(90184),tt=t(56889),re=t(67871),$=t(72501),ce=t(88654),nt=t(75625),at=t(39330),st=t(45250),ot=t(65398),it=t.n(ot),lt=t(8859),de=t(34428),ue=t(67720),me=t(48514);const f=Object.freeze({createNameColumn(n){function a(s){return s.metadata?.title||(0,H.S)(s,{defaultKind:n?.defaultKind})}return{title:"Name",field:"resolved.entityRef",highlight:!0,customSort({entity:s},{entity:i}){return a(s).localeCompare(a(i))},render:({entity:s})=>(0,e.jsx)(lt.z,{entityRef:s,defaultKind:n?.defaultKind||"Component"})}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",customFilterAndSearch:(n,a)=>a.resolved.partOfSystemRelations?a.resolved.partOfSystemRelations.map(o=>o.name).join(", ").toLocaleUpperCase("en-US").includes(n.toLocaleUpperCase("en-US")):!1,render:({resolved:n})=>(0,e.jsx)(de.i,{entityRefs:n.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:n})=>(0,e.jsx)(de.i,{entityRefs:n.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",customFilterAndSearch:(n,a)=>{let s=[];return a.entity?.spec?.targets&&Array.isArray(a.entity?.spec?.targets)?s=a.entity?.spec?.targets:a.entity?.spec?.target&&(s=[a.entity?.spec?.target]),s.join(", ").toLocaleUpperCase("en-US").includes(n.toLocaleUpperCase("en-US"))},render:({entity:n})=>(0,e.jsx)(e.Fragment,{children:(n?.spec?.targets||n?.spec?.target)&&(0,e.jsx)(me.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,e.jsx)(me.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,e.jsx)(e.Fragment,{children:n.metadata.tags&&n.metadata.tags.map(a=>(0,e.jsx)(ue.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 s(i,o){const l=o.metadata?.labels;return l&&l[i]||""}return{title:a?.title||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},customSort({entity:i},{entity:o}){return s(n,i).localeCompare(s(n,o))},render:({entity:i})=>{const o=i.metadata?.labels,l=o&&o[n]||a?.defaultValue;return(0,e.jsx)(e.Fragment,{children:l&&(0,e.jsx)(ue.A,{label:l,size:"small",variant:"outlined"},l)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}});var rt=t(95061),ct=t(63301),pe=t(34839),ye=t(75173),dt=t(64704),ut=t(45917),mt=t(16983);const pt=(0,W.A)(n=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),yt=()=>{const n=pt(),{t:a}=(0,j.i)(I.j),{updateFilters:s,queryParameters:{text:i}}=(0,F.nK)(),o=(0,m.useMemo)(()=>[i].flat()[0],[i]),[l,r]=(0,m.useState)(o??"");return(0,mt.A)(()=>{s({text:l.length?new N.V3(l):void 0})},250,[l,s]),(0,m.useEffect)(()=>{o&&r(o)},[o]),(0,e.jsx)(ye.A,{className:n.searchToolbar,children:(0,e.jsx)(rt.A,{children:(0,e.jsx)(ct.A,{"aria-label":"search",id:"input-with-icon-adornment",className:n.input,placeholder:a("entitySearchBar.placeholder"),autoComplete:"off",onChange:c=>r(c.target.value),value:l,startAdornment:(0,e.jsx)(pe.A,{position:"start",children:(0,e.jsx)(ut.A,{})}),endAdornment:(0,e.jsx)(pe.A,{position:"end",children:(0,e.jsx)(g.A,{"aria-label":"clear search",onClick:()=>r(""),edge:"end",disabled:l.length===0,children:(0,e.jsx)(dt.A,{})})})})})})},gt=(0,W.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 ge(n){const a=gt();return(0,e.jsxs)(ye.A,{className:a.root,children:[(0,e.jsx)($.A,{variant:"h5",className:a.text,children:n.title}),(0,e.jsx)(yt,{})]})}function ft(n){const{columns:a,data:s,options:i,...o}=n,{setLimit:l,setOffset:r,limit:c,totalItems:d,offset:p}=(0,F.nK)(),[u,v]=(0,m.useState)(p&&c?Math.floor(p/c):0);return(0,m.useEffect)(()=>{d&&u*c>=d?r(Math.max(0,d-c)):r(Math.max(0,u*c))},[r,u,c,d]),(0,e.jsx)(J.X,{columns:a,data:s,options:{pageSizeOptions:[5,10,20,50,100],pageSize:c,emptyRowsWhenPaging:!1,...i},components:{Toolbar:ge},page:u,onPageChange:v,onRowsPerPageChange:l,totalCount:d,...o})}function ht(n){const{columns:a,data:s,next:i,prev:o,options:l,...r}=n;return(0,e.jsx)(J.X,{columns:a,data:s,options:{...l,pageSizeOptions:[],showFirstLastPageButtons:!1,pageSize:Number.MAX_SAFE_INTEGER,emptyRowsWhenPaging:!1},onPageChange:c=>{c>0?i?.():o?.()},components:{Toolbar:ge},page:o?1:0,totalCount:i?Number.MAX_VALUE:Number.MAX_SAFE_INTEGER,localization:{pagination:{labelDisplayedRows:""}},...r})}const fe=({filters:n,entities:a})=>{const s=n.type===void 0;return[f.createTitleColumn({hidden:!0}),f.createNameColumn({defaultKind:n.kind?.value}),...i()];function i(){const o=[f.createMetadataDescriptionColumn(),f.createTagsColumn()],l=[f.createSystemColumn(),f.createOwnerColumn(),f.createSpecTypeColumn({hidden:!s}),f.createSpecLifecycleColumn()];switch(n.kind?.value){case"user":return[...o];case"domain":case"system":return[f.createOwnerColumn(),...o];case"group":case"template":return[f.createSpecTypeColumn({hidden:!s}),...o];case"location":return[f.createSpecTypeColumn({hidden:!s}),f.createSpecTargetsColumn()];default:return a.every(r=>r.metadata.namespace==="default")?[...l,...o]:[...l,f.createNamespaceColumn(),...o]}}};var he=t(90759),Ct=t(18956);const vt=(n,a)=>{const s=i=>i.metadata.title||(0,H.S)(i,{defaultKind:"Component"});return s(n).localeCompare(s(a))},G=n=>{const{columns:a=fe,tableOptions:s,subtitle:i,emptyContent:o}=n,{isStarredEntity:l,toggleStarredEntity:r}=(0,tt.I)(),c=(0,F.nK)(),{loading:d,error:p,entities:u,filters:v,pageInfo:x,totalItems:T,paginationMode:V}=c,U=(0,m.useMemo)(()=>typeof a=="function"?a(c):a,[a,c]),{t:P}=(0,j.i)(he.W);if(p)return(0,e.jsx)("div",{children:(0,e.jsx)(_e.B,{severity:"error",title:P("catalogTable.warningPanelTitle"),children:(0,e.jsx)(et.z,{language:"text",text:p.toString()})})});const X=[({entity:L})=>{const A=L.metadata.annotations?.[ie._P],D=P("catalogTable.viewActionTitle");return{icon:()=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)($.A,{style:ce.A,children:D}),(0,e.jsx)(at.A,{fontSize:"small"})]}),tooltip:D,disabled:!A,onClick:()=>{A&&window.open(A,"_blank")}}},({entity:L})=>{const A=L.metadata.annotations?.[ie.P],D=P("catalogTable.editActionTitle");return{icon:()=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)($.A,{style:ce.A,children:D}),(0,e.jsx)(nt.A,{fontSize:"small"})]}),tooltip:D,disabled:!A,onClick:()=>{A&&window.open(A,"_blank")}}},({entity:L})=>{const A=l(L),D=P(A?"catalogTable.unStarActionTitle":"catalogTable.starActionTitle");return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,e.jsx)(Ct.m,{isFavorite:A}),tooltip:D,onClick:()=>r(L)}}],B=v.kind?.label||"",Pt=v.type?.value||"",At=typeof T=="number"?`(${T})`:"",Et=(0,st.capitalize)(v.user?.value??"all"),q=n.title||[Et,Pt,it()(B),At].filter(L=>L).join(" "),_=n.actions||X,ee={actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!d,padding:"dense",...s};if(V==="cursor")return(0,e.jsx)(ht,{columns:U,emptyContent:o,isLoading:d,title:q,actions:_,subtitle:i,options:ee,data:u.map(Z),next:x?.next,prev:x?.prev});if(V==="offset")return(0,e.jsx)(ft,{columns:U,emptyContent:o,isLoading:d,title:q,actions:_,subtitle:i,options:ee,data:u.map(Z)});const Te=u.sort(vt).map(Z),Se=20,jt=Te.length>Se;return(0,e.jsx)(J.X,{isLoading:d,columns:U,options:{paging:jt,pageSize:Se,pageSizeOptions:[20,50,100],...ee},title:q,data:Te,actions:_,subtitle:i,emptyContent:o})};G.columns=f,G.defaultColumnsFunc=fe;function Z(n){const a=(0,re.t)(n,le.jn,{kind:"system"}),s=(0,re.t)(n,le.vv);return{entity:n,resolved:{name:(0,H.S)(n,{defaultKind:"Component"}),entityRef:(0,qe.U2)(n),ownedByRelationsTitle:s.map(i=>(0,H.S)(i,{defaultKind:"group"})).join(", "),ownedByRelations:s,partOfSystemRelationTitle:a.map(i=>(0,H.S)(i,{defaultKind:"system"})).join(", "),partOfSystemRelations:a}}}var Tt=t(35773),St=t(39292);function Ce(n){const{filters:a,content:s=(0,e.jsx)(G,{}),pagination:i}=n,o=(0,w.gf)(xe.U).getOptionalString("organization.name")??"Backstage",l=(0,Pe.S)(Ze.qP),{t:r}=(0,j.i)(he.W),{allowed:c}=(0,St.J)({permission:Tt.C4});return(0,e.jsx)(S.d,{title:r("indexPage.title",{orgName:o}),themeId:"home",children:(0,e.jsxs)(C.U,{children:[(0,e.jsxs)(O.d,{title:"",children:[c&&(0,e.jsx)(R,{title:r("indexPage.createButtonTitle"),to:l&&l()}),(0,e.jsx)(Y.Y,{children:r("indexPage.supportButtonContent")})]}),(0,e.jsx)(F.B9,{pagination:i,children:(0,e.jsxs)(k.GI,{children:[(0,e.jsx)(k.GI.Filters,{children:a}),(0,e.jsx)(k.GI.Content,{children:s})]})})]})})}function ve(n){const{columns:a,actions:s,initiallySelectedFilter:i="owned",initialKind:o="component",tableOptions:l={},emptyContent:r,pagination:c,ownerPickerMode:d,filters:p,initiallySelectedNamespaces:u}=n;return(0,e.jsx)(Ce,{filters:p??(0,e.jsx)($e,{initialKind:o,initiallySelectedFilter:i,ownerPickerMode:d,initiallySelectedNamespaces:u}),content:(0,e.jsx)(G,{columns:a,actions:s,tableOptions:l,emptyContent:r}),pagination:c})}function xt(n){return(0,y.P1)()||(0,e.jsx)(ve,{...n})}},14117:(z,h,t)=>{t.d(h,{i:()=>e});function e({name:y,attributes:S,resourceType:C}){return C?{type:"resource",name:y,attributes:S,resourceType:C}:{type:"basic",name:y,attributes:S}}},39292:(z,h,t)=>{t.d(h,{J:()=>E});var e=t(72427),y=t(96824),S=t(13646),C=t(54241),O=t(68721);function E(g){const M=(0,e.gf)(y.x),{data:b,error:K}=(0,O.Ay)(g,async R=>{if((0,S.OL)(R.permission)&&!R.resourceRef)return C.b.DENY;const{result:Y}=await M.authorize(R);return Y});return K?{error:K,loading:!1,allowed:!1}:b===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:b===C.b.ALLOW}}}}]);})(); //# sourceMappingURL=2177.68de3516.chunk.js.map