@backstage/plugin-techdocs 1.3.3 → 1.4.0-next.1

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 CHANGED
@@ -1,5 +1,57 @@
1
1
  # @backstage/plugin-techdocs
2
2
 
3
+ ## 1.4.0-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 9e4d8e6198: Fix logic bug that broke techdocs-cli-embedded-app
8
+
9
+ ## 1.4.0-next.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 5691baea69: Add ability to configure filters when using EntityListDocsGrid
14
+
15
+ The following example will render two sections of cards grid:
16
+
17
+ - One section for documentations tagged as `recommended`
18
+ - One section for documentations tagged as `runbook`
19
+
20
+ ```js
21
+ <EntityListDocsGrid groups={{[
22
+ {
23
+ title: "Recommended Documentation",
24
+ filterPredicate: entity =>
25
+ entity?.metadata?.tags?.includes('recommended') ?? false,
26
+ },
27
+ {
28
+ title: "RunBooks Documentation",
29
+ filterPredicate: entity =>
30
+ entity?.metadata?.tags?.includes('runbook') ?? false,
31
+ }
32
+ ]}} />
33
+ ```
34
+
35
+ ### Patch Changes
36
+
37
+ - cbe11d1e23: Tweak README
38
+ - 7573b65232: Internal refactor of imports to avoid circular dependencies
39
+ - c1784a4980: Replaces in-code uses of `GitHub` with `Github` and deprecates old versions.
40
+ - 3a1a999b7b: Include query parameters when navigating to relative links in documents
41
+ - Updated dependencies
42
+ - @backstage/plugin-catalog-react@1.2.1-next.0
43
+ - @backstage/core-components@0.12.0-next.0
44
+ - @backstage/core-plugin-api@1.1.0-next.0
45
+ - @backstage/integration@1.4.0-next.0
46
+ - @backstage/catalog-model@1.1.3-next.0
47
+ - @backstage/integration-react@1.1.6-next.0
48
+ - @backstage/plugin-search-react@1.2.1-next.0
49
+ - @backstage/plugin-techdocs-react@1.0.6-next.0
50
+ - @backstage/config@1.0.4-next.0
51
+ - @backstage/errors@1.1.3-next.0
52
+ - @backstage/theme@0.2.16
53
+ - @backstage/plugin-search-common@1.1.1-next.0
54
+
3
55
  ## 1.3.3
4
56
 
5
57
  ### 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-b9f615fb.esm.js';
5
+ import { T as TechDocsPageWrapper, D as DocsTable, a as DocsCardGrid } from './index-c0c013ea.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-eccef158.esm.js.map
130
+ //# sourceMappingURL=TechDocsCustomHome-b18e6234.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TechDocsCustomHome-eccef158.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;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x"],"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;AAC1B,EAAA,MAAM,EAAE,OAAA,EAAS,gBAAkB,EAAA,aAAA,KAAkB,kBAAmB,EAAA,CAAA;AAExE,EAAM,MAAA,KAAA,GAAQ,OAAO,MAAO,CAAA,SAAA,CAAA,CAAA;AAE5B,EAAM,MAAA,aAAA,GAAgB,QAAS,CAAA,MAAA,CAAO,CAAU,MAAA,KAAA;AAC9C,IAAI,IAAA,MAAA,CAAO,oBAAoB,aAAe,EAAA;AAC5C,MAAA,IAAI,gBAAkB,EAAA;AACpB,QAAO,OAAA,KAAA,CAAA;AAAA,OACT;AACA,MAAA,OAAO,cAAc,MAAM,CAAA,CAAA;AAAA,KAC7B;AAEA,IAAA,OACE,OAAO,MAAO,CAAA,eAAA,KAAoB,UACl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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-b9f615fb.esm.js';
1
+ export { c as TechDocsReaderLayout, b as TechDocsReaderPage } from './index-c0c013ea.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-b7cba14e.esm.js.map
34
+ //# sourceMappingURL=index-73ab5148.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-73ab5148.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, ContentHeader, SupportButton, MissingAnnotationEmptyState } from '@backstage/core-components';
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 { replaceGitHubUrlType } from '@backstage/integration';
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" ? replaceGitHubUrlType(sourceURL.href, "blob") : sourceURL.href;
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(`${parsedUrl.pathname}${parsedUrl.hash}`, "_blank");
1669
+ window.open(fullPath, "_blank");
1669
1670
  } else {
1670
- navigate(`${parsedUrl.pathname}${parsedUrl.hash}`);
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(parsedUrl.pathname, "_blank");
1676
+ window.open(fullPath, "_blank");
1676
1677
  } else {
1677
- navigate(parsedUrl.pathname);
1678
+ navigate(fullPath);
1678
1679
  }
1679
1680
  }
1680
1681
  }
@@ -1994,19 +1995,15 @@ const TechDocsReaderPage$1 = (props) => {
1994
1995
  const outlet = useOutlet();
1995
1996
  if (!children) {
1996
1997
  const childrenList = outlet ? Children.toArray(outlet.props.children) : [];
1997
- const page = childrenList.find((child) => {
1998
- var _a;
1999
- if (getComponentData(child, TECHDOCS_ADDONS_WRAPPER_KEY)) {
2000
- return false;
2001
- }
2002
- const nestedChildren = (_a = child == null ? void 0 : child.props) == null ? void 0 : _a.children;
2003
- if (nestedChildren) {
2004
- return !Children.toArray(nestedChildren).some(
2005
- (nested) => getComponentData(nested, TECHDOCS_ADDONS_WRAPPER_KEY)
2006
- );
1998
+ const grandChildren = childrenList.flatMap(
1999
+ (child) => {
2000
+ var _a, _b;
2001
+ return (_b = (_a = child == null ? void 0 : child.props) == null ? void 0 : _a.children) != null ? _b : [];
2007
2002
  }
2008
- return true;
2009
- });
2003
+ );
2004
+ const page = grandChildren.find(
2005
+ (grandChild) => !getComponentData(grandChild, TECHDOCS_ADDONS_WRAPPER_KEY)
2006
+ );
2010
2007
  return /* @__PURE__ */ React.createElement(TechDocsReaderPageProvider, {
2011
2008
  entityRef
2012
2009
  }, page || /* @__PURE__ */ React.createElement(TechDocsReaderLayout, null));
@@ -2060,7 +2057,37 @@ const DocsCardGrid = (props) => {
2060
2057
  }));
2061
2058
  };
