diff --git a/plugins/.changeset/dull-adults-drum.md b/plugins/.changeset/dull-adults-drum.md new file mode 100644 index 0000000000..088eb1539e --- /dev/null +++ b/plugins/.changeset/dull-adults-drum.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-adr': patch +--- + +Updated readme instructions diff --git a/plugins/adr/README.md b/plugins/adr/README.md index 4860406229..2e2b82b3fd 100644 --- a/plugins/adr/README.md +++ b/plugins/adr/README.md @@ -69,33 +69,68 @@ Afterwards, add the following code snippet to use `AdrSearchResultListItem` when ```tsx // In packages/app/src/components/search/SearchPage.tsx import { AdrSearchResultListItem } from '@backstage/plugin-adr'; +import { AdrDocument } from '@backstage/plugin-adr-common'; ... + , }, ]} /> - + ... -case 'adrs': - return ( - + +... + // ADR specific type + {types.includes('adr') && ( + { + // Return a list of entities which have ADRs. + const { items } = await catalogApi.getEntities({ + fields: ['metadata.name'], + filter: { + 'metadata.annotations.backstage.io/adr-location': + CATALOG_FILTER_EXISTS, + }, + }); + + const names = items.map(entity => entity.metadata.name); + names.sort(); + return names; + }} /> - ); + )} + +... + +// In results + + + {({ results }) => ( + case 'adr': + return ( + + ); ``` -> Note the `AdrDocument` might not be needed in newer versions https://github.com/backstage/backstage/issues/13723 ## Custom ADR formats