diff --git a/plugins/harness-iacm/src/components/WorkspaceList/index.tsx b/plugins/harness-iacm/src/components/WorkspaceList/index.tsx index d5fa727..6a7a8b2 100644 --- a/plugins/harness-iacm/src/components/WorkspaceList/index.tsx +++ b/plugins/harness-iacm/src/components/WorkspaceList/index.tsx @@ -18,6 +18,7 @@ import useGetResources from '../../hooks/useGetResources'; import useProjectUrlSlugEntity from '../../hooks/useProjectUrlEntity'; import { useResourceSlugFromEntity } from './useResourceSlugFromEntity'; import ResourceTable from '../ResourceTable'; +import { EmptyState } from '@backstage/core-components'; const useStyles = makeStyles(theme => ({ container: { @@ -48,6 +49,16 @@ const useStyles = makeStyles(theme => ({ alignItems: 'center', gap: '5px', }, + noAccess: { + padding: theme.spacing(2), + display: 'flex', + + textAlign: 'center', + }, + workspaceList: { + marginTop: '-40px', + }, + workspaceItem: { padding: '0.75rem', fontSize: '1rem' }, })); export interface Workspace { @@ -153,6 +164,31 @@ function WorkspaceList() { ); + if (state === AsyncStatus.Unauthorized) { + const urls = Object.values(harnessWorkspaceUrlObject).map(url => + url.replace('|', ''), + ); + return ( + + {urls.map(workspace => ( +
  • + {workspace} +
  • + ))} + + } + /> + ); + } + if (state === AsyncStatus.Init || state === AsyncStatus.Loading) { return (