mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
fix: set admin permission (#736)
This commit is contained in:
parent
9e0eec10ba
commit
38c26ec052
@ -19,6 +19,8 @@ import EnvironmentListItem from './EnvironmentListItem/EnvironmentListItem';
|
||||
import { mutate } from 'swr';
|
||||
import EnvironmentToggleConfirm from './EnvironmentToggleConfirm/EnvironmentToggleConfirm';
|
||||
import useProjectRolePermissions from '../../../hooks/api/getters/useProjectRolePermissions/useProjectRolePermissions';
|
||||
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||
|
||||
const EnvironmentList = () => {
|
||||
const defaultEnv = {
|
||||
@ -30,6 +32,7 @@ const EnvironmentList = () => {
|
||||
protected: false,
|
||||
};
|
||||
const { environments, refetch } = useEnvironments();
|
||||
const { uiConfig } = useUiConfig();
|
||||
const { refetch: refetchProjectRolePermissions } =
|
||||
useProjectRolePermissions();
|
||||
|
||||
@ -161,7 +164,6 @@ const EnvironmentList = () => {
|
||||
const navigateToCreateEnvironment = () => {
|
||||
history.push('/environments/create');
|
||||
};
|
||||
|
||||
return (
|
||||
<PageContent
|
||||
headerContent={
|
||||
@ -174,6 +176,8 @@ const EnvironmentList = () => {
|
||||
maxWidth="700px"
|
||||
tooltip="Add environment"
|
||||
Icon={Add}
|
||||
permission={ADMIN}
|
||||
disabled={!Boolean(uiConfig.flags.EEA)}
|
||||
>
|
||||
Add Environment
|
||||
</ResponsiveButton>
|
||||
|
@ -5,7 +5,7 @@ export const defaultValue = {
|
||||
version: '3.x',
|
||||
environment: '',
|
||||
slogan: 'The enterprise ready feature toggle service.',
|
||||
flags: { P: false, C: false, E: false, RE: false },
|
||||
flags: { P: false, C: false, E: false, RE: false, EEA: false },
|
||||
links: [
|
||||
{
|
||||
value: 'Documentation',
|
||||
|
@ -24,6 +24,8 @@ export interface IFlags {
|
||||
P: boolean;
|
||||
E: boolean;
|
||||
RE: boolean;
|
||||
EEA?: boolean;
|
||||
OIDC?: boolean;
|
||||
}
|
||||
|
||||
export interface IVersionInfo {
|
||||
|
Loading…
Reference in New Issue
Block a user