chore: api-report change for permission react
Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com> Co-authored-by: Fredrik Adelöw <freben@gmail.com> Co-authored-by: Johan Haals <johan.haals@gmail.com> Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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<PermissionApi>;
|
||||
|
||||
// @public @deprecated
|
||||
export const PermissionedRoute: (
|
||||
_props: ComponentProps<typeof Route> & {
|
||||
props: {
|
||||
caseSensitive?: boolean;
|
||||
children?: ReactNode;
|
||||
element?: ReactElement | null;
|
||||
path?: string;
|
||||
errorComponent?: ReactElement | null;
|
||||
} & (
|
||||
| {
|
||||
permission: Exclude<Permission, ResourcePermission>;
|
||||
resourceRef?: never;
|
||||
}
|
||||
| {
|
||||
permission: ResourcePermission;
|
||||
resourceRef: string | undefined;
|
||||
}
|
||||
),
|
||||
) => never;
|
||||
| {
|
||||
permission: Exclude<Permission, ResourcePermission>;
|
||||
resourceRef?: never;
|
||||
}
|
||||
| {
|
||||
permission: ResourcePermission;
|
||||
resourceRef: string | undefined;
|
||||
}
|
||||
),
|
||||
) => JSX.Element;
|
||||
|
||||
// @public
|
||||
export function RequirePermission(
|
||||
|
||||
Reference in New Issue
Block a user