From 574a301265ce56c4b42fcd0ca7e32ad10924bef0 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 30 Aug 2022 11:21:59 +0200 Subject: [PATCH] chore: api-report change for permission react MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Patrik Oldsberg Co-authored-by: Fredrik Adelöw Co-authored-by: Johan Haals Signed-off-by: blam --- .changeset/popular-shirts-happen.md | 2 ++ plugins/permission-react/api-report.md | 28 ++++++++++++++------------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.changeset/popular-shirts-happen.md b/.changeset/popular-shirts-happen.md index 9221301f82..137354fe2b 100644 --- a/.changeset/popular-shirts-happen.md +++ b/.changeset/popular-shirts-happen.md @@ -3,3 +3,5 @@ --- **DEPRECATION**: The `PermissionedRoute` component has been deprecated in favor of the new `RequirePermission` component. This is because the usage pattern of `PermissionedRoute` is not compatible with React Router v6 stable. + +Embed the type from `react-router` instead of exporting it directly. diff --git a/plugins/permission-react/api-report.md b/plugins/permission-react/api-report.md index 27c3270ef1..293343b7ac 100644 --- a/plugins/permission-react/api-report.md +++ b/plugins/permission-react/api-report.md @@ -6,7 +6,6 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { AuthorizePermissionRequest } from '@backstage/plugin-permission-common'; import { AuthorizePermissionResponse } from '@backstage/plugin-permission-common'; -import { ComponentProps } from 'react'; import { Config } from '@backstage/config'; import { DiscoveryApi } from '@backstage/core-plugin-api'; import { EvaluatePermissionRequest } from '@backstage/plugin-permission-common'; @@ -16,7 +15,6 @@ import { Permission } from '@backstage/plugin-permission-common'; import { ReactElement } from 'react'; import { ReactNode } from 'react'; import { ResourcePermission } from '@backstage/plugin-permission-common'; -import { Route } from 'react-router'; // @public (undocumented) export type AsyncPermissionResult = { @@ -51,19 +49,23 @@ export const permissionApiRef: ApiRef; // @public @deprecated export const PermissionedRoute: ( - _props: ComponentProps & { + props: { + caseSensitive?: boolean; + children?: ReactNode; + element?: ReactElement | null; + path?: string; errorComponent?: ReactElement | null; } & ( - | { - permission: Exclude; - resourceRef?: never; - } - | { - permission: ResourcePermission; - resourceRef: string | undefined; - } - ), -) => never; + | { + permission: Exclude; + resourceRef?: never; + } + | { + permission: ResourcePermission; + resourceRef: string | undefined; + } + ), +) => JSX.Element; // @public export function RequirePermission(