1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-24 01:18:01 +02:00

Remove full width access tab (#2679)

Remove full width access tab
This commit is contained in:
sjaanus 2022-12-13 13:41:40 +02:00 committed by GitHub
parent 025c8bd7d9
commit fb06fa9f46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 40 deletions

View File

@ -69,7 +69,7 @@ describe('project-access', () => {
beforeEach(() => { beforeEach(() => {
cy.login(); cy.login();
cy.visit(`/projects/${groupAndProjectName}/access`); cy.visit(`/projects/${groupAndProjectName}/settings/access`);
if (document.querySelector("[data-testid='CLOSE_SPLASH']")) { if (document.querySelector("[data-testid='CLOSE_SPLASH']")) {
cy.get("[data-testid='CLOSE_SPLASH']").click(); cy.get("[data-testid='CLOSE_SPLASH']").click();
} }

View File

@ -126,7 +126,7 @@ export const GroupCard = ({ group }: IGroupCardProps) => {
onClick={e => { onClick={e => {
e.preventDefault(); e.preventDefault();
navigate( navigate(
`/projects/${project}/access` `/projects/${project}/settings/access`
); );
}} }}
color="secondary" color="secondary"

View File

@ -8,7 +8,6 @@ import { Delete, Edit } from '@mui/icons-material';
import useToast from 'hooks/useToast'; import useToast from 'hooks/useToast';
import useQueryParams from 'hooks/useQueryParams'; import useQueryParams from 'hooks/useQueryParams';
import React, { useEffect, useMemo, useState } from 'react'; import React, { useEffect, useMemo, useState } from 'react';
import { ProjectAccess } from '../ProjectAccess/ProjectAccess';
import ProjectEnvironment from '../ProjectEnvironment/ProjectEnvironment'; import ProjectEnvironment from '../ProjectEnvironment/ProjectEnvironment';
import { ProjectFeaturesArchive } from './ProjectFeaturesArchive/ProjectFeaturesArchive'; import { ProjectFeaturesArchive } from './ProjectFeaturesArchive/ProjectFeaturesArchive';
import ProjectOverview from './ProjectOverview'; import ProjectOverview from './ProjectOverview';
@ -20,7 +19,7 @@ import {
} from 'component/providers/AccessProvider/permissions'; } from 'component/providers/AccessProvider/permissions';
import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { Route, Routes, useLocation } from 'react-router-dom'; import { Navigate, Route, Routes, useLocation } from 'react-router-dom';
import { DeleteProjectDialogue } from './DeleteProject/DeleteProjectDialogue'; import { DeleteProjectDialogue } from './DeleteProject/DeleteProjectDialogue';
import { ProjectLog } from './ProjectLog/ProjectLog'; import { ProjectLog } from './ProjectLog/ProjectLog';
import { ChangeRequestOverview } from 'component/changeRequest/ChangeRequestOverview/ChangeRequestOverview'; import { ChangeRequestOverview } from 'component/changeRequest/ChangeRequestOverview/ChangeRequestOverview';
@ -93,20 +92,6 @@ const Project = () => {
path: `${basePath}/health`, path: `${basePath}/health`,
name: 'health', name: 'health',
}, },
...(!isChangeRequestFlagEnabled
? [
{
title: 'Access',
path: `${basePath}/access`,
name: 'access',
},
{
title: 'Environments',
path: `${basePath}/environments`,
name: 'environments',
},
]
: []),
{ {
title: 'Archive', title: 'Archive',
path: `${basePath}/archive`, path: `${basePath}/archive`,
@ -115,28 +100,23 @@ const Project = () => {
...(isChangeRequestFlagEnabled ...(isChangeRequestFlagEnabled
? [ ? [
{ {
title: 'Project settings', title: 'Change requests',
path: `${basePath}/settings`, path: `${basePath}/change-requests`,
name: 'settings', name: 'change-request',
}, },
] ]
: []), : []),
{
title: 'Project settings',
path: `${basePath}/settings`,
name: 'settings',
},
{ {
title: 'Event log', title: 'Event log',
path: `${basePath}/logs`, path: `${basePath}/logs`,
name: 'logs', name: 'logs',
}, },
]; ];
const changeRequestTab = {
title: 'Change requests',
path: `${basePath}/change-requests`,
name: 'change-request',
};
if (isChangeRequestFlagEnabled) {
tabArray.splice(tabArray.length - 2, 0, changeRequestTab);
}
return tabArray; return tabArray;
}, [isChangeRequestFlagEnabled]); }, [isChangeRequestFlagEnabled]);
@ -155,7 +135,6 @@ const Project = () => {
title: text, title: text,
}); });
} }
/* eslint-disable-next-line */ /* eslint-disable-next-line */
}, []); }, []);
@ -290,7 +269,15 @@ const Project = () => {
/> />
<Routes> <Routes>
<Route path="health" element={<ProjectHealth />} /> <Route path="health" element={<ProjectHealth />} />
<Route path="access/*" element={<ProjectAccess />} /> <Route
path="access/*"
element={
<Navigate
replace
to={`/projects/${projectId}/settings/access`}
/>
}
/>
<Route path="environments" element={<ProjectEnvironment />} /> <Route path="environments" element={<ProjectEnvironment />} />
<Route path="archive" element={<ProjectFeaturesArchive />} /> <Route path="archive" element={<ProjectFeaturesArchive />} />
<Route path="logs" element={<ProjectLog />} /> <Route path="logs" element={<ProjectLog />} />

View File

@ -18,12 +18,7 @@ interface IProjectInfoProps {
description?: string; description?: string;
} }
const ProjectInfo = ({ const ProjectInfo = ({ id, memberCount, health }: IProjectInfoProps) => {
id,
memberCount,
health,
description,
}: IProjectInfoProps) => {
const { classes: themeStyles } = useThemeStyles(); const { classes: themeStyles } = useThemeStyles();
const { classes: styles } = useStyles(); const { classes: styles } = useStyles();
const { uiConfig } = useUiConfig(); const { uiConfig } = useUiConfig();
@ -31,7 +26,7 @@ const ProjectInfo = ({
let link = `/admin/users`; let link = `/admin/users`;
if (uiConfig?.versionInfo?.current?.enterprise) { if (uiConfig?.versionInfo?.current?.enterprise) {
link = `/projects/${id}/access`; link = `/projects/${id}/settings/access`;
} }
return ( return (