2062
2059
 
2063
- const EntityListDocsGrid = () => {
2060
+ const allEntitiesGroup = {
2061
+ title: "All Documentation",
2062
+ filterPredicate: () => true
2063
+ };
2064
+ const EntityListDocsGridGroup = ({
2065
+ entities,
2066
+ group
2067
+ }) => {
2068
+ const { loading: loadingOwnership, isOwnedEntity } = useEntityOwnership();
2069
+ const shownEntities = entities.filter((entity) => {
2070
+ if (group.filterPredicate === "ownedByUser") {
2071
+ if (loadingOwnership) {
2072
+ return false;
2073
+ }
2074
+ return isOwnedEntity(entity);
2075
+ }
2076
+ return typeof group.filterPredicate === "function" && group.filterPredicate(entity);
2077
+ });
2078
+ const titleComponent = (() => {
2079
+ return typeof group.title === "string" ? /* @__PURE__ */ React.createElement(ContentHeader, {
2080
+ title: group.title
2081
+ }) : group.title;
2082
+ })();
2083
+ if (shownEntities.length === 0) {
2084
+ return null;
2085
+ }
2086
+ return /* @__PURE__ */ React.createElement(Content, null, titleComponent, /* @__PURE__ */ React.createElement(DocsCardGrid, {
2087
+ entities: shownEntities
2088
+ }));
2089
+ };
2090
+ const EntityListDocsGrid = ({ groups }) => {
2064
2091
  const { loading, error, entities } = useEntityList();
2065
2092
  if (error) {
2066
2093
  return /* @__PURE__ */ React.createElement(WarningPanel, {
@@ -2071,9 +2098,18 @@ const EntityListDocsGrid = () => {
2071
2098
  text: error.toString()
2072
2099
  }));
2073
2100
  }
2074
- if (loading || !entities) {
2101
+ if (loading) {
2075
2102
  return /* @__PURE__ */ React.createElement(Progress, null);
2076
2103
  }
2104
+ if (entities.length === 0) {
2105
+ return /* @__PURE__ */ React.createElement("div", {
2106
+ "data-testid": "doc-not-found"
2107
+ }, /* @__PURE__ */ React.createElement(Typography, {
2108
+ variant: "body2"
2109
+ }, "No documentation found that match your filter. Learn more about", " ", /* @__PURE__ */ React.createElement(Link, {
2110
+ to: "https://backstage.io/docs/features/techdocs/creating-and-publishing"
2111
+ }, "publishing documentation"), "."));
2112
+ }
2077
2113
  entities.sort(
2078
2114
  (a, b) => {
2079
2115
  var _a, _b;
@@ -2082,9 +2118,11 @@ const EntityListDocsGrid = () => {
2082
2118
  );
2083
2119
  }
2084
2120
  );
2085
- return /* @__PURE__ */ React.createElement(DocsCardGrid, {
2086
- entities
2087
- });
2121
+ return /* @__PURE__ */ React.createElement(Content, null, (groups || [allEntitiesGroup]).map((group, index) => /* @__PURE__ */ React.createElement(EntityListDocsGridGroup, {
2122
+ entities,
2123
+ group,
2124
+ key: `${group.title}-${index}`
2125
+ })));
2088
2126
  };
2089
2127
 
2090
2128
  const YellowStar = withStyles$1({
@@ -2342,7 +2380,7 @@ const EntityTechdocsContent = techdocsPlugin.provide(
2342
2380
  const TechDocsCustomHome = techdocsPlugin.provide(
2343
2381
  createRoutableExtension({
2344
2382
  name: "TechDocsCustomHome",
2345
- component: () => import('./TechDocsCustomHome-eccef158.esm.js').then(
2383
+ component: () => import('./TechDocsCustomHome-b18e6234.esm.js').then(
2346
2384
  (m) => m.TechDocsCustomHome
2347
2385
  ),
2348
2386
  mountPoint: rootRouteRef
@@ -2360,7 +2398,7 @@ const TechDocsIndexPage$2 = techdocsPlugin.provide(
2360
2398
  const TechDocsReaderPage = techdocsPlugin.provide(
2361
2399
  createRoutableExtension({
2362
2400
  name: "TechDocsReaderPage",
2363
- component: () => import('./index-b7cba14e.esm.js').then(
2401
+ component: () => import('./index-73ab5148.esm.js').then(
2364
2402
  (m) => m.TechDocsReaderPage
2365
2403
  ),
2366
2404
  mountPoint: rootDocsRouteRef
@@ -2437,4 +2475,4 @@ var Router$1 = /*#__PURE__*/Object.freeze({
2437
2475
  });
2438
2476
 
2439
2477
  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-b9f615fb.esm.js.map
2478
+ //# sourceMappingURL=index-c0c013ea.esm.js.map