@techdocs/cli 1.3.2-next.2 → 1.3.2
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 +22 -0
- package/dist/cjs/{generate-103520bb.cjs.js → generate-2111f828.cjs.js} +11 -2
- package/dist/cjs/generate-2111f828.cjs.js.map +1 -0
- package/dist/cjs/{mkdocs-1501e940.cjs.js → mkdocs-452eb543.cjs.js} +13 -1
- package/dist/cjs/mkdocs-452eb543.cjs.js.map +1 -0
- package/dist/cjs/{serve-ca27a9de.cjs.js → serve-5138af76.cjs.js} +17 -5
- package/dist/cjs/serve-5138af76.cjs.js.map +1 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{5837.51740a39.chunk.js → 5837.239cccbd.chunk.js} +1 -1
- package/dist/embedded-app/static/{5837.51740a39.chunk.js.map → 5837.239cccbd.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{6051.e3b445b2.chunk.js → 6051.66d9ff08.chunk.js} +1 -1
- package/dist/embedded-app/static/{6051.e3b445b2.chunk.js.map → 6051.66d9ff08.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7560.ecd330c0.chunk.js → 7560.3487acce.chunk.js} +1 -1
- package/dist/embedded-app/static/{7560.ecd330c0.chunk.js.map → 7560.3487acce.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7670.5e26cab8.chunk.js +3 -0
- package/dist/embedded-app/static/7670.5e26cab8.chunk.js.map +1 -0
- package/dist/embedded-app/static/{7750.0502b5b8.chunk.js → 7750.6d01f7cb.chunk.js} +1 -1
- package/dist/embedded-app/static/{7750.0502b5b8.chunk.js.map → 7750.6d01f7cb.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8951.3e2e38b8.chunk.js → 8951.fbe78c62.chunk.js} +1 -1
- package/dist/embedded-app/static/{8951.3e2e38b8.chunk.js.map → 8951.fbe78c62.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.a942e8cf.js +503 -0
- package/dist/embedded-app/static/main.a942e8cf.js.map +1 -0
- package/dist/embedded-app/static/{runtime.abaaf437.js → runtime.a942e8cf.js} +2 -2
- package/dist/embedded-app/static/{runtime.abaaf437.js.map → runtime.a942e8cf.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.abaaf437.js → vendor.a942e8cf.js} +1 -1
- package/dist/embedded-app/static/{vendor.abaaf437.js.map → vendor.a942e8cf.js.map} +1 -1
- package/dist/index.cjs.js +16 -4
- package/dist/index.cjs.js.map +1 -1
- package/package.json +5 -5
- package/dist/cjs/generate-103520bb.cjs.js.map +0 -1
- package/dist/cjs/mkdocs-1501e940.cjs.js.map +0 -1
- package/dist/cjs/serve-ca27a9de.cjs.js.map +0 -1
- package/dist/embedded-app/static/7670.3857b377.chunk.js +0 -3
- package/dist/embedded-app/static/7670.3857b377.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.abaaf437.js +0 -503
- package/dist/embedded-app/static/main.abaaf437.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://techdocs-cli-embedded-app/../../plugins/techdocs/src/home/components/TechDocsCustomHome.tsx"],"names":["panels","DocsTable","DocsCardGrid","CustomPanel","config","entities","index","classes","makeStyles","panelContainer","marginBottom","panelCSS","loading","loadingOwnership","isOwnedEntity","useEntityOwnership","Panel","panelType","shownEntities","filter","entity","filterPredicate","ContentHeader","title","description","SupportButton","div","className","data-testid","TechDocsCustomHome","props","tabsConfig","selectedTab","setSelectedTab","useState","catalogApi","useApi","catalogApiRef","value","error","useAsync","getEntities","CATALOG_FILTER_EXISTS","fields","items","metadata","annotations","currentTabConfig","TechDocsPageWrapper","Content","Progress","WarningPanel","severity","CodeSnippet","language","text","toString","HeaderTabs","selectedIndex","onChange","tabs","map","label","id"],"mappings":"4TA0CA,MAAMA,EAAS,CACbC,UAAWA,IACXC,aAAcA,GAChB,EAuCMC,EAAc,CAAC,CACnBC,SACAC,WACAC,OAAK,IAKD,CAOJ,MA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AAC8B,KAAWA,CAACC,SAAS,OAAOC,KAAMhB,EAAMiB,SAAS,C,YAQ1D,QAACR,IAAmBA,C,aAClB,OAACS,KAAUA,CACTC,cAAe1B,EACf2B,SAAUrD,GAAS2B,EAAe3B,CAAK,EACvCsD,KAAM7B,EAAW8B,IAAI,CAAC,CAAEC,OAAM,EAAGxD,KAAW,CAC1CyD,GAAIzD,EAAMkD,SAAS,EACnBM,OACF,EAAE,C,MAEJ,OAACb,KAAOA,CAACrB,cAAY,mB,SAClBmB,EAAiB/C,OAAO6D,IAAI,CAACzD,EAAQE,K,EACpC,OAACH,GAECC,OAAQA,EACRC,SAAYA,GAAsB,CAAC,EACnCC,MAAOA,C,EAHFA,CAAK,CAALA,C,KASjB,C","file":"static/7560.
|
|
1
|
+
{"version":3,"sources":["webpack://techdocs-cli-embedded-app/../../plugins/techdocs/src/home/components/TechDocsCustomHome.tsx"],"names":["panels","DocsTable","DocsCardGrid","CustomPanel","config","entities","index","classes","makeStyles","panelContainer","marginBottom","panelCSS","loading","loadingOwnership","isOwnedEntity","useEntityOwnership","Panel","panelType","shownEntities","filter","entity","filterPredicate","ContentHeader","title","description","SupportButton","div","className","data-testid","TechDocsCustomHome","props","tabsConfig","selectedTab","setSelectedTab","useState","catalogApi","useApi","catalogApiRef","value","error","useAsync","getEntities","CATALOG_FILTER_EXISTS","fields","items","metadata","annotations","currentTabConfig","TechDocsPageWrapper","Content","Progress","WarningPanel","severity","CodeSnippet","language","text","toString","HeaderTabs","selectedIndex","onChange","tabs","map","label","id"],"mappings":"4TA0CA,MAAMA,EAAS,CACbC,UAAWA,IACXC,aAAcA,GAChB,EAuCMC,EAAc,CAAC,CACnBC,SACAC,WACAC,OAAK,IAKD,CAOJ,MAAMC,G,EANYC,KAAW,CAC3BC,eAAgB,CACdC,aAAc,OACd,GAAIN,EAAOO,SAAWP,EAAOO,SAAW,CAAC,CAC3C,CACF,CAAC,EACyB,EACpB,CAAEC,QAASC,EAAkBC,eAAc,G,EAAIC,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CsD,KAAM7B,EAAW8B,IAAI,CAAC,CAAEC,OAAM,EAAGxD,KAAW,CAC1CyD,GAAIzD,EAAMkD,SAAS,EACnBM,OACF,EAAE,C,MAEJ,OAACb,KAAOA,CAACrB,cAAY,mB,SAClBmB,EAAiB/C,OAAO6D,IAAI,CAACzD,EAAQE,K,EACpC,OAACH,GAECC,OAAQA,EACRC,SAAYA,GAAsB,CAAC,EACnCC,MAAOA,C,EAHFA,CAAK,CAALA,C,KASjB,C","file":"static/7560.3487acce.chunk.js","sourcesContent":["/*\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, { useState } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { makeStyles } from '@material-ui/core';\nimport { CSSProperties } from '@material-ui/styles';\nimport {\n CATALOG_FILTER_EXISTS,\n catalogApiRef,\n CatalogApi,\n useEntityOwnership,\n} from '@backstage/plugin-catalog-react';\nimport { Entity } from '@backstage/catalog-model';\nimport { DocsTable } from './Tables';\nimport { DocsCardGrid } from './Grids';\nimport { TechDocsPageWrapper } from './TechDocsPageWrapper';\n\nimport {\n CodeSnippet,\n Content,\n HeaderTabs,\n Progress,\n WarningPanel,\n SupportButton,\n ContentHeader,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\nconst panels = {\n DocsTable: DocsTable,\n DocsCardGrid: DocsCardGrid,\n};\n\n/**\n * Available panel types\n *\n * @public\n */\nexport type PanelType = 'DocsCardGrid' | 'DocsTable';\n\n/**\n * Type representing a TechDocsCustomHome panel.\n *\n * @public\n */\nexport interface PanelConfig {\n title: string;\n description: string;\n panelType: PanelType;\n panelCSS?: CSSProperties;\n filterPredicate: ((entity: Entity) => boolean) | string;\n}\n\n/**\n * Type representing a TechDocsCustomHome tab.\n *\n * @public\n */\nexport interface TabConfig {\n label: string;\n panels: PanelConfig[];\n}\n\n/**\n * Type representing a list of TechDocsCustomHome tabs.\n *\n * @public\n */\nexport type TabsConfig = TabConfig[];\n\nconst CustomPanel = ({\n config,\n entities,\n index,\n}: {\n config: PanelConfig;\n entities: Entity[];\n index: number;\n}) => {\n const useStyles = makeStyles({\n panelContainer: {\n marginBottom: '2rem',\n ...(config.panelCSS ? config.panelCSS : {}),\n },\n });\n const classes = useStyles();\n const { loading: loadingOwnership, isOwnedEntity } = useEntityOwnership();\n\n const Panel = panels[config.panelType];\n\n const shownEntities = entities.filter(entity => {\n if (config.filterPredicate === 'ownedByUser') {\n if (loadingOwnership) {\n return false;\n }\n return isOwnedEntity(entity);\n }\n\n return (\n typeof config.filterPredicate === 'function' &&\n config.filterPredicate(entity)\n );\n });\n\n return (\n <>\n <ContentHeader title={config.title} description={config.description}>\n {index === 0 ? (\n <SupportButton>\n Discover documentation in your ecosystem.\n </SupportButton>\n ) : null}\n </ContentHeader>\n <div className={classes.panelContainer}>\n <Panel data-testid=\"techdocs-custom-panel\" entities={shownEntities} />\n </div>\n </>\n );\n};\n\n/**\n * Props for {@link TechDocsCustomHome}\n *\n * @public\n */\nexport type TechDocsCustomHomeProps = {\n tabsConfig: TabsConfig;\n};\n\nexport const TechDocsCustomHome = (props: TechDocsCustomHomeProps) => {\n const { tabsConfig } = props;\n const [selectedTab, setSelectedTab] = useState<number>(0);\n const catalogApi: CatalogApi = useApi(catalogApiRef);\n\n const {\n value: entities,\n loading,\n error,\n } = useAsync(async () => {\n const response = await catalogApi.getEntities({\n filter: {\n 'metadata.annotations.backstage.io/techdocs-ref': CATALOG_FILTER_EXISTS,\n },\n fields: [\n 'apiVersion',\n 'kind',\n 'metadata',\n 'relations',\n 'spec.owner',\n 'spec.type',\n ],\n });\n return response.items.filter((entity: Entity) => {\n return !!entity.metadata.annotations?.['backstage.io/techdocs-ref'];\n });\n });\n\n const currentTabConfig = tabsConfig[selectedTab];\n\n if (loading) {\n return (\n <TechDocsPageWrapper>\n <Content>\n <Progress />\n </Content>\n </TechDocsPageWrapper>\n );\n }\n\n if (error) {\n return (\n <TechDocsPageWrapper>\n <Content>\n <WarningPanel\n severity=\"error\"\n title=\"Could not load available documentation.\"\n >\n <CodeSnippet language=\"text\" text={error.toString()} />\n </WarningPanel>\n </Content>\n </TechDocsPageWrapper>\n );\n }\n\n return (\n <TechDocsPageWrapper>\n <HeaderTabs\n selectedIndex={selectedTab}\n onChange={index => setSelectedTab(index)}\n tabs={tabsConfig.map(({ label }, index) => ({\n id: index.toString(),\n label,\n }))}\n />\n <Content data-testid=\"techdocs-content\">\n {currentTabConfig.panels.map((config, index) => (\n <CustomPanel\n key={index}\n config={config}\n entities={!!entities ? entities : []}\n index={index}\n />\n ))}\n </Content>\n </TechDocsPageWrapper>\n );\n};\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[7670],{27670:function(v,n,e){e.r(n),e.d(n,{CatalogSearchResultListItem:function(){return f}});var s=e(52322),u=e(2784),r=e(79692),d=e(86136),m=e(49378),h=e(95544),c=e(7089),x=e(23196),o=e(15096);const g=(0,r.Z)({item:{},flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",wordBreak:"break-all",marginBottom:"1rem"}},{name:"CatalogSearchResultListItem"});function f(a){const l=a.result,t=a.highlight,i=g();return l?(0,s.jsxs)("div",{className:i.item,children:[a.icon&&(0,s.jsx)(d.Z,{children:a.icon}),(0,s.jsxs)("div",{className:i.flexContainer,children:[(0,s.jsx)(m.Z,{className:i.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,s.jsx)(x.rU,{noTrack:!0,to:l.location,children:t!=null&&t.fields.title?(0,s.jsx)(o.FA,{text:t.fields.title,preTag:t.preTag,postTag:t.postTag}):l.title}),secondary:t!=null&&t.fields.text?(0,s.jsx)(o.FA,{text:t.fields.text,preTag:t.preTag,postTag:t.postTag}):l.text}),(0,s.jsxs)(h.Z,{children:[l.kind&&(0,s.jsx)(c.Z,{label:`Kind: ${l.kind}`,size:"small"}),l.lifecycle&&(0,s.jsx)(c.Z,{label:`Lifecycle: ${l.lifecycle}`,size:"small"})]})]})]}):null}}}]);})();
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=7670.5e26cab8.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx"],"names":["useStyles","makeStyles","item","flexContainer","flexWrap","itemText","width","wordBreak","marginBottom","name","CatalogSearchResultListItem","props","result","highlight","classes","div","className","icon","ListItemIcon","ListItemText","primaryTypographyProps","variant","primary","Link","noTrack","to","location","fields","title","HighlightedSearchResultText","text","preTag","postTag","secondary","Box","kind","Chip","label","size","lifecycle"],"mappings":"yTA+BA,MAAMA,G,EAAYC,KAChB,CACEC,KAAM,CAAC,EACPC,cAAe,CACbC,SAAU,MACZ,EACAC,SAAU,CACRC,MAAO,OACPC,UAAW,YACXC,aAAc,MAChB,CACF,EACA,CAAEC,KAAM,6BAA8B,CAAC,EAgBlC,SAASC,EACdC,EACA,CACA,MAAMC,EAASD,EAAMC,OACfC,EAAYF,EAAME,UAElBC,EAAUd,EAAU,EAE1B,OAAKY,G,EAGH,QAACG,OAAIC,UAAWF,EAAQZ,K,UACrBS,EAAMM,O,EAAQ,OAACC,IAAYA,C,SAAEP,EAAMM,I,MACpC,QAACF,OAAIC,UAAWF,EAAQX,c,aACtB,OAACgB,IAAYA,CACXH,UAAWF,EAAQT,SACnBe,uBAAwB,CAAEC,QAAS,IAAK,EACxCC,S,EACE,OAACC,KAAIA,CAACC,QAAO,GAACC,GAAIb,EAAOc,S,SACtBb,WAAWc,OAAOC,O,EACjB,OAACC,KAA2BA,CAC1BC,KAAMjB,EAAUc,OAAOC,MACvBG,OAAQlB,EAAUkB,OAClBC,QAASnB,EAAUmB,O,GAGrBpB,EAAOgB,K,GAIbK,UACEpB,WAAWc,OAAOG,M,EAChB,OAACD,KAA2BA,CAC1BC,KAAMjB,EAAUc,OAAOG,KACvBC,OAAQlB,EAAUkB,OAClBC,QAASnB,EAAUmB,O,GAGrBpB,EAAOkB,I,MAIb,QAACI,IAAGA,C,UACDtB,EAAOuB,O,EAAQ,OAACC,IAAIA,CAACC,MAAO,SAASzB,EAAOuB,OAAQG,KAAK,O,GACzD1B,EAAO2B,Y,EACN,OAACH,IAAIA,CAACC,MAAO,cAAczB,EAAO2B,YAAaD,KAAK,O,YArC1C,IA2CtB,C","file":"static/7670.5e26cab8.chunk.js","sourcesContent":["/*\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, { ReactNode } from 'react';\nimport {\n Box,\n Chip,\n ListItemIcon,\n ListItemText,\n makeStyles,\n} from '@material-ui/core';\nimport { Link } from '@backstage/core-components';\nimport {\n IndexableDocument,\n ResultHighlight,\n} from '@backstage/plugin-search-common';\nimport { HighlightedSearchResultText } from '@backstage/plugin-search-react';\n\nconst useStyles = makeStyles(\n {\n item: {},\n flexContainer: {\n flexWrap: 'wrap',\n },\n itemText: {\n width: '100%',\n wordBreak: 'break-all',\n marginBottom: '1rem',\n },\n },\n { name: 'CatalogSearchResultListItem' },\n);\n\n/**\n * Props for {@link CatalogSearchResultListItem}.\n *\n * @public\n */\nexport interface CatalogSearchResultListItemProps {\n icon?: ReactNode;\n result?: IndexableDocument;\n highlight?: ResultHighlight;\n rank?: number;\n}\n\n/** @public */\nexport function CatalogSearchResultListItem(\n props: CatalogSearchResultListItemProps,\n) {\n const result = props.result as any;\n const highlight = props.highlight as ResultHighlight;\n\n const classes = useStyles();\n\n if (!result) return null;\n\n return (\n <div className={classes.item}>\n {props.icon && <ListItemIcon>{props.icon}</ListItemIcon>}\n <div className={classes.flexContainer}>\n <ListItemText\n className={classes.itemText}\n primaryTypographyProps={{ variant: 'h6' }}\n primary={\n <Link noTrack to={result.location}>\n {highlight?.fields.title ? (\n <HighlightedSearchResultText\n text={highlight.fields.title}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.title\n )}\n </Link>\n }\n secondary={\n highlight?.fields.text ? (\n <HighlightedSearchResultText\n text={highlight.fields.text}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.text\n )\n }\n />\n <Box>\n {result.kind && <Chip label={`Kind: ${result.kind}`} size=\"small\" />}\n {result.lifecycle && (\n <Chip label={`Lifecycle: ${result.lifecycle}`} size=\"small\" />\n )}\n </Box>\n </div>\n </div>\n );\n}\n"],"sourceRoot":""}
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
title: My Dashboard
|
|
6
6
|
icon: dashboard`,p=(0,u.Z)(a=>({code:{borderRadius:6,margin:`${a.spacing(2)}px 0px`,background:a.palette.type==="dark"?"#444":"#fff"}}),{name:"PluginCatalogEntityLinksEmptyState"});function f(){const a=p();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.Z,{variant:"body1",children:"No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:"}),(0,n.jsx)("div",{className:a.code,children:(0,n.jsx)(m.Oi,{text:y,language:"yaml",showLineNumbers:!0,highlightedNumbers:[3,4,5,6],customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(g.Z,{variant:"contained",color:"primary",target:"_blank",href:"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional",children:"Read more"})]})}var x=t(24851),L=t(25248);const k=a=>{var o;const{cols:j=void 0,variant:S}=a,{entity:i}=(0,h.X2)(),E=(0,L.qD)();var e;const b=s=>s&&(e=E.getSystemIcon(s))!==null&&e!==void 0?e:c.Z,d=i==null||(o=i.metadata)===null||o===void 0?void 0:o.links;return(0,n.jsx)(m.rJ,{title:"Links",variant:S,children:!d||d.length===0?(0,n.jsx)(f,{}):(0,n.jsx)(x.s,{cols:j,items:d.map(({url:s,title:l,icon:C})=>({text:l!=null?l:s,href:s,Icon:b(C)}))})})}}}]);})();
|
|
7
7
|
|
|
8
|
-
//# sourceMappingURL=7750.
|
|
8
|
+
//# sourceMappingURL=7750.6d01f7cb.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/EntityLinksEmptyState.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx"],"names":["ENTITY_YAML","useStyles","makeStyles","theme","code","borderRadius","margin","spacing","background","palette","type","name","EntityLinksEmptyState","classes","Typography","variant","div","className","CodeSnippet","text","language","showLineNumbers","highlightedNumbers","customStyle","fontSize","Button","color","target","href","EntityLinksCard","props","entity","cols","undefined","useEntity","app","useApp","iconResolver","key","getSystemIcon","LanguageIcon","links","metadata","InfoCard","title","length","LinksGridList","items","map","url","icon","Icon"],"mappings":"mSAqBA,MAAMA,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA,uBAUdC,G,EAAYC,KAChBC,IAAU,CACRC,KAAM,CACJC,aAAc,EACdC,OAAQ,GAAGH,EAAMI,QAAQ,CAAC,UAC1BC,WAAYL,EAAMM,QAAQC,OAAS,OAAS,OAAS,MACvD,CACF,GACA,CAAEC,KAAM,oCAAqC,CAAC,EAGzC,SAASC,GAAwB,CACtC,MAAMC,EAAUZ,EAAU,EAE1B,O,EACE,oB,aACE,OAACa,IAAUA,CAACC,QAAQ,Q,SAAQ,oH,MAI5B,OAACC,OAAIC,UAAWJ,EAAQT,K,YACtB,OAACc,KAAWA,CACVC,KAAMnB,EACNoB,SAAS,OACTC,gBAAe,GACfC,mBAAoB,CAAC,EAAG,EAAG,EAAG,C,EAC9BC,YAAa,CAAEf,WAAY,UAAWgB,SAAU,MAAO,C,QAG3D,OAACC,IAAMA,CACLV,QAAQ,YACRW,MAAM,UACNC,OAAO,SACPC,KAAK,uF,SACN,W,KAKP,C,0BCvCO,MAAMC,EAAmBC,GAAgC,C,IAQhDC,EAPd,KAAM,CAAEC,OAAOC,OAAWlB,SAAQ,EAAIe,EAChC,CAAEC,QAAO,G,EAAIG,MAAU,EACvBC,G,EAAMC,MAAO,E,IAGXD,EADR,MAAME,EAAgBC,GACpBA,IAAMH,IAAII,cAAcD,CAAG,KAAHA,MAAlBH,aAAyCK,IAE3CC,EAAQV,cAAQW,YAAQ,MAAhBX,oBAAkBU,MAEhC,O,EACE,OAACE,KAAQA,CAACC,MAAM,QAAQ7B,QAASA,E,SAC9B,CAAC0B,GAASA,EAAMI,SAAW,G,EAC1B,OAACjC,EAAqBA,K,EAEtB,OAACkC,IAAaA,CACZd,KAAMA,EACNe,MAAON,EAAMO,IAAI,CAAC,CAAEC,MAAKL,QAAOM,MAAK,KAAO,CAC1C/B,KAAMyB,UAASK,EACfrB,KAAMqB,EACNE,KAAMd,EAAaa,CAAI,CACzB,EAAE,C,IAKZ,C","file":"static/7750.
|
|
1
|
+
{"version":3,"sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/EntityLinksEmptyState.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx"],"names":["ENTITY_YAML","useStyles","makeStyles","theme","code","borderRadius","margin","spacing","background","palette","type","name","EntityLinksEmptyState","classes","Typography","variant","div","className","CodeSnippet","text","language","showLineNumbers","highlightedNumbers","customStyle","fontSize","Button","color","target","href","EntityLinksCard","props","entity","cols","undefined","useEntity","app","useApp","iconResolver","key","getSystemIcon","LanguageIcon","links","metadata","InfoCard","title","length","LinksGridList","items","map","url","icon","Icon"],"mappings":"mSAqBA,MAAMA,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA,uBAUdC,G,EAAYC,KAChBC,IAAU,CACRC,KAAM,CACJC,aAAc,EACdC,OAAQ,GAAGH,EAAMI,QAAQ,CAAC,UAC1BC,WAAYL,EAAMM,QAAQC,OAAS,OAAS,OAAS,MACvD,CACF,GACA,CAAEC,KAAM,oCAAqC,CAAC,EAGzC,SAASC,GAAwB,CACtC,MAAMC,EAAUZ,EAAU,EAE1B,O,EACE,oB,aACE,OAACa,IAAUA,CAACC,QAAQ,Q,SAAQ,oH,MAI5B,OAACC,OAAIC,UAAWJ,EAAQT,K,YACtB,OAACc,KAAWA,CACVC,KAAMnB,EACNoB,SAAS,OACTC,gBAAe,GACfC,mBAAoB,CAAC,EAAG,EAAG,EAAG,C,EAC9BC,YAAa,CAAEf,WAAY,UAAWgB,SAAU,MAAO,C,QAG3D,OAACC,IAAMA,CACLV,QAAQ,YACRW,MAAM,UACNC,OAAO,SACPC,KAAK,uF,SACN,W,KAKP,C,0BCvCO,MAAMC,EAAmBC,GAAgC,C,IAQhDC,EAPd,KAAM,CAAEC,OAAOC,OAAWlB,SAAQ,EAAIe,EAChC,CAAEC,QAAO,G,EAAIG,MAAU,EACvBC,G,EAAMC,MAAO,E,IAGXD,EADR,MAAME,EAAgBC,GACpBA,IAAMH,IAAII,cAAcD,CAAG,KAAHA,MAAlBH,aAAyCK,IAE3CC,EAAQV,cAAQW,YAAQ,MAAhBX,oBAAkBU,MAEhC,O,EACE,OAACE,KAAQA,CAACC,MAAM,QAAQ7B,QAASA,E,SAC9B,CAAC0B,GAASA,EAAMI,SAAW,G,EAC1B,OAACjC,EAAqBA,K,EAEtB,OAACkC,IAAaA,CACZd,KAAMA,EACNe,MAAON,EAAMO,IAAI,CAAC,CAAEC,MAAKL,QAAOM,MAAK,KAAO,CAC1C/B,KAAMyB,UAASK,EACfrB,KAAMqB,EACNE,KAAMd,EAAaa,CAAI,CACzB,EAAE,C,IAKZ,C","file":"static/7750.6d01f7cb.chunk.js","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 { BackstageTheme } from '@backstage/theme';\nimport { Button, makeStyles, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `metadata:\n name: example\n links:\n - url: https://dashboard.example.com\n title: My Dashboard\n icon: dashboard`;\n\n/** @public */\nexport type EntityLinksEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles<BackstageTheme>(\n theme => ({\n code: {\n borderRadius: 6,\n margin: `${theme.spacing(2)}px 0px`,\n background: theme.palette.type === 'dark' ? '#444' : '#fff',\n },\n }),\n { name: 'PluginCatalogEntityLinksEmptyState' },\n);\n\nexport function EntityLinksEmptyState() {\n const classes = useStyles();\n\n return (\n <>\n <Typography variant=\"body1\">\n No links defined for this entity. You can add links to your entity YAML\n as shown in the highlighted example below:\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional\"\n >\n Read more\n </Button>\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 { useEntity } from '@backstage/plugin-catalog-react';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { EntityLinksEmptyState } from './EntityLinksEmptyState';\nimport { LinksGridList } from './LinksGridList';\nimport { ColumnBreakpoints } from './types';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport { InfoCard, InfoCardVariants } from '@backstage/core-components';\n\n/** @public */\nexport interface EntityLinksCardProps {\n cols?: ColumnBreakpoints | number;\n variant?: InfoCardVariants;\n}\n\nexport const EntityLinksCard = (props: EntityLinksCardProps) => {\n const { cols = undefined, variant } = props;\n const { entity } = useEntity();\n const app = useApp();\n\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n const links = entity?.metadata?.links;\n\n return (\n <InfoCard title=\"Links\" variant={variant}>\n {!links || links.length === 0 ? (\n <EntityLinksEmptyState />\n ) : (\n <LinksGridList\n cols={cols}\n items={links.map(({ url, title, icon }) => ({\n text: title ?? url,\n href: url,\n Icon: iconResolver(icon),\n }))}\n />\n )}\n </InfoCard>\n );\n};\n"],"sourceRoot":""}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[8951],{78951:function(j,o,t){t.r(o),t.d(o,{CatalogEntityPage:function(){return E}});var r=t(52322),v=t(2784),a=t(79635),e=t(56941),n=t(25248),y=t(77446);const m=()=>{const{kind:c,namespace:i,name:s}=(0,n.Oi)(e.wi),d=(0,a.s0)(),l=(0,n.h_)(n.VE),u=(0,n.h_)(e.Ah),{value:h,error:f,loading:g,retry:p}=(0,y.Z)(()=>u.getEntityByRef({kind:c,namespace:i,name:s}),[u,c,i,s]);return(0,v.useEffect)(()=>{s||(l.post(new Error("No name provided!")),d("/"))},[l,d,f,g,h,s]),{entity:h,loading:g,error:f,refresh:p}};function E(){return(0,r.jsx)(e.h$,{...m(),children:(0,r.jsx)(a.j3,{})})}}}]);})();
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=8951.
|
|
3
|
+
//# sourceMappingURL=8951.fbe78c62.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogEntityPage/useEntityFromUrl.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogEntityPage/CatalogEntityPage.tsx"],"names":["useEntityFromUrl","kind","namespace","name","useRouteRefParams","entityRouteRef","navigate","useNavigate","errorApi","useApi","errorApiRef","catalogApi","catalogApiRef","value","entity","error","loading","retry","refresh","useAsyncRetry","getEntityByRef","useEffect","post","Error","CatalogEntityPage","AsyncEntityProvider","Outlet"],"mappings":"+QA8BO,MAAMA,EAAmB,IAA2B,CACzD,KAAM,CAAEC,OAAMC,YAAWC,MAAK,G,EAAIC,MAAkBC,IAAcA,EAC5DC,G,EAAWC,MAAY,EACvBC,G,EAAWC,MAAOC,IAAWA,EAC7BC,G,EAAaF,MAAOG,IAAaA,EAEjC,CACJC,MAAOC,EACPC,QACAC,UACAC,MAAOC,CAAO,G,EACZC,KACF,IAAMR,EAAWS,eAAe,CAAEnB,OAAMC,YAAWC,MAAK,CAAC,EACzD,CAACQ,EAAYV,EAAMC,EAAWC,C,CAAK,EAGrCkB,O,EAAAA,aAAU,IAAM,CACTlB,IACHK,EAASc,KAAK,IAAIC,MAAM,mBAAmB,CAAC,EAC5CjB,EAAS,GAAG,EAEhB,EAAG,CAACE,EAAUF,EAAUS,EAAOC,EAASF,EAAQX,C,CAAK,EAE9C,CAAEW,SAAQE,UAASD,QAAOG,SAAQ,CAC3C,EChCO,SAASM,GAAoB,CAClC,O,EACE,OAACC,KAAmBA,CAAE,GAAGzB,EAAiB,E,YACxC,OAAC0B,KAAMA,G,EAGb,C","file":"static/8951.
|
|
1
|
+
{"version":3,"sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogEntityPage/useEntityFromUrl.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogEntityPage/CatalogEntityPage.tsx"],"names":["useEntityFromUrl","kind","namespace","name","useRouteRefParams","entityRouteRef","navigate","useNavigate","errorApi","useApi","errorApiRef","catalogApi","catalogApiRef","value","entity","error","loading","retry","refresh","useAsyncRetry","getEntityByRef","useEffect","post","Error","CatalogEntityPage","AsyncEntityProvider","Outlet"],"mappings":"+QA8BO,MAAMA,EAAmB,IAA2B,CACzD,KAAM,CAAEC,OAAMC,YAAWC,MAAK,G,EAAIC,MAAkBC,IAAcA,EAC5DC,G,EAAWC,MAAY,EACvBC,G,EAAWC,MAAOC,IAAWA,EAC7BC,G,EAAaF,MAAOG,IAAaA,EAEjC,CACJC,MAAOC,EACPC,QACAC,UACAC,MAAOC,CAAO,G,EACZC,KACF,IAAMR,EAAWS,eAAe,CAAEnB,OAAMC,YAAWC,MAAK,CAAC,EACzD,CAACQ,EAAYV,EAAMC,EAAWC,C,CAAK,EAGrCkB,O,EAAAA,aAAU,IAAM,CACTlB,IACHK,EAASc,KAAK,IAAIC,MAAM,mBAAmB,CAAC,EAC5CjB,EAAS,GAAG,EAEhB,EAAG,CAACE,EAAUF,EAAUS,EAAOC,EAASF,EAAQX,C,CAAK,EAE9C,CAAEW,SAAQE,UAASD,QAAOG,SAAQ,CAC3C,EChCO,SAASM,GAAoB,CAClC,O,EACE,OAACC,KAAmBA,CAAE,GAAGzB,EAAiB,E,YACxC,OAAC0B,KAAMA,G,EAGb,C","file":"static/8951.fbe78c62.chunk.js","sourcesContent":["/*\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 errorApiRef,\n useApi,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n EntityLoadingStatus,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { useEffect } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport useAsyncRetry from 'react-use/lib/useAsyncRetry';\n\nexport const useEntityFromUrl = (): EntityLoadingStatus => {\n const { kind, namespace, name } = useRouteRefParams(entityRouteRef);\n const navigate = useNavigate();\n const errorApi = useApi(errorApiRef);\n const catalogApi = useApi(catalogApiRef);\n\n const {\n value: entity,\n error,\n loading,\n retry: refresh,\n } = useAsyncRetry(\n () => catalogApi.getEntityByRef({ kind, namespace, name }),\n [catalogApi, kind, namespace, name],\n );\n\n useEffect(() => {\n if (!name) {\n errorApi.post(new Error('No name provided!'));\n navigate('/');\n }\n }, [errorApi, navigate, error, loading, entity, name]);\n\n return { entity, loading, error, refresh };\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 React from 'react';\nimport { Outlet } from 'react-router-dom';\nimport { AsyncEntityProvider } from '@backstage/plugin-catalog-react';\nimport { useEntityFromUrl } from './useEntityFromUrl';\n\n/** @public */\nexport function CatalogEntityPage() {\n return (\n <AsyncEntityProvider {...useEntityFromUrl()}>\n <Outlet />\n </AsyncEntityProvider>\n );\n}\n"],"sourceRoot":""}
|