From ed148a542d6671dc2f172e90d265777328e765cb Mon Sep 17 00:00:00 2001 From: akhilmhdh Date: Fri, 3 Feb 2023 22:19:03 +0530 Subject: [PATCH] feat(ui): implemented the new project settings page --- frontend/public/locales/en/section-token.json | 2 +- frontend/src/components/basic/Layout.tsx | 57 ++- .../basic/table/EnvironmentsTable.tsx | 57 ++- frontend/src/components/dashboard/SideBar.tsx | 4 +- .../components/navigation/NavBarDashboard.tsx | 2 +- .../src/components/navigation/NavHeader.tsx | 23 +- frontend/src/const.ts | 28 +- frontend/src/pages/_app.tsx | 16 +- frontend/src/pages/activity/[id].tsx | 2 +- frontend/src/pages/dashboard/[id].tsx | 4 +- frontend/src/pages/settings/project/[id].tsx | 328 +----------------- .../ProjectSettingsPage.tsx | 287 +++++++++++++++ .../CopyProjectIDSection.tsx | 66 ++++ .../components/CopyProjectIDSection/index.tsx | 1 + .../EnvironmentSection/EnvironmentSection.tsx | 239 +++++++++++++ .../components/EnvironmentSection/index.tsx | 1 + .../ProjectNameChangeSection.tsx | 71 ++++ .../ProjectNameChangeSection/index.tsx | 1 + .../ServiceTokenSection.tsx | 307 ++++++++++++++++ .../components/ServiceTokenSection/index.tsx | 1 + .../ProjectSettingsPage/components/index.tsx | 6 + .../Settings/ProjectSettingsPage/index.tsx | 1 + 22 files changed, 1099 insertions(+), 405 deletions(-) create mode 100644 frontend/src/views/Settings/ProjectSettingsPage/ProjectSettingsPage.tsx create mode 100644 frontend/src/views/Settings/ProjectSettingsPage/components/CopyProjectIDSection/CopyProjectIDSection.tsx create mode 100644 frontend/src/views/Settings/ProjectSettingsPage/components/CopyProjectIDSection/index.tsx create mode 100644 frontend/src/views/Settings/ProjectSettingsPage/components/EnvironmentSection/EnvironmentSection.tsx create mode 100644 frontend/src/views/Settings/ProjectSettingsPage/components/EnvironmentSection/index.tsx create mode 100644 frontend/src/views/Settings/ProjectSettingsPage/components/ProjectNameChangeSection/ProjectNameChangeSection.tsx create mode 100644 frontend/src/views/Settings/ProjectSettingsPage/components/ProjectNameChangeSection/index.tsx create mode 100644 frontend/src/views/Settings/ProjectSettingsPage/components/ServiceTokenSection/ServiceTokenSection.tsx create mode 100644 frontend/src/views/Settings/ProjectSettingsPage/components/ServiceTokenSection/index.tsx create mode 100644 frontend/src/views/Settings/ProjectSettingsPage/components/index.tsx create mode 100644 frontend/src/views/Settings/ProjectSettingsPage/index.tsx diff --git a/frontend/public/locales/en/section-token.json b/frontend/public/locales/en/section-token.json index d12bd202c..ce468b1af 100644 --- a/frontend/public/locales/en/section-token.json +++ b/frontend/public/locales/en/section-token.json @@ -4,7 +4,7 @@ "add-new": "Add New Token", "add-dialog": { "title": "Add a service token for {{target}}", - "description": "Specify the name, environment, and expiry period. When a token is generated, you will only be able to see it once before it disappears. Make sure to save it somewhere.", + "description": "When a token is generated, you will only be able to see it once before it disappears. Make sure to save it somewhere.", "name": "Service Token Name", "add": "Add Service Token", "copy-service-token": "Copy your service token", diff --git a/frontend/src/components/basic/Layout.tsx b/frontend/src/components/basic/Layout.tsx index a3d6092a1..ba4cf73b2 100644 --- a/frontend/src/components/basic/Layout.tsx +++ b/frontend/src/components/basic/Layout.tsx @@ -187,10 +187,10 @@ const Layout = ({ children }: LayoutProps) => { }); const userWorkspaces = orgUserProjects; if ( - userWorkspaces.length === 0 && - router.asPath !== '/noprojects' && - !router.asPath.includes('home') && - !router.asPath.includes('settings') || + (userWorkspaces.length === 0 && + router.asPath !== '/noprojects' && + !router.asPath.includes('home') && + !router.asPath.includes('settings')) || router.asPath === '/dashboard/undefined' ) { router.push('/noprojects'); @@ -246,16 +246,15 @@ const Layout = ({ children }: LayoutProps) => { return ( <> -
-