Skip to content

Commit

Permalink
feat: [IAC-2429]: IACM plugin unauthourized message
Browse files Browse the repository at this point in the history
  • Loading branch information
simonharness committed Sep 9, 2024
1 parent 41c0601 commit 64f2a47
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions plugins/harness-iacm/src/components/WorkspaceList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -48,6 +49,12 @@ const useStyles = makeStyles(theme => ({
alignItems: 'center',
gap: '5px',
},
noAccess: {
padding: theme.spacing(2),
display: 'flex',

textAlign: 'center',
},
}));

export interface Workspace {
Expand Down Expand Up @@ -152,6 +159,16 @@ function WorkspaceList() {
) : null}
</Grid>
);
if (state === AsyncStatus.Unauthorized) {
return (
<EmptyState
title="You do not have the permission to view the following IaCM workspaces"
missing="info"
description="The x-api-key is either missing or incorrect in app-config.yaml under
proxy settings"
/>
);
}

if (state === AsyncStatus.Init || state === AsyncStatus.Loading) {
return (
Expand Down

0 comments on commit 64f2a47

Please sign in to comment.