UNPKG

@techdocs/cli

Version:

Utility CLI for managing TechDocs sites in Backstage.

5 lines • 10.1 kB
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["843"],{27597:function(e,t,n){var i=n(15755),a=n(25357);t.default=void 0;var o=a(n(2784));t.default=(0,i(n(50175)).default)(o.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward")},35402:function(e,t,n){n.d(t,{r:()=>S});var i=n(52322),a=n(94339),o=n(14503),s=n(24579),r=n(32552),l=n(85256),d=n(79692),c=n(77392),h=n(16709),p=n.n(h),u=n(53244),m=n(90436),y=n(27597),g=n(13039);let f=(0,d.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function b(e){let{link:t,title:n,onClick:a}=e,o=f();return(0,i.jsxs)(u.Z,{children:[(0,i.jsx)(l.Z,{}),(0,i.jsx)(g.rU,{to:t,onClick:a,underline:"none",children:(0,i.jsxs)(u.Z,{display:"flex",alignItems:"center",className:o.root,children:[(0,i.jsx)(u.Z,{className:o.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,i.jsx)(m.Z,{children:(0,i.jsx)("strong",{children:n})})}),(0,i.jsx)(y.default,{className:o.arrow})]})})]})}var x=n(2784),C=n(37667),v=n(33414),T=n(2210),w=n(14380);let j=e=>{let{slackChannel:t}=e,{t:n}=(0,w.i)(T.v);return t?"string"==typeof t?(0,i.jsx)(m.Z,{children:n("errorBoundary.title",{slackChannel:t})}):t.href?(0,i.jsx)(C.Q,{to:t.href,variant:"contained",children:t.name}):(0,i.jsx)(m.Z,{children:n("errorBoundary.title",{slackChannel:t.name})}):null},k=class extends x.Component{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}componentDidCatch(e,t){console.error(`ErrorBoundary, error: ${e}`,{error:e,errorInfo:t}),this.setState({error:e,errorInfo:t})}render(){let{slackChannel:e,children:t}=this.props,{error:n}=this.state;return n?(0,i.jsx)(v.y,{title:"Something Went Wrong",error:n,children:(0,i.jsx)(j,{slackChannel:e})}):t}},L=(0,d.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},contentAlignBottom:{display:"flex",alignItems:"self-end"},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),N=(0,c.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(o.Z),E={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"}}},B={fullHeight:{flex:1},gridItem:{flex:1}};function S(e){let{title:t,subheader:n,divider:d=!0,deepLink:c,slackChannel:h,errorBoundaryProps:u,variant:m,alignContent:y="normal",children:g,headerStyle:f,headerProps:x,icon:C,action:v,actionsClassName:T,actions:w,cardClassName:j,actionsTopRight:S,className:M,noPadding:Z,titleTypographyProps:D,subheaderTypographyProps:A}=e,O=L(),F={},R={};return m&&m.split(/[\s]+/g).forEach(e=>{F={...F,...E[e]},R={...R,...B[e]}}),(0,i.jsx)(a.Z,{style:F,className:M,children:(0,i.jsxs)(k,{...u||(h?{slackChannel:h}:{}),children:[t&&(0,i.jsx)(r.Z,{classes:{root:p()(O.header),title:O.headerTitle,subheader:O.headerSubheader,avatar:O.headerAvatar,action:O.headerAction,content:O.headerContent},title:t,subheader:n||C?(0,i.jsxs)("div",{"data-testid":"info-card-subheader",children:[n&&(0,i.jsx)("div",{className:O.subheader,children:n}),C]}):null,action:v,style:{...f},titleTypographyProps:D,subheaderTypographyProps:A,...x}),S&&(0,i.jsx)(N,{children:S}),d&&(0,i.jsx)(l.Z,{}),(0,i.jsx)(s.Z,{className:p()(j,{[O.noPadding]:Z,[O.contentAlignBottom]:"bottom"===y}),style:R,children:g}),w&&(0,i.jsx)(o.Z,{className:T,children:w}),c&&(0,i.jsx)(b,{...c})]})})}},5e4:function(e,t,n){n.d(t,{X2:()=>c,ce:()=>h,h$:()=>d});var i=n(52322),a=n(39381),o=n(60214),s=n(18011),r=n(88260);let l=(0,s.CT)("entity-context"),d=e=>{let{children:t,entity:n,loading:s,error:d,refresh:c}=e;return(0,i.jsx)(l.Provider,{value:(0,r.E)({1:{entity:n,loading:s,error:d,refresh:c}}),children:(0,i.jsx)(o.fC,{attributes:{...n?{entityRef:(0,a.eE)(n)}:void 0},children:t})})};function c(){let e=(0,s.Vt)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");if(!t.entity)throw 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:t.entity}}function h(){let e=(0,s.Vt)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");let{entity:n,loading:i,error:a,refresh:o}=t;return{entity:n,loading:i,error:a,refresh:o}}},94890:function(e,t,n){n.d(t,{s:()=>i});let i=(0,n(73669).F)({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.\n 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"}}}})},64833:function(e,t,n){n.r(t),n.d(t,{hasLabels:()=>b,EntityLabelsCard:()=>f});var i=n(52322),a=n(5e4),o=n(35402),s=n(33702),r=n(77277),l=n(90436),d=n(79692),c=n(12753),h=n(94890),p=n(14380);let u=`metadata: name: example labels: javaVersion: 1.2.3`,m=(0,d.Z)(e=>({code:{borderRadius:6,margin:e.spacing(2,0),background:"dark"===e.palette.type?"#444":e.palette.common.white}}),{name:"PluginCatalogEntityLabelsEmptyState"});function y(){let e=m(),{t}=(0,p.i)(h.s);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.Z,{variant:"body1",children:t("entityLabelsCard.emptyDescription")}),(0,i.jsx)("div",{className:e.code,children:(0,i.jsx)(c.O,{text:u,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,i.jsx)(r.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional",children:t("entityLabelsCard.readMoreButtonTitle")})]})}let g=(0,d.Z)(e=>({key:{fontWeight:"bold"}})),f=e=>{let{variant:t,title:n}=e,{entity:r}=(0,a.X2)(),d=g(),{t:c}=(0,p.i)(h.s),u=[{render:e=>(0,i.jsx)(l.Z,{className:d.key,variant:"body2",children:e.key})},{field:"value"}],m=r?.metadata?.labels;return(0,i.jsx)(o.r,{title:n||c("entityLabelsCard.title"),variant:t,children:m&&0!==Object.keys(m).length?(0,i.jsx)(s.i,{columns:u,data:Object.keys(m).map(e=>({key:e,value:m[e]})),options:{search:!1,showTitle:!0,loadingType:"linear",header:!1,padding:"dense",pageSize:5,toolbar:!1,paging:Object.keys(m).length>5}}):(0,i.jsx)(y,{})})};function b(e){return!!e?.metadata?.labels&&Object.keys(e?.metadata?.labels).some(Boolean)}}}]); //# sourceMappingURL=843.f00633b3.chunk.js.map