From fb06fa9f460d1e167194d61a95f02ba14580e350 Mon Sep 17 00:00:00 2001 From: sjaanus Date: Tue, 13 Dec 2022 13:41:40 +0200 Subject: [PATCH] Remove full width access tab (#2679) Remove full width access tab --- .../integration/projects/access.spec.ts | 2 +- .../groups/GroupsList/GroupCard/GroupCard.tsx | 2 +- .../src/component/project/Project/Project.tsx | 49 +++++++------------ .../Project/ProjectInfo/ProjectInfo.tsx | 9 +--- 4 files changed, 22 insertions(+), 40 deletions(-) diff --git a/frontend/cypress/integration/projects/access.spec.ts b/frontend/cypress/integration/projects/access.spec.ts index 08c2f8df9e..67dfac45b9 100644 --- a/frontend/cypress/integration/projects/access.spec.ts +++ b/frontend/cypress/integration/projects/access.spec.ts @@ -69,7 +69,7 @@ describe('project-access', () => { beforeEach(() => { cy.login(); - cy.visit(`/projects/${groupAndProjectName}/access`); + cy.visit(`/projects/${groupAndProjectName}/settings/access`); if (document.querySelector("[data-testid='CLOSE_SPLASH']")) { cy.get("[data-testid='CLOSE_SPLASH']").click(); } diff --git a/frontend/src/component/admin/groups/GroupsList/GroupCard/GroupCard.tsx b/frontend/src/component/admin/groups/GroupsList/GroupCard/GroupCard.tsx index d05db751ff..a32af02347 100644 --- a/frontend/src/component/admin/groups/GroupsList/GroupCard/GroupCard.tsx +++ b/frontend/src/component/admin/groups/GroupsList/GroupCard/GroupCard.tsx @@ -126,7 +126,7 @@ export const GroupCard = ({ group }: IGroupCardProps) => { onClick={e => { e.preventDefault(); navigate( - `/projects/${project}/access` + `/projects/${project}/settings/access` ); }} color="secondary" diff --git a/frontend/src/component/project/Project/Project.tsx b/frontend/src/component/project/Project/Project.tsx index 35606e475a..33f5e32f88 100644 --- a/frontend/src/component/project/Project/Project.tsx +++ b/frontend/src/component/project/Project/Project.tsx @@ -8,7 +8,6 @@ import { Delete, Edit } from '@mui/icons-material'; import useToast from 'hooks/useToast'; import useQueryParams from 'hooks/useQueryParams'; import React, { useEffect, useMemo, useState } from 'react'; -import { ProjectAccess } from '../ProjectAccess/ProjectAccess'; import ProjectEnvironment from '../ProjectEnvironment/ProjectEnvironment'; import { ProjectFeaturesArchive } from './ProjectFeaturesArchive/ProjectFeaturesArchive'; import ProjectOverview from './ProjectOverview'; @@ -20,7 +19,7 @@ import { } from 'component/providers/AccessProvider/permissions'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; 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 { ProjectLog } from './ProjectLog/ProjectLog'; import { ChangeRequestOverview } from 'component/changeRequest/ChangeRequestOverview/ChangeRequestOverview'; @@ -93,20 +92,6 @@ const Project = () => { path: `${basePath}/health`, name: 'health', }, - ...(!isChangeRequestFlagEnabled - ? [ - { - title: 'Access', - path: `${basePath}/access`, - name: 'access', - }, - { - title: 'Environments', - path: `${basePath}/environments`, - name: 'environments', - }, - ] - : []), { title: 'Archive', path: `${basePath}/archive`, @@ -115,28 +100,23 @@ const Project = () => { ...(isChangeRequestFlagEnabled ? [ { - title: 'Project settings', - path: `${basePath}/settings`, - name: 'settings', + title: 'Change requests', + path: `${basePath}/change-requests`, + name: 'change-request', }, ] : []), + { + title: 'Project settings', + path: `${basePath}/settings`, + name: 'settings', + }, { title: 'Event log', path: `${basePath}/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; }, [isChangeRequestFlagEnabled]); @@ -155,7 +135,6 @@ const Project = () => { title: text, }); } - /* eslint-disable-next-line */ }, []); @@ -290,7 +269,15 @@ const Project = () => { /> } /> - } /> + + } + /> } /> } /> } /> diff --git a/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.tsx b/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.tsx index 4c5a00c7d7..c596784215 100644 --- a/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.tsx +++ b/frontend/src/component/project/Project/ProjectInfo/ProjectInfo.tsx @@ -18,12 +18,7 @@ interface IProjectInfoProps { description?: string; } -const ProjectInfo = ({ - id, - memberCount, - health, - description, -}: IProjectInfoProps) => { +const ProjectInfo = ({ id, memberCount, health }: IProjectInfoProps) => { const { classes: themeStyles } = useThemeStyles(); const { classes: styles } = useStyles(); const { uiConfig } = useUiConfig(); @@ -31,7 +26,7 @@ const ProjectInfo = ({ let link = `/admin/users`; if (uiConfig?.versionInfo?.current?.enterprise) { - link = `/projects/${id}/access`; + link = `/projects/${id}/settings/access`; } return (