From 83ed4b1a40ce69907a69e377aecd3fc938daf0fc Mon Sep 17 00:00:00 2001 From: Youssef Date: Fri, 7 Jan 2022 08:19:16 +0100 Subject: [PATCH 1/3] fix: remove create-toggle2 from breadcrumb menu --- frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx b/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx index 6f8d71f9f8..11b5b15e50 100644 --- a/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx +++ b/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx @@ -23,7 +23,8 @@ const BreadcrumbNav = () => { item !== 'copy' && item !== 'strategies' && item !== 'features' && - item !== 'features2' + item !== 'features2' && + item !== 'create-toggle2' ); return ( From e6f0dcd08fa5c1a5394f06c8be2f06d6d37beae6 Mon Sep 17 00:00:00 2001 From: Youssef Date: Mon, 10 Jan 2022 13:04:49 +0100 Subject: [PATCH 2/3] fix: replace create-toggle2 with create-toggle --- .../application-edit-component-test.js.snap | 2 +- .../src/component/application/application-view.jsx | 2 +- .../component/common/BreadcrumbNav/BreadcrumbNav.tsx | 2 +- .../menu/__tests__/__snapshots__/routes-test.jsx.snap | 11 +---------- frontend/src/component/menu/routes.js | 11 +---------- frontend/src/utils/route-path-helpers.ts | 4 +--- 6 files changed, 6 insertions(+), 26 deletions(-) diff --git a/frontend/src/component/application/__tests__/__snapshots__/application-edit-component-test.js.snap b/frontend/src/component/application/__tests__/__snapshots__/application-edit-component-test.js.snap index ac44894f3a..c444d314f0 100644 --- a/frontend/src/component/application/__tests__/__snapshots__/application-edit-component-test.js.snap +++ b/frontend/src/component/application/__tests__/__snapshots__/application-edit-component-test.js.snap @@ -339,7 +339,7 @@ exports[`renders correctly with permissions 1`] = ` className="MuiTypography-root MuiListItemText-primary MuiTypography-body1 MuiTypography-displayBlock" > ToggleB diff --git a/frontend/src/component/application/application-view.jsx b/frontend/src/component/application/application-view.jsx index 895f1d1442..5c0a0c485d 100644 --- a/frontend/src/component/application/application-view.jsx +++ b/frontend/src/component/application/application-view.jsx @@ -91,7 +91,7 @@ function ApplicationView({ key={`toggle_conditional_${name}`} condition={notFound} show={notFoundListItem({ - createUrl: `/projects/default/create-toggle2?name=${name}`, + createUrl: `/projects/default/create-toggle?name=${name}`, name, permission: CREATE_FEATURE, i, diff --git a/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx b/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx index 11b5b15e50..4281fd2bdd 100644 --- a/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx +++ b/frontend/src/component/common/BreadcrumbNav/BreadcrumbNav.tsx @@ -24,7 +24,7 @@ const BreadcrumbNav = () => { item !== 'strategies' && item !== 'features' && item !== 'features2' && - item !== 'create-toggle2' + item !== 'create-toggle' ); return ( diff --git a/frontend/src/component/menu/__tests__/__snapshots__/routes-test.jsx.snap b/frontend/src/component/menu/__tests__/__snapshots__/routes-test.jsx.snap index ad801ba46d..6c7727842f 100644 --- a/frontend/src/component/menu/__tests__/__snapshots__/routes-test.jsx.snap +++ b/frontend/src/component/menu/__tests__/__snapshots__/routes-test.jsx.snap @@ -62,17 +62,8 @@ Array [ "layout": "main", "menu": Object {}, "parent": "/projects/:id/features", - "path": "/projects/:projectId/create-toggle2", - "title": "Create feature toggle", - "type": "protected", - }, - Object { - "component": [Function], - "layout": "main", - "menu": Object {}, - "parent": "/projects", "path": "/projects/:projectId/create-toggle", - "title": "Create", + "title": "Create feature toggle", "type": "protected", }, Object { diff --git a/frontend/src/component/menu/routes.js b/frontend/src/component/menu/routes.js index 89d9fb9886..1e0fa11e4c 100644 --- a/frontend/src/component/menu/routes.js +++ b/frontend/src/component/menu/routes.js @@ -101,7 +101,7 @@ export const routes = [ menu: {}, }, { - path: '/projects/:projectId/create-toggle2', + path: '/projects/:projectId/create-toggle', parent: '/projects/:id/features', title: 'Create feature toggle', component: FeatureCreate, @@ -109,15 +109,6 @@ export const routes = [ layout: 'main', menu: {}, }, - { - path: '/projects/:projectId/create-toggle', - parent: '/projects', - title: 'Create', - component: CreateFeatureToggle, - type: 'protected', - layout: 'main', - menu: {}, - }, { path: '/projects/:projectId/features/:name', parent: '/features', diff --git a/frontend/src/utils/route-path-helpers.ts b/frontend/src/utils/route-path-helpers.ts index 3707618813..6b06119d0d 100644 --- a/frontend/src/utils/route-path-helpers.ts +++ b/frontend/src/utils/route-path-helpers.ts @@ -14,9 +14,7 @@ export const getCreateTogglePath = ( newPath: boolean = false, query?: Object ) => { - const path = newPath - ? `/projects/${projectId}/create-toggle2` - : `/projects/${projectId}/create-toggle`; + const path = `/projects/${projectId}/create-toggle`; let queryString; if (query) { From 123d29b9be4abcdba6f0fa0a1d3aa56a838091e6 Mon Sep 17 00:00:00 2001 From: Youssef Khedher Date: Mon, 10 Jan 2022 14:19:49 +0100 Subject: [PATCH 3/3] fix: remove unused component in routes --- frontend/src/component/menu/routes.js | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/component/menu/routes.js b/frontend/src/component/menu/routes.js index 1e0fa11e4c..f38024ae7a 100644 --- a/frontend/src/component/menu/routes.js +++ b/frontend/src/component/menu/routes.js @@ -1,4 +1,3 @@ -import CreateFeatureToggle from '../../page/features/create'; import CopyFeatureToggle from '../../page/features/copy'; import ViewFeatureToggle from '../../page/features/show'; import Features from '../../page/features';