@techdocs/cli
Version:
Utility CLI for managing TechDocs sites in Backstage.
9 lines (8 loc) • 12.3 kB
JavaScript
;(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[8307],{52235:(b,i,t)=>{var e,u=t(4293),m=t(78920);e={value:!0},i.A=void 0;var d=m(t(14041)),p=u(t(74044)),g=(0,p.default)(d.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward");i.A=g},23127:(b,i,t)=>{var e,u=t(4293),m=t(78920);e={value:!0},i.A=void 0;var d=m(t(14041)),p=u(t(74044)),g=(0,p.default)(d.createElement("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"}),"Language");i.A=g},48045:(b,i,t)=>{t.d(i,{n:()=>O});var e=t(31085),u=t(40703),m=t(59469),d=t(48653),p=t(45685),g=t(37197),v=t(58837),L=t(87051),T=t(53373),E=t.n(T),a=t(10394),r=t(72501),f=t(52235),x=t(72072);const c=(0,v.A)(l=>({root:{maxWidth:"fit-content",padding:l.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:l.palette.textSubtle},arrow:{color:l.palette.textSubtle}}),{name:"BackstageBottomLink"});function h(l){const{link:o,title:y,onClick:M}=l,B=c();return(0,e.jsxs)(a.A,{children:[(0,e.jsx)(g.A,{}),(0,e.jsx)(x.N_,{to:o,onClick:M,underline:"none",children:(0,e.jsxs)(a.A,{display:"flex",alignItems:"center",className:B.root,children:[(0,e.jsx)(a.A,{className:B.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,e.jsx)(r.A,{children:(0,e.jsx)("strong",{children:y})})}),(0,e.jsx)(f.A,{className:B.arrow})]})})]})}var s=t(14041),n=t(73896),C=t(22020),S=t(10315),N=t(87849);const D=l=>{const{slackChannel:o}=l,{t:y}=(0,N.i)(S.O);if(o){if(typeof o=="string")return(0,e.jsx)(r.A,{children:y("errorBoundary.title",{slackChannel:o})});if(!o.href)return(0,e.jsx)(r.A,{children:y("errorBoundary.title",{slackChannel:o.name})})}else return null;return(0,e.jsx)(n.z,{to:o.href,variant:"contained",children:o.name})},R=class extends s.Component{constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}componentDidCatch(o,y){console.error(`ErrorBoundary, error: ${o}`,{error:o,errorInfo:y}),this.setState({error:o,errorInfo:y})}render(){const{slackChannel:o,children:y}=this.props,{error:M}=this.state;return M?(0,e.jsx)(C.b,{title:"Something Went Wrong",error:M,children:(0,e.jsx)(D,{slackChannel:o})}):y}},I=(0,v.A)(l=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},contentAlignBottom:{display:"flex",alignItems:"self-end"},header:{padding:l.spacing(2,2,2,2.5)},headerTitle:{fontWeight:l.typography.fontWeightBold},headerSubheader:{paddingTop:l.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),j=(0,L.A)(l=>({root:{display:"inline-block",padding:l.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(m.A),P={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function O(l){const{title:o,subheader:y,divider:M=!0,deepLink:B,slackChannel:z,errorBoundaryProps:w,variant:H,alignContent:V="normal",children:G,headerStyle:Q,headerProps:$,icon:F,action:J,actionsClassName:X,actions:U,cardClassName:Z,actionsTopRight:Y,className:q,noPadding:_,titleTypographyProps:tt,subheaderTypographyProps:et}=l,A=I();let k={},W={};H&&H.split(/[\s]+/g).forEach(K=>{k={...k,...P.card[K]},W={...W,...P.cardContent[K]}});const nt=()=>!y&&!F?null:(0,e.jsxs)("div",{"data-testid":"info-card-subheader",children:[y&&(0,e.jsx)("div",{className:A.subheader,children:y}),F]}),at=w||(z?{slackChannel:z}:{});return(0,e.jsx)(u.A,{style:k,className:q,children:(0,e.jsxs)(R,{...at,children:[o&&(0,e.jsx)(p.A,{classes:{root:E()(A.header),title:A.headerTitle,subheader:A.headerSubheader,avatar:A.headerAvatar,action:A.headerAction,content:A.headerContent},title:o,subheader:nt(),action:J,style:{...Q},titleTypographyProps:tt,subheaderTypographyProps:et,...$}),Y&&(0,e.jsx)(j,{children:Y}),M&&(0,e.jsx)(g.A,{}),(0,e.jsx)(d.A,{className:E()(Z,{[A.noPadding]:_,[A.contentAlignBottom]:V==="bottom"}),style:W,children:G}),U&&(0,e.jsx)(m.A,{className:X,children:U}),B&&(0,e.jsx)(h,{...B})]})})}},99538:(b,i,t)=>{t.d(i,{T7:()=>v,TY:()=>E,tN:()=>T});var e=t(31085),u=t(6820),m=t(25862),d=t(43836),p=t(10602);const g=(0,d.tK)("entity-context"),v=a=>{const{children:r,entity:f,loading:x,error:c,refresh:h}=a,s={entity:f,loading:x,error:c,refresh:h};return(0,e.jsx)(g.Provider,{value:(0,p.B)({1:s}),children:(0,e.jsx)(m.Ig,{attributes:{...f?{entityRef:(0,u.U2)(f)}:void 0},children:r})})},L=a=>_jsx(v,{entity:a.entity,loading:!a.entity,error:void 0,refresh:void 0,children:a.children});function T(){const a=(0,d.qO)("entity-context");if(!a)throw new Error("Entity context is not available");const r=a.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 E(){const a=(0,d.qO)("entity-context");if(!a)throw new Error("Entity context is not available");const r=a.atVersion(1);if(!r)throw new Error("EntityContext v1 not available");const{entity:f,loading:x,error:c,refresh:h}=r;return{entity:f,loading:x,error:c,refresh:h}}},90759:(b,i,t)=>{t.d(i,{W:()=>u});var e=t(93184);const u=(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"}}}})},18750:(b,i,t)=>{t.d(i,{m:()=>x});var e=t(31085),u=t(24709),m=t(44913),d=t(10394),p=t(72501),g=t(58837),v=t(23127),L=t(72072);const T=(0,g.A)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function E(c){const{href:h,text:s,Icon:n}=c,C=T();return(0,e.jsxs)(d.A,{display:"flex",children:[(0,e.jsx)(d.A,{mr:1,className:C.svgIcon,children:(0,e.jsx)(p.A,{component:"div",children:n?(0,e.jsx)(n,{}):(0,e.jsx)(v.A,{})})}),(0,e.jsx)(d.A,{flexGrow:"1",children:(0,e.jsx)(L.N_,{to:h,target:"_blank",rel:"noopener",children:s||h})})]})}var a=t(5893);const r={xs:1,sm:1,md:1,lg:2,xl:3};function f(c){const h=[(0,a.A)(n=>n.breakpoints.up("xl"))?"xl":null,(0,a.A)(n=>n.breakpoints.up("lg"))?"lg":null,(0,a.A)(n=>n.breakpoints.up("md"))?"md":null,(0,a.A)(n=>n.breakpoints.up("sm"))?"sm":null,(0,a.A)(n=>n.breakpoints.up("xs"))?"xs":null];let s=1;if(typeof c=="number")s=c;else{const n=h.find(C=>C!==null)??"xs";s=c?.[n]??r[n]}return s}function x(c){const{items:h,cols:s=void 0}=c,n=f(s);return(0,e.jsx)(u.A,{rowHeight:"auto",cols:n,children:h.map(({text:C,href:S,Icon:N},D)=>(0,e.jsx)(m.A,{children:(0,e.jsx)(E,{href:S,text:C??S,Icon:N})},D))})}},18307:(b,i,t)=>{t.r(i),t.d(i,{EntityLinksCard:()=>h});var e=t(31085),u=t(99538),m=t(23127),d=t(64947),p=t(72501),g=t(58837),v=t(77310),L=t(87849),T=t(90759);const E=`metadata:
name: example
links:
- url: https://dashboard.example.com
title: My Dashboard
icon: dashboard`,a=(0,g.A)(s=>({code:{borderRadius:6,margin:s.spacing(2,0),background:s.palette.type==="dark"?"#444":s.palette.common.white}}),{name:"PluginCatalogEntityLinksEmptyState"});function r(){const s=a(),{t:n}=(0,L.i)(T.W);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(p.A,{variant:"body1",children:n("entityLinksCard.emptyDescription")}),(0,e.jsx)("div",{className:s.code,children:(0,e.jsx)(v.z,{text:E,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,e.jsx)(d.A,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional",children:n("entityLinksCard.readMoreButtonTitle")})]})}var f=t(18750),x=t(82266),c=t(48045);const h=s=>{const{cols:n=void 0,variant:C}=s,{entity:S}=(0,u.tN)(),N=(0,x.n)(),{t:D}=(0,L.i)(T.W),R=j=>j?N.getSystemIcon(j)??m.A:m.A,I=S?.metadata?.links;return(0,e.jsx)(c.n,{title:D("entityLinksCard.title"),variant:C,children:!I||I.length===0?(0,e.jsx)(r,{}):(0,e.jsx)(f.m,{cols:n,items:I.map(({url:j,title:P,icon:O})=>({text:P??j,href:j,Icon:R(O)}))})})}}}]);})();
//# sourceMappingURL=8307.e9b33c8f.chunk.js.map