diff --git a/.changeset/dull-masks-occur.md b/.changeset/dull-masks-occur.md new file mode 100644 index 0000000000..076f4dfef4 --- /dev/null +++ b/.changeset/dull-masks-occur.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-react': minor +--- + +`entityRouteParams` now also accepts entity refs, and can help with encoding the resulting parameters. diff --git a/plugins/catalog-react/report.api.md b/plugins/catalog-react/report.api.md index 1e5735bd86..f7673e1bd8 100644 --- a/plugins/catalog-react/report.api.md +++ b/plugins/catalog-react/report.api.md @@ -524,12 +524,20 @@ export interface EntityRefPresentationSnapshot { } // @public -export function entityRouteParams(entity: Entity): { +export function entityRouteParams( + entityOrRef: Entity | CompoundEntityRef | string, + options?: EntityRouteParamsOptions, +): { readonly kind: string; readonly namespace: string; readonly name: string; }; +// @public +export type EntityRouteParamsOptions = { + encodeParams?: boolean; +}; + // @public export const entityRouteRef: RouteRef<{ name: string;