From 2c8b234dfc6c9cb240cb769a207b898f252e6405 Mon Sep 17 00:00:00 2001 From: Youssef Date: Tue, 12 Oct 2021 05:57:25 +0100 Subject: [PATCH] fix links order --- .../__snapshots__/routes-test.jsx.snap | 248 ++++++++-------- frontend/src/component/menu/routes.js | 264 +++++++++--------- 2 files changed, 257 insertions(+), 255 deletions(-) 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 b5a1354ce6..c493186d80 100644 --- a/frontend/src/component/menu/__tests__/__snapshots__/routes-test.jsx.snap +++ b/frontend/src/component/menu/__tests__/__snapshots__/routes-test.jsx.snap @@ -96,44 +96,6 @@ Array [ "title": "Projects", "type": "protected", }, - Object { - "component": [Function], - "layout": "main", - "menu": Object {}, - "parent": "/tag-types", - "path": "/tag-types/create", - "title": "Create", - "type": "protected", - }, - Object { - "component": [Function], - "layout": "main", - "menu": Object {}, - "parent": "/tag-types", - "path": "/tag-types/edit/:name", - "title": ":name", - "type": "protected", - }, - Object { - "component": [Function], - "layout": "main", - "menu": Object { - "advanced": true, - "mobile": true, - }, - "path": "/tag-types", - "title": "Tag types", - "type": "protected", - }, - Object { - "component": [Function], - "layout": "main", - "menu": Object {}, - "parent": "/tags", - "path": "/tags/create", - "title": "Create", - "type": "protected", - }, Object { "component": [Function], "layout": "main", @@ -153,92 +115,6 @@ Array [ "title": "Feature Toggles", "type": "protected", }, - Object { - "component": [Function], - "layout": "main", - "menu": Object {}, - "parent": "/strategies", - "path": "/strategies/create", - "title": "Create", - "type": "protected", - }, - Object { - "component": [Function], - "layout": "main", - "menu": Object {}, - "parent": "/strategies", - "path": "/strategies/:activeTab/:strategyName", - "title": ":strategyName", - "type": "protected", - }, - Object { - "component": [Function], - "layout": "main", - "menu": Object { - "advanced": true, - "mobile": true, - }, - "path": "/strategies", - "title": "Strategies", - "type": "protected", - }, - Object { - "component": [Function], - "layout": "main", - "menu": Object {}, - "parent": "/environments", - "path": "/environments/create", - "title": "Environments", - "type": "protected", - }, - Object { - "component": [Function], - "flag": "E", - "layout": "main", - "menu": Object { - "advanced": true, - "mobile": true, - }, - "path": "/environments", - "title": "Environments", - "type": "protected", - }, - Object { - "component": [Function], - "layout": "main", - "menu": Object {}, - "parent": "/history", - "path": "/history/:toggleName", - "title": ":toggleName", - "type": "protected", - }, - Object { - "component": [Function], - "layout": "main", - "menu": Object { - "adminSettings": true, - }, - "path": "/history", - "title": "Event History", - "type": "protected", - }, - Object { - "component": [Function], - "layout": "main", - "menu": Object {}, - "parent": "/archive", - "path": "/projects/:id/archived/:name/:activeTab", - "title": ":name", - "type": "protected", - }, - Object { - "component": [Function], - "layout": "main", - "menu": Object {}, - "path": "/archive", - "title": "Archived Toggles", - "type": "protected", - }, Object { "component": [Function], "layout": "main", @@ -289,6 +165,94 @@ Array [ "title": "Context Fields", "type": "protected", }, + Object { + "component": [Function], + "layout": "main", + "menu": Object {}, + "parent": "/strategies", + "path": "/strategies/create", + "title": "Create", + "type": "protected", + }, + Object { + "component": [Function], + "layout": "main", + "menu": Object {}, + "parent": "/strategies", + "path": "/strategies/:activeTab/:strategyName", + "title": ":strategyName", + "type": "protected", + }, + Object { + "component": [Function], + "layout": "main", + "menu": Object { + "advanced": true, + "mobile": true, + }, + "path": "/strategies", + "title": "Strategies", + "type": "protected", + }, + Object { + "component": [Function], + "layout": "main", + "menu": Object {}, + "parent": "/environments", + "path": "/environments/create", + "title": "Environments", + "type": "protected", + }, + Object { + "component": [Function], + "flag": "E", + "layout": "main", + "menu": Object { + "advanced": true, + "mobile": true, + }, + "path": "/environments", + "title": "Environments", + "type": "protected", + }, + Object { + "component": [Function], + "layout": "main", + "menu": Object {}, + "parent": "/tag-types", + "path": "/tag-types/create", + "title": "Create", + "type": "protected", + }, + Object { + "component": [Function], + "layout": "main", + "menu": Object {}, + "parent": "/tag-types", + "path": "/tag-types/edit/:name", + "title": ":name", + "type": "protected", + }, + Object { + "component": [Function], + "layout": "main", + "menu": Object { + "advanced": true, + "mobile": true, + }, + "path": "/tag-types", + "title": "Tag types", + "type": "protected", + }, + Object { + "component": [Function], + "layout": "main", + "menu": Object {}, + "parent": "/tags", + "path": "/tags/create", + "title": "Create", + "type": "protected", + }, Object { "component": [Function], "layout": "main", @@ -319,6 +283,42 @@ Array [ "title": "Addons", "type": "protected", }, + Object { + "component": [Function], + "layout": "main", + "menu": Object {}, + "parent": "/history", + "path": "/history/:toggleName", + "title": ":toggleName", + "type": "protected", + }, + Object { + "component": [Function], + "layout": "main", + "menu": Object { + "adminSettings": true, + }, + "path": "/history", + "title": "Event History", + "type": "protected", + }, + Object { + "component": [Function], + "layout": "main", + "menu": Object {}, + "parent": "/archive", + "path": "/projects/:id/archived/:name/:activeTab", + "title": ":name", + "type": "protected", + }, + Object { + "component": [Function], + "layout": "main", + "menu": Object {}, + "path": "/archive", + "title": "Archived Toggles", + "type": "protected", + }, Object { "component": [Function], "layout": "main", diff --git a/frontend/src/component/menu/routes.js b/frontend/src/component/menu/routes.js index fc08d52914..3280dc64de 100644 --- a/frontend/src/component/menu/routes.js +++ b/frontend/src/component/menu/routes.js @@ -136,51 +136,6 @@ export const routes = [ menu: { mobile: true }, }, - { - path: '/tag-types/create', - parent: '/tag-types', - title: 'Create', - component: CreateTagType, - type: 'protected', - layout: 'main', - menu: {}, - }, - { - path: '/tag-types/edit/:name', - parent: '/tag-types', - title: ':name', - component: EditTagType, - type: 'protected', - layout: 'main', - menu: {}, - }, - { - path: '/tag-types', - title: 'Tag types', - component: ListTagTypes, - type: 'protected', - layout: 'main', - menu: { mobile: true, advanced: true }, - }, - - { - path: '/tags/create', - parent: '/tags', - title: 'Create', - component: CreateTag, - type: 'protected', - layout: 'main', - menu: {}, - }, - { - path: '/tags', - title: 'Tags', - component: ListTags, - hidden: true, - type: 'protected', - layout: 'main', - menu: {}, - }, // Features { path: '/features/:activeTab/:name', @@ -199,91 +154,7 @@ export const routes = [ layout: 'main', menu: { mobile: true }, }, - - // Strategies - { - path: '/strategies/create', - title: 'Create', - parent: '/strategies', - component: CreateStrategies, - type: 'protected', - layout: 'main', - menu: {}, - }, - { - path: '/strategies/:activeTab/:strategyName', - title: ':strategyName', - parent: '/strategies', - component: StrategyView, - type: 'protected', - layout: 'main', - menu: {}, - }, - { - path: '/strategies', - title: 'Strategies', - component: Strategies, - type: 'protected', - layout: 'main', - menu: { mobile: true, advanced: true }, - }, - { - path: '/environments/create', - title: 'Environments', - component: CreateEnvironment, - parent: '/environments', - type: 'protected', - layout: 'main', - menu: {}, - }, - { - path: '/environments', - title: 'Environments', - component: EnvironmentList, - type: 'protected', - layout: 'main', - flag: E, - menu: { mobile: true, advanced: true }, - }, - - // History - { - path: '/history/:toggleName', - title: ':toggleName', - parent: '/history', - component: HistoryTogglePage, - type: 'protected', - layout: 'main', - menu: {}, - }, - { - path: '/history', - title: 'Event History', - component: HistoryPage, - type: 'protected', - layout: 'main', - menu: { adminSettings: true }, - }, - - // Archive - { - path: '/projects/:id/archived/:name/:activeTab', - title: ':name', - parent: '/archive', - component: ShowArchive, - type: 'protected', - layout: 'main', - menu: {}, - }, - { - path: '/archive', - title: 'Archived Toggles', - component: Archive, - type: 'protected', - layout: 'main', - menu: {}, - }, - + // Applications { path: '/applications/:name', @@ -332,8 +203,100 @@ export const routes = [ menu: { mobile: true, advanced: true }, }, - // Addons + // Strategies { + path: '/strategies/create', + title: 'Create', + parent: '/strategies', + component: CreateStrategies, + type: 'protected', + layout: 'main', + menu: {}, + }, + { + path: '/strategies/:activeTab/:strategyName', + title: ':strategyName', + parent: '/strategies', + component: StrategyView, + type: 'protected', + layout: 'main', + menu: {}, + }, + { + path: '/strategies', + title: 'Strategies', + component: Strategies, + type: 'protected', + layout: 'main', + menu: { mobile: true, advanced: true }, + }, + { + path: '/environments/create', + title: 'Environments', + component: CreateEnvironment, + parent: '/environments', + type: 'protected', + layout: 'main', + menu: {}, + }, + { + path: '/environments', + title: 'Environments', + component: EnvironmentList, + type: 'protected', + layout: 'main', + flag: E, + menu: { mobile: true, advanced: true }, + }, + + // Tags + { + path: '/tag-types/create', + parent: '/tag-types', + title: 'Create', + component: CreateTagType, + type: 'protected', + layout: 'main', + menu: {}, + }, + { + path: '/tag-types/edit/:name', + parent: '/tag-types', + title: ':name', + component: EditTagType, + type: 'protected', + layout: 'main', + menu: {}, + }, + { + path: '/tag-types', + title: 'Tag types', + component: ListTagTypes, + type: 'protected', + layout: 'main', + menu: { mobile: true, advanced: true }, + }, + { + path: '/tags/create', + parent: '/tags', + title: 'Create', + component: CreateTag, + type: 'protected', + layout: 'main', + menu: {}, + }, + { + path: '/tags', + title: 'Tags', + component: ListTags, + hidden: true, + type: 'protected', + layout: 'main', + menu: {}, + }, + + // Addons + { path: '/addons/create/:provider', parent: '/addons', title: 'Create', @@ -360,6 +323,45 @@ export const routes = [ layout: 'main', menu: { mobile: true, advanced: true }, }, + + // History + { + path: '/history/:toggleName', + title: ':toggleName', + parent: '/history', + component: HistoryTogglePage, + type: 'protected', + layout: 'main', + menu: {}, + }, + { + path: '/history', + title: 'Event History', + component: HistoryPage, + type: 'protected', + layout: 'main', + menu: { adminSettings: true }, + }, + + // Archive + { + path: '/projects/:id/archived/:name/:activeTab', + title: ':name', + parent: '/archive', + component: ShowArchive, + type: 'protected', + layout: 'main', + menu: {}, + }, + { + path: '/archive', + title: 'Archived Toggles', + component: Archive, + type: 'protected', + layout: 'main', + menu: {}, + }, + // Admin { path: '/admin/api',