feat: enable passing material table options to docs table via entity list docs table
Signed-off-by: Ryan Hanchett <ryan.hanchett@invitae.com>
This commit is contained in:
@@ -29,6 +29,7 @@ import {
|
||||
EmptyState,
|
||||
Table,
|
||||
TableColumn,
|
||||
TableOptions,
|
||||
TableProps,
|
||||
} from '@backstage/core-components';
|
||||
import { actionFactories } from './actions';
|
||||
@@ -47,6 +48,7 @@ export type DocsTableProps = {
|
||||
loading?: boolean | undefined;
|
||||
columns?: TableColumn<DocsTableRow>[];
|
||||
actions?: TableProps<DocsTableRow>['actions'];
|
||||
options?: TableOptions<DocsTableRow>;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -55,7 +57,7 @@ export type DocsTableProps = {
|
||||
* @public
|
||||
*/
|
||||
export const DocsTable = (props: DocsTableProps) => {
|
||||
const { entities, title, loading, columns, actions } = props;
|
||||
const { entities, title, loading, columns, actions, options } = props;
|
||||
const [, copyToClipboard] = useCopyToClipboard();
|
||||
const getRouteToReaderPageFor = useRouteRef(rootDocsRouteRef);
|
||||
const config = useApi(configApiRef);
|
||||
@@ -102,6 +104,7 @@ export const DocsTable = (props: DocsTableProps) => {
|
||||
pageSize: 20,
|
||||
search: true,
|
||||
actionsColumnIndex: -1,
|
||||
...options,
|
||||
}}
|
||||
data={documents}
|
||||
columns={columns || defaultColumns}
|
||||
|
||||
@@ -20,6 +20,7 @@ import { capitalize } from 'lodash';
|
||||
import {
|
||||
CodeSnippet,
|
||||
TableColumn,
|
||||
TableOptions,
|
||||
TableProps,
|
||||
WarningPanel,
|
||||
} from '@backstage/core-components';
|
||||
@@ -40,6 +41,7 @@ import { DocsTableRow } from './types';
|
||||
export type EntityListDocsTableProps = {
|
||||
columns?: TableColumn<DocsTableRow>[];
|
||||
actions?: TableProps<DocsTableRow>['actions'];
|
||||
options?: TableOptions<DocsTableRow>;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -48,7 +50,7 @@ export type EntityListDocsTableProps = {
|
||||
* @public
|
||||
*/
|
||||
export const EntityListDocsTable = (props: EntityListDocsTableProps) => {
|
||||
const { columns, actions } = props;
|
||||
const { columns, actions, options } = props;
|
||||
const { loading, error, entities, filters } = useEntityList();
|
||||
const { isStarredEntity, toggleStarredEntity } = useStarredEntities();
|
||||
const [, copyToClipboard] = useCopyToClipboard();
|
||||
@@ -81,6 +83,7 @@ export const EntityListDocsTable = (props: EntityListDocsTableProps) => {
|
||||
loading={loading}
|
||||
actions={actions || defaultActions}
|
||||
columns={columns}
|
||||
options={options}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user