Move page and content
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
This commit is contained in:
@@ -63,12 +63,12 @@ export const KubernetesContent = ({
|
||||
: new Map<string, DetectedError[]>();
|
||||
|
||||
return (
|
||||
<RequireKubernetesPermissions>
|
||||
<DetectedErrorsContext.Provider
|
||||
value={[...detectedErrors.values()].flat()}
|
||||
>
|
||||
<Page themeId="tool">
|
||||
<Content>
|
||||
<Page themeId="tool">
|
||||
<Content>
|
||||
<RequireKubernetesPermissions>
|
||||
<DetectedErrorsContext.Provider
|
||||
value={[...detectedErrors.values()].flat()}
|
||||
>
|
||||
{kubernetesObjects === undefined && error === undefined && (
|
||||
<Progress />
|
||||
)}
|
||||
@@ -147,9 +147,9 @@ export const KubernetesContent = ({
|
||||
</Grid>
|
||||
</Grid>
|
||||
)}
|
||||
</Content>
|
||||
</Page>
|
||||
</DetectedErrorsContext.Provider>
|
||||
</RequireKubernetesPermissions>
|
||||
</DetectedErrorsContext.Provider>
|
||||
</RequireKubernetesPermissions>
|
||||
</Content>
|
||||
</Page>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
kubernetesResourcesReadPermission,
|
||||
} from '@backstage/plugin-kubernetes-common';
|
||||
import { usePermission } from '@backstage/plugin-permission-react';
|
||||
import { Content, Page, WarningPanel } from '@backstage/core-components';
|
||||
import { WarningPanel } from '@backstage/core-components';
|
||||
|
||||
export type RequireKubernetesPermissionProps = {
|
||||
children: ReactNode;
|
||||
@@ -50,14 +50,10 @@ export function RequireKubernetesPermissions(
|
||||
}
|
||||
|
||||
return (
|
||||
<Page themeId="tool">
|
||||
<Content>
|
||||
<WarningPanel
|
||||
title="Permission required"
|
||||
message={`To view Kubernetes objects, contact your administrator to give you the
|
||||
<WarningPanel
|
||||
title="Permission required"
|
||||
message={`To view Kubernetes objects, contact your administrator to give you the
|
||||
'${kubernetesClustersReadPermission.name}' and '${kubernetesResourcesReadPermission.name}' permission.`}
|
||||
/>
|
||||
</Content>
|
||||
</Page>
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user