@backstage/plugin-techdocs 1.3.3 → 1.4.0-next.0
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 +46 -0
- package/dist/esm/{TechDocsCustomHome-eccef158.esm.js → TechDocsCustomHome-435142e9.esm.js} +2 -2
- package/dist/esm/{TechDocsCustomHome-eccef158.esm.js.map → TechDocsCustomHome-435142e9.esm.js.map} +1 -1
- package/dist/esm/{index-b7cba14e.esm.js → index-28743841.esm.js} +2 -2
- package/dist/esm/index-28743841.esm.js.map +1 -0
- package/dist/esm/{index-b9f615fb.esm.js → index-72bbb7eb.esm.js} +58 -16
- package/dist/esm/index-72bbb7eb.esm.js.map +1 -0
- package/dist/index.d.ts +19 -2
- package/dist/index.esm.js +1 -1
- package/package.json +16 -16
- package/dist/esm/index-b7cba14e.esm.js.map +0 -1
- package/dist/esm/index-b9f615fb.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# @backstage/plugin-techdocs
|
|
2
2
|
|
|
3
|
+
## 1.4.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5691baea69: Add ability to configure filters when using EntityListDocsGrid
|
|
8
|
+
|
|
9
|
+
The following example will render two sections of cards grid:
|
|
10
|
+
|
|
11
|
+
- One section for documentations tagged as `recommended`
|
|
12
|
+
- One section for documentations tagged as `runbook`
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
<EntityListDocsGrid groups={{[
|
|
16
|
+
{
|
|
17
|
+
title: "Recommended Documentation",
|
|
18
|
+
filterPredicate: entity =>
|
|
19
|
+
entity?.metadata?.tags?.includes('recommended') ?? false,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
title: "RunBooks Documentation",
|
|
23
|
+
filterPredicate: entity =>
|
|
24
|
+
entity?.metadata?.tags?.includes('runbook') ?? false,
|
|
25
|
+
}
|
|
26
|
+
]}} />
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- cbe11d1e23: Tweak README
|
|
32
|
+
- 7573b65232: Internal refactor of imports to avoid circular dependencies
|
|
33
|
+
- c1784a4980: Replaces in-code uses of `GitHub` with `Github` and deprecates old versions.
|
|
34
|
+
- 3a1a999b7b: Include query parameters when navigating to relative links in documents
|
|
35
|
+
- Updated dependencies
|
|
36
|
+
- @backstage/plugin-catalog-react@1.2.1-next.0
|
|
37
|
+
- @backstage/core-components@0.12.0-next.0
|
|
38
|
+
- @backstage/core-plugin-api@1.1.0-next.0
|
|
39
|
+
- @backstage/integration@1.4.0-next.0
|
|
40
|
+
- @backstage/catalog-model@1.1.3-next.0
|
|
41
|
+
- @backstage/integration-react@1.1.6-next.0
|
|
42
|
+
- @backstage/plugin-search-react@1.2.1-next.0
|
|
43
|
+
- @backstage/plugin-techdocs-react@1.0.6-next.0
|
|
44
|
+
- @backstage/config@1.0.4-next.0
|
|
45
|
+
- @backstage/errors@1.1.3-next.0
|
|
46
|
+
- @backstage/theme@0.2.16
|
|
47
|
+
- @backstage/plugin-search-common@1.1.1-next.0
|
|
48
|
+
|
|
3
49
|
## 1.3.3
|
|
4
50
|
|
|
5
51
|
### Patch Changes
|
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import useAsync from 'react-use/lib/useAsync';
|
|
3
3
|
import { makeStyles } from '@material-ui/core';
|
|
4
4
|
import { catalogApiRef, CATALOG_FILTER_EXISTS, useEntityOwnership } from '@backstage/plugin-catalog-react';
|
|
5
|
-
import { T as TechDocsPageWrapper, D as DocsTable, a as DocsCardGrid } from './index-
|
|
5
|
+
import { T as TechDocsPageWrapper, D as DocsTable, a as DocsCardGrid } from './index-72bbb7eb.esm.js';
|
|
6
6
|
import { Content, Progress, WarningPanel, CodeSnippet, HeaderTabs, ContentHeader, SupportButton } from '@backstage/core-components';
|
|
7
7
|
import { useApi } from '@backstage/core-plugin-api';
|
|
8
8
|
import '@backstage/errors';
|
|
@@ -127,4 +127,4 @@ const TechDocsCustomHome = (props) => {
|
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
export { TechDocsCustomHome };
|
|
130
|
-
//# sourceMappingURL=TechDocsCustomHome-
|
|
130
|
+
//# sourceMappingURL=TechDocsCustomHome-435142e9.esm.js.map
|
package/dist/esm/{TechDocsCustomHome-eccef158.esm.js.map → TechDocsCustomHome-435142e9.esm.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TechDocsCustomHome-
|
|
1
|
+
{"version":3,"file":"TechDocsCustomHome-435142e9.esm.js","sources":["../../src/home/components/TechDocsCustomHome.tsx"],"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"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAM,MAAS,GAAA;AAAA,EACb,SAAA;AAAA,EACA,YAAA;AACF,CAAA,CAAA;AAuCA,MAAM,cAAc,CAAC;AAAA,EACnB,MAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AACF,CAIM,KAAA;AACJ,EAAA,MAAM,YAAY,UAAW,CAAA;AAAA,IAC3B,cAAgB,EAAA;AAAA,MACd,YAAc,EAAA,MAAA;AAAA,MACd,GAAI,MAAA,CAAO,QAAW,GAAA,MAAA,CAAO,WAAW,EAAC;AAAA,KAC3C;AAAA,GACD,CAAA,CAAA;AACD,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AA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A,WAAA,EAAA;AAAA,MAAY,QAAS,EAAA,MAAA;AAAA,MAAO,IAAA,EAAM,MAAM,QAAS,EAAA;AAAA,KAAG,CACvD,CACF,CACF,CAAA,CAAA;AAAA,GAEJ;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,2CACE,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA;AAAA,IACC,aAAe,EAAA,WAAA;AAAA,IACf,QAAA,EAAU,CAAS,KAAA,KAAA,cAAA,CAAe,KAAK,CAAA;AAAA,IACvC,MAAM,UAAW,CAAA,GAAA,CAAI,CAAC,EAAE,KAAA,IAAS,KAAW,MAAA;AAAA,MAC1C,EAAA,EAAI,MAAM,QAAS,EAAA;AAAA,MACnB,KAAA;AAAA,KACA,CAAA,CAAA;AAAA,GACJ,mBACC,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA;AAAA,IAAQ,aAAY,EAAA,kBAAA;AAAA,GAAA,EAClB,iBAAiB,MAAO,CAAA,GAAA,CAAI,CAAC,MAAA,EAAQ,0BACnC,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA;AAAA,IACC,GAAK,EAAA,KAAA;AAAA,IACL,MAAA;AAAA,IACA,QAAU,EAAA,CAAC,CAAC,QAAA,GAAW,WAAW,EAAC;AAAA,IACnC,KAAA;AAAA,GACF,CACD,CACH,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as TechDocsReaderLayout, b as TechDocsReaderPage } from './index-
|
|
1
|
+
export { c as TechDocsReaderLayout, b as TechDocsReaderPage } from './index-72bbb7eb.esm.js';
|
|
2
2
|
import '@backstage/core-plugin-api';
|
|
3
3
|
import '@backstage/errors';
|
|
4
4
|
import 'event-source-polyfill';
|
|
@@ -31,4 +31,4 @@ import '@material-ui/icons/Share';
|
|
|
31
31
|
import '@material-ui/styles';
|
|
32
32
|
import '@material-ui/icons/Star';
|
|
33
33
|
import '@material-ui/icons/StarBorder';
|
|
34
|
-
//# sourceMappingURL=index-
|
|
34
|
+
//# sourceMappingURL=index-28743841.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-28743841.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -6,7 +6,7 @@ import { useParams, useNavigate as useNavigate$1, useOutlet, Routes, Route, useR
|
|
|
6
6
|
import { techdocsStorageApiRef as techdocsStorageApiRef$1, useTechDocsReaderPage, SHADOW_DOM_STYLE_LOAD_EVENT, useShadowDomStylesLoading, useTechDocsAddons, TechDocsAddonLocations, TechDocsShadowDom, TECHDOCS_ADDONS_WRAPPER_KEY, TechDocsReaderPageProvider, techdocsApiRef as techdocsApiRef$1 } from '@backstage/plugin-techdocs-react';
|
|
7
7
|
import useAsync from 'react-use/lib/useAsync';
|
|
8
8
|
import useAsyncRetry from 'react-use/lib/useAsyncRetry';
|
|
9
|
-
import { Link, LogViewer, ErrorPage, useSidebarPinState, Content, HeaderLabel, Header, Page, ItemCardGrid, ItemCardHeader, Button as Button$1, WarningPanel, CodeSnippet, Progress, SubvalueCell, Table, EmptyState, PageWithHeader,
|
|
9
|
+
import { Link, LogViewer, ErrorPage, useSidebarPinState, Content, HeaderLabel, Header, Page, ItemCardGrid, ItemCardHeader, Button as Button$1, WarningPanel, CodeSnippet, Progress, ContentHeader, SubvalueCell, Table, EmptyState, PageWithHeader, SupportButton, MissingAnnotationEmptyState } from '@backstage/core-components';
|
|
10
10
|
import { makeStyles, ListItemText, ListItem, ListItemIcon, Divider, Paper, createStyles, Button, Drawer, Grid, Typography, IconButton, CircularProgress, lighten, alpha, useTheme, withStyles, Tooltip, ThemeProvider, SvgIcon, useMediaQuery, Portal, Toolbar, Box, Menu, Card, CardMedia, CardContent, CardActions } from '@material-ui/core';
|
|
11
11
|
import { HighlightedSearchResultText, SearchContextProvider, useSearch, SearchAutocomplete } from '@backstage/plugin-search-react';
|
|
12
12
|
import { useNavigate, useOutlet as useOutlet$1 } from 'react-router';
|
|
@@ -14,14 +14,14 @@ import { Alert, Skeleton } from '@material-ui/lab';
|
|
|
14
14
|
import Close from '@material-ui/icons/Close';
|
|
15
15
|
import { scmIntegrationsApiRef } from '@backstage/integration-react';
|
|
16
16
|
import DOMPurify from 'dompurify';
|
|
17
|
-
import {
|
|
17
|
+
import { replaceGithubUrlType } from '@backstage/integration';
|
|
18
18
|
import FeedbackOutlinedIcon from '@material-ui/icons/FeedbackOutlined';
|
|
19
19
|
import ReactDOM from 'react-dom';
|
|
20
20
|
import parseGitUrl from 'git-url-parse';
|
|
21
21
|
import MenuIcon from '@material-ui/icons/Menu';
|
|
22
22
|
import Helmet from 'react-helmet';
|
|
23
23
|
import CodeIcon from '@material-ui/icons/Code';
|
|
24
|
-
import { getEntityRelations, EntityRefLink, EntityRefLinks, useEntityList, humanizeEntityRef, useStarredEntities, CATALOG_FILTER_EXISTS, EntityListProvider, CatalogFilterLayout, UserListPicker, EntityOwnerPicker, EntityTagPicker, useEntity } from '@backstage/plugin-catalog-react';
|
|
24
|
+
import { getEntityRelations, EntityRefLink, EntityRefLinks, useEntityList, useEntityOwnership, humanizeEntityRef, useStarredEntities, CATALOG_FILTER_EXISTS, EntityListProvider, CatalogFilterLayout, UserListPicker, EntityOwnerPicker, EntityTagPicker, useEntity } from '@backstage/plugin-catalog-react';
|
|
25
25
|
import { RELATION_OWNED_BY, getCompoundEntityRef } from '@backstage/catalog-model';
|
|
26
26
|
import SettingsIcon from '@material-ui/icons/Settings';
|
|
27
27
|
import useCopyToClipboard from 'react-use/lib/useCopyToClipboard';
|
|
@@ -1329,7 +1329,7 @@ ${sourceAnchor.href}
|
|
|
1329
1329
|
|
|
1330
1330
|
Feedback:`
|
|
1331
1331
|
);
|
|
1332
|
-
const gitUrl = (integration == null ? void 0 : integration.type) === "github" ?
|
|
1332
|
+
const gitUrl = (integration == null ? void 0 : integration.type) === "github" ? replaceGithubUrlType(sourceURL.href, "blob") : sourceURL.href;
|
|
1333
1333
|
const gitInfo = parseGitUrl(gitUrl);
|
|
1334
1334
|
const repoPath = `/${gitInfo.organization}/${gitInfo.name}`;
|
|
1335
1335
|
const feedbackLink = sourceAnchor.cloneNode();
|
|
@@ -1663,18 +1663,19 @@ const useTechDocsReaderDom = (entityRef) => {
|
|
|
1663
1663
|
var _a;
|
|
1664
1664
|
const modifierActive = event.ctrlKey || event.metaKey;
|
|
1665
1665
|
const parsedUrl = new URL(url);
|
|
1666
|
+
const fullPath = `${parsedUrl.pathname}${parsedUrl.search}${parsedUrl.hash}`;
|
|
1666
1667
|
if (parsedUrl.hash) {
|
|
1667
1668
|
if (modifierActive) {
|
|
1668
|
-
window.open(
|
|
1669
|
+
window.open(fullPath, "_blank");
|
|
1669
1670
|
} else {
|
|
1670
|
-
navigate(
|
|
1671
|
+
navigate(fullPath);
|
|
1671
1672
|
(_a = transformedElement == null ? void 0 : transformedElement.querySelector(`[id="${parsedUrl.hash.slice(1)}"]`)) == null ? void 0 : _a.scrollIntoView();
|
|
1672
1673
|
}
|
|
1673
1674
|
} else {
|
|
1674
1675
|
if (modifierActive) {
|
|
1675
|
-
window.open(
|
|
1676
|
+
window.open(fullPath, "_blank");
|
|
1676
1677
|
} else {
|
|
1677
|
-
navigate(
|
|
1678
|
+
navigate(fullPath);
|
|
1678
1679
|
}
|
|
1679
1680
|
}
|
|
1680
1681
|
}
|
|
@@ -2060,7 +2061,37 @@ const DocsCardGrid = (props) => {
|
|
|
2060
2061
|
}));
|
|
2061
2062
|
};
|
|
2062
2063
|
|
|
2063
|
-
const
|
|
2064
|
+
const allEntitiesGroup = {
|
|
2065
|
+
title: "All Documentation",
|
|
2066
|
+
filterPredicate: () => true
|
|
2067
|
+
};
|
|
2068
|
+
const EntityListDocsGridGroup = ({
|
|
2069
|
+
entities,
|
|
2070
|
+
group
|
|
2071
|
+
}) => {
|
|
2072
|
+
const { loading: loadingOwnership, isOwnedEntity } = useEntityOwnership();
|
|
2073
|
+
const shownEntities = entities.filter((entity) => {
|
|
2074
|
+
if (group.filterPredicate === "ownedByUser") {
|
|
2075
|
+
if (loadingOwnership) {
|
|
2076
|
+
return false;
|
|
2077
|
+
}
|
|
2078
|
+
return isOwnedEntity(entity);
|
|
2079
|
+
}
|
|
2080
|
+
return typeof group.filterPredicate === "function" && group.filterPredicate(entity);
|
|
2081
|
+
});
|
|
2082
|
+
const titleComponent = (() => {
|
|
2083
|
+
return typeof group.title === "string" ? /* @__PURE__ */ React.createElement(ContentHeader, {
|
|
2084
|
+
title: group.title
|
|
2085
|
+
}) : group.title;
|
|
2086
|
+
})();
|
|
2087
|
+
if (shownEntities.length === 0) {
|
|
2088
|
+
return null;
|
|
2089
|
+
}
|
|
2090
|
+
return /* @__PURE__ */ React.createElement(Content, null, titleComponent, /* @__PURE__ */ React.createElement(DocsCardGrid, {
|
|
2091
|
+
entities: shownEntities
|
|
2092
|
+
}));
|
|
2093
|
+
};
|
|
2094
|
+
const EntityListDocsGrid = ({ groups }) => {
|
|
2064
2095
|
const { loading, error, entities } = useEntityList();
|
|
2065
2096
|
if (error) {
|
|
2066
2097
|
return /* @__PURE__ */ React.createElement(WarningPanel, {
|
|
@@ -2071,9 +2102,18 @@ const EntityListDocsGrid = () => {
|
|
|
2071
2102
|
text: error.toString()
|
|
2072
2103
|
}));
|
|
2073
2104
|
}
|
|
2074
|
-
if (loading
|
|
2105
|
+
if (loading) {
|
|
2075
2106
|
return /* @__PURE__ */ React.createElement(Progress, null);
|
|
2076
2107
|
}
|
|
2108
|
+
if (entities.length === 0) {
|
|
2109
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
2110
|
+
"data-testid": "doc-not-found"
|
|
2111
|
+
}, /* @__PURE__ */ React.createElement(Typography, {
|
|
2112
|
+
variant: "body2"
|
|
2113
|
+
}, "No documentation found that match your filter. Learn more about", " ", /* @__PURE__ */ React.createElement(Link, {
|
|
2114
|
+
to: "https://backstage.io/docs/features/techdocs/creating-and-publishing"
|
|
2115
|
+
}, "publishing documentation"), "."));
|
|
2116
|
+
}
|
|
2077
2117
|
entities.sort(
|
|
2078
2118
|
(a, b) => {
|
|
2079
2119
|
var _a, _b;
|
|
@@ -2082,9 +2122,11 @@ const EntityListDocsGrid = () => {
|
|
|
2082
2122
|
);
|
|
2083
2123
|
}
|
|
2084
2124
|
);
|
|
2085
|
-
return /* @__PURE__ */ React.createElement(
|
|
2086
|
-
entities
|
|
2087
|
-
|
|
2125
|
+
return /* @__PURE__ */ React.createElement(Content, null, (groups || [allEntitiesGroup]).map((group, index) => /* @__PURE__ */ React.createElement(EntityListDocsGridGroup, {
|
|
2126
|
+
entities,
|
|
2127
|
+
group,
|
|
2128
|
+
key: `${group.title}-${index}`
|
|
2129
|
+
})));
|
|
2088
2130
|
};
|
|
2089
2131
|
|
|
2090
2132
|
const YellowStar = withStyles$1({
|
|
@@ -2342,7 +2384,7 @@ const EntityTechdocsContent = techdocsPlugin.provide(
|
|
|
2342
2384
|
const TechDocsCustomHome = techdocsPlugin.provide(
|
|
2343
2385
|
createRoutableExtension({
|
|
2344
2386
|
name: "TechDocsCustomHome",
|
|
2345
|
-
component: () => import('./TechDocsCustomHome-
|
|
2387
|
+
component: () => import('./TechDocsCustomHome-435142e9.esm.js').then(
|
|
2346
2388
|
(m) => m.TechDocsCustomHome
|
|
2347
2389
|
),
|
|
2348
2390
|
mountPoint: rootRouteRef
|
|
@@ -2360,7 +2402,7 @@ const TechDocsIndexPage$2 = techdocsPlugin.provide(
|
|
|
2360
2402
|
const TechDocsReaderPage = techdocsPlugin.provide(
|
|
2361
2403
|
createRoutableExtension({
|
|
2362
2404
|
name: "TechDocsReaderPage",
|
|
2363
|
-
component: () => import('./index-
|
|
2405
|
+
component: () => import('./index-28743841.esm.js').then(
|
|
2364
2406
|
(m) => m.TechDocsReaderPage
|
|
2365
2407
|
),
|
|
2366
2408
|
mountPoint: rootDocsRouteRef
|
|
@@ -2437,4 +2479,4 @@ var Router$1 = /*#__PURE__*/Object.freeze({
|
|
|
2437
2479
|
});
|
|
2438
2480
|
|
|
2439
2481
|
export { DocsTable as D, EntityTechdocsContent as E, Reader as R, TechDocsPageWrapper as T, DocsCardGrid as a, TechDocsReaderPage$1 as b, TechDocsReaderLayout as c, TechDocsCustomHome as d, TechDocsIndexPage$2 as e, TechdocsPage as f, TechDocsReaderPage as g, techdocsStorageApiRef as h, techdocsApiRef as i, TechDocsClient as j, TechDocsStorageClient as k, TechDocsReaderProvider as l, TechDocsReaderPageHeader as m, TechDocsReaderPageContent as n, TechDocsReaderPageSubheader as o, TechDocsSearchResultListItem as p, TechDocsSearch as q, EntityListDocsGrid as r, EntityListDocsTable as s, techdocsPlugin as t, DefaultTechDocsHome as u, TechDocsPicker as v, isTechDocsAvailable as w, Router as x, EmbeddedDocsRouter as y };
|
|
2440
|
-
//# sourceMappingURL=index-
|
|
2482
|
+
//# sourceMappingURL=index-72bbb7eb.esm.js.map
|