feat: add property ownerPickerMode to TechDocsIndexPage and DefaultApiExplorerPage

Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
This commit is contained in:
Benjamin Janssens
2024-04-23 12:36:38 +02:00
parent f611eb3295
commit 96cd13eca2
7 changed files with 30 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-techdocs': minor
---
Added property ownerPickerMode to TechDocsIndexPage
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-api-docs': patch
---
Added property ownerPickerMode to DefaultApiExplorerPage
+2
View File
@@ -9,6 +9,7 @@ import { ApiEntity } from '@backstage/catalog-model';
import { ApiRef } from '@backstage/core-plugin-api';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { CatalogTableRow } from '@backstage/plugin-catalog';
import { EntityOwnerPickerProps } from '@backstage/plugin-catalog-react';
import { ExternalRouteRef } from '@backstage/core-plugin-api';
import { InfoCardVariants } from '@backstage/core-components';
import { JSX as JSX_2 } from 'react';
@@ -105,6 +106,7 @@ export type DefaultApiExplorerPageProps = {
initiallySelectedFilter?: UserListFilterKind;
columns?: TableColumn<CatalogTableRow>[];
actions?: TableProps<CatalogTableRow>['actions'];
ownerPickerMode?: EntityOwnerPickerProps['mode'];
};
// @public (undocumented)
@@ -35,6 +35,7 @@ import {
UserListFilterKind,
UserListPicker,
CatalogFilterLayout,
EntityOwnerPickerProps,
} from '@backstage/plugin-catalog-react';
import React from 'react';
import { registerComponentRouteRef } from '../../routes';
@@ -60,6 +61,7 @@ export type DefaultApiExplorerPageProps = {
initiallySelectedFilter?: UserListFilterKind;
columns?: TableColumn<CatalogTableRow>[];
actions?: TableProps<CatalogTableRow>['actions'];
ownerPickerMode?: EntityOwnerPickerProps['mode'];
};
/**
@@ -67,7 +69,12 @@ export type DefaultApiExplorerPageProps = {
* @public
*/
export const DefaultApiExplorerPage = (props: DefaultApiExplorerPageProps) => {
const { initiallySelectedFilter = 'all', columns, actions } = props;
const {
initiallySelectedFilter = 'all',
columns,
actions,
ownerPickerMode,
} = props;
const configApi = useApi(configApiRef);
const generatedSubtitle = `${
@@ -101,7 +108,7 @@ export const DefaultApiExplorerPage = (props: DefaultApiExplorerPageProps) => {
<EntityKindPicker initialFilter="api" hidden />
<EntityTypePicker />
<UserListPicker initialFilter={initiallySelectedFilter} />
<EntityOwnerPicker />
<EntityOwnerPicker mode={ownerPickerMode} />
<EntityLifecyclePicker />
<EntityTagPicker />
</CatalogFilterLayout.Filters>
+2
View File
@@ -12,6 +12,7 @@ import { Config } from '@backstage/config';
import { CSSProperties } from '@material-ui/styles/withStyles';
import { DiscoveryApi } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { EntityOwnerPickerProps } from '@backstage/plugin-catalog-react';
import { FetchApi } from '@backstage/core-plugin-api';
import { IdentityApi } from '@backstage/core-plugin-api';
import { JSX as JSX_2 } from 'react';
@@ -292,6 +293,7 @@ export type TechDocsIndexPageProps = {
initialFilter?: UserListFilterKind;
columns?: TableColumn<DocsTableRow>[];
actions?: TableProps<DocsTableRow>['actions'];
ownerPickerMode?: EntityOwnerPickerProps['mode'];
};
// @public @deprecated (undocumented)
@@ -46,7 +46,7 @@ export type DefaultTechDocsHomeProps = TechDocsIndexPageProps;
* @public
*/
export const DefaultTechDocsHome = (props: TechDocsIndexPageProps) => {
const { initialFilter = 'owned', columns, actions } = props;
const { initialFilter = 'owned', columns, actions, ownerPickerMode } = props;
return (
<TechDocsPageWrapper>
<Content>
@@ -60,7 +60,7 @@ export const DefaultTechDocsHome = (props: TechDocsIndexPageProps) => {
<CatalogFilterLayout.Filters>
<TechDocsPicker />
<UserListPicker initialFilter={initialFilter} />
<EntityOwnerPicker />
<EntityOwnerPicker mode={ownerPickerMode} />
<EntityTagPicker />
</CatalogFilterLayout.Filters>
<CatalogFilterLayout.Content>
@@ -17,7 +17,10 @@
import React from 'react';
import { useOutlet } from 'react-router-dom';
import { TableColumn, TableProps } from '@backstage/core-components';
import { UserListFilterKind } from '@backstage/plugin-catalog-react';
import {
EntityOwnerPickerProps,
UserListFilterKind,
} from '@backstage/plugin-catalog-react';
import { DefaultTechDocsHome } from './DefaultTechDocsHome';
import { DocsTableRow } from './Tables';
@@ -30,6 +33,7 @@ export type TechDocsIndexPageProps = {
initialFilter?: UserListFilterKind;
columns?: TableColumn<DocsTableRow>[];
actions?: TableProps<DocsTableRow>['actions'];
ownerPickerMode?: EntityOwnerPickerProps['mode'];
};
export const TechDocsIndexPage = (props: TechDocsIndexPageProps) => {