From ba5487233f2939198b8668b73b36ccebf373621b Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 28 Dec 2023 17:10:47 +0100 Subject: [PATCH] org: fix missing PermissionApi in story Signed-off-by: Patrik Oldsberg --- plugins/org/package.json | 1 + .../Group/GroupProfile/GroupProfileCard.stories.tsx | 13 ++++++++++++- yarn.lock | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/plugins/org/package.json b/plugins/org/package.json index b6e1ef9ca3..e5722113c3 100644 --- a/plugins/org/package.json +++ b/plugins/org/package.json @@ -56,6 +56,7 @@ "@backstage/core-app-api": "workspace:^", "@backstage/dev-utils": "workspace:^", "@backstage/plugin-catalog": "workspace:^", + "@backstage/plugin-permission-common": "workspace:^", "@backstage/plugin-permission-react": "workspace:^", "@backstage/test-utils": "workspace:^", "@backstage/types": "workspace:^", diff --git a/plugins/org/src/components/Cards/Group/GroupProfile/GroupProfileCard.stories.tsx b/plugins/org/src/components/Cards/Group/GroupProfile/GroupProfileCard.stories.tsx index 62ecca14e0..17f285c039 100644 --- a/plugins/org/src/components/Cards/Group/GroupProfile/GroupProfileCard.stories.tsx +++ b/plugins/org/src/components/Cards/Group/GroupProfile/GroupProfileCard.stories.tsx @@ -21,6 +21,8 @@ import { EntityProvider, entityRouteRef, } from '@backstage/plugin-catalog-react'; +import { permissionApiRef } from '@backstage/plugin-permission-react'; +import { AuthorizeResult } from '@backstage/plugin-permission-common'; import { TestApiProvider, wrapInTestApp } from '@backstage/test-utils'; import { Grid } from '@material-ui/core'; import React, { ComponentType, PropsWithChildren } from 'react'; @@ -60,6 +62,10 @@ const catalogApi: Partial = { async refreshEntity() {}, }; +const permissionApi: typeof permissionApiRef.T = { + authorize: async () => ({ result: AuthorizeResult.ALLOW }), +}; + export const Default = () => ( @@ -76,7 +82,12 @@ export default { decorators: [ (Story: ComponentType>) => wrapInTestApp( - + , { diff --git a/yarn.lock b/yarn.lock index 0b1b81f289..f2674df212 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7724,6 +7724,7 @@ __metadata: "@backstage/plugin-catalog": "workspace:^" "@backstage/plugin-catalog-common": "workspace:^" "@backstage/plugin-catalog-react": "workspace:^" + "@backstage/plugin-permission-common": "workspace:^" "@backstage/plugin-permission-react": "workspace:^" "@backstage/test-utils": "workspace:^" "@backstage/types": "workspace:^"