Merge branch 'master' into tech-docs-search-by-title
Signed-off-by: Stephen <code@stephenawilson.ca>
This commit is contained in:
@@ -1,5 +1,49 @@
|
||||
# @backstage/plugin-techdocs
|
||||
|
||||
## 1.10.7-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 60caa92: Fix double scrollbar bug in reader
|
||||
- Updated dependencies
|
||||
- @backstage/plugin-catalog-react@1.12.2-next.1
|
||||
- @backstage/core-compat-api@0.2.7-next.0
|
||||
- @backstage/core-components@0.14.9-next.0
|
||||
- @backstage/core-plugin-api@1.9.3
|
||||
- @backstage/plugin-search-react@1.7.13-next.0
|
||||
- @backstage/catalog-model@1.5.0
|
||||
- @backstage/config@1.2.0
|
||||
- @backstage/errors@1.2.4
|
||||
- @backstage/frontend-plugin-api@0.6.7-next.0
|
||||
- @backstage/integration@1.13.0-next.0
|
||||
- @backstage/integration-react@1.1.29-next.0
|
||||
- @backstage/theme@0.5.6
|
||||
- @backstage/plugin-auth-react@0.1.4-next.0
|
||||
- @backstage/plugin-search-common@1.2.12
|
||||
- @backstage/plugin-techdocs-react@1.2.6-next.0
|
||||
|
||||
## 1.10.7-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 8ac9ce5: Fixed a bug with the TechDocsReaderPageProvider not re-rendering when setShadowDom is called, meaning that the useShadowDom hooks were inconsistent. This issue caused the TextSize addon changes not to reapply during navigation.
|
||||
- Updated dependencies
|
||||
- @backstage/plugin-techdocs-react@1.2.6-next.0
|
||||
- @backstage/core-components@0.14.9-next.0
|
||||
- @backstage/integration@1.13.0-next.0
|
||||
- @backstage/plugin-catalog-react@1.12.2-next.0
|
||||
- @backstage/frontend-plugin-api@0.6.7-next.0
|
||||
- @backstage/integration-react@1.1.29-next.0
|
||||
- @backstage/plugin-auth-react@0.1.4-next.0
|
||||
- @backstage/plugin-search-react@1.7.13-next.0
|
||||
- @backstage/core-compat-api@0.2.7-next.0
|
||||
- @backstage/core-plugin-api@1.9.3
|
||||
- @backstage/catalog-model@1.5.0
|
||||
- @backstage/config@1.2.0
|
||||
- @backstage/errors@1.2.4
|
||||
- @backstage/theme@0.5.6
|
||||
- @backstage/plugin-search-common@1.2.12
|
||||
|
||||
## 1.10.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@backstage/plugin-techdocs",
|
||||
"version": "1.10.6",
|
||||
"version": "1.10.7-next.1",
|
||||
"description": "The Backstage plugin that renders technical documentation for your components",
|
||||
"backstage": {
|
||||
"role": "frontend-plugin",
|
||||
|
||||
@@ -51,6 +51,14 @@ export type DocsTableProps = {
|
||||
options?: TableOptions<DocsTableRow>;
|
||||
};
|
||||
|
||||
const defaultColumns: TableColumn<DocsTableRow>[] = [
|
||||
columnFactories.createTitleColumn({ hidden: true }),
|
||||
columnFactories.createNameColumn(),
|
||||
columnFactories.createOwnerColumn(),
|
||||
columnFactories.createKindColumn(),
|
||||
columnFactories.createTypeColumn(),
|
||||
];
|
||||
|
||||
/**
|
||||
* Component which renders a table documents
|
||||
*
|
||||
@@ -84,14 +92,6 @@ export const DocsTable = (props: DocsTableProps) => {
|
||||
};
|
||||
});
|
||||
|
||||
const defaultColumns: TableColumn<DocsTableRow>[] = [
|
||||
columnFactories.createTitleColumn({ hidden: true }),
|
||||
columnFactories.createNameColumn(),
|
||||
columnFactories.createOwnerColumn(),
|
||||
columnFactories.createKindColumn(),
|
||||
columnFactories.createTypeColumn(),
|
||||
];
|
||||
|
||||
const defaultActions: TableProps<DocsTableRow>['actions'] = [
|
||||
actionFactories.createCopyDocsUrlAction(copyToClipboard),
|
||||
];
|
||||
|
||||
@@ -31,21 +31,12 @@ function customTitle(entity: Entity): string {
|
||||
*/
|
||||
export const columnFactories = {
|
||||
createTitleColumn(options?: { hidden?: boolean }): TableColumn<DocsTableRow> {
|
||||
const nameCol = columnFactories.createNameColumn()
|
||||
return {
|
||||
title: 'Document',
|
||||
...nameCol,
|
||||
field: 'entity.metadata.title',
|
||||
hidden: options?.hidden,
|
||||
highlight: true,
|
||||
searchable: true,
|
||||
render: (row: DocsTableRow) => (
|
||||
<SubvalueCell
|
||||
value={
|
||||
<Link to={row.resolved.docsUrl}>{customTitle(row.entity)}</Link>
|
||||
}
|
||||
subvalue={row.entity.metadata.description}
|
||||
/>
|
||||
),
|
||||
};
|
||||
}
|
||||
},
|
||||
createNameColumn(): TableColumn<DocsTableRow> {
|
||||
return {
|
||||
@@ -53,6 +44,12 @@ export const columnFactories = {
|
||||
field: 'entity.metadata.name',
|
||||
highlight: true,
|
||||
searchable: true,
|
||||
defaultSort: 'asc',
|
||||
customSort: (row1, row2) => {
|
||||
const title1 = customTitle(row1.entity).toLocaleLowerCase();
|
||||
const title2 = customTitle(row2.entity).toLocaleLowerCase();
|
||||
return title1.localeCompare(title2);
|
||||
},
|
||||
render: (row: DocsTableRow) => (
|
||||
<SubvalueCell
|
||||
value={
|
||||
|
||||
+1
-3
@@ -80,7 +80,6 @@ export const TechDocsReaderPageContent = withTechDocsReaderProvider(
|
||||
entityMetadata: { value: entityMetadata, loading: entityMetadataLoading },
|
||||
entityRef,
|
||||
setShadowRoot,
|
||||
incShadowRootVersion,
|
||||
} = useTechDocsReaderPage();
|
||||
const dom = useTechDocsReaderDom(entityRef);
|
||||
const path = window.location.pathname;
|
||||
@@ -103,12 +102,11 @@ export const TechDocsReaderPageContent = withTechDocsReaderProvider(
|
||||
const handleAppend = useCallback(
|
||||
(newShadowRoot: ShadowRoot) => {
|
||||
setShadowRoot(newShadowRoot);
|
||||
incShadowRootVersion();
|
||||
if (onReady instanceof Function) {
|
||||
onReady();
|
||||
}
|
||||
},
|
||||
[setShadowRoot, incShadowRootVersion, onReady],
|
||||
[setShadowRoot, onReady],
|
||||
);
|
||||
|
||||
// No entity metadata = 404. Don't render content at all.
|
||||
|
||||
@@ -74,6 +74,7 @@ export default ({ theme, sidebar }: RuleOptions) => `
|
||||
}
|
||||
.md-sidebar .md-sidebar__scrollwrap {
|
||||
width: calc(12.1rem);
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.md-sidebar--secondary {
|
||||
right: ${theme.spacing(3)}px;
|
||||
@@ -234,7 +235,7 @@ export default ({ theme, sidebar }: RuleOptions) => `
|
||||
#toggle-sidebar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
.md-content {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user