From 18287cdbd028de788bfa90cd47b8236a713467a3 Mon Sep 17 00:00:00 2001 From: Fredrik Strand Oseberg Date: Fri, 4 Feb 2022 10:36:08 +0100 Subject: [PATCH] Fix/cleanup unused code (#651) * fix: remove unused context code * fix: refactor users * fix: rename delete user * fix: rename frontend * fix: update feature view path * fix: cleanup create feature * fix: cleanup feature views * fix: cleanup feature strategies * fix: update paths * fix: remove unused strategy components * fix strategies link * fix: update snapshots * fix: import paths * fix: add name to useEffect dependency --- .../feature-toggle/feature.spec.js | 14 +- .../ReportToggleListItem.jsx | 2 +- frontend/src/component/admin/api/index.js | 2 +- .../component/admin/auth/authentication.jsx | 47 +- .../{admin-menu.jsx => menu/AdminMenu.tsx} | 2 +- .../ProjectRoles/ProjectRoles.tsx | 2 +- .../{index.styles.js => UserAdmin.styles.ts} | 0 .../admin/users/{index.js => UsersAdmin.tsx} | 12 +- .../ChangePassword/ChangePassword.tsx} | 35 +- .../DeleteUser/DeleteUser.tsx} | 34 +- .../admin/users/UsersList/UsersList.tsx | 6 +- .../component/admin/users/UsersList/index.js | 12 - .../src/component/archive/view-container.js | 23 - .../common/Constraint/Constraint.tsx | 2 +- .../EnvironmentStrategyDialog.tsx | 2 +- frontend/src/component/common/util.js | 4 +- .../src/component/context/Context.module.scss | 65 -- .../context/ContextList/ContextList.jsx | 9 +- .../component/context/ContextList/index.jsx | 22 - .../context/form-context-component.jsx | 311 --------- .../{create => }/CopyFeature/CopyFeature.jsx | 22 +- .../CopyFeature/CopyFeature.module.scss | 0 .../{create => }/CopyFeature/index.jsx | 4 +- .../{CreateFeature => }/CreateFeature.tsx | 18 +- .../EditFeature/EditFeature.tsx | 18 +- .../FeatureCreate/FeatureCreate.styles.ts | 17 - .../feature/FeatureCreate/FeatureCreate.tsx | 176 ----- .../FeatureForm/FeatureForm.styles.ts | 0 .../FeatureForm/FeatureForm.tsx | 20 +- .../FeatureToggleListItem.jsx | 6 +- .../feature-list-item-component-test.jsx.snap | 4 +- .../FeatureToggleListNewItem.tsx | 6 +- .../FeatureLog/FeatureLog.styles.ts | 0 .../FeatureLog/FeatureLog.tsx | 0 .../FeatureMetrics/FeatureMetrics.styles.ts | 0 .../FeatureMetrics/FeatureMetrics.tsx | 0 .../AddTagDialog/AddTagDialog.styles.ts | 0 .../AddTagDialog/AddTagDialog.tsx | 0 .../FeatureEnvironmentMetrics.styles.ts | 0 .../FeatureEnvironmentMetrics.tsx | 0 .../FeatureOverview/FeatureOverview.styles.ts | 0 .../FeatureOverview/FeatureOverview.tsx | 0 .../FeatureOverviewEnvSwitch.tsx | 0 .../FeatureOverviewEnvSwitches.styles.ts | 0 .../FeatureOverviewEnvSwitches.tsx | 0 .../FeatureOverviewEnvironment.styles.ts | 0 .../FeatureOverviewEnvironment.tsx | 2 +- .../FeatureOverviewEnvironmentBody.tsx | 2 +- .../FeatureOverviewEnvironmentFooter.tsx | 0 ...eatureOverviewEnvironmentMetrics.styles.ts | 0 .../FeatureOverviewEnvironmentMetrics.tsx | 0 .../FeatureOverviewEnvironmentStrategies.tsx | 0 ...atureOverviewEnvironmentStrategy.styles.ts | 0 .../FeatureOverviewEnvironmentStrategy.tsx | 2 +- .../FeatureOverviewEnvironments.tsx | 0 .../FeatureOverviewMetaData.tsx | 4 +- .../FeatureOverviewMetadata.styles.ts | 0 .../FeatureOverviewTags.styles.ts | 0 .../FeatureOverviewTags.tsx | 0 .../StaleDialog/StaleDialog.tsx | 0 .../FeatureSeenApplications.styles.ts | 0 .../FeatureSeenApplications.tsx | 0 .../FeatureSettings/FeatureSettings.styles.ts | 0 .../FeatureSettings/FeatureSettings.tsx | 0 .../FeatureSettingsMetadata.tsx | 0 .../FeatureTypeSelect/FeatureTypeSelect.tsx | 0 .../FeatureProjectSelect.tsx | 0 .../FeatureSettingsProject.tsx | 2 +- .../FeatureSettingsProjectConfirm.styles.ts | 0 .../FeatureSettingsProjectConfirm.tsx | 0 .../FeatureStatus/FeatureStatus.styles.ts | 0 .../FeatureStatus/FeatureStatus.tsx | 0 .../FeatureStrategies.styles.ts | 0 .../FeatureStrategies/FeatureStrategies.tsx | 0 ...tureEnvironmentStrategyExecution.styles.ts | 0 .../FeatureEnvironmentStrategyExecution.tsx | 0 ...onmentStrategyExecutionSeparator.styles.ts | 0 ...eEnvironmentStrategyExecutionSeparator.tsx | 0 ...ureEnvironmentStrategyExecutionWrapper.tsx | 0 .../FeatureStrategiesConfigure.styles.ts | 0 .../FeatureStrategiesConfigure.tsx | 0 .../FeatureStrategiesCreateHeader.styles.ts | 0 .../FeatureStrategiesCreateHeader.tsx | 0 ...FeatureStrategiesEnvironmentList.styles.ts | 0 .../FeatureStrategiesEnvironmentList.tsx | 0 .../useDeleteStrategyMarkup.tsx | 0 .../useDropboxMarkup.tsx | 0 .../useFeatureStrategiesEnvironmentList.ts | 0 .../useProductionGuardMarkup.tsx | 0 .../FeatureStrategiesEnvironments.styles.ts | 0 .../FeatureStrategiesEnvironments.tsx | 0 .../FeatureStrategiesProductionGuard.tsx | 0 .../FeatureStrategiesRefresh.styles.ts | 0 .../FeatureStrategiesRefresh.tsx | 0 .../FeatureStrategiesSeparator.tsx | 0 .../FeatureStrategyEditable.styles.ts | 0 .../FeatureStrategyEditable.tsx | 0 .../FeatureStrategiesList.styles.ts | 0 .../FeatureStrategiesList.tsx | 0 .../FeatureStrategyCard.styles.ts | 0 .../FeatureStrategyCard.tsx | 0 .../FeatureStrategiesUIProvider.tsx | 0 .../FeatureStrategyAccordion.styles.ts | 0 .../FeatureStrategyAccordion.tsx | 0 .../FeatureStrategyAccordionBody.styles.ts | 0 .../FeatureStrategyAccordionBody.tsx | 0 .../FeatureStrategyExecution.styles.ts | 0 .../FeatureStrategyExecution.tsx | 0 .../FeatureStrategyExecutionChips.styles.ts | 0 .../FeatureStrategyExecutionChips.tsx | 0 .../DefaultStrategy/DefaultStrategy.tsx | 0 .../FlexibleStrategy/FlexibleStrategy.tsx | 0 .../GeneralStrategy/GeneralStrategy.styles.ts | 0 .../GeneralStrategy/GeneralStrategy.tsx | 0 .../common/RolloutSlider/RolloutSlider.tsx | 0 .../StrategyConstraintInputField.jsx | 10 +- .../StrategyConstraintInputField.styles.js | 0 .../StrategyConstraintInputField/index.jsx | 0 .../StrategyConstraints.tsx | 2 +- .../StrategyInputList/StrategyInputList.tsx | 0 .../common/UserWithIdStrategy/UserWithId.tsx | 0 .../FeatureType/FeatureType.styles.ts | 0 .../FeatureType/FeatureType.tsx | 0 .../FeatureVariants/FeatureVariants.styles.ts | 0 .../FeatureVariants/FeatureVariants.tsx | 0 .../AddFeatureVariant/AddFeatureVariant.tsx | 2 +- .../OverrideConfig/OverrideConfig.jsx | 0 .../OverrideConfig/OverrideConfig.styles.js | 0 .../AddFeatureVariant/enums.ts} | 0 .../FeatureVariantsList.tsx | 0 .../FeatureVariantsListItem.tsx | 8 +- .../useDeleteVariantMarkup.tsx | 0 .../FeatureVariantsList/variants.module.scss | 0 .../feature/FeatureView/FeatureView.jsx | 458 ------------ .../FeatureView/FeatureView.module.scss | 32 - .../FeatureView.styles.ts} | 0 .../FeatureView.tsx} | 22 +- .../component/feature/FeatureView/index.jsx | 41 -- .../src/component/feature/ProgressWheel.jsx | 153 ---- .../RedirectFeatureView.tsx | 39 +- .../feature/RedirectFeatureView/index.ts | 19 - .../__snapshots__/progress-test.jsx.snap | 105 --- .../feature/__tests__/progress-test.jsx | 42 -- .../feature/add-tag-dialog-component.jsx | 126 ---- .../add-tag-dialog-component.module.scss | 3 - .../feature/add-tag-dialog-container.js | 16 - .../create/CreateFeature/CreateFeature.jsx | 156 ----- .../feature/create/CreateFeature/index.jsx | 149 ---- .../feature/create/__tests__/.eslintrc | 5 - .../create/add-feature-component.module.scss | 31 - .../feature/feature-tag-component.jsx | 112 --- .../feature/feature-type-select-component.jsx | 61 -- .../feature/feature-type-select-container.jsx | 11 - .../hooks/useFeatureForm.ts | 6 +- .../component/feature/progress.module.scss | 17 - .../feature/project-select-component.jsx | 65 -- .../feature/project-select-container.jsx | 13 - .../strategy/AddStrategy/AddStrategy.jsx | 138 ---- .../AddStrategy/AddStrategy.styles.js | 17 - .../AddStrategyCard/AddStrategyCard.jsx | 28 - .../AddStrategyCard/AddStrategyCard.styles.js | 15 - .../EditStrategyModal/EditStrategyModal.jsx | 133 ---- .../EditStrategyModal/FlexibleStrategy.jsx | 118 ---- .../EditStrategyModal/default-strategy.jsx | 10 - .../EditStrategyModal/general-strategy.jsx | 154 ----- .../strategy/EditStrategyModal/input-list.jsx | 117 ---- .../EditStrategyModal/input-percentage.jsx | 104 --- .../EditStrategyModal/loading-strategy.jsx | 9 - .../EditStrategyModal/strategy-input-props.js | 12 - .../EditStrategyModal/unknown-strategy.jsx | 20 - .../user-with-id-strategy.jsx | 23 - .../strategy/StrategyCard/StrategyCard.jsx | 56 -- .../StrategyCard/StrategyCard.styles.js | 21 - .../StrategyCardContent.jsx | 65 -- .../StrategyCardContentCustom.jsx | 103 --- .../StrategyCardContentDefault.jsx | 24 - .../StrategyCardContentFlexible.jsx | 35 - .../StrategyCardContentGradRandom.jsx | 28 - .../StrategyCardContentList.jsx | 39 -- .../StrategyCardContentRollout.jsx | 33 - .../StrategyCardConstraints.jsx | 129 ---- .../StrategyCardConstraints.styles.js | 27 - .../common/StrategyCardConstraints/index.js | 9 - .../StrategyCardField/StrategyCardField.jsx | 24 - .../StrategyCardField.styles.js | 12 - .../StrategyCardList/StrategyCardList.jsx | 32 - .../StrategyCardList.styles.js | 13 - .../StrageyCardPercentage.jsx | 25 - .../StrategyCardPercentage.styles.js | 11 - .../StrategyCardHeader/StrategyCardHeader.jsx | 112 --- .../StrategyCardHeader.styles.js | 30 - .../feature/strategy/StrategyCard/index.jsx | 58 -- .../StrategyConstraintInput.jsx | 103 --- .../StrategyConstraintInput/index.jsx | 13 - .../feature/strategy/strategies-add.jsx | 83 --- .../strategy/strategies-list-component.jsx | 250 ------- .../strategy/strategies-list-container.jsx | 9 - .../feature/strategy/strategy.module.scss | 166 ----- .../feature/variant/AddVariant/AddVariant.jsx | 345 --------- .../OverrideConfig/OverrideConfig.jsx | 123 ---- .../OverrideConfig/OverrideConfig.styles.js | 7 - .../update-variant-component-test.jsx.snap | 653 ------------------ .../update-variant-component-test.jsx | 134 ---- .../variant/update-variant-component.jsx | 209 ------ .../variant/update-variant-container.jsx | 65 -- .../variant/variant-view-component.jsx | 71 -- .../feature/variant/variant.module.scss | 100 --- .../feature/view/__tests__/.eslintrc | 5 - .../update-strategies-component-test.jsx.snap | 27 - .../view-component-test.jsx.snap | 567 --------------- .../update-strategies-component-test.jsx | 24 - .../view/__tests__/view-component-test.jsx | 101 --- .../feature/view/metric-component.jsx | 173 ----- .../feature/view/metric-container.jsx | 32 - .../component/feature/view/metric.module.scss | 41 -- .../feature/view/status-update-component.jsx | 42 -- .../view/update-description-component.jsx | 114 --- .../update-description-component.module.scss | 3 - .../view/update-strategies-component.jsx | 28 - .../view/update-strategies-container.jsx | 19 - .../__snapshots__/routes-test.jsx.snap | 19 +- frontend/src/component/menu/routes.js | 43 +- .../api/getters/useFeatures/useFeatures.ts | 40 ++ frontend/src/page/archive/show.js | 20 - frontend/src/page/context/create.js | 11 - frontend/src/page/context/edit.js | 14 - frontend/src/page/context/index.js | 11 - frontend/src/page/features/copy.js | 2 +- frontend/src/page/features/redirect.js | 24 - frontend/src/page/features/show.js | 24 - frontend/src/utils/get-strategy-object.ts | 2 +- .../resolve-default-param-value.ts} | 0 frontend/src/utils/route-path-helpers.ts | 4 +- 233 files changed, 250 insertions(+), 7868 deletions(-) rename frontend/src/component/admin/{admin-menu.jsx => menu/AdminMenu.tsx} (97%) rename frontend/src/component/admin/users/{index.styles.js => UserAdmin.styles.ts} (100%) rename frontend/src/component/admin/users/{index.js => UsersAdmin.tsx} (84%) rename frontend/src/component/admin/users/{change-password-component.jsx => UsersList/ChangePassword/ChangePassword.tsx} (84%) rename frontend/src/component/admin/users/{del-user-component.jsx => UsersList/DeleteUser/DeleteUser.tsx} (76%) delete mode 100644 frontend/src/component/admin/users/UsersList/index.js delete mode 100644 frontend/src/component/archive/view-container.js delete mode 100644 frontend/src/component/context/Context.module.scss delete mode 100644 frontend/src/component/context/ContextList/index.jsx delete mode 100644 frontend/src/component/context/form-context-component.jsx rename frontend/src/component/feature/{create => }/CopyFeature/CopyFeature.jsx (85%) rename frontend/src/component/feature/{create => }/CopyFeature/CopyFeature.module.scss (100%) rename frontend/src/component/feature/{create => }/CopyFeature/index.jsx (82%) rename frontend/src/component/feature/CreateFeature/{CreateFeature => }/CreateFeature.tsx (84%) rename frontend/src/component/feature/{CreateFeature => }/EditFeature/EditFeature.tsx (84%) delete mode 100644 frontend/src/component/feature/FeatureCreate/FeatureCreate.styles.ts delete mode 100644 frontend/src/component/feature/FeatureCreate/FeatureCreate.tsx rename frontend/src/component/feature/{CreateFeature => }/FeatureForm/FeatureForm.styles.ts (100%) rename frontend/src/component/feature/{CreateFeature => }/FeatureForm/FeatureForm.tsx (88%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureLog/FeatureLog.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureLog/FeatureLog.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureMetrics/FeatureMetrics.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureMetrics/FeatureMetrics.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/AddTagDialog/AddTagDialog.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/AddTagDialog/AddTagDialog.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureEnvironmentMetrics/FeatureEnvironmentMetrics.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureEnvironmentMetrics/FeatureEnvironmentMetrics.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverview.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverview.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitch/FeatureOverviewEnvSwitch.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.tsx (98%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentBody/FeatureOverviewEnvironmentBody.tsx (95%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentFooter/FeatureOverviewEnvironmentFooter.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentMetrics/FeatureOverviewEnvironmentMetrics.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentMetrics/FeatureOverviewEnvironmentMetrics.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategies.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategy/FeatureOverviewEnvironmentStrategy.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategy/FeatureOverviewEnvironmentStrategy.tsx (95%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironments.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetaData.tsx (98%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetadata.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewTags/FeatureOverviewTags.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewTags/FeatureOverviewTags.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureOverview/StaleDialog/StaleDialog.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureSeenApplications/FeatureSeenApplications.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureSeenApplications/FeatureSeenApplications.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureSettings/FeatureSettings.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureSettings/FeatureSettings.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureSettings/FeatureSettingsMetadata/FeatureSettingsMetadata.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureSettings/FeatureSettingsMetadata/FeatureTypeSelect/FeatureTypeSelect.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureSettings/FeatureSettingsProject/FeatureProjectSelect/FeatureProjectSelect.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureSettings/FeatureSettingsProject/FeatureSettingsProject.tsx (98%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureSettings/FeatureSettingsProject/FeatureSettingsProjectConfirm/FeatureSettingsProjectConfirm.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureSettings/FeatureSettingsProject/FeatureSettingsProjectConfirm/FeatureSettingsProjectConfirm.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStatus/FeatureStatus.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStatus/FeatureStatus.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategies.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategies.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecution.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecution.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecutionSeparator/FeatureEnvironmentStrategyExecutionSeparator.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecutionSeparator/FeatureEnvironmentStrategyExecutionSeparator.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecutionWrapper/FeatureEnvironmentStrategyExecutionWrapper.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesConfigure/FeatureStrategiesConfigure.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesConfigure/FeatureStrategiesConfigure.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesCreateHeader/FeatureStrategiesCreateHeader.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesCreateHeader/FeatureStrategiesCreateHeader.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/FeatureStrategiesEnvironmentList.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/FeatureStrategiesEnvironmentList.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDeleteStrategyMarkup.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDropboxMarkup.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useFeatureStrategiesEnvironmentList.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useProductionGuardMarkup.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironments.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironments.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesProductionGuard/FeatureStrategiesProductionGuard.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesRefresh/FeatureStrategiesRefresh.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesRefresh/FeatureStrategiesRefresh.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesSeparator/FeatureStrategiesSeparator.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategyEditable/FeatureStrategyEditable.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategyEditable/FeatureStrategyEditable.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesList/FeatureStrategiesList.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesList/FeatureStrategiesList.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesList/FeatureStrategyCard/FeatureStrategyCard.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesList/FeatureStrategyCard/FeatureStrategyCard.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategiesUIProvider.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordion.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordion.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordionBody/FeatureStrategyAccordionBody.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordionBody/FeatureStrategyAccordionBody.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecution.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecution.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecutionChips/FeatureStrategyExecutionChips.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecutionChips/FeatureStrategyExecutionChips.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/common/DefaultStrategy/DefaultStrategy.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/common/FlexibleStrategy/FlexibleStrategy.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/common/GeneralStrategy/GeneralStrategy.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/common/GeneralStrategy/GeneralStrategy.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/common/RolloutSlider/RolloutSlider.tsx (100%) rename frontend/src/component/feature/{strategy/StrategyConstraint => FeatureView/FeatureStrategies/common/StrategyConstraints}/StrategyConstraintInputField/StrategyConstraintInputField.jsx (94%) rename frontend/src/component/feature/{strategy/StrategyConstraint => FeatureView/FeatureStrategies/common/StrategyConstraints}/StrategyConstraintInputField/StrategyConstraintInputField.styles.js (100%) rename frontend/src/component/feature/{strategy/StrategyConstraint => FeatureView/FeatureStrategies/common/StrategyConstraints}/StrategyConstraintInputField/index.jsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/common/StrategyConstraints/StrategyConstraints.tsx (97%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/common/StrategyInputList/StrategyInputList.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureStrategies/common/UserWithIdStrategy/UserWithId.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureType/FeatureType.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureType/FeatureType.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureVariants/FeatureVariants.styles.ts (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureVariants/FeatureVariants.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureVariants/FeatureVariantsList/AddFeatureVariant/AddFeatureVariant.tsx (99%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureVariants/FeatureVariantsList/AddFeatureVariant/OverrideConfig/OverrideConfig.jsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureVariants/FeatureVariantsList/AddFeatureVariant/OverrideConfig/OverrideConfig.styles.js (100%) rename frontend/src/component/feature/{variant/enums.js => FeatureView/FeatureVariants/FeatureVariantsList/AddFeatureVariant/enums.ts} (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureVariants/FeatureVariantsList/FeatureVariantsList.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureVariants/FeatureVariantsList/FeatureVariantsListItem/FeatureVariantsListItem.tsx (93%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureVariants/FeatureVariantsList/FeatureVariantsListItem/useDeleteVariantMarkup.tsx (100%) rename frontend/src/component/feature/{FeatureView2 => FeatureView}/FeatureVariants/FeatureVariantsList/variants.module.scss (100%) delete mode 100644 frontend/src/component/feature/FeatureView/FeatureView.jsx delete mode 100644 frontend/src/component/feature/FeatureView/FeatureView.module.scss rename frontend/src/component/feature/{FeatureView2/FeatureView2.styles.ts => FeatureView/FeatureView.styles.ts} (100%) rename frontend/src/component/feature/{FeatureView2/FeatureView2.tsx => FeatureView/FeatureView.tsx} (93%) delete mode 100644 frontend/src/component/feature/FeatureView/index.jsx delete mode 100644 frontend/src/component/feature/ProgressWheel.jsx delete mode 100644 frontend/src/component/feature/RedirectFeatureView/index.ts delete mode 100644 frontend/src/component/feature/__tests__/__snapshots__/progress-test.jsx.snap delete mode 100644 frontend/src/component/feature/__tests__/progress-test.jsx delete mode 100644 frontend/src/component/feature/add-tag-dialog-component.jsx delete mode 100644 frontend/src/component/feature/add-tag-dialog-component.module.scss delete mode 100644 frontend/src/component/feature/add-tag-dialog-container.js delete mode 100644 frontend/src/component/feature/create/CreateFeature/CreateFeature.jsx delete mode 100644 frontend/src/component/feature/create/CreateFeature/index.jsx delete mode 100644 frontend/src/component/feature/create/__tests__/.eslintrc delete mode 100644 frontend/src/component/feature/create/add-feature-component.module.scss delete mode 100644 frontend/src/component/feature/feature-tag-component.jsx delete mode 100644 frontend/src/component/feature/feature-type-select-component.jsx delete mode 100644 frontend/src/component/feature/feature-type-select-container.jsx rename frontend/src/component/feature/{CreateFeature => }/hooks/useFeatureForm.ts (92%) delete mode 100644 frontend/src/component/feature/progress.module.scss delete mode 100644 frontend/src/component/feature/project-select-component.jsx delete mode 100644 frontend/src/component/feature/project-select-container.jsx delete mode 100644 frontend/src/component/feature/strategy/AddStrategy/AddStrategy.jsx delete mode 100644 frontend/src/component/feature/strategy/AddStrategy/AddStrategy.styles.js delete mode 100644 frontend/src/component/feature/strategy/AddStrategy/AddStrategyCard/AddStrategyCard.jsx delete mode 100644 frontend/src/component/feature/strategy/AddStrategy/AddStrategyCard/AddStrategyCard.styles.js delete mode 100644 frontend/src/component/feature/strategy/EditStrategyModal/EditStrategyModal.jsx delete mode 100644 frontend/src/component/feature/strategy/EditStrategyModal/FlexibleStrategy.jsx delete mode 100644 frontend/src/component/feature/strategy/EditStrategyModal/default-strategy.jsx delete mode 100644 frontend/src/component/feature/strategy/EditStrategyModal/general-strategy.jsx delete mode 100644 frontend/src/component/feature/strategy/EditStrategyModal/input-list.jsx delete mode 100644 frontend/src/component/feature/strategy/EditStrategyModal/input-percentage.jsx delete mode 100644 frontend/src/component/feature/strategy/EditStrategyModal/loading-strategy.jsx delete mode 100644 frontend/src/component/feature/strategy/EditStrategyModal/strategy-input-props.js delete mode 100644 frontend/src/component/feature/strategy/EditStrategyModal/unknown-strategy.jsx delete mode 100644 frontend/src/component/feature/strategy/EditStrategyModal/user-with-id-strategy.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCard.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCard.styles.js delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/StrategyCardContent.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/StrategyCardContentCustom/StrategyCardContentCustom.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/StrategyCardContentDefault/StrategyCardContentDefault.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/StrategyCardContentFlexible/StrategyCardContentFlexible.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/StrategyCardContentGradRandom/StrategyCardContentGradRandom.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/StrategyCardContentList/StrategyCardContentList.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/StrategyCardContentRollout/StrategyCardContentRollout.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/common/StrategyCardConstraints/StrategyCardConstraints.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/common/StrategyCardConstraints/StrategyCardConstraints.styles.js delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/common/StrategyCardConstraints/index.js delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/common/StrategyCardField/StrategyCardField.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/common/StrategyCardField/StrategyCardField.styles.js delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/common/StrategyCardList/StrategyCardList.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/common/StrategyCardList/StrategyCardList.styles.js delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/common/StrategyCardPercentage/StrageyCardPercentage.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardContent/common/StrategyCardPercentage/StrategyCardPercentage.styles.js delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardHeader/StrategyCardHeader.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/StrategyCardHeader/StrategyCardHeader.styles.js delete mode 100644 frontend/src/component/feature/strategy/StrategyCard/index.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyConstraint/StrategyConstraintInput/StrategyConstraintInput.jsx delete mode 100644 frontend/src/component/feature/strategy/StrategyConstraint/StrategyConstraintInput/index.jsx delete mode 100644 frontend/src/component/feature/strategy/strategies-add.jsx delete mode 100644 frontend/src/component/feature/strategy/strategies-list-component.jsx delete mode 100644 frontend/src/component/feature/strategy/strategies-list-container.jsx delete mode 100644 frontend/src/component/feature/strategy/strategy.module.scss delete mode 100644 frontend/src/component/feature/variant/AddVariant/AddVariant.jsx delete mode 100644 frontend/src/component/feature/variant/AddVariant/OverrideConfig/OverrideConfig.jsx delete mode 100644 frontend/src/component/feature/variant/AddVariant/OverrideConfig/OverrideConfig.styles.js delete mode 100644 frontend/src/component/feature/variant/__tests__/__snapshots__/update-variant-component-test.jsx.snap delete mode 100644 frontend/src/component/feature/variant/__tests__/update-variant-component-test.jsx delete mode 100644 frontend/src/component/feature/variant/update-variant-component.jsx delete mode 100644 frontend/src/component/feature/variant/update-variant-container.jsx delete mode 100644 frontend/src/component/feature/variant/variant-view-component.jsx delete mode 100644 frontend/src/component/feature/variant/variant.module.scss delete mode 100644 frontend/src/component/feature/view/__tests__/.eslintrc delete mode 100644 frontend/src/component/feature/view/__tests__/__snapshots__/update-strategies-component-test.jsx.snap delete mode 100644 frontend/src/component/feature/view/__tests__/__snapshots__/view-component-test.jsx.snap delete mode 100644 frontend/src/component/feature/view/__tests__/update-strategies-component-test.jsx delete mode 100644 frontend/src/component/feature/view/__tests__/view-component-test.jsx delete mode 100644 frontend/src/component/feature/view/metric-component.jsx delete mode 100644 frontend/src/component/feature/view/metric-container.jsx delete mode 100644 frontend/src/component/feature/view/metric.module.scss delete mode 100644 frontend/src/component/feature/view/status-update-component.jsx delete mode 100644 frontend/src/component/feature/view/update-description-component.jsx delete mode 100644 frontend/src/component/feature/view/update-description-component.module.scss delete mode 100644 frontend/src/component/feature/view/update-strategies-component.jsx delete mode 100644 frontend/src/component/feature/view/update-strategies-container.jsx create mode 100644 frontend/src/hooks/api/getters/useFeatures/useFeatures.ts delete mode 100644 frontend/src/page/archive/show.js delete mode 100644 frontend/src/page/context/create.js delete mode 100644 frontend/src/page/context/edit.js delete mode 100644 frontend/src/page/context/index.js delete mode 100644 frontend/src/page/features/redirect.js delete mode 100644 frontend/src/page/features/show.js rename frontend/src/{component/feature/strategy/AddStrategy/utils.js => utils/resolve-default-param-value.ts} (100%) diff --git a/frontend/cypress/integration/feature-toggle/feature.spec.js b/frontend/cypress/integration/feature-toggle/feature.spec.js index 4beadf4e5a..487016af0f 100644 --- a/frontend/cypress/integration/feature-toggle/feature.spec.js +++ b/frontend/cypress/integration/feature-toggle/feature.spec.js @@ -96,7 +96,7 @@ describe('feature toggle', () => { it('Can add a gradual rollout strategy to the development environment', () => { cy.wait(500); - cy.visit(`/projects/default/features2/${featureToggleName}/strategies`); + cy.visit(`/projects/default/features/${featureToggleName}/strategies`); cy.get('[data-test=ADD_NEW_STRATEGY_ID]').click(); cy.get('[data-test=ADD_NEW_STRATEGY_CARD_BUTTON_ID-2').click(); cy.get('[data-test=ROLLOUT_SLIDER_ID') @@ -139,7 +139,7 @@ describe('feature toggle', () => { it('can update a strategy in the development environment', () => { cy.wait(500); - cy.visit(`/projects/default/features2/${featureToggleName}/strategies`); + cy.visit(`/projects/default/features/${featureToggleName}/strategies`); cy.get('[data-test=STRATEGY_ACCORDION_ID-flexibleRollout').click(); cy.get('[data-test=ROLLOUT_SLIDER_ID') @@ -186,7 +186,7 @@ describe('feature toggle', () => { it('can delete a strategy in the development environment', () => { cy.wait(500); - cy.visit(`/projects/default/features2/${featureToggleName}/strategies`); + cy.visit(`/projects/default/features/${featureToggleName}/strategies`); cy.intercept( 'DELETE', @@ -205,7 +205,7 @@ describe('feature toggle', () => { it('Can add a userid strategy to the development environment', () => { cy.wait(500); - cy.visit(`/projects/default/features2/${featureToggleName}/strategies`); + cy.visit(`/projects/default/features/${featureToggleName}/strategies`); cy.get('[data-test=ADD_NEW_STRATEGY_ID]').click(); cy.get('[data-test=ADD_NEW_STRATEGY_CARD_BUTTON_ID-3').click(); @@ -252,7 +252,7 @@ describe('feature toggle', () => { const variantName = 'my-new-variant'; const secondVariantName = 'my-second-variant'; cy.wait(500); - cy.visit(`/projects/default/features2/${featureToggleName}/variants`); + cy.visit(`/projects/default/features/${featureToggleName}/variants`); cy.intercept( 'PATCH', `/api/admin/projects/default/features/${featureToggleName}/variants`, @@ -283,7 +283,7 @@ describe('feature toggle', () => { it('Can set weight to fixed value for one of the variants', () => { cy.wait(500); - cy.visit(`/projects/default/features2/${featureToggleName}/variants`); + cy.visit(`/projects/default/features/${featureToggleName}/variants`); cy.get('[data-test=VARIANT_EDIT_BUTTON]').first().click(); cy.get('[data-test=VARIANT_NAME_INPUT]') .children() @@ -319,7 +319,7 @@ describe('feature toggle', () => { it(`can delete variant`, () => { const variantName = 'to-be-deleted'; cy.wait(500); - cy.visit(`/projects/default/features2/${featureToggleName}/variants`); + cy.visit(`/projects/default/features/${featureToggleName}/variants`); cy.get('[data-test=ADD_VARIANT_BUTTON]').click(); cy.get('[data-test=VARIANT_NAME_INPUT]').type(variantName); cy.get('[data-test=DIALOGUE_CONFIRM_ID]').click(); diff --git a/frontend/src/component/Reporting/ReportToggleList/ReportToggleListItem/ReportToggleListItem.jsx b/frontend/src/component/Reporting/ReportToggleList/ReportToggleListItem/ReportToggleListItem.jsx index afaf89a606..c298d67bf7 100644 --- a/frontend/src/component/Reporting/ReportToggleList/ReportToggleListItem/ReportToggleListItem.jsx +++ b/frontend/src/component/Reporting/ReportToggleList/ReportToggleListItem/ReportToggleListItem.jsx @@ -7,7 +7,7 @@ import { Checkbox } from '@material-ui/core'; import CheckIcon from '@material-ui/icons/Check'; import ReportProblemOutlinedIcon from '@material-ui/icons/ReportProblemOutlined'; import ConditionallyRender from '../../../common/ConditionallyRender/ConditionallyRender'; -import FeatureStatus from '../../../feature/FeatureView2/FeatureStatus/FeatureStatus'; +import FeatureStatus from '../../../feature/FeatureView/FeatureStatus/FeatureStatus'; import { pluralize, diff --git a/frontend/src/component/admin/api/index.js b/frontend/src/component/admin/api/index.js index 23cad0056a..e5d8985d4a 100644 --- a/frontend/src/component/admin/api/index.js +++ b/frontend/src/component/admin/api/index.js @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import ApiTokenList from '../api-token/ApiTokenList/ApiTokenList'; -import AdminMenu from '../admin-menu'; +import AdminMenu from '../menu/AdminMenu'; import usePermissions from '../../../hooks/usePermissions'; import ConditionallyRender from '../../common/ConditionallyRender'; diff --git a/frontend/src/component/admin/auth/authentication.jsx b/frontend/src/component/admin/auth/authentication.jsx index e1233a2e73..ea7ea4f5e6 100644 --- a/frontend/src/component/admin/auth/authentication.jsx +++ b/frontend/src/component/admin/auth/authentication.jsx @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import AdminMenu from '../admin-menu'; +import AdminMenu from '../menu/AdminMenu'; import { Alert } from '@material-ui/lab'; import GoogleAuth from './google-auth-container'; import SamlAuth from './saml-auth-container'; @@ -22,7 +22,7 @@ function AdminAuthPage({ authenticationType, history }) { }, { label: 'Password', - component: + component: , }, { label: 'Google', @@ -34,34 +34,47 @@ function AdminAuthPage({ authenticationType, history }) {
- - } + } /> - - You are running the open-source version of Unleash. You have to use the Enterprise edition - in order configure Single Sign-on. + You are running the open-source version of Unleash. + You have to use the Enterprise edition in order + configure Single Sign-on. + } /> - - You are running Unleash in demo mode. You have to use the Enterprise edition - in order configure Single Sign-on. + You are running Unleash in demo mode. You have to + use the Enterprise edition in order configure Single + Sign-on. + } /> - You have decided to use custom authentication type. You have to use the Enterprise edition - in order configure Single Sign-on from the user interface. + + You have decided to use custom authentication type. + You have to use the Enterprise edition in order + configure Single Sign-on from the user interface. + } /> - Your Unleash instance is managed by the Unleash team. + + Your Unleash instance is managed by the Unleash + team. + } /> diff --git a/frontend/src/component/admin/admin-menu.jsx b/frontend/src/component/admin/menu/AdminMenu.tsx similarity index 97% rename from frontend/src/component/admin/admin-menu.jsx rename to frontend/src/component/admin/menu/AdminMenu.tsx index 8169e7e1b3..1125b3e27f 100644 --- a/frontend/src/component/admin/admin-menu.jsx +++ b/frontend/src/component/admin/menu/AdminMenu.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { NavLink } from 'react-router-dom'; import { Paper, Tabs, Tab } from '@material-ui/core'; -import useUiConfig from '../../hooks/api/getters/useUiConfig/useUiConfig'; +import useUiConfig from '../../../hooks/api/getters/useUiConfig/useUiConfig'; const navLinkStyle = { display: 'flex', diff --git a/frontend/src/component/admin/project-roles/ProjectRoles/ProjectRoles.tsx b/frontend/src/component/admin/project-roles/ProjectRoles/ProjectRoles.tsx index 432fa70cd0..143566ea2c 100644 --- a/frontend/src/component/admin/project-roles/ProjectRoles/ProjectRoles.tsx +++ b/frontend/src/component/admin/project-roles/ProjectRoles/ProjectRoles.tsx @@ -7,7 +7,7 @@ import ConditionallyRender from '../../../common/ConditionallyRender'; import HeaderTitle from '../../../common/HeaderTitle'; import PageContent from '../../../common/PageContent'; import { ADMIN } from '../../../providers/AccessProvider/permissions'; -import AdminMenu from '../../admin-menu'; +import AdminMenu from '../../menu/AdminMenu'; import { useStyles } from './ProjectRoles.styles'; import ProjectRoleList from './ProjectRoleList/ProjectRoleList'; diff --git a/frontend/src/component/admin/users/index.styles.js b/frontend/src/component/admin/users/UserAdmin.styles.ts similarity index 100% rename from frontend/src/component/admin/users/index.styles.js rename to frontend/src/component/admin/users/UserAdmin.styles.ts diff --git a/frontend/src/component/admin/users/index.js b/frontend/src/component/admin/users/UsersAdmin.tsx similarity index 84% rename from frontend/src/component/admin/users/index.js rename to frontend/src/component/admin/users/UsersAdmin.tsx index 36c003fe47..de57980a09 100644 --- a/frontend/src/component/admin/users/index.js +++ b/frontend/src/component/admin/users/UsersAdmin.tsx @@ -1,14 +1,14 @@ import { useContext } from 'react'; import UsersList from './UsersList/UsersList'; -import AdminMenu from '../admin-menu'; -import PageContent from '../../../component/common/PageContent/PageContent'; +import AdminMenu from '../menu/AdminMenu'; +import PageContent from '../../common/PageContent/PageContent'; import AccessContext from '../../../contexts/AccessContext'; -import ConditionallyRender from '../../../component/common/ConditionallyRender'; -import { ADMIN } from '../../../component/providers/AccessProvider/permissions'; +import ConditionallyRender from '../../common/ConditionallyRender'; +import { ADMIN } from '../../providers/AccessProvider/permissions'; import { Alert } from '@material-ui/lab'; -import HeaderTitle from '../../../component/common/HeaderTitle'; +import HeaderTitle from '../../common/HeaderTitle'; import { Button } from '@material-ui/core'; -import { useStyles } from './index.styles'; +import { useStyles } from './UserAdmin.styles'; import { useHistory } from 'react-router-dom'; const UsersAdmin = () => { diff --git a/frontend/src/component/admin/users/change-password-component.jsx b/frontend/src/component/admin/users/UsersList/ChangePassword/ChangePassword.tsx similarity index 84% rename from frontend/src/component/admin/users/change-password-component.jsx rename to frontend/src/component/admin/users/UsersList/ChangePassword/ChangePassword.tsx index cb040e043b..976a6ec8d2 100644 --- a/frontend/src/component/admin/users/change-password-component.jsx +++ b/frontend/src/component/admin/users/UsersList/ChangePassword/ChangePassword.tsx @@ -1,22 +1,29 @@ import { useState } from 'react'; -import PropTypes from 'prop-types'; import classnames from 'classnames'; import { TextField, Typography, Avatar } from '@material-ui/core'; -import { trim } from '../../common/util'; -import { modalStyles } from './util'; -import Dialogue from '../../common/Dialogue/Dialogue'; -import PasswordChecker from '../../user/common/ResetPasswordForm/PasswordChecker/PasswordChecker'; -import { useCommonStyles } from '../../../common.styles'; -import PasswordMatcher from '../../user/common/ResetPasswordForm/PasswordMatcher/PasswordMatcher'; -import ConditionallyRender from '../../common/ConditionallyRender'; +import { trim } from '../../../../common/util'; +import { modalStyles } from '../../util'; +import Dialogue from '../../../../common/Dialogue/Dialogue'; +import PasswordChecker from '../../../../user/common/ResetPasswordForm/PasswordChecker/PasswordChecker'; +import { useCommonStyles } from '../../../../../common.styles'; +import PasswordMatcher from '../../../../user/common/ResetPasswordForm/PasswordMatcher/PasswordMatcher'; +import ConditionallyRender from '../../../../common/ConditionallyRender'; import { Alert } from '@material-ui/lab'; +import { IUser } from '../../../../../interfaces/user'; -function ChangePassword({ +interface IChangePasswordProps { + showDialog: () => void; + closeDialog: () => void; + changePassword: () => void; + user: IUser; +} + +const ChangePassword = ({ showDialog, closeDialog, changePassword, user = {}, -}) { +}: IChangePasswordProps) => { const [data, setData] = useState({}); const [error, setError] = useState({}); const [validPassword, setValidPassword] = useState(false); @@ -137,14 +144,6 @@ function ChangePassword({ ); -} - -ChangePassword.propTypes = { - showDialog: PropTypes.bool.isRequired, - closeDialog: PropTypes.func.isRequired, - changePassword: PropTypes.func.isRequired, - validatePassword: PropTypes.func.isRequired, - user: PropTypes.object, }; export default ChangePassword; diff --git a/frontend/src/component/admin/users/del-user-component.jsx b/frontend/src/component/admin/users/UsersList/DeleteUser/DeleteUser.tsx similarity index 76% rename from frontend/src/component/admin/users/del-user-component.jsx rename to frontend/src/component/admin/users/UsersList/DeleteUser/DeleteUser.tsx index 24001f34d2..03d1e1799f 100644 --- a/frontend/src/component/admin/users/del-user-component.jsx +++ b/frontend/src/component/admin/users/UsersList/DeleteUser/DeleteUser.tsx @@ -1,21 +1,30 @@ import React from 'react'; -import Dialogue from '../../common/Dialogue/Dialogue'; -import ConditionallyRender from '../../common/ConditionallyRender/ConditionallyRender'; -import propTypes from 'prop-types'; -import { REMOVE_USER_ERROR } from '../../../hooks/api/actions/useAdminUsersApi/useAdminUsersApi'; +import Dialogue from '../../../../common/Dialogue/Dialogue'; +import ConditionallyRender from '../../../../common/ConditionallyRender/ConditionallyRender'; +import { REMOVE_USER_ERROR } from '../../../../../hooks/api/actions/useAdminUsersApi/useAdminUsersApi'; import { Alert } from '@material-ui/lab'; -import useLoading from '../../../hooks/useLoading'; +import useLoading from '../../../../../hooks/useLoading'; import { Avatar, Typography } from '@material-ui/core'; -import { useCommonStyles } from '../../../common.styles'; +import { useCommonStyles } from '../../../../../common.styles'; +import { IUser } from '../../../../../interfaces/user'; -const DelUserComponent = ({ +interface IDeleteUserProps { + showDialog: () => void; + closeDialog: () => void; + user: IUser; + userLoading: boolean; + removeUser: () => void; + userApiErrors: Object; +} + +const DeleteUser = ({ showDialog, closeDialog, user, userLoading, removeUser, userApiErrors, -}) => { +}: IDeleteUserProps) => { const ref = useLoading(userLoading); const commonStyles = useCommonStyles(); @@ -75,11 +84,4 @@ const DelUserComponent = ({ ); }; -DelUserComponent.propTypes = { - showDialog: propTypes.bool.isRequired, - closeDialog: propTypes.func.isRequired, - user: propTypes.object, - removeUser: propTypes.func.isRequired, -}; - -export default DelUserComponent; +export default DeleteUser; diff --git a/frontend/src/component/admin/users/UsersList/UsersList.tsx b/frontend/src/component/admin/users/UsersList/UsersList.tsx index d2d6f8a9cd..8205aeb5e5 100644 --- a/frontend/src/component/admin/users/UsersList/UsersList.tsx +++ b/frontend/src/component/admin/users/UsersList/UsersList.tsx @@ -7,8 +7,8 @@ import { TableHead, TableRow, } from '@material-ui/core'; -import ChangePassword from '../change-password-component'; -import DelUser from '../del-user-component'; +import ChangePassword from './ChangePassword/ChangePassword'; +import DeleteUser from './DeleteUser/DeleteUser'; import ConditionallyRender from '../../../common/ConditionallyRender/ConditionallyRender'; import AccessContext from '../../../../contexts/AccessContext'; import { ADMIN } from '../../../providers/AccessProvider/permissions'; @@ -170,7 +170,7 @@ const UsersList = () => { { - return { - location: state.settings.toJS().location || {}, - }; -}; - -const Container = connect(mapStateToProps)(UsersList); - -export default Container; diff --git a/frontend/src/component/archive/view-container.js b/frontend/src/component/archive/view-container.js deleted file mode 100644 index c08a94cb1b..0000000000 --- a/frontend/src/component/archive/view-container.js +++ /dev/null @@ -1,23 +0,0 @@ -import { connect } from 'react-redux'; -import { fetchArchive, revive } from './../../store/archive/actions'; -import ViewToggleComponent from '../feature/FeatureView/FeatureView'; -import { fetchTags } from '../../store/feature-tags/actions'; - -export default connect( - (state, props) => ({ - features: state.archive.get('list').toArray(), - featureToggle: state.archive - .get('list') - .toArray() - .find(toggle => toggle.name === props.featureToggleName), - tagTypes: state.tagTypes.toJS(), - user: state.user.toJS(), - featureTags: state.featureTags.toJS(), - activeTab: props.activeTab, - }), - { - fetchArchive, - revive, - fetchTags, - } -)(ViewToggleComponent); diff --git a/frontend/src/component/common/Constraint/Constraint.tsx b/frontend/src/component/common/Constraint/Constraint.tsx index 8b960fac12..4a89e7bc1c 100644 --- a/frontend/src/component/common/Constraint/Constraint.tsx +++ b/frontend/src/component/common/Constraint/Constraint.tsx @@ -3,7 +3,7 @@ import classnames from 'classnames'; import { useParams } from 'react-router'; import { IFeatureViewParams } from '../../../interfaces/params'; import { IConstraint } from '../../../interfaces/strategy'; -import FeatureStrategiesSeparator from '../../feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesSeparator/FeatureStrategiesSeparator'; +import FeatureStrategiesSeparator from '../../feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesSeparator/FeatureStrategiesSeparator'; import { UPDATE_FEATURE } from '../../providers/AccessProvider/permissions'; import ConditionallyRender from '../ConditionallyRender'; import PermissionIconButton from '../PermissionIconButton/PermissionIconButton'; diff --git a/frontend/src/component/common/EnvironmentStrategiesDialog/EnvironmentStrategyDialog.tsx b/frontend/src/component/common/EnvironmentStrategiesDialog/EnvironmentStrategyDialog.tsx index 0ee68cae2a..2a158ee38d 100644 --- a/frontend/src/component/common/EnvironmentStrategiesDialog/EnvironmentStrategyDialog.tsx +++ b/frontend/src/component/common/EnvironmentStrategiesDialog/EnvironmentStrategyDialog.tsx @@ -20,7 +20,7 @@ const EnvironmentStrategyDialog = ({ }: IEnvironmentStrategyDialogProps) => { const styles = useStyles(); const history = useHistory(); - const strategiesLink = `/projects/${projectId}/features2/${featureId}/strategies?environment=${environmentName}&addStrategy=true`; + const strategiesLink = `/projects/${projectId}/features/${featureId}/strategies?environment=${environmentName}&addStrategy=true`; return ( { }; export function updateWeight(variants, totalWeight) { - if (variants.length === 0){ + if (variants.length === 0) { return []; } const variantMetadata = variants.reduce( diff --git a/frontend/src/component/context/Context.module.scss b/frontend/src/component/context/Context.module.scss deleted file mode 100644 index b3a7561edb..0000000000 --- a/frontend/src/component/context/Context.module.scss +++ /dev/null @@ -1,65 +0,0 @@ -.header { - padding: var(--card-header-padding); - margin-bottom: var(--card-margin-y); - word-break: break-all; - border-bottom: var(--default-border); - display: flex; - align-items: center; - justify-content: space-between; -} - -.header h1 { - font-size: var(--h1-size); -} - -.formButtons { - padding-top: 1rem; -} - -.supporting { - font-size: var(--caption-size); - max-width: 800px; -} - -.container { - padding: var(--card-padding); -} - -.container section { - margin: 1rem 0 -} - -.h6 { - margin-top: 0; -} - -.alpha { - color: rgba(0,0,0,.54); -} - -.inset { - background-color: rgb(250, 250, 250); - padding: var(--card-padding); - max-width: 650px; -} - -.chip { - margin-right: 4px; -} - -.valueField { - width: 130px; -} - -.legalValueButton { - margin-left: 10px; -} - -.formContainer { - margin-bottom: 1.5rem; - max-width: 650px; -} - -.formContainer > *, .inset > * { - margin: 0.5rem 0; -} diff --git a/frontend/src/component/context/ContextList/ContextList.jsx b/frontend/src/component/context/ContextList/ContextList.jsx index b10447882e..c9379b0110 100644 --- a/frontend/src/component/context/ContextList/ContextList.jsx +++ b/frontend/src/component/context/ContextList/ContextList.jsx @@ -1,4 +1,3 @@ -import PropTypes from 'prop-types'; import PageContent from '../../common/PageContent/PageContent'; import HeaderTitle from '../../common/HeaderTitle'; import ConditionallyRender from '../../common/ConditionallyRender/ConditionallyRender'; @@ -27,7 +26,7 @@ import useUnleashContext from '../../../hooks/api/getters/useUnleashContext/useU import useContextsApi from '../../../hooks/api/actions/useContextsApi/useContextsApi'; import useToast from '../../../hooks/useToast'; -const ContextList = ({ removeContextField }) => { +const ContextList = () => { const { hasAccess } = useContext(AccessContext); const [showDelDialogue, setShowDelDialogue] = useState(false); const smallScreen = useMediaQuery('(max-width:700px)'); @@ -164,10 +163,4 @@ const ContextList = ({ removeContextField }) => { ); }; -ContextList.propTypes = { - contextFields: PropTypes.array.isRequired, - removeContextField: PropTypes.func.isRequired, - history: PropTypes.object.isRequired, -}; - export default ContextList; diff --git a/frontend/src/component/context/ContextList/index.jsx b/frontend/src/component/context/ContextList/index.jsx deleted file mode 100644 index 34d0e1c684..0000000000 --- a/frontend/src/component/context/ContextList/index.jsx +++ /dev/null @@ -1,22 +0,0 @@ -import { connect } from 'react-redux'; -import ContextList from './ContextList'; -import { fetchContext, removeContextField } from '../../../store/context/actions'; - -const mapStateToProps = state => { - const list = state.context.toJS(); - - return { - contextFields: list, - }; -}; - -const mapDispatchToProps = dispatch => ({ - removeContextField: contextField => { - removeContextField(contextField)(dispatch); - }, - fetchContext: () => fetchContext()(dispatch), -}); - -const ContextFieldListContainer = connect(mapStateToProps, mapDispatchToProps)(ContextList); - -export default ContextFieldListContainer; diff --git a/frontend/src/component/context/form-context-component.jsx b/frontend/src/component/context/form-context-component.jsx deleted file mode 100644 index 3616acf8d6..0000000000 --- a/frontend/src/component/context/form-context-component.jsx +++ /dev/null @@ -1,311 +0,0 @@ -import { Component } from 'react'; -import PropTypes from 'prop-types'; -import { Button, Chip, TextField, Switch, Typography } from '@material-ui/core'; -import styles from './Context.module.scss'; -import classnames from 'classnames'; -import { FormButtons, styles as commonStyles } from '../common'; -import { trim } from '../common/util'; -import PageContent from '../common/PageContent/PageContent'; -import ConditionallyRender from '../common/ConditionallyRender'; -import { Alert } from '@material-ui/lab'; -import { Add } from '@material-ui/icons'; - -const sortIgnoreCase = (a, b) => { - a = a.toLowerCase(); - b = b.toLowerCase(); - if (a === b) return 0; - if (a > b) return 1; - return -1; -}; - -class AddContextComponent extends Component { - constructor(props) { - super(props); - this.state = { - contextField: props.contextField, - errors: {}, - currentLegalValue: '', - dirty: false, - focusedLegalValue: false, - }; - } - - handleKeydown = e => { - if (e.key === 'Enter' && this.state.focusedLegalValue) { - this.addLegalValue(e); - } else if (e.key === 'Enter') { - this.onSubmit(e); - } - }; - - componentDidMount() { - window.addEventListener('keydown', this.handleKeydown); - } - - componentWillUnmount() { - window.removeEventListener('keydown', this.handleKeydown); - } - - static getDerivedStateFromProps(props, state) { - if (state.contextField.initial && !props.contextField.initial) { - return { contextField: props.contextField }; - } else { - return null; - } - } - - setValue = (field, value) => { - const { contextField } = this.state; - contextField[field] = value; - this.setState({ contextField, dirty: true }); - }; - - validateContextName = async name => { - const { errors } = this.state; - const { validateName, editMode } = this.props; - - if (editMode) return true; - - try { - await validateName(name); - errors.name = undefined; - } catch (err) { - errors.name = err.message; - } - this.setState({ errors }); - if (errors.name) return false; - return true; - }; - - onCancel = evt => { - evt.preventDefault(); - this.props.history.push('/context'); - }; - - onSubmit = async evt => { - evt.preventDefault(); - const { contextField } = this.state; - - const valid = await this.validateContextName(contextField.name); - - if (valid) { - this.props - .submit(contextField) - .then(() => this.props.history.push('/context')) - .catch(e => - this.setState(prev => ({ - ...prev, - errors: { api: e.toString() }, - })) - ); - } - }; - - updateCurrentLegalValue = evt => { - this.setState({ currentLegalValue: trim(evt.target.value) }); - }; - - addLegalValue = evt => { - evt.preventDefault(); - const { contextField, currentLegalValue, errors } = this.state; - - if (!currentLegalValue) { - return; - } - - if (contextField.legalValues.indexOf(currentLegalValue) !== -1) { - errors.currentLegalValue = 'Duplicate legal value'; - this.setState({ errors }); - return; - } - - const legalValues = contextField.legalValues.concat( - trim(currentLegalValue) - ); - contextField.legalValues = legalValues.sort(sortIgnoreCase); - this.setState({ - contextField, - currentLegalValue: '', - errors: {}, - }); - }; - - removeLegalValue = index => { - const { contextField } = this.state; - const legalValues = contextField.legalValues.filter( - (_, i) => i !== index - ); - contextField.legalValues = legalValues; - this.setState({ contextField }); - }; - - renderLegalValue = (value, index) => ( - this.removeLegalValue(index)} - label={value} - /> - ); - - render() { - const { contextField, errors } = this.state; - const { editMode } = this.props; - const submitText = editMode ? 'Update' : 'Create'; - - return ( - -
- Context fields are a basic building block used in Unleash to - control roll-out. They can be used together with strategy - constraints as part of the activation strategy evaluation. -
-
-
- - {this.state.errors.api} - - } - /> - - this.validateContextName(v.target.value) - } - onChange={v => - this.setValue('name', trim(v.target.value)) - } - /> - - this.setValue('description', v.target.value) - } - /> -
-
-
-
-
Legal values
-

- By defining the legal values the Unleash Admin UI - will validate the user input. A concrete example - would be that we know all values for our - “environment” (local, development, stage, - production). -

-
- - this.setState(prev => ({ - ...prev, - focusedLegalValue: true, - })) - } - onBlur={() => - this.setState(prev => ({ - ...prev, - focusedLegalValue: false, - })) - } - value={this.state.currentLegalValue} - error={!!errors.currentLegalValue} - helperText={errors.currentLegalValue} - variant="outlined" - size="small" - onChange={this.updateCurrentLegalValue} - /> - -
-
- {contextField.legalValues.map( - this.renderLegalValue - )} -
-
-
-
- - Custom stickiness (beta) - -

- By enabling stickiness on this context field you can - use it together with the flexible-rollout strategy. - This will guarantee a consistent behavior for - specific values of this context field. PS! Not all - client SDK's support this feature yet!{' '} - - Read more - -

- - this.setValue( - 'stickiness', - !contextField.stickiness - ) - } - /> -
-
- -
-
-
- ); - } -} - -AddContextComponent.propTypes = { - contextField: PropTypes.object.isRequired, - validateName: PropTypes.func.isRequired, - submit: PropTypes.func.isRequired, - history: PropTypes.object.isRequired, - editMode: PropTypes.bool.isRequired, -}; - -export default AddContextComponent; diff --git a/frontend/src/component/feature/create/CopyFeature/CopyFeature.jsx b/frontend/src/component/feature/CopyFeature/CopyFeature.jsx similarity index 85% rename from frontend/src/component/feature/create/CopyFeature/CopyFeature.jsx rename to frontend/src/component/feature/CopyFeature/CopyFeature.jsx index 8ac61c9759..88a119219e 100644 --- a/frontend/src/component/feature/create/CopyFeature/CopyFeature.jsx +++ b/frontend/src/component/feature/CopyFeature/CopyFeature.jsx @@ -12,16 +12,16 @@ import { } from '@material-ui/core'; import { FileCopy } from '@material-ui/icons'; -import { styles as commonStyles } from '../../../common'; +import { styles as commonStyles } from '../../common'; import styles from './CopyFeature.module.scss'; -import { trim } from '../../../common/util'; -import ConditionallyRender from '../../../common/ConditionallyRender'; +import { trim } from '../../common/util'; +import ConditionallyRender from '../../common/ConditionallyRender'; import { Alert } from '@material-ui/lab'; -import { getTogglePath } from '../../../../utils/route-path-helpers'; -import useFeatureApi from '../../../../hooks/api/actions/useFeatureApi/useFeatureApi'; -import useFeature from '../../../../hooks/api/getters/useFeature/useFeature'; -import useUiConfig from '../../../../hooks/api/getters/useUiConfig/useUiConfig'; +import { getTogglePath } from '../../../utils/route-path-helpers'; +import useFeatureApi from '../../../hooks/api/actions/useFeatureApi/useFeatureApi'; +import useFeature from '../../../hooks/api/getters/useFeature/useFeature'; +import useUiConfig from '../../../hooks/api/getters/useUiConfig/useUiConfig'; const CopyFeature = props => { // static displayName = `AddFeatureComponent-${getDisplayName(Component)}`; @@ -96,13 +96,7 @@ const CopyFeature = props => {

You are about to create a new feature toggle by cloning the configuration of feature toggle  - + {copyToggleName} . You must give the new feature toggle a unique name before diff --git a/frontend/src/component/feature/create/CopyFeature/CopyFeature.module.scss b/frontend/src/component/feature/CopyFeature/CopyFeature.module.scss similarity index 100% rename from frontend/src/component/feature/create/CopyFeature/CopyFeature.module.scss rename to frontend/src/component/feature/CopyFeature/CopyFeature.module.scss diff --git a/frontend/src/component/feature/create/CopyFeature/index.jsx b/frontend/src/component/feature/CopyFeature/index.jsx similarity index 82% rename from frontend/src/component/feature/create/CopyFeature/index.jsx rename to frontend/src/component/feature/CopyFeature/index.jsx index a1e07db14d..d54fc2b9c6 100644 --- a/frontend/src/component/feature/create/CopyFeature/index.jsx +++ b/frontend/src/component/feature/CopyFeature/index.jsx @@ -1,8 +1,6 @@ import { connect } from 'react-redux'; import CopyFeatureComponent from './CopyFeature'; -import { - validateName -} from '../../../../store/feature-toggle/actions'; +import { validateName } from '../../../store/feature-toggle/actions'; const mapStateToProps = (state, props) => ({ history: props.history, diff --git a/frontend/src/component/feature/CreateFeature/CreateFeature/CreateFeature.tsx b/frontend/src/component/feature/CreateFeature/CreateFeature.tsx similarity index 84% rename from frontend/src/component/feature/CreateFeature/CreateFeature/CreateFeature.tsx rename to frontend/src/component/feature/CreateFeature/CreateFeature.tsx index d3b7ba4dd3..a8d136dc2a 100644 --- a/frontend/src/component/feature/CreateFeature/CreateFeature/CreateFeature.tsx +++ b/frontend/src/component/feature/CreateFeature/CreateFeature.tsx @@ -1,15 +1,15 @@ -import FormTemplate from '../../../common/FormTemplate/FormTemplate'; +import FormTemplate from '../../common/FormTemplate/FormTemplate'; import { useHistory } from 'react-router-dom'; import FeatureForm from '../FeatureForm/FeatureForm'; import useFeatureForm from '../hooks/useFeatureForm'; -import useUiConfig from '../../../../hooks/api/getters/useUiConfig/useUiConfig'; -import useToast from '../../../../hooks/useToast'; -import useFeatureApi from '../../../../hooks/api/actions/useFeatureApi/useFeatureApi'; -import { CREATE_FEATURE } from '../../../providers/AccessProvider/permissions'; -import PermissionButton from '../../../common/PermissionButton/PermissionButton'; -import { CF_CREATE_BTN_ID } from '../../../../testIds'; +import useUiConfig from '../../../hooks/api/getters/useUiConfig/useUiConfig'; +import useToast from '../../../hooks/useToast'; +import useFeatureApi from '../../../hooks/api/actions/useFeatureApi/useFeatureApi'; +import { CREATE_FEATURE } from '../../providers/AccessProvider/permissions'; +import PermissionButton from '../../common/PermissionButton/PermissionButton'; +import { CF_CREATE_BTN_ID } from '../../../testIds'; import { useContext } from 'react'; -import UIContext from '../../../../contexts/UIContext'; +import UIContext from '../../../contexts/UIContext'; const CreateFeature = () => { /* @ts-ignore */ @@ -46,7 +46,7 @@ const CreateFeature = () => { const payload = getTogglePayload(); try { await createFeatureToggle(project, payload); - history.push(`/projects/${project}/features2/${name}`); + history.push(`/projects/${project}/features/${name}`); setToastData({ title: 'Toggle created successfully', text: 'Now you can start using your toggle.', diff --git a/frontend/src/component/feature/CreateFeature/EditFeature/EditFeature.tsx b/frontend/src/component/feature/EditFeature/EditFeature.tsx similarity index 84% rename from frontend/src/component/feature/CreateFeature/EditFeature/EditFeature.tsx rename to frontend/src/component/feature/EditFeature/EditFeature.tsx index 3891acf8ef..74566c8a80 100644 --- a/frontend/src/component/feature/CreateFeature/EditFeature/EditFeature.tsx +++ b/frontend/src/component/feature/EditFeature/EditFeature.tsx @@ -1,15 +1,15 @@ -import FormTemplate from '../../../common/FormTemplate/FormTemplate'; +import FormTemplate from '../../common/FormTemplate/FormTemplate'; import { useHistory, useParams } from 'react-router-dom'; import FeatureForm from '../FeatureForm/FeatureForm'; import useFeatureForm from '../hooks/useFeatureForm'; -import useUiConfig from '../../../../hooks/api/getters/useUiConfig/useUiConfig'; -import useToast from '../../../../hooks/useToast'; -import useFeatureApi from '../../../../hooks/api/actions/useFeatureApi/useFeatureApi'; -import useFeature from '../../../../hooks/api/getters/useFeature/useFeature'; -import { IFeatureViewParams } from '../../../../interfaces/params'; +import useUiConfig from '../../../hooks/api/getters/useUiConfig/useUiConfig'; +import useToast from '../../../hooks/useToast'; +import useFeatureApi from '../../../hooks/api/actions/useFeatureApi/useFeatureApi'; +import useFeature from '../../../hooks/api/getters/useFeature/useFeature'; +import { IFeatureViewParams } from '../../../interfaces/params'; import * as jsonpatch from 'fast-json-patch'; -import PermissionButton from '../../../common/PermissionButton/PermissionButton'; -import { UPDATE_FEATURE } from '../../../providers/AccessProvider/permissions'; +import PermissionButton from '../../common/PermissionButton/PermissionButton'; +import { UPDATE_FEATURE } from '../../providers/AccessProvider/permissions'; const EditFeature = () => { /* @ts-ignore */ @@ -53,7 +53,7 @@ const EditFeature = () => { const patch = createPatch(); try { await patchFeatureToggle(project, featureId, patch); - history.push(`/projects/${project}/features2/${name}`); + history.push(`/projects/${project}/features/${name}`); setToastData({ title: 'Toggle updated successfully', text: 'Now you can start using your toggle.', diff --git a/frontend/src/component/feature/FeatureCreate/FeatureCreate.styles.ts b/frontend/src/component/feature/FeatureCreate/FeatureCreate.styles.ts deleted file mode 100644 index 7174f7e034..0000000000 --- a/frontend/src/component/feature/FeatureCreate/FeatureCreate.styles.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { makeStyles } from '@material-ui/core/styles'; - -export const useStyles = makeStyles(theme => ({ - bodyContainer: { - borderRadius: '12.5px', - backgroundColor: '#fff', - padding: '2rem', - }, - formContainer: { - marginBottom: '1.5rem', - maxWidth: '350px', - }, - nameInput: { - marginRight: `1.5rem`, - minWidth: `250px` - } -})); diff --git a/frontend/src/component/feature/FeatureCreate/FeatureCreate.tsx b/frontend/src/component/feature/FeatureCreate/FeatureCreate.tsx deleted file mode 100644 index a482e37bd8..0000000000 --- a/frontend/src/component/feature/FeatureCreate/FeatureCreate.tsx +++ /dev/null @@ -1,176 +0,0 @@ -import { useEffect, useState, FormEvent } from 'react'; -import { useHistory, useParams } from 'react-router'; -import { useStyles } from './FeatureCreate.styles'; -import { IFeatureViewParams } from '../../../interfaces/params'; -import PageContent from '../../common/PageContent'; -import useFeatureApi from '../../../hooks/api/actions/useFeatureApi/useFeatureApi'; -import { CardActions } from '@material-ui/core'; -import FeatureTypeSelect from '../FeatureView2/FeatureSettings/FeatureSettingsMetadata/FeatureTypeSelect/FeatureTypeSelect'; -import { - CF_CREATE_BTN_ID, - CF_DESC_ID, - CF_NAME_ID, - CF_TYPE_ID, -} from '../../../testIds'; -import { getTogglePath } from '../../../utils/route-path-helpers'; -import { IFeatureToggleDTO } from '../../../interfaces/featureToggle'; -import { useCommonStyles } from '../../../common.styles'; -import { FormButtons } from '../../common'; -import useQueryParams from '../../../hooks/useQueryParams'; -import useUiConfig from '../../../hooks/api/getters/useUiConfig/useUiConfig'; -import Input from '../../common/Input/Input'; -import ProjectSelect from '../project-select-container'; -import { projectFilterGenerator } from '../../../utils/project-filter-generator'; -import useUser from '../../../hooks/api/getters/useUser/useUser'; -import { trim } from '../../common/util'; -import { CREATE_FEATURE } from '../../providers/AccessProvider/permissions'; - -const FeatureCreate = () => { - const styles = useStyles(); - const commonStyles = useCommonStyles(); - const { projectId } = useParams(); - const params = useQueryParams(); - const { createFeatureToggle, validateFeatureToggleName } = useFeatureApi(); - const history = useHistory(); - const [toggle, setToggle] = useState({ - name: params.get('name') || '', - description: '', - type: 'release', - stale: false, - variants: [], - project: projectId, - archived: false, - }); - - const [nameError, setNameError] = useState(''); - const { uiConfig } = useUiConfig(); - const { permissions } = useUser(); - - useEffect(() => { - window.onbeforeunload = () => - 'Data will be lost if you leave the page, are you sure?'; - - return () => { - //@ts-ignore - window.onbeforeunload = false; - }; - }, []); - - const onCancel = () => history.push(`/projects/${projectId}`); - - const validateName = async (featureToggleName: string) => { - if (featureToggleName.length > 0) { - try { - await validateFeatureToggleName(featureToggleName); - } catch (err: any) { - setNameError( - err && err.message ? err.message : 'Could not check name' - ); - } - } - }; - - const onSubmit = async (evt: FormEvent) => { - evt.preventDefault(); - - await validateName(toggle.name); - - if(!toggle.name) { - setNameError('Name is not allowed to be empty'); - return; - } - - if (nameError) { - return; - } - - try { - await createFeatureToggle(toggle.project, toggle) - history.push(getTogglePath(toggle.project, toggle.name, uiConfig.flags.E)); - // Trigger - } catch (err) { - if(err instanceof Error) { - if (err.toString().includes('not allowed to be empty')) { - setNameError('Name is not allowed to be empty'); - } - } - } - }; - - const setValue = (field: string, value: string) => { - setToggle({ ...toggle, [field]: value }); - }; - - return ( - -

- -
- validateName(v.target.value)} - onChange={v => { - setValue('name', trim(v.target.value)); - setNameError(''); - }} - /> -
-
- setValue('type', v.target.value)} - label={'Toggle type'} - id="feature-type-select" - editable - inputProps={{ - 'data-test': CF_TYPE_ID, - }} - /> -
-
- setValue('project', v.target.value)} - filter={projectFilterGenerator({ permissions }, CREATE_FEATURE)} - /> -
-
- setValue('description', v.target.value)} - /> -
- - - -
- - ); -}; - -export default FeatureCreate; diff --git a/frontend/src/component/feature/CreateFeature/FeatureForm/FeatureForm.styles.ts b/frontend/src/component/feature/FeatureForm/FeatureForm.styles.ts similarity index 100% rename from frontend/src/component/feature/CreateFeature/FeatureForm/FeatureForm.styles.ts rename to frontend/src/component/feature/FeatureForm/FeatureForm.styles.ts diff --git a/frontend/src/component/feature/CreateFeature/FeatureForm/FeatureForm.tsx b/frontend/src/component/feature/FeatureForm/FeatureForm.tsx similarity index 88% rename from frontend/src/component/feature/CreateFeature/FeatureForm/FeatureForm.tsx rename to frontend/src/component/feature/FeatureForm/FeatureForm.tsx index c605a80d75..4d690c4cb8 100644 --- a/frontend/src/component/feature/CreateFeature/FeatureForm/FeatureForm.tsx +++ b/frontend/src/component/feature/FeatureForm/FeatureForm.tsx @@ -1,16 +1,16 @@ -import { CREATE_FEATURE } from '../../../providers/AccessProvider/permissions'; -import Input from '../../../common/Input/Input'; import { Button, FormControl, Switch, Typography } from '@material-ui/core'; import { useStyles } from './FeatureForm.styles'; -import FeatureTypeSelect from '../../FeatureView2/FeatureSettings/FeatureSettingsMetadata/FeatureTypeSelect/FeatureTypeSelect'; -import { CF_DESC_ID, CF_NAME_ID, CF_TYPE_ID } from '../../../../testIds'; -import useFeatureTypes from '../../../../hooks/api/getters/useFeatureTypes/useFeatureTypes'; +import FeatureTypeSelect from '../FeatureView/FeatureSettings/FeatureSettingsMetadata/FeatureTypeSelect/FeatureTypeSelect'; +import { CF_DESC_ID, CF_NAME_ID, CF_TYPE_ID } from '../../../testIds'; +import useFeatureTypes from '../../../hooks/api/getters/useFeatureTypes/useFeatureTypes'; import { KeyboardArrowDownOutlined } from '@material-ui/icons'; -import useUser from '../../../../hooks/api/getters/useUser/useUser'; -import { projectFilterGenerator } from '../../../../utils/project-filter-generator'; -import FeatureProjectSelect from '../../FeatureView2/FeatureSettings/FeatureSettingsProject/FeatureProjectSelect/FeatureProjectSelect'; -import ConditionallyRender from '../../../common/ConditionallyRender'; -import { trim } from '../../../common/util'; +import useUser from '../../../hooks/api/getters/useUser/useUser'; +import { projectFilterGenerator } from '../../../utils/project-filter-generator'; +import FeatureProjectSelect from '../FeatureView/FeatureSettings/FeatureSettingsProject/FeatureProjectSelect/FeatureProjectSelect'; +import ConditionallyRender from '../../common/ConditionallyRender'; +import { trim } from '../../common/util'; +import Input from '../../common/Input/Input'; +import { CREATE_FEATURE } from '../../providers/AccessProvider/permissions'; interface IFeatureToggleForm { type: string; diff --git a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/FeatureToggleListItem.jsx b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/FeatureToggleListItem.jsx index a4f4723501..e157d7b9fe 100644 --- a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/FeatureToggleListItem.jsx +++ b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/FeatureToggleListItem.jsx @@ -15,8 +15,8 @@ import { styles as commonStyles } from '../../../common'; import { useStyles } from './styles'; import { getTogglePath } from '../../../../utils/route-path-helpers'; -import FeatureStatus from '../../FeatureView2/FeatureStatus/FeatureStatus'; -import FeatureType from '../../FeatureView2/FeatureType/FeatureType'; +import FeatureStatus from '../../FeatureView/FeatureStatus/FeatureStatus'; +import FeatureType from '../../FeatureView/FeatureType/FeatureType'; import useProjects from '../../../../hooks/api/getters/useProjects/useProjects'; import PermissionIconButton from '../../../common/PermissionIconButton/PermissionIconButton'; @@ -76,7 +76,7 @@ const FeatureToggleListItem = ({ condition={!isArchive} show={ { if (!ref.current?.contains(e.target)) { - history.push(getTogglePath(projectId, name, uiConfig.flags.E)); + history.push(getTogglePath(projectId, name)); } }; diff --git a/frontend/src/component/feature/FeatureView2/FeatureLog/FeatureLog.styles.ts b/frontend/src/component/feature/FeatureView/FeatureLog/FeatureLog.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureLog/FeatureLog.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureLog/FeatureLog.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureLog/FeatureLog.tsx b/frontend/src/component/feature/FeatureView/FeatureLog/FeatureLog.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureLog/FeatureLog.tsx rename to frontend/src/component/feature/FeatureView/FeatureLog/FeatureLog.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureMetrics/FeatureMetrics.styles.ts b/frontend/src/component/feature/FeatureView/FeatureMetrics/FeatureMetrics.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureMetrics/FeatureMetrics.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureMetrics/FeatureMetrics.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureMetrics/FeatureMetrics.tsx b/frontend/src/component/feature/FeatureView/FeatureMetrics/FeatureMetrics.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureMetrics/FeatureMetrics.tsx rename to frontend/src/component/feature/FeatureView/FeatureMetrics/FeatureMetrics.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/AddTagDialog/AddTagDialog.styles.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/AddTagDialog/AddTagDialog.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/AddTagDialog/AddTagDialog.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureOverview/AddTagDialog/AddTagDialog.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/AddTagDialog/AddTagDialog.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/AddTagDialog/AddTagDialog.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/AddTagDialog/AddTagDialog.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/AddTagDialog/AddTagDialog.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureEnvironmentMetrics/FeatureEnvironmentMetrics.styles.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureEnvironmentMetrics/FeatureEnvironmentMetrics.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureEnvironmentMetrics/FeatureEnvironmentMetrics.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureEnvironmentMetrics/FeatureEnvironmentMetrics.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureEnvironmentMetrics/FeatureEnvironmentMetrics.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureEnvironmentMetrics/FeatureEnvironmentMetrics.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureEnvironmentMetrics/FeatureEnvironmentMetrics.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureEnvironmentMetrics/FeatureEnvironmentMetrics.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverview.styles.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverview.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverview.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverview.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverview.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverview.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverview.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverview.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitch/FeatureOverviewEnvSwitch.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitch/FeatureOverviewEnvSwitch.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitch/FeatureOverviewEnvSwitch.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitch/FeatureOverviewEnvSwitch.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.styles.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvSwitches/FeatureOverviewEnvSwitches.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.styles.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.tsx similarity index 98% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.tsx index e4180bd634..788ba43819 100644 --- a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.tsx @@ -63,7 +63,7 @@ const FeatureOverviewEnvironment = ({ return `This environment is disabled, which means that none of your strategies are executing`; }; - const strategiesLink = `/projects/${projectId}/features2/${featureId}/strategies?environment=${featureEnvironment?.name}&addStrategy=true`; + const strategiesLink = `/projects/${projectId}/features/${featureId}/strategies?environment=${featureEnvironment?.name}&addStrategy=true`; const getStrategyIcons = () => { const strategyObjects = featureEnvironment?.strategies.reduce( diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentBody/FeatureOverviewEnvironmentBody.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentBody/FeatureOverviewEnvironmentBody.tsx similarity index 95% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentBody/FeatureOverviewEnvironmentBody.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentBody/FeatureOverviewEnvironmentBody.tsx index 21349904a2..d48d1d8396 100644 --- a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentBody/FeatureOverviewEnvironmentBody.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentBody/FeatureOverviewEnvironmentBody.tsx @@ -22,7 +22,7 @@ const FeatureOverviewEnvironmentBody = ({ const styles = useStyles(); const history = useHistory(); const { hasAccess } = useContext(AccessContext); - const strategiesLink = `/projects/${projectId}/features2/${featureId}/strategies?environment=${featureEnvironment?.name}&addStrategy=true`; + const strategiesLink = `/projects/${projectId}/features/${featureId}/strategies?environment=${featureEnvironment?.name}`; if (!featureEnvironment) return null; diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentFooter/FeatureOverviewEnvironmentFooter.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentFooter/FeatureOverviewEnvironmentFooter.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentFooter/FeatureOverviewEnvironmentFooter.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentFooter/FeatureOverviewEnvironmentFooter.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentMetrics/FeatureOverviewEnvironmentMetrics.styles.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentMetrics/FeatureOverviewEnvironmentMetrics.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentMetrics/FeatureOverviewEnvironmentMetrics.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentMetrics/FeatureOverviewEnvironmentMetrics.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentMetrics/FeatureOverviewEnvironmentMetrics.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentMetrics/FeatureOverviewEnvironmentMetrics.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentMetrics/FeatureOverviewEnvironmentMetrics.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentMetrics/FeatureOverviewEnvironmentMetrics.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategies.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategies.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategies.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategies.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategy/FeatureOverviewEnvironmentStrategy.styles.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategy/FeatureOverviewEnvironmentStrategy.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategy/FeatureOverviewEnvironmentStrategy.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategy/FeatureOverviewEnvironmentStrategy.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategy/FeatureOverviewEnvironmentStrategy.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategy/FeatureOverviewEnvironmentStrategy.tsx similarity index 95% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategy/FeatureOverviewEnvironmentStrategy.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategy/FeatureOverviewEnvironmentStrategy.tsx index 1ca444e3ca..beda59ba22 100644 --- a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategy/FeatureOverviewEnvironmentStrategy.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironmentStrategies/FeatureOverviewEnvironmentStrategy/FeatureOverviewEnvironmentStrategy.tsx @@ -40,7 +40,7 @@ const FeatureOverviewEnvironmentStrategy = ({ environmentId={environmentName} projectId={projectId} component={Link} - to={`/projects/${projectId}/features2/${featureId}/strategies?environment=${environmentName}`} + to={`/projects/${projectId}/features/${featureId}/strategies?environment=${environmentName}`} > diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironments.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironments.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironments.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironments.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetaData.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetaData.tsx similarity index 98% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetaData.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetaData.tsx index 0d18b9b8a3..f493ffdb31 100644 --- a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetaData.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetaData.tsx @@ -49,7 +49,7 @@ const FeatureOverviewMetaData = () => { projectId={projectId} permission={UPDATE_FEATURE} component={Link} - to={`/projects/${projectId}/features2/${featureId}/settings`} + to={`/projects/${projectId}/features/${featureId}/settings`} > @@ -64,7 +64,7 @@ const FeatureOverviewMetaData = () => { projectId={projectId} permission={UPDATE_FEATURE} component={Link} - to={`/projects/${projectId}/features2/${featureId}/settings`} + to={`/projects/${projectId}/features/${featureId}/settings`} > diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetadata.styles.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetadata.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetadata.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetadata.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewTags/FeatureOverviewTags.styles.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewTags/FeatureOverviewTags.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewTags/FeatureOverviewTags.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewTags/FeatureOverviewTags.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewTags/FeatureOverviewTags.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewTags/FeatureOverviewTags.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewTags/FeatureOverviewTags.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewTags/FeatureOverviewTags.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureOverview/StaleDialog/StaleDialog.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/StaleDialog/StaleDialog.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureOverview/StaleDialog/StaleDialog.tsx rename to frontend/src/component/feature/FeatureView/FeatureOverview/StaleDialog/StaleDialog.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureSeenApplications/FeatureSeenApplications.styles.ts b/frontend/src/component/feature/FeatureView/FeatureSeenApplications/FeatureSeenApplications.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureSeenApplications/FeatureSeenApplications.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureSeenApplications/FeatureSeenApplications.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureSeenApplications/FeatureSeenApplications.tsx b/frontend/src/component/feature/FeatureView/FeatureSeenApplications/FeatureSeenApplications.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureSeenApplications/FeatureSeenApplications.tsx rename to frontend/src/component/feature/FeatureView/FeatureSeenApplications/FeatureSeenApplications.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettings.styles.ts b/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettings.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettings.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettings.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettings.tsx b/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettings.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettings.tsx rename to frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettings.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettingsMetadata/FeatureSettingsMetadata.tsx b/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsMetadata/FeatureSettingsMetadata.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettingsMetadata/FeatureSettingsMetadata.tsx rename to frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsMetadata/FeatureSettingsMetadata.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettingsMetadata/FeatureTypeSelect/FeatureTypeSelect.tsx b/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsMetadata/FeatureTypeSelect/FeatureTypeSelect.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettingsMetadata/FeatureTypeSelect/FeatureTypeSelect.tsx rename to frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsMetadata/FeatureTypeSelect/FeatureTypeSelect.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettingsProject/FeatureProjectSelect/FeatureProjectSelect.tsx b/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureProjectSelect/FeatureProjectSelect.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettingsProject/FeatureProjectSelect/FeatureProjectSelect.tsx rename to frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureProjectSelect/FeatureProjectSelect.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettingsProject/FeatureSettingsProject.tsx b/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureSettingsProject.tsx similarity index 98% rename from frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettingsProject/FeatureSettingsProject.tsx rename to frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureSettingsProject.tsx index c3fa5dd4f9..f12cb4e1c1 100644 --- a/frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettingsProject/FeatureSettingsProject.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureSettingsProject.tsx @@ -59,7 +59,7 @@ const FeatureSettingsProject = () => { setDirty(false); setShowConfirmDialog(false); history.replace( - `/projects/${newProject}/features2/${featureId}/settings` + `/projects/${newProject}/features/${featureId}/settings` ); } catch (e) { setToastApiError(e.message); diff --git a/frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettingsProject/FeatureSettingsProjectConfirm/FeatureSettingsProjectConfirm.styles.ts b/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureSettingsProjectConfirm/FeatureSettingsProjectConfirm.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettingsProject/FeatureSettingsProjectConfirm/FeatureSettingsProjectConfirm.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureSettingsProjectConfirm/FeatureSettingsProjectConfirm.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettingsProject/FeatureSettingsProjectConfirm/FeatureSettingsProjectConfirm.tsx b/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureSettingsProjectConfirm/FeatureSettingsProjectConfirm.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureSettings/FeatureSettingsProject/FeatureSettingsProjectConfirm/FeatureSettingsProjectConfirm.tsx rename to frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureSettingsProjectConfirm/FeatureSettingsProjectConfirm.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStatus/FeatureStatus.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStatus/FeatureStatus.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStatus/FeatureStatus.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStatus/FeatureStatus.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStatus/FeatureStatus.tsx b/frontend/src/component/feature/FeatureView/FeatureStatus/FeatureStatus.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStatus/FeatureStatus.tsx rename to frontend/src/component/feature/FeatureView/FeatureStatus/FeatureStatus.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategies.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategies.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategies.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategies.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategies.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategies.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategies.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategies.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecution.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecution.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecution.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecution.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecution.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecution.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecution.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecution.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecutionSeparator/FeatureEnvironmentStrategyExecutionSeparator.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecutionSeparator/FeatureEnvironmentStrategyExecutionSeparator.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecutionSeparator/FeatureEnvironmentStrategyExecutionSeparator.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecutionSeparator/FeatureEnvironmentStrategyExecutionSeparator.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecutionSeparator/FeatureEnvironmentStrategyExecutionSeparator.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecutionSeparator/FeatureEnvironmentStrategyExecutionSeparator.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecutionSeparator/FeatureEnvironmentStrategyExecutionSeparator.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecutionSeparator/FeatureEnvironmentStrategyExecutionSeparator.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecutionWrapper/FeatureEnvironmentStrategyExecutionWrapper.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecutionWrapper/FeatureEnvironmentStrategyExecutionWrapper.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecutionWrapper/FeatureEnvironmentStrategyExecutionWrapper.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureEnvironmentStrategyExecution/FeatureEnvironmentStrategyExecutionWrapper/FeatureEnvironmentStrategyExecutionWrapper.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesConfigure/FeatureStrategiesConfigure.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesConfigure/FeatureStrategiesConfigure.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesConfigure/FeatureStrategiesConfigure.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesConfigure/FeatureStrategiesConfigure.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesConfigure/FeatureStrategiesConfigure.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesConfigure/FeatureStrategiesConfigure.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesConfigure/FeatureStrategiesConfigure.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesConfigure/FeatureStrategiesConfigure.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesCreateHeader/FeatureStrategiesCreateHeader.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesCreateHeader/FeatureStrategiesCreateHeader.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesCreateHeader/FeatureStrategiesCreateHeader.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesCreateHeader/FeatureStrategiesCreateHeader.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesCreateHeader/FeatureStrategiesCreateHeader.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesCreateHeader/FeatureStrategiesCreateHeader.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesCreateHeader/FeatureStrategiesCreateHeader.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesCreateHeader/FeatureStrategiesCreateHeader.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/FeatureStrategiesEnvironmentList.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/FeatureStrategiesEnvironmentList.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/FeatureStrategiesEnvironmentList.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/FeatureStrategiesEnvironmentList.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/FeatureStrategiesEnvironmentList.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/FeatureStrategiesEnvironmentList.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/FeatureStrategiesEnvironmentList.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/FeatureStrategiesEnvironmentList.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDeleteStrategyMarkup.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDeleteStrategyMarkup.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDeleteStrategyMarkup.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDeleteStrategyMarkup.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDropboxMarkup.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDropboxMarkup.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDropboxMarkup.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useDropboxMarkup.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useFeatureStrategiesEnvironmentList.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useFeatureStrategiesEnvironmentList.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useFeatureStrategiesEnvironmentList.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useFeatureStrategiesEnvironmentList.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useProductionGuardMarkup.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useProductionGuardMarkup.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useProductionGuardMarkup.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironmentList/useProductionGuardMarkup.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironments.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironments.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironments.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironments.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironments.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironments.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironments.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesEnvironments.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesProductionGuard/FeatureStrategiesProductionGuard.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesProductionGuard/FeatureStrategiesProductionGuard.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesProductionGuard/FeatureStrategiesProductionGuard.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesProductionGuard/FeatureStrategiesProductionGuard.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesRefresh/FeatureStrategiesRefresh.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesRefresh/FeatureStrategiesRefresh.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesRefresh/FeatureStrategiesRefresh.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesRefresh/FeatureStrategiesRefresh.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesRefresh/FeatureStrategiesRefresh.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesRefresh/FeatureStrategiesRefresh.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesRefresh/FeatureStrategiesRefresh.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesRefresh/FeatureStrategiesRefresh.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesSeparator/FeatureStrategiesSeparator.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesSeparator/FeatureStrategiesSeparator.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesSeparator/FeatureStrategiesSeparator.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategiesSeparator/FeatureStrategiesSeparator.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategyEditable/FeatureStrategyEditable.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategyEditable/FeatureStrategyEditable.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategyEditable/FeatureStrategyEditable.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategyEditable/FeatureStrategyEditable.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategyEditable/FeatureStrategyEditable.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategyEditable/FeatureStrategyEditable.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategyEditable/FeatureStrategyEditable.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesEnvironments/FeatureStrategyEditable/FeatureStrategyEditable.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesList/FeatureStrategiesList.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesList/FeatureStrategiesList.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesList/FeatureStrategiesList.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesList/FeatureStrategiesList.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesList/FeatureStrategiesList.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesList/FeatureStrategiesList.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesList/FeatureStrategiesList.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesList/FeatureStrategiesList.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesList/FeatureStrategyCard/FeatureStrategyCard.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesList/FeatureStrategyCard/FeatureStrategyCard.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesList/FeatureStrategyCard/FeatureStrategyCard.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesList/FeatureStrategyCard/FeatureStrategyCard.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesList/FeatureStrategyCard/FeatureStrategyCard.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesList/FeatureStrategyCard/FeatureStrategyCard.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesList/FeatureStrategyCard/FeatureStrategyCard.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesList/FeatureStrategyCard/FeatureStrategyCard.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesUIProvider.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesUIProvider.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategiesUIProvider.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategiesUIProvider.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordion.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordion.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordion.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordion.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordion.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordion.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordion.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordion.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordionBody/FeatureStrategyAccordionBody.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordionBody/FeatureStrategyAccordionBody.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordionBody/FeatureStrategyAccordionBody.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordionBody/FeatureStrategyAccordionBody.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordionBody/FeatureStrategyAccordionBody.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordionBody/FeatureStrategyAccordionBody.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordionBody/FeatureStrategyAccordionBody.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyAccordion/FeatureStrategyAccordionBody/FeatureStrategyAccordionBody.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecution.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecution.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecution.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecution.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecution.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecution.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecution.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecution.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecutionChips/FeatureStrategyExecutionChips.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecutionChips/FeatureStrategyExecutionChips.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecutionChips/FeatureStrategyExecutionChips.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecutionChips/FeatureStrategyExecutionChips.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecutionChips/FeatureStrategyExecutionChips.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecutionChips/FeatureStrategyExecutionChips.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecutionChips/FeatureStrategyExecutionChips.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/FeatureStrategyExecution/FeatureStrategyExecutionChips/FeatureStrategyExecutionChips.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/common/DefaultStrategy/DefaultStrategy.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/common/DefaultStrategy/DefaultStrategy.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/common/DefaultStrategy/DefaultStrategy.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/common/DefaultStrategy/DefaultStrategy.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/common/FlexibleStrategy/FlexibleStrategy.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/common/FlexibleStrategy/FlexibleStrategy.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/common/FlexibleStrategy/FlexibleStrategy.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/common/FlexibleStrategy/FlexibleStrategy.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/common/GeneralStrategy/GeneralStrategy.styles.ts b/frontend/src/component/feature/FeatureView/FeatureStrategies/common/GeneralStrategy/GeneralStrategy.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/common/GeneralStrategy/GeneralStrategy.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureStrategies/common/GeneralStrategy/GeneralStrategy.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/common/GeneralStrategy/GeneralStrategy.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/common/GeneralStrategy/GeneralStrategy.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/common/GeneralStrategy/GeneralStrategy.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/common/GeneralStrategy/GeneralStrategy.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/common/RolloutSlider/RolloutSlider.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/common/RolloutSlider/RolloutSlider.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/common/RolloutSlider/RolloutSlider.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/common/RolloutSlider/RolloutSlider.tsx diff --git a/frontend/src/component/feature/strategy/StrategyConstraint/StrategyConstraintInputField/StrategyConstraintInputField.jsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/common/StrategyConstraints/StrategyConstraintInputField/StrategyConstraintInputField.jsx similarity index 94% rename from frontend/src/component/feature/strategy/StrategyConstraint/StrategyConstraintInputField/StrategyConstraintInputField.jsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/common/StrategyConstraints/StrategyConstraintInputField/StrategyConstraintInputField.jsx index 60c9b386f7..27200c2249 100644 --- a/frontend/src/component/feature/strategy/StrategyConstraint/StrategyConstraintInputField/StrategyConstraintInputField.jsx +++ b/frontend/src/component/feature/FeatureView/FeatureStrategies/common/StrategyConstraints/StrategyConstraintInputField/StrategyConstraintInputField.jsx @@ -4,12 +4,12 @@ import { IconButton, TextField } from '@material-ui/core'; import { Autocomplete } from '@material-ui/lab'; import { Delete } from '@material-ui/icons'; -import InputListField from '../../../../common/input-list-field'; -import ConditionallyRender from '../../../../common/ConditionallyRender/ConditionallyRender'; -import { useCommonStyles } from '../../../../../common.styles'; +import InputListField from '../../../../../../common/input-list-field'; +import ConditionallyRender from '../../../../../../common/ConditionallyRender/ConditionallyRender'; +import { useCommonStyles } from '../../../../../../../common.styles'; import { useStyles } from './StrategyConstraintInputField.styles'; -import { CONSTRAINT_AUTOCOMPLETE_ID } from '../../../../../testIds'; -import GeneralSelect from '../../../../common/GeneralSelect/GeneralSelect'; +import { CONSTRAINT_AUTOCOMPLETE_ID } from '../../../../../../../testIds'; +import GeneralSelect from '../../../../../../common/GeneralSelect/GeneralSelect'; const constraintOperators = [ { key: 'IN', label: 'IN' }, diff --git a/frontend/src/component/feature/strategy/StrategyConstraint/StrategyConstraintInputField/StrategyConstraintInputField.styles.js b/frontend/src/component/feature/FeatureView/FeatureStrategies/common/StrategyConstraints/StrategyConstraintInputField/StrategyConstraintInputField.styles.js similarity index 100% rename from frontend/src/component/feature/strategy/StrategyConstraint/StrategyConstraintInputField/StrategyConstraintInputField.styles.js rename to frontend/src/component/feature/FeatureView/FeatureStrategies/common/StrategyConstraints/StrategyConstraintInputField/StrategyConstraintInputField.styles.js diff --git a/frontend/src/component/feature/strategy/StrategyConstraint/StrategyConstraintInputField/index.jsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/common/StrategyConstraints/StrategyConstraintInputField/index.jsx similarity index 100% rename from frontend/src/component/feature/strategy/StrategyConstraint/StrategyConstraintInputField/index.jsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/common/StrategyConstraints/StrategyConstraintInputField/index.jsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/common/StrategyConstraints/StrategyConstraints.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/common/StrategyConstraints/StrategyConstraints.tsx similarity index 97% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/common/StrategyConstraints/StrategyConstraints.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/common/StrategyConstraints/StrategyConstraints.tsx index a3c1b38871..cf10e8f777 100644 --- a/frontend/src/component/feature/FeatureView2/FeatureStrategies/common/StrategyConstraints/StrategyConstraints.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureStrategies/common/StrategyConstraints/StrategyConstraints.tsx @@ -6,7 +6,7 @@ import { useCommonStyles } from '../../../../../../common.styles'; import useUiConfig from '../../../../../../hooks/api/getters/useUiConfig/useUiConfig'; import { C } from '../../../../../common/flags'; import useUnleashContext from '../../../../../../hooks/api/getters/useUnleashContext/useUnleashContext'; -import StrategyConstraintInputField from '../../../../strategy/StrategyConstraint/StrategyConstraintInputField'; +import StrategyConstraintInputField from './StrategyConstraintInputField'; import { useEffect } from 'react'; interface IStrategyConstraintProps { diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/common/StrategyInputList/StrategyInputList.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/common/StrategyInputList/StrategyInputList.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/common/StrategyInputList/StrategyInputList.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/common/StrategyInputList/StrategyInputList.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureStrategies/common/UserWithIdStrategy/UserWithId.tsx b/frontend/src/component/feature/FeatureView/FeatureStrategies/common/UserWithIdStrategy/UserWithId.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureStrategies/common/UserWithIdStrategy/UserWithId.tsx rename to frontend/src/component/feature/FeatureView/FeatureStrategies/common/UserWithIdStrategy/UserWithId.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureType/FeatureType.styles.ts b/frontend/src/component/feature/FeatureView/FeatureType/FeatureType.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureType/FeatureType.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureType/FeatureType.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureType/FeatureType.tsx b/frontend/src/component/feature/FeatureView/FeatureType/FeatureType.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureType/FeatureType.tsx rename to frontend/src/component/feature/FeatureView/FeatureType/FeatureType.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariants.styles.ts b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariants.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariants.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariants.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariants.tsx b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariants.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariants.tsx rename to frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariants.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariantsList/AddFeatureVariant/AddFeatureVariant.tsx b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/AddFeatureVariant/AddFeatureVariant.tsx similarity index 99% rename from frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariantsList/AddFeatureVariant/AddFeatureVariant.tsx rename to frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/AddFeatureVariant/AddFeatureVariant.tsx index 3f50304527..3f14534fc0 100644 --- a/frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariantsList/AddFeatureVariant/AddFeatureVariant.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/AddFeatureVariant/AddFeatureVariant.tsx @@ -11,7 +11,7 @@ import { } from '@material-ui/core'; import { Info } from '@material-ui/icons'; -import { weightTypes } from '../../../../variant/enums'; +import { weightTypes } from './enums'; import OverrideConfig from './OverrideConfig/OverrideConfig'; import ConditionallyRender from '../../../../../common/ConditionallyRender'; diff --git a/frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariantsList/AddFeatureVariant/OverrideConfig/OverrideConfig.jsx b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/AddFeatureVariant/OverrideConfig/OverrideConfig.jsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariantsList/AddFeatureVariant/OverrideConfig/OverrideConfig.jsx rename to frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/AddFeatureVariant/OverrideConfig/OverrideConfig.jsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariantsList/AddFeatureVariant/OverrideConfig/OverrideConfig.styles.js b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/AddFeatureVariant/OverrideConfig/OverrideConfig.styles.js similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariantsList/AddFeatureVariant/OverrideConfig/OverrideConfig.styles.js rename to frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/AddFeatureVariant/OverrideConfig/OverrideConfig.styles.js diff --git a/frontend/src/component/feature/variant/enums.js b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/AddFeatureVariant/enums.ts similarity index 100% rename from frontend/src/component/feature/variant/enums.js rename to frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/AddFeatureVariant/enums.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariantsList/FeatureVariantsList.tsx b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/FeatureVariantsList.tsx similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariantsList/FeatureVariantsList.tsx rename to frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/FeatureVariantsList.tsx diff --git a/frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariantsList/FeatureVariantsListItem/FeatureVariantsListItem.tsx b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/FeatureVariantsListItem/FeatureVariantsListItem.tsx similarity index 93% rename from frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariantsList/FeatureVariantsListItem/FeatureVariantsListItem.tsx rename to frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/FeatureVariantsListItem/FeatureVariantsListItem.tsx index 410d45201d..b3159ad2b0 100644 --- a/frontend/src/component/feature/FeatureView2/FeatureVariants/FeatureVariantsList/FeatureVariantsListItem/FeatureVariantsListItem.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList/FeatureVariantsListItem/FeatureVariantsListItem.tsx @@ -4,7 +4,7 @@ import { Edit, Delete } from '@material-ui/icons'; import styles from '../variants.module.scss'; import { IFeatureVariant } from '../../../../../../interfaces/featureToggle'; import ConditionallyRender from '../../../../../common/ConditionallyRender'; -import { weightTypes } from '../../../../variant/enums'; +import { weightTypes } from '../AddFeatureVariant/enums'; interface IFeatureVariantListItem { variant: IFeatureVariant; @@ -23,11 +23,7 @@ const FeatureVariantListItem = ({ return ( - - {variant.name} - + {variant.name} { - const isFeatureView = !!fetchFeatureToggles; - const [delDialog, setDelDialog] = useState(false); - const commonStyles = useCommonStyles(); - const { hasAccess } = useContext(AccessContext); - const { project } = featureToggle || {}; - const { changeFeatureProject } = useFeatureApi(); - const { setToastApiError, setToastData } = useToast(); - const archive = !Boolean(isFeatureView); - const { uiConfig } = useUiConfig(); - - useEffect(() => { - if (uiConfig.flags.E && featureToggle && featureToggle.project) { - const newTogglePAth = getTogglePath( - featureToggle.project, - featureToggleName, - true - ); - history.push(newTogglePAth); - } - }, [featureToggleName, uiConfig, featureToggle, history]); - - useEffect(() => { - scrollToTop(); - fetchTags(featureToggleName); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - useLayoutEffect(() => { - if (isFeatureView) { - fetchFeatureToggles(); - } else { - fetchArchive(); - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - const editable = isFeatureView && hasAccess(UPDATE_FEATURE, project); - - const getTabComponent = key => { - switch (key) { - case 'activation': - return ( - - ); - case 'metrics': - return ; - case 'variants': - return ( - - ); - case 'log': - return ; - default: - return null; - } - }; - - const getTabData = () => { - const path = !!isFeatureView - ? `projects/${project}/features` - : `projects/${project}/archived`; - - if (archive) { - return [ - { - label: 'Metrics', - component: getTabComponent('metrics'), - name: 'metrics', - path: `/${path}/${featureToggleName}/metrics`, - }, - { - label: 'Variants', - component: getTabComponent('variants'), - name: 'variants', - path: `/${path}/${featureToggleName}/variants`, - }, - { - label: 'Log', - component: getTabComponent('log'), - name: 'logs', - path: `/${path}/${featureToggleName}/logs`, - }, - ]; - } - return [ - { - label: 'Activation', - component: getTabComponent('activation'), - name: 'strategies', - path: `/${path}/${featureToggleName}/strategies`, - }, - { - label: 'Metrics', - component: getTabComponent('metrics'), - name: 'metrics', - path: `/${path}/${featureToggleName}/metrics`, - }, - { - label: 'Variants', - component: getTabComponent('variants'), - name: 'variants', - path: `/${path}/${featureToggleName}/variants`, - }, - { - label: 'Log', - component: getTabComponent('log'), - name: 'logs', - path: `/${path}/${featureToggleName}/logs`, - }, - ]; - }; - - if (!featureToggle) { - if (features.length === 0) { - return ; - } - return ( - - Could not find the toggle{' '} - - {featureToggleName} - - } - elseShow={featureToggleName} - /> - - ); - } - - const removeToggle = () => { - removeFeatureToggle(featureToggle.name); - history.push(`/projects/${featureToggle.project}`); - }; - const reviveToggle = () => { - revive(featureToggle.name); - history.push(`/projects/${featureToggle.project}`); - }; - const updateDescription = description => { - let feature = { ...featureToggle, description }; - if (Array.isArray(feature.strategies)) { - feature.strategies.forEach(s => { - delete s.id; - }); - } - - editFeatureToggle(feature); - }; - const updateType = evt => { - evt.preventDefault(); - const type = evt.target.value; - let feature = { ...featureToggle, type }; - if (Array.isArray(feature.strategies)) { - feature.strategies.forEach(s => { - delete s.id; - }); - } - - editFeatureToggle(feature); - }; - - const updateProject = evt => { - const { project, name } = featureToggle; - const newProjectId = evt.target.value; - - changeFeatureProject(project, name, newProjectId) - .then(() => { - fetchFeatureToggles(); - setToastData({ - title: 'Updated toggle project', - type: 'success', - text: 'Successfully updated toggle project.', - }); - }) - .catch(e => { - setToastApiError(e.toString()); - }); - }; - - const updateStale = stale => { - setStale(stale, featureToggleName); - }; - - const tabs = getTabData(); - - const findActiveTab = activeTab => - tabs.findIndex(tab => tab.name === activeTab); - - return ( - -
-
- - {featureToggle.name} - - Archived} - elseShow={} - /> -
-
- -
- -   - -
- -
-
- -
- - - - toggleFeature( - !featureToggle.enabled, - featureToggle.name - ) - } - /> - - {featureToggle.enabled - ? 'Enabled' - : 'Disabled'} - - - } - elseShow={ - <> - - - {featureToggle.enabled - ? 'Enabled' - : 'Disabled'} - - - } - /> - - - - - - - - -
- } - elseShow={ - - } - /> -
- -
- - - { - setDelDialog(false); - removeToggle(); - }} - onClose={() => setDelDialog(false)} - /> - - ); -}; - -FeatureView.propTypes = { - activeTab: PropTypes.string.isRequired, - featureToggleName: PropTypes.string.isRequired, - features: PropTypes.array.isRequired, - toggleFeature: PropTypes.func, - setStale: PropTypes.func, - removeFeatureToggle: PropTypes.func, - revive: PropTypes.func, - fetchArchive: PropTypes.func, - fetchFeatureToggles: PropTypes.func, - fetchFeatureToggle: PropTypes.func, - editFeatureToggle: PropTypes.func, - featureToggle: PropTypes.object, - history: PropTypes.object.isRequired, - fetchTags: PropTypes.func, - untagFeature: PropTypes.func, - featureTags: PropTypes.array, - tagTypes: PropTypes.array, -}; - -export default FeatureView; diff --git a/frontend/src/component/feature/FeatureView/FeatureView.module.scss b/frontend/src/component/feature/FeatureView/FeatureView.module.scss deleted file mode 100644 index 2ef31b9ab8..0000000000 --- a/frontend/src/component/feature/FeatureView/FeatureView.module.scss +++ /dev/null @@ -1,32 +0,0 @@ -.header { - display: flex; - padding: var(--card-header-padding); - justify-content: space-between; - align-items: center; - border-bottom: var(--default-border); -} - -.heading { - font-size: var(--h1-size); -} - -.featureInfoContainer { - padding: var(--card-header-padding); -} - -.selectContainer { - margin-top: 1rem; -} - -.actions { - display: flex; - justify-content: space-between; - align-items: center; - padding: var(--card-header-padding); - border-bottom: var(--default-border); - border-top: var(--default-border); -} - -.tabContentContainer { - padding: var(--card-padding); -} diff --git a/frontend/src/component/feature/FeatureView2/FeatureView2.styles.ts b/frontend/src/component/feature/FeatureView/FeatureView.styles.ts similarity index 100% rename from frontend/src/component/feature/FeatureView2/FeatureView2.styles.ts rename to frontend/src/component/feature/FeatureView/FeatureView.styles.ts diff --git a/frontend/src/component/feature/FeatureView2/FeatureView2.tsx b/frontend/src/component/feature/FeatureView/FeatureView.tsx similarity index 93% rename from frontend/src/component/feature/FeatureView2/FeatureView2.tsx rename to frontend/src/component/feature/FeatureView/FeatureView.tsx index c70a121eea..a612c964eb 100644 --- a/frontend/src/component/feature/FeatureView2/FeatureView2.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureView.tsx @@ -20,7 +20,7 @@ import FeatureMetrics from './FeatureMetrics/FeatureMetrics'; import FeatureOverview from './FeatureOverview/FeatureOverview'; import FeatureStrategies from './FeatureStrategies/FeatureStrategies'; import FeatureVariants from './FeatureVariants/FeatureVariants'; -import { useStyles } from './FeatureView2.styles'; +import { useStyles } from './FeatureView.styles'; import FeatureSettings from './FeatureSettings/FeatureSettings'; import useLoading from '../../../hooks/useLoading'; import ConditionallyRender from '../../common/ConditionallyRender'; @@ -30,7 +30,7 @@ import StaleDialog from './FeatureOverview/StaleDialog/StaleDialog'; import AddTagDialog from './FeatureOverview/AddTagDialog/AddTagDialog'; import StatusChip from '../../common/StatusChip/StatusChip'; -const FeatureView2 = () => { +const FeatureView = () => { const { projectId, featureId } = useParams(); const { feature, loading, error } = useFeature(projectId, featureId); const { refetch: projectRefetch } = useProject(projectId); @@ -47,7 +47,7 @@ const FeatureView2 = () => { const ref = useLoading(loading); const { uiConfig } = useUiConfig(); - const basePath = `/projects/${projectId}/features2/${featureId}`; + const basePath = `/projects/${projectId}/features/${featureId}`; const archiveToggle = async () => { try { @@ -157,7 +157,7 @@ const FeatureView2 = () => { tooltip="Copy" data-loading component={Link} - to={`/projects/${projectId}/features2/${featureId}/strategies/copy`} + to={`/projects/${projectId}/features/${featureId}/strategies/copy`} > @@ -204,27 +204,27 @@ const FeatureView2 = () => { { ); }; -export default FeatureView2; +export default FeatureView; diff --git a/frontend/src/component/feature/FeatureView/index.jsx b/frontend/src/component/feature/FeatureView/index.jsx deleted file mode 100644 index 880a68ad79..0000000000 --- a/frontend/src/component/feature/FeatureView/index.jsx +++ /dev/null @@ -1,41 +0,0 @@ -import { connect } from 'react-redux'; - -import { - fetchFeatureToggles, - fetchFeatureToggle, - toggleFeature, - setStale, - removeFeatureToggle, - editFeatureToggle, -} from '../../../store/feature-toggle/actions'; - -import FeatureView from './FeatureView'; -import { - fetchTags, - tagFeature, - untagFeature, -} from '../../../store/feature-tags/actions'; - -export default connect( - (state, props) => ({ - features: state.features.toJS(), - featureToggle: state.features - .toJS() - .find(toggle => toggle.name === props.featureToggleName), - featureTags: state.featureTags.toJS(), - tagTypes: state.tagTypes.toJS(), - activeTab: props.activeTab, - user: state.user.toJS(), - }), - { - fetchFeatureToggles, - fetchFeatureToggle, - toggleFeature, - setStale, - removeFeatureToggle, - editFeatureToggle, - tagFeature, - untagFeature, - fetchTags, - } -)(FeatureView); diff --git a/frontend/src/component/feature/ProgressWheel.jsx b/frontend/src/component/feature/ProgressWheel.jsx deleted file mode 100644 index 206e33a772..0000000000 --- a/frontend/src/component/feature/ProgressWheel.jsx +++ /dev/null @@ -1,153 +0,0 @@ -import { useState, useEffect, useRef } from 'react'; -import PropTypes from 'prop-types'; -import styles from './progress.module.scss'; - -const Progress = ({ - percentage, - strokeWidth = 10, - initialAnimation = false, - animatePercentageText = false, - textForPercentage, - colorClassName, - isFallback = false, -}) => { - const [localPercentage, setLocalPercentage] = useState({ - percentage: initialAnimation ? 0 : percentage, - percentageText: initialAnimation ? 0 : percentage, - }); - const timeoutId = useRef(); - const rafTimerInit = useRef(); - const rafCounterTimer = useRef(); - const nextTimer = useRef(); - - useEffect(() => { - if (initialAnimation) { - timeoutId.current = setTimeout(() => { - rafTimerInit.current = window.requestAnimationFrame(() => { - setLocalPercentage(prev => ({ ...prev, percentage })); - }); - }, 0); - } - - return () => { - clearTimeout(timeoutId.current); - clearTimeout(nextTimer); - window.cancelAnimationFrame(rafTimerInit.current); - window.cancelAnimationFrame(rafCounterTimer.current); - }; - /* eslint-disable-next-line */ - }, []); - - useEffect(() => { - if (percentage !== localPercentage) { - const nextState = { percentage }; - if (animatePercentageText) { - animateTo(percentage, getTarget(percentage)); - } else { - nextState.percentageText = percentage; - } - setLocalPercentage(prev => ({ ...prev, ...nextState })); - } - /* eslint-disable-next-line */ - }, [percentage]); - - const getTarget = target => { - const start = localPercentage.percentageText; - const TOTAL_ANIMATION_TIME = 5000; - const diff = start > target ? -(start - target) : target - start; - const perCycle = TOTAL_ANIMATION_TIME / diff; - const cyclesCounter = Math.round( - Math.abs(TOTAL_ANIMATION_TIME / perCycle) - ); - const perCycleTime = Math.round(Math.abs(perCycle)); - - return { - start, - target, - cyclesCounter, - perCycleTime, - increment: diff / cyclesCounter, - }; - }; - - const animateTo = (percentage, targetState) => { - cancelAnimationFrame(rafCounterTimer.current); - clearTimeout(nextTimer.current); - - const current = localPercentage.percentageText; - - targetState.cyclesCounter--; - if (targetState.cyclesCounter <= 0) { - setLocalPercentage({ percentageText: targetState.target }); - return; - } - - const next = Math.round(current + targetState.increment); - rafCounterTimer.current = requestAnimationFrame(() => { - setLocalPercentage({ percentageText: next }); - nextTimer.current = setTimeout(() => { - animateTo(next, targetState); - }, targetState.perCycleTime); - }); - }; - - const radius = 50 - strokeWidth / 2; - const pathDescription = ` - M 50,50 m 0,-${radius} - a ${radius},${radius} 0 1 1 0,${2 * radius} - a ${radius},${radius} 0 1 1 0,-${2 * radius} - `; - - const diameter = Math.PI * 2 * radius; - const progressStyle = { - strokeDasharray: `${diameter}px ${diameter}px`, - strokeDashoffset: `${ - ((100 - localPercentage.percentage) / 100) * diameter - }px`, - }; - - return isFallback ? ( - - { - // eslint-disable-next-line max-len - } - - - ) : ( - - - - - - - {localPercentage.percentageText}% - - - ); -}; - -Progress.propTypes = { - percentage: PropTypes.number.isRequired, - strokeWidth: PropTypes.number, - initialAnimation: PropTypes.bool, - animatePercentageText: PropTypes.bool, - textForPercentage: PropTypes.func, - colorClassName: PropTypes.string, - isFallback: PropTypes.bool, -}; - -export default Progress; diff --git a/frontend/src/component/feature/RedirectFeatureView/RedirectFeatureView.tsx b/frontend/src/component/feature/RedirectFeatureView/RedirectFeatureView.tsx index 3d97d1ae4a..c642cf0800 100644 --- a/frontend/src/component/feature/RedirectFeatureView/RedirectFeatureView.tsx +++ b/frontend/src/component/feature/RedirectFeatureView/RedirectFeatureView.tsx @@ -1,30 +1,33 @@ -import { useEffect } from 'react'; -import { Redirect } from 'react-router-dom'; +import { useEffect, useState } from 'react'; +import { Redirect, useParams } from 'react-router-dom'; +import useFeatures from '../../../hooks/api/getters/useFeatures/useFeatures'; +import { IFeatureToggle } from '../../../interfaces/featureToggle'; import { getTogglePath } from '../../../utils/route-path-helpers'; -interface IRedirectFeatureViewProps { - featureToggle: any; - features: any; - fetchFeatureToggles: () => void; - newPath: boolean; +interface IRedirectParams { + name: string; } -const RedirectFeatureView = ({ - featureToggle, - fetchFeatureToggles, - newPath = false, -}: IRedirectFeatureViewProps) => { +const RedirectFeatureView = () => { + const { name } = useParams(); + const { features } = useFeatures(); + const [featureToggle, setFeatureToggle] = useState( + null + ); + useEffect(() => { - if (!featureToggle) { - fetchFeatureToggles(); - } - /* eslint-disable-next-line */ - }, []); + const toggle = features.find( + (toggle: IFeatureToggle) => toggle.name === name + ); + + setFeatureToggle(toggle); + }, [features, name]); if (!featureToggle) return null; + return ( ); }; diff --git a/frontend/src/component/feature/RedirectFeatureView/index.ts b/frontend/src/component/feature/RedirectFeatureView/index.ts deleted file mode 100644 index d9e2b5b595..0000000000 --- a/frontend/src/component/feature/RedirectFeatureView/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { connect } from 'react-redux'; - -import { fetchFeatureToggles } from '../../../store/feature-toggle/actions'; - -import RedirectFeatureView from './RedirectFeatureView'; - -import { E } from '../../common/flags'; - -export default connect( - (state, props) => ({ - newPath: !!state.uiConfig.toJS().flags[E], - featureToggle: state.features - .toJS() - .find(toggle => toggle.name === props.featureToggleName), - }), - { - fetchFeatureToggles, - } -)(RedirectFeatureView); diff --git a/frontend/src/component/feature/__tests__/__snapshots__/progress-test.jsx.snap b/frontend/src/component/feature/__tests__/__snapshots__/progress-test.jsx.snap deleted file mode 100644 index 4ff1c90119..0000000000 --- a/frontend/src/component/feature/__tests__/__snapshots__/progress-test.jsx.snap +++ /dev/null @@ -1,105 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renders correctly with 0% done no fallback 1`] = ` - - - - - 0 - % - - -`; - -exports[`renders correctly with 0% done with fallback 1`] = ` - - - -`; - -exports[`renders correctly with 15% done no fallback 1`] = ` - - - - - 15 - % - - -`; - -exports[`renders correctly with 15% done with fallback 1`] = ` - - - -`; diff --git a/frontend/src/component/feature/__tests__/progress-test.jsx b/frontend/src/component/feature/__tests__/progress-test.jsx deleted file mode 100644 index ce22d6e886..0000000000 --- a/frontend/src/component/feature/__tests__/progress-test.jsx +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; - -import Progress from '../ProgressWheel'; -import renderer from 'react-test-renderer'; - -jest.mock('@material-ui/core'); - -test('renders correctly with 15% done no fallback', () => { - const percent = 15; - const tree = renderer.create( - - ); - - expect(tree).toMatchSnapshot(); -}); - -test('renders correctly with 0% done no fallback', () => { - const percent = 0; - const tree = renderer.create( - - ); - - expect(tree).toMatchSnapshot(); -}); - -test('renders correctly with 15% done with fallback', () => { - const percent = 15; - const tree = renderer.create( - - ); - - expect(tree).toMatchSnapshot(); -}); - -test('renders correctly with 0% done with fallback', () => { - const percent = 0; - const tree = renderer.create( - - ); - - expect(tree).toMatchSnapshot(); -}); diff --git a/frontend/src/component/feature/add-tag-dialog-component.jsx b/frontend/src/component/feature/add-tag-dialog-component.jsx deleted file mode 100644 index 19bff270b6..0000000000 --- a/frontend/src/component/feature/add-tag-dialog-component.jsx +++ /dev/null @@ -1,126 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; - -import { DialogContentText, Button, TextField } from '@material-ui/core'; -import Dialogue from '../common/Dialogue'; -import { trim } from '../common/util'; -import TagSelect from '../common/TagSelect/TagSelect'; - -import styles from './add-tag-dialog-component.module.scss'; - -class AddTagDialogComponent extends Component { - constructor(props) { - super(props); - this.state = { - openDialog: false, - errors: {}, - currentLegalValue: '', - dirty: false, - featureToggleName: props.featureToggleName, - tag: props.tag, - }; - } - - handleOpenDialog() { - this.setState({ openDialog: true }); - } - handleCancel() { - this.setState({ - openDialog: false, - tag: { type: 'simple', value: '' }, - }); - } - - setValue = (field, value) => { - const { tag } = this.state; - tag[field] = trim(value); - this.setState({ tag, dirty: true }); - }; - - onCancel = evt => { - evt.preventDefault(); - this.setState({ - openDialog: false, - tag: { type: 'simple', value: '' }, - }); - }; - onSubmit = async evt => { - evt.preventDefault(); - const { tag } = this.state; - if (!tag.type) { - tag.type = 'simple'; - } - try { - await this.props.submit(this.props.featureToggleName, tag); - this.setState({ - openDialog: false, - tag: { type: 'simple', value: '' }, - }); - } catch (e) { - this.setState({ errors: { general: e.message } }); - } - }; - render() { - const { tag, errors, openDialog } = this.state; - const formId = 'add-tag-dialog-form'; - return ( - - - - - <> - - Tags allow you to group features together - -
-
- - this.setValue('type', v.target.value) - } - /> -
- - this.setValue('value', v.target.value) - } - /> -
- {errors.general && ( -

{errors.general}

- )} -
- -
-
- ); - } -} - -AddTagDialogComponent.propTypes = { - featureToggleName: PropTypes.string.isRequired, - tag: PropTypes.object.isRequired, - submit: PropTypes.func.isRequired, -}; - -export default AddTagDialogComponent; diff --git a/frontend/src/component/feature/add-tag-dialog-component.module.scss b/frontend/src/component/feature/add-tag-dialog-component.module.scss deleted file mode 100644 index 73f0c9063a..0000000000 --- a/frontend/src/component/feature/add-tag-dialog-component.module.scss +++ /dev/null @@ -1,3 +0,0 @@ -.dialogueFormContent > * { - margin: 0.5rem 0; -} \ No newline at end of file diff --git a/frontend/src/component/feature/add-tag-dialog-container.js b/frontend/src/component/feature/add-tag-dialog-container.js deleted file mode 100644 index f99e7dd57e..0000000000 --- a/frontend/src/component/feature/add-tag-dialog-container.js +++ /dev/null @@ -1,16 +0,0 @@ -import { connect } from 'react-redux'; -import AddTagDialogComponent from './add-tag-dialog-component'; - -import { tagFeature } from '../../store/feature-tags/actions'; - -const mapStateToProps = () => ({ - tag: { type: 'simple', value: '' }, -}); - -const mapDispatchToProps = dispatch => ({ - submit: (featureToggleName, tag) => tagFeature(featureToggleName, tag)(dispatch), -}); - -const AddTagDialogContainer = connect(mapStateToProps, mapDispatchToProps)(AddTagDialogComponent); - -export default AddTagDialogContainer; diff --git a/frontend/src/component/feature/create/CreateFeature/CreateFeature.jsx b/frontend/src/component/feature/create/CreateFeature/CreateFeature.jsx deleted file mode 100644 index 967410802a..0000000000 --- a/frontend/src/component/feature/create/CreateFeature/CreateFeature.jsx +++ /dev/null @@ -1,156 +0,0 @@ -import { useEffect } from 'react'; -import { useParams } from 'react-router'; -import PropTypes from 'prop-types'; -import { CardActions, Switch, TextField } from '@material-ui/core'; -import FeatureTypeSelect from '../../feature-type-select-container'; -import ProjectSelect from '../../project-select-container'; -import StrategiesList from '../../strategy/strategies-list-container'; -import PageContent from '../../../common/PageContent/PageContent'; - -import { FormButtons, styles as commonStyles } from '../../../common'; -import { trim } from '../../../common/util'; - -import styles from '../add-feature-component.module.scss'; -import { - CF_CREATE_BTN_ID, - CF_DESC_ID, - CF_NAME_ID, - CF_TYPE_ID, -} from '../../../../testIds'; -import { CREATE_FEATURE } from '../../../providers/AccessProvider/permissions'; -import { projectFilterGenerator } from '../../../../utils/project-filter-generator'; -import { useHistory } from 'react-router-dom'; - -const CreateFeature = ({ - input, - errors, - setValue, - validateName, - onSubmit, - user, -}) => { - const { projectId } = useParams(); - - const history = useHistory(); - - useEffect(() => { - if (projectId) { - setValue('project', projectId); - } - /* eslint-disable-next-line */ - }, []); - - useEffect(() => { - window.onbeforeunload = () => - 'Data will be lost if you leave the page, are you sure?'; - - return () => { - window.onbeforeunload = false; - }; - }, []); - - const onCancel = () => history.goBack(); - - return ( - -
-
- validateName(v.target.value)} - onChange={v => setValue('name', trim(v.target.value))} - /> -
-
- setValue('type', v.target.value)} - label={'Toggle type'} - id="feature-type-select" - editable - inputProps={{ - 'data-test': CF_TYPE_ID, - }} - /> -
-
- setValue('project', v.target.value)} - filter={projectFilterGenerator(user, CREATE_FEATURE)} - /> -
-
- setValue('description', v.target.value)} - /> -
-
- { - setValue('enabled', !input.enabled); - }} - /> -

- {input.enabled ? 'Enabled' : 'Disabled'} feature toggle -

-
-
- setValue('strategies', s)} - editable - /> -
- - - -
-
- ); -}; - -CreateFeature.propTypes = { - input: PropTypes.object, - errors: PropTypes.object, - setValue: PropTypes.func.isRequired, - onSubmit: PropTypes.func.isRequired, - onCancel: PropTypes.func.isRequired, - validateName: PropTypes.func.isRequired, - initCallRequired: PropTypes.bool, - init: PropTypes.func, -}; - -export default CreateFeature; diff --git a/frontend/src/component/feature/create/CreateFeature/index.jsx b/frontend/src/component/feature/create/CreateFeature/index.jsx deleted file mode 100644 index ad6de0bd91..0000000000 --- a/frontend/src/component/feature/create/CreateFeature/index.jsx +++ /dev/null @@ -1,149 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { connect } from 'react-redux'; -import { - createFeatureToggles, - validateName, -} from '../../../../store/feature-toggle/actions'; -import CreateFeature from './CreateFeature'; -import { loadNameFromUrl, showPnpsFeedback } from '../../../common/util'; -import { showFeedback } from '../../../../store/feedback/actions'; -import { getTogglePath } from '../../../../utils/route-path-helpers'; - -const defaultStrategy = { - name: 'default', - parameters: {}, -}; - -function resolveCurrentProjectId(settings) { - if (!settings.currentProjectId) { - return 'default'; - } else if (settings.currentProjectId === '*') { - return 'default'; - } else { - return settings.currentProjectId; - } -} - -class WrapperComponent extends Component { - constructor(props) { - super(); - const name = loadNameFromUrl(); - this.state = { - featureToggle: { - name, - description: '', - type: 'release', - stale: false, - strategies: [], - variants: [], - enabled: true, - project: props.currentProjectId, - }, - errors: {}, - dirty: false, - }; - } - - setValue = (field, value) => { - const { featureToggle } = this.state; - featureToggle[field] = value; - this.setState({ featureToggle, dirty: true }); - }; - - validateName = async featureToggleName => { - if (featureToggleName.length > 0) { - const { errors } = { ...this.state }; - try { - await validateName(featureToggleName); - errors.name = undefined; - } catch (err) { - errors.name = err.message; - } - - this.setState({ errors }); - } - }; - - onSubmit = async evt => { - const { user } = this.props; - evt.preventDefault(); - const { createFeatureToggles, history, showFeedback } = this.props; - const { featureToggle } = this.state; - - const errors = Object.values(this.state.errors).filter(i => i); - - if (errors.length > 0) { - return; - } - - if (featureToggle.strategies < 1) { - featureToggle.strategies = [defaultStrategy]; - } - - try { - await createFeatureToggles(featureToggle).then(() => - history.push( - getTogglePath(featureToggle.project, featureToggle.name) - ) - ); - - if (showPnpsFeedback(user)) { - showFeedback(); - } - // Trigger - } catch (e) { - if (e.toString().includes('not allowed to be empty')) { - this.setState({ - errors: { name: 'Name is not allowed to be empty' }, - }); - } - } - }; - - onCancel = evt => { - evt.preventDefault(); - this.props.history.goBack(); - }; - - render() { - return ( - - ); - } -} -WrapperComponent.propTypes = { - history: PropTypes.object.isRequired, - createFeatureToggles: PropTypes.func.isRequired, - currentProjectId: PropTypes.string.isRequired, -}; - -const mapDispatchToProps = dispatch => ({ - validateName: name => validateName(name)(dispatch), - createFeatureToggles: featureToggle => - createFeatureToggles(featureToggle)(dispatch), - showFeedback: showFeedback(dispatch), -}); - -const mapStateToProps = state => { - const settings = state.settings.toJS().feature || {}; - const currentProjectId = resolveCurrentProjectId(settings); - - return { currentProjectId, user: state.user.toJS() }; -}; - -const FormAddContainer = connect( - mapStateToProps, - mapDispatchToProps -)(WrapperComponent); - -export default FormAddContainer; diff --git a/frontend/src/component/feature/create/__tests__/.eslintrc b/frontend/src/component/feature/create/__tests__/.eslintrc deleted file mode 100644 index eba2077219..0000000000 --- a/frontend/src/component/feature/create/__tests__/.eslintrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "env": { - "jest": true - } -} diff --git a/frontend/src/component/feature/create/add-feature-component.module.scss b/frontend/src/component/feature/create/add-feature-component.module.scss deleted file mode 100644 index efaf1e98a2..0000000000 --- a/frontend/src/component/feature/create/add-feature-component.module.scss +++ /dev/null @@ -1,31 +0,0 @@ -.header { - font-size: var(--h1-size); - padding: var(--card-header-padding); -} - -.container { - padding: var(--card-padding); -} - -.nameInput { - margin-right: 1.5rem; - min-width: 250px; -} - -.formContainer { - margin-bottom: 1.5rem; - max-width: 350px; -} - -.legalValueFormContainer { - display: flex; -} - -.toggleContainer { - display: flex; - align-items: center; -} - -.strategiesContainer { - margin: 2rem 0; -} diff --git a/frontend/src/component/feature/feature-tag-component.jsx b/frontend/src/component/feature/feature-tag-component.jsx deleted file mode 100644 index 3fe4699301..0000000000 --- a/frontend/src/component/feature/feature-tag-component.jsx +++ /dev/null @@ -1,112 +0,0 @@ -import React, { useState } from 'react'; -import PropTypes from 'prop-types'; -import { Chip } from '@material-ui/core'; -import { Label } from '@material-ui/icons'; - -import ConditionallyRender from '../common/ConditionallyRender/ConditionallyRender'; -import Dialogue from '../common/Dialogue'; - -import slackIcon from '../../assets/icons/slack.svg'; -import jiraIcon from '../../assets/icons/jira.svg'; -import webhookIcon from '../../assets/icons/webhooks.svg'; -import { formatAssetPath } from '../../utils/format-path'; - -function FeatureTagComponent({ - tags, - tagTypes, - featureToggleName, - untagFeature, -}) { - const [showDialog, setShowDialog] = useState(false); - const [selectedTag, setSelectedTag] = useState(undefined); - const onUntagFeature = tag => { - // eslint-disable-next-line no-alert - untagFeature(featureToggleName, tag); - setSelectedTag(undefined); - }; - - const tagIcon = typeName => { - let tagType = tagTypes.find(type => type.name === typeName); - - const style = { width: '20px', height: '20px', marginRight: '5px' }; - - if (tagType && tagType.icon) { - switch (tagType.name) { - case 'slack': - return ( - slack - ); - case 'jira': - return ( - jira - ); - case 'webhook': - return ( - webhook - ); - default: - return
- Read more - - - - - -`; - -exports[`renders correctly with without variants 1`] = ` -
-

- Variants allows you to return a variant object if the feature toggle is considered enabled for the current request. When using variants you should use the - - - getVariant() - - method in the Client SDK. -

-

- No variants defined. -

-
-
- -
-
-`; - -exports[`renders correctly without variants and no permissions 1`] = ` -
-

- Variants allows you to return a variant object if the feature toggle is considered enabled for the current request. When using variants you should use the - - - getVariant() - - method in the Client SDK. -

-

- No variants defined. -

-
-
- -
-
-`; diff --git a/frontend/src/component/feature/variant/__tests__/update-variant-component-test.jsx b/frontend/src/component/feature/variant/__tests__/update-variant-component-test.jsx deleted file mode 100644 index c6a4aefdcd..0000000000 --- a/frontend/src/component/feature/variant/__tests__/update-variant-component-test.jsx +++ /dev/null @@ -1,134 +0,0 @@ -import { MemoryRouter } from 'react-router-dom'; -import { ThemeProvider } from '@material-ui/core'; - -import UpdateVariant from './../update-variant-component'; -import renderer from 'react-test-renderer'; -import { weightTypes } from '../enums'; -import theme from '../../../../themes/main-theme'; -import { Provider } from 'react-redux'; -import { createStore } from 'redux'; - -jest.mock( - '../AddVariant/OverrideConfig/OverrideConfig.jsx', - () => 'OverrideConfig' -); - -const mockStore = { - uiConfig: { - toJS: () => ({ - flags: { - P: true, - }, - }), - }, -}; - -const mockReducer = state => state; - -test('renders correctly with without variants', () => { - const tree = renderer.create( - - - - - - - - ); - - expect(tree).toMatchSnapshot(); -}); - -test('renders correctly without variants and no permissions', () => { - const tree = renderer.create( - - - - - - - - ); - - expect(tree).toMatchSnapshot(); -}); - -test('renders correctly with with variants', () => { - const featureToggle = { - name: 'toggle.variants', - description: 'description', - enabled: false, - strategies: [ - { - name: 'gradualRolloutRandom', - parameters: { - percentage: 50, - }, - }, - ], - variants: [ - { - name: 'blue', - weight: 34, - overrides: [ - { - field: 'userId', - values: ['1337', '123'], - }, - ], - }, - { - name: 'yellow', - weight: 33, - }, - { - name: 'orange', - weight: 33, - weightType: weightTypes.FIX, - payload: { - type: 'string', - value: '{"color": "blue", "animated": false}', - }, - }, - ], - createdAt: '2018-02-04T20:27:52.127Z', - }; - const tree = renderer.create( - - - - - - - - ); - - expect(tree).toMatchSnapshot(); -}); diff --git a/frontend/src/component/feature/variant/update-variant-component.jsx b/frontend/src/component/feature/variant/update-variant-component.jsx deleted file mode 100644 index 9cf9777c55..0000000000 --- a/frontend/src/component/feature/variant/update-variant-component.jsx +++ /dev/null @@ -1,209 +0,0 @@ -import { Component } from 'react'; -import PropTypes from 'prop-types'; -import classnames from 'classnames'; - -import VariantViewComponent from './variant-view-component'; -import styles from './variant.module.scss'; -import { - Table, - TableHead, - TableRow, - TableCell, - TableBody, - Button, - Typography, -} from '@material-ui/core'; -import AddVariant from './AddVariant/AddVariant'; - -import ConditionallyRender from '../../common/ConditionallyRender/ConditionallyRender'; -import GeneralSelect from '../../common/GeneralSelect/GeneralSelect'; - -const initialState = { - showDialog: false, - editVariant: undefined, - editIndex: -1, -}; - -class UpdateVariantComponent extends Component { - constructor(props) { - super(props); - this.state = { ...initialState }; - } - - closeDialog = () => { - this.setState({ ...initialState }); - }; - - openAddVariant = e => { - e.preventDefault(); - this.setState({ - showDialog: true, - editVariant: undefined, - editIndex: undefined, - title: 'Add variant', - }); - }; - - openEditVariant = (e, index, variant) => { - e.preventDefault(); - if (this.props.editable) { - this.setState({ - showDialog: true, - editVariant: variant, - editIndex: index, - title: 'Edit variant', - }); - } - }; - - validateName = name => { - if (!name) { - return { name: 'Name is required' }; - } - }; - - onRemoveVariant = (e, index) => { - e.preventDefault(); - try { - this.props.removeVariant(index); - } catch (e) { - console.log('An exception was caught.'); - } - }; - - renderVariant = (variant, index) => ( - this.openEditVariant(e, index, variant)} - removeVariant={e => this.onRemoveVariant(e, index)} - editable={this.props.editable} - /> - ); - - renderVariants = variants => ( - - - - Variant name - - Weight - Weight Type - - - - {variants.map(this.renderVariant)} -
- ); - - renderStickiness = variants => { - const { updateStickiness, stickinessOptions } = this.props; - - if (!variants || variants.length < 2) { - return null; - } - - const value = variants[0].stickiness || 'default'; - const options = stickinessOptions.map(c => ({ key: c, label: c })); - - // guard on stickiness being disabled for context field. - if (!stickinessOptions.includes(value)) { - options.push({ key: value, label: value }); - } - - const onChange = event => updateStickiness(event.target.value); - - return ( -
- -    - - By overriding the stickiness you can control which parameter - you want to be used in order to ensure consistent traffic - allocation across variants.{' '} - - Read more - - -
- ); - }; - - render() { - const { showDialog, editVariant, editIndex, title } = this.state; - const { variants, addVariant, updateVariant } = this.props; - const saveVariant = editVariant - ? updateVariant.bind(null, editIndex) - : addVariant; - - return ( -
- - Variants allows you to return a variant object if the - feature toggle is considered enabled for the current - request. When using variants you should use the{' '} - getVariant() method - in the Client SDK. - - - 0} - show={this.renderVariants(variants)} - elseShow={

No variants defined.

} - /> - -
- - - {this.renderStickiness(variants)} - - } - /> - - -
- ); - } -} - -UpdateVariantComponent.propTypes = { - variants: PropTypes.array.isRequired, - addVariant: PropTypes.func.isRequired, - removeVariant: PropTypes.func.isRequired, - updateVariant: PropTypes.func.isRequired, - updateStickiness: PropTypes.func.isRequired, - editable: PropTypes.bool.isRequired, - stickinessOptions: PropTypes.array, -}; - -export default UpdateVariantComponent; diff --git a/frontend/src/component/feature/variant/update-variant-container.jsx b/frontend/src/component/feature/variant/update-variant-container.jsx deleted file mode 100644 index 2116cca026..0000000000 --- a/frontend/src/component/feature/variant/update-variant-container.jsx +++ /dev/null @@ -1,65 +0,0 @@ -import { connect } from 'react-redux'; - -import { requestUpdateFeatureToggleVariants } from '../../../store/feature-toggle/actions'; -import UpdateFeatureToggleComponent from './update-variant-component'; -import { updateWeight } from '../../common/util'; - -const mapStateToProps = (state, ownProps) => ({ - variants: ownProps.featureToggle.variants || [], - features: state.features.toJS(), - stickinessOptions: [ - 'default', - ...state.context.filter(c => c.stickiness).map(c => c.name), - ], -}); - -const mapDispatchToProps = (dispatch, ownProps) => ({ - addVariant: variant => { - const { featureToggle } = ownProps; - const currentVariants = featureToggle.variants || []; - let stickiness; - if (currentVariants.length > 0) { - stickiness = currentVariants[0].stickiness || 'default'; - } else { - stickiness = 'default'; - } - variant.stickiness = stickiness; - - const variants = [...currentVariants, variant]; - updateWeight(variants, 1000); - return requestUpdateFeatureToggleVariants( - featureToggle, - variants - )(dispatch); - }, - removeVariant: index => { - const { featureToggle } = ownProps; - const currentVariants = featureToggle.variants || []; - - const variants = currentVariants.filter((v, i) => i !== index); - if (variants.length > 0) { - updateWeight(variants, 1000); - } - requestUpdateFeatureToggleVariants(featureToggle, variants)(dispatch); - }, - updateVariant: (index, variant) => { - const { featureToggle } = ownProps; - const currentVariants = featureToggle.variants || []; - const variants = currentVariants.map((v, i) => - i === index ? variant : v - ); - updateWeight(variants, 1000); - requestUpdateFeatureToggleVariants(featureToggle, variants)(dispatch); - }, - updateStickiness: stickiness => { - const { featureToggle } = ownProps; - const currentVariants = featureToggle.variants || []; - const variants = currentVariants.map(v => ({ ...v, stickiness })); - requestUpdateFeatureToggleVariants(featureToggle, variants)(dispatch); - }, -}); - -export default connect( - mapStateToProps, - mapDispatchToProps -)(UpdateFeatureToggleComponent); diff --git a/frontend/src/component/feature/variant/variant-view-component.jsx b/frontend/src/component/feature/variant/variant-view-component.jsx deleted file mode 100644 index c4310f5085..0000000000 --- a/frontend/src/component/feature/variant/variant-view-component.jsx +++ /dev/null @@ -1,71 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { IconButton, Chip, TableCell, TableRow } from '@material-ui/core'; -import { Edit, Delete } from '@material-ui/icons'; - -import { weightTypes } from './enums'; - -import ConditionallyRender from '../../common/ConditionallyRender/ConditionallyRender'; - -import styles from './variant.module.scss'; -function VariantViewComponent({ - variant, - editVariant, - removeVariant, - editable, -}) { - const { FIX } = weightTypes; - return ( - - {variant.name} - - } - /> - 0 - } - show={ - - } - /> - - {variant.weight / 10.0} % - - {variant.weightType === FIX ? 'Fix' : 'Variable'} - - -
- - - - - - -
- - } - elseShow={} - /> -
- ); -} - -VariantViewComponent.propTypes = { - variant: PropTypes.object, - removeVariant: PropTypes.func, - editVariant: PropTypes.func, - editable: PropTypes.bool.isRequired, -}; - -export default VariantViewComponent; diff --git a/frontend/src/component/feature/variant/variant.module.scss b/frontend/src/component/feature/variant/variant.module.scss deleted file mode 100644 index 8110253b45..0000000000 --- a/frontend/src/component/feature/variant/variant.module.scss +++ /dev/null @@ -1,100 +0,0 @@ -.variantTable { - width: 100%; - max-width: 700px; - - th, - td { - text-align: center; - } - th:first-of-type, - td:first-of-type { - text-align: left; - width: 100%; - } - tbody tr:hover { - background-color: rgba(173, 216, 230, 0.2); - } -} - -@media (max-width: 600px) { - th.labels { - display: none; - } - td.labels { - display: none; - } -} - -th.labels { - text-align: right; -} - -td.labels { - text-align: right; - vertical-align: top; -} - -th.actions { - text-align: right; -} - -td.actions { - height: 100%; - text-align: right; - vertical-align: top; -} - -.actionsContainer { - display: flex; - align-items: center; -} - -.modal { - max-width: 90%; - width: 600px; - position: absolute !important; -} - -@media (max-width: 600px) { - .modal { - top: 0 !important; - } -} - -.tooltip { - i { - font-size: 18px; - } -} - -.inputWeight { - text-align: right; -} - -.flexCenter { - display: flex; - justify-content: center; - align-items: center; -} - -.flex { - display: flex; - align-items: center; -} - -.marginL10 { - margin-left: 10px; -} - -.addVariantButton { - margin: 1rem 0; -} - -.paragraph { - max-width: 400px; -} - -.helperText { - display: block; - margin-top: 0.5rem; -} diff --git a/frontend/src/component/feature/view/__tests__/.eslintrc b/frontend/src/component/feature/view/__tests__/.eslintrc deleted file mode 100644 index eba2077219..0000000000 --- a/frontend/src/component/feature/view/__tests__/.eslintrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "env": { - "jest": true - } -} diff --git a/frontend/src/component/feature/view/__tests__/__snapshots__/update-strategies-component-test.jsx.snap b/frontend/src/component/feature/view/__tests__/__snapshots__/update-strategies-component-test.jsx.snap deleted file mode 100644 index b3bacd516f..0000000000 --- a/frontend/src/component/feature/view/__tests__/__snapshots__/update-strategies-component-test.jsx.snap +++ /dev/null @@ -1,27 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`render the create feature page 1`] = ` -
- -
-`; diff --git a/frontend/src/component/feature/view/__tests__/__snapshots__/view-component-test.jsx.snap b/frontend/src/component/feature/view/__tests__/__snapshots__/view-component-test.jsx.snap deleted file mode 100644 index fcf80e93cd..0000000000 --- a/frontend/src/component/feature/view/__tests__/__snapshots__/view-component-test.jsx.snap +++ /dev/null @@ -1,567 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renders correctly with one feature 1`] = ` -
-
-
-

- Another -

-
-
- - Active - -
-
-
-
-
-

- another's description -

-
-
-
- -
-
- Release -
- - - - -
- - - Feature type - - -
-
-
-   -
- -
-
- default -
- - - - -
- - - Project - - -
-
-
-
- -
-
-
- - - - - - - - - - - - Disabled - - -
- - - - Clone - - - - -
-
-
-
-
-
-
- - - - -
-
-
-
-
- - - ); - } -} diff --git a/frontend/src/component/feature/view/metric-container.jsx b/frontend/src/component/feature/view/metric-container.jsx deleted file mode 100644 index cb9857e6b3..0000000000 --- a/frontend/src/component/feature/view/metric-container.jsx +++ /dev/null @@ -1,32 +0,0 @@ -import { connect } from 'react-redux'; - -import { fetchFeatureMetrics, fetchSeenApps } from '../../../store/feature-metrics/actions'; - -import MatricComponent from './metric-component'; - -function getMetricsForToggle(state, toggleName) { - if (!toggleName) { - return; - } - const result = {}; - - if (state.featureMetrics.hasIn(['seenApps', toggleName])) { - result.seenApps = state.featureMetrics.getIn(['seenApps', toggleName]); - } - if (state.featureMetrics.hasIn(['lastHour', toggleName])) { - result.lastHour = state.featureMetrics.getIn(['lastHour', toggleName]); - result.lastMinute = state.featureMetrics.getIn(['lastMinute', toggleName]); - } - return result; -} - -export default connect( - (state, props) => ({ - metrics: getMetricsForToggle(state, props.featureToggle.name), - location: state.settings.toJS().location || {}, - }), - { - fetchFeatureMetrics, - fetchSeenApps, - } -)(MatricComponent); diff --git a/frontend/src/component/feature/view/metric.module.scss b/frontend/src/component/feature/view/metric.module.scss deleted file mode 100644 index 7a84b6afb2..0000000000 --- a/frontend/src/component/feature/view/metric.module.scss +++ /dev/null @@ -1,41 +0,0 @@ -.chip { - display: inline-flex; - vertical-align: middle; - margin-left: 30px; - position: relative; - z-index: 1; - overflow: visible; -} - -.chip:first-child { - margin-left: 0; -} - -.chip:not(:first-child):after { - content: " OR "; - position: absolute; - left: -27px; - top: 0; - color: #ccc; - width: 25px; - line-height: 32px; - font-size: 14px; - text-align: center; - height: 100%; - z-index: 2; -} - -.chip:first-child:before { - content: ""; -} - -.problemIcon { - width: 100px; - height: 100px; - font-size: 100px !important; - color: #ccc; -} - -.grid { - text-align: center; -} diff --git a/frontend/src/component/feature/view/status-update-component.jsx b/frontend/src/component/feature/view/status-update-component.jsx deleted file mode 100644 index 8a350169c2..0000000000 --- a/frontend/src/component/feature/view/status-update-component.jsx +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; -import { MenuItem } from '@material-ui/core'; -import DropdownMenu from '../../common/DropdownMenu/DropdownMenu'; -import PropTypes from 'prop-types'; - -export default function StatusUpdateComponent({ stale, updateStale }) { - function setStatus(field) { - if (field === 'active') { - updateStale(false); - } else if (field === 'stale') { - updateStale(true); - } - } - - const renderOptions = () => [ - - Set toggle Active - , - - Mark toggle as Stale - , - ]; - - const onClick = e => { - setStatus(e.target.getAttribute('data-target')); - }; - - return ( - - ); -} - -StatusUpdateComponent.propTypes = { - stale: PropTypes.bool.isRequired, - updateStale: PropTypes.func.isRequired, -}; diff --git a/frontend/src/component/feature/view/update-description-component.jsx b/frontend/src/component/feature/view/update-description-component.jsx deleted file mode 100644 index 907c8c6b8c..0000000000 --- a/frontend/src/component/feature/view/update-description-component.jsx +++ /dev/null @@ -1,114 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { Link } from 'react-router-dom'; -import { - Typography, - IconButton, - FormControl, - TextField, - Button, -} from '@material-ui/core'; -import CreateIcon from '@material-ui/icons/Create'; -import ConditionallyRender from '../../common/ConditionallyRender/ConditionallyRender'; - -import styles from './update-description-component.module.scss'; - -export default class UpdateDescriptionComponent extends React.Component { - constructor(props) { - super(props); - this.state = { editMode: false }; - } - - static propTypes = { - isFeatureView: PropTypes.bool.isRequired, - update: PropTypes.func, - featureToggle: PropTypes.object, - editable: PropTypes.bool, - }; - - onEditMode = (description, evt) => { - evt.preventDefault(); - this.setState({ editMode: true, description }); - }; - - updateValue = evt => { - evt.preventDefault(); - this.setState({ description: evt.target.value }); - }; - - onSave = evt => { - evt.preventDefault(); - this.props.update(this.state.description); - this.setState({ editMode: false, description: undefined }); - }; - - onCancel = evt => { - evt.preventDefault(); - this.setState({ editMode: false, description: undefined }); - }; - - renderRead({ description, editable }) { - return ( - - - {description || 'No feature toggle description'} - - - - } - /> - - - ); - } - - renderEdit() { - const { description } = this.state; - return ( -
- -
- -   - -
-
- ); - } - - render() { - const { editMode } = this.state; - return editMode - ? this.renderEdit(this.props) - : this.renderRead(this.props); - } -} diff --git a/frontend/src/component/feature/view/update-description-component.module.scss b/frontend/src/component/feature/view/update-description-component.module.scss deleted file mode 100644 index 2d1d2d2a85..0000000000 --- a/frontend/src/component/feature/view/update-description-component.module.scss +++ /dev/null @@ -1,3 +0,0 @@ -.descriptionInput { - width: 350px; -} diff --git a/frontend/src/component/feature/view/update-strategies-component.jsx b/frontend/src/component/feature/view/update-strategies-component.jsx deleted file mode 100644 index 3ae49d067d..0000000000 --- a/frontend/src/component/feature/view/update-strategies-component.jsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import StrategiesList from '../strategy/strategies-list-container'; - -// TODO: do we still need this wrapper? -function UpdateStrategiesComponent(props) { - const { configuredStrategies } = props; - if (!configuredStrategies || configuredStrategies.length === 0) return null; - - return ( -
- -
- ); -} - -UpdateStrategiesComponent.propTypes = { - featureToggleName: PropTypes.string.isRequired, - strategies: PropTypes.array, - configuredStrategies: PropTypes.array.isRequired, - editable: PropTypes.bool, -}; - -UpdateStrategiesComponent.defaultProps = { - editable: true, -}; - -export default UpdateStrategiesComponent; diff --git a/frontend/src/component/feature/view/update-strategies-container.jsx b/frontend/src/component/feature/view/update-strategies-container.jsx deleted file mode 100644 index 1b63833a90..0000000000 --- a/frontend/src/component/feature/view/update-strategies-container.jsx +++ /dev/null @@ -1,19 +0,0 @@ -/* eslint-disable no-console */ -import { connect } from 'react-redux'; - -import { requestUpdateFeatureToggleStrategies } from '../../../store/feature-toggle/actions'; -import UpdateStrategiesComponent from './update-strategies-component'; - -const mapStateToProps = (state, ownProps) => ({ - featureToggleName: ownProps.featureToggle.name, - configuredStrategies: ownProps.featureToggle.strategies, -}); - -const mapDispatchToProps = (dispatch, ownProps) => ({ - saveStrategies: strategies => { - const featureToggle = ownProps.featureToggle; - return requestUpdateFeatureToggleStrategies(featureToggle, strategies)(dispatch); - }, -}); - -export default connect(mapStateToProps, mapDispatchToProps)(UpdateStrategiesComponent); 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 8bccd68c6a..9b57beca74 100644 --- a/frontend/src/component/menu/__tests__/__snapshots__/routes-test.jsx.snap +++ b/frontend/src/component/menu/__tests__/__snapshots__/routes-test.jsx.snap @@ -43,7 +43,7 @@ Array [ "layout": "main", "menu": Object {}, "parent": "/projects/:id/features/:name/:activeTab", - "path": "/projects/:id/features2/:name/:activeTab/copy", + "path": "/projects/:id/features/:name/:activeTab/copy", "title": "Copy", "type": "protected", }, @@ -52,7 +52,7 @@ Array [ "layout": "main", "menu": Object {}, "parent": "/projects", - "path": "/projects/:projectId/features2/:featureId/settings", + "path": "/projects/:projectId/features/:featureId/settings", "title": "Edit Feature", "type": "protected", }, @@ -62,8 +62,8 @@ Array [ "layout": "main", "menu": Object {}, "parent": "/projects", - "path": "/projects/:projectId/features2/:featureId", - "title": "FeatureView2", + "path": "/projects/:projectId/features/:featureId", + "title": "FeatureView", "type": "protected", }, Object { @@ -89,7 +89,7 @@ Array [ "layout": "main", "menu": Object {}, "parent": "/features", - "path": "/projects/:projectId/features/:name", + "path": "/projects/:projectId/features2/:name", "title": ":name", "type": "protected", }, @@ -330,15 +330,6 @@ Array [ "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", diff --git a/frontend/src/component/menu/routes.js b/frontend/src/component/menu/routes.js index 8359ee178a..9f48947b11 100644 --- a/frontend/src/component/menu/routes.js +++ b/frontend/src/component/menu/routes.js @@ -1,23 +1,20 @@ import CopyFeatureToggle from '../../page/features/copy'; -import ViewFeatureToggle from '../../page/features/show'; import Features from '../../page/features'; import CreateStrategies from '../../page/strategies/create'; import StrategyView from '../../page/strategies/show'; import Strategies from '../../page/strategies'; import HistoryPage from '../../page/history'; import HistoryTogglePage from '../../page/history/toggle'; -import ShowArchive from '../../page/archive/show'; import Archive from '../../page/archive'; import Applications from '../../page/applications'; import ApplicationView from '../../page/applications/view'; -import ContextFields from '../../page/context'; import ListTagTypes from '../../page/tag-types'; import Addons from '../../page/addons'; import AddonsCreate from '../../page/addons/create'; import AddonsEdit from '../../page/addons/edit'; import Admin from '../admin'; import AdminApi from '../admin/api'; -import AdminUsers from '../admin/users'; +import AdminUsers from '../admin/users/UsersAdmin'; import AdminInvoice from '../admin/invoice'; import AdminAuth from '../admin/auth'; import Login from '../user/Login/Login'; @@ -27,10 +24,9 @@ import ResetPassword from '../user/ResetPassword/ResetPassword'; import ForgottenPassword from '../user/ForgottenPassword/ForgottenPassword'; import ProjectListNew from '../project/ProjectList/ProjectList'; import Project from '../project/Project/Project'; -import RedirectFeatureViewPage from '../../page/features/redirect'; import RedirectArchive from '../feature/RedirectArchive/RedirectArchive'; import EnvironmentList from '../environments/EnvironmentList/EnvironmentList'; -import FeatureView2 from '../feature/FeatureView2/FeatureView2'; +import FeatureView from '../feature/FeatureView/FeatureView'; import ProjectRoles from '../admin/project-roles/ProjectRoles/ProjectRoles'; import CreateProjectRole from '../admin/project-roles/CreateProjectRole/CreateProjectRole'; import EditProjectRole from '../admin/project-roles/EditProjectRole/EditProjectRole'; @@ -45,8 +41,10 @@ import EditTagType from '../tagTypes/EditTagType/EditTagType'; import CreateTagType from '../tagTypes/CreateTagType/CreateTagType'; import EditProject from '../project/Project/EditProject/EditProject'; import CreateProject from '../project/Project/CreateProject/CreateProject'; -import CreateFeature from '../feature/CreateFeature/CreateFeature/CreateFeature'; -import EditFeature from '../feature/CreateFeature/EditFeature/EditFeature'; +import CreateFeature from '../feature/CreateFeature/CreateFeature'; +import EditFeature from '../feature/EditFeature/EditFeature'; +import ContextList from '../context/ContextList/ContextList'; +import RedirectFeatureView from '../feature/RedirectFeatureView/RedirectFeatureView'; export const routes = [ // Project @@ -88,7 +86,7 @@ export const routes = [ menu: {}, }, { - path: '/projects/:id/features2/:name/:activeTab/copy', + path: '/projects/:id/features/:name/:activeTab/copy', parent: '/projects/:id/features/:name/:activeTab', title: 'Copy', component: CopyFeatureToggle, @@ -97,7 +95,7 @@ export const routes = [ menu: {}, }, { - path: '/projects/:projectId/features2/:featureId/settings', + path: '/projects/:projectId/features/:featureId/settings', parent: '/projects', title: 'Edit Feature', component: EditFeature, @@ -106,10 +104,10 @@ export const routes = [ menu: {}, }, { - path: '/projects/:projectId/features2/:featureId', + path: '/projects/:projectId/features/:featureId', parent: '/projects', - title: 'FeatureView2', - component: FeatureView2, + title: 'FeatureView', + component: FeatureView, type: 'protected', layout: 'main', flags: E, @@ -119,7 +117,7 @@ export const routes = [ path: '/projects/:id/features/:name/:activeTab', parent: '/projects', title: ':name', - component: ViewFeatureToggle, + component: FeatureView, type: 'protected', layout: 'main', menu: {}, @@ -134,10 +132,10 @@ export const routes = [ menu: {}, }, { - path: '/projects/:projectId/features/:name', + path: '/projects/:projectId/features2/:name', parent: '/features', title: ':name', - component: RedirectFeatureViewPage, + component: RedirectFeatureView, type: 'protected', layout: 'main', menu: {}, @@ -176,7 +174,7 @@ export const routes = [ path: '/features/:activeTab/:name', parent: '/features', title: ':name', - component: RedirectFeatureViewPage, + component: RedirectFeatureView, type: 'protected', layout: 'main', menu: {}, @@ -233,7 +231,7 @@ export const routes = [ { path: '/context', title: 'Context Fields', - component: ContextFields, + component: ContextList, type: 'protected', flag: C, layout: 'main', @@ -371,15 +369,6 @@ export const routes = [ }, // Archive - { - path: '/projects/:id/archived/:name/:activeTab', - title: ':name', - parent: '/archive', - component: ShowArchive, - type: 'protected', - layout: 'main', - menu: {}, - }, { path: '/archive', title: 'Archived Toggles', diff --git a/frontend/src/hooks/api/getters/useFeatures/useFeatures.ts b/frontend/src/hooks/api/getters/useFeatures/useFeatures.ts new file mode 100644 index 0000000000..ac7e290741 --- /dev/null +++ b/frontend/src/hooks/api/getters/useFeatures/useFeatures.ts @@ -0,0 +1,40 @@ +import useSWR, { mutate, SWRConfiguration } from 'swr'; +import { useState, useEffect } from 'react'; +import { formatApiPath } from '../../../../utils/format-path'; +import handleErrorResponses from '../httpErrorResponseHandler'; + +const useFeatures = (options: SWRConfiguration = {}) => { + const fetcher = async () => { + const path = formatApiPath('api/admin/features/'); + return fetch(path, { + method: 'GET', + }) + .then(handleErrorResponses('Features')) + .then(res => res.json()); + }; + + const FEATURES_CACHE_KEY = 'api/admin/features/'; + + const { data, error } = useSWR(FEATURES_CACHE_KEY, fetcher, { + ...options, + }); + + const [loading, setLoading] = useState(!error && !data); + + const refetchFeatures = () => { + mutate(FEATURES_CACHE_KEY); + }; + + useEffect(() => { + setLoading(!error && !data); + }, [data, error]); + + return { + features: data?.features || [], + error, + loading, + refetchFeatures, + }; +}; + +export default useFeatures; diff --git a/frontend/src/page/archive/show.js b/frontend/src/page/archive/show.js deleted file mode 100644 index d937968f3c..0000000000 --- a/frontend/src/page/archive/show.js +++ /dev/null @@ -1,20 +0,0 @@ -import React, { PureComponent } from 'react'; -import PropTypes from 'prop-types'; -import ViewFeatureToggle from './../../component/archive/view-container'; -export default class Features extends PureComponent { - static propTypes = { - match: PropTypes.object.isRequired, - history: PropTypes.object.isRequired, - }; - - render() { - const { match, history } = this.props; - return ( - - ); - } -} diff --git a/frontend/src/page/context/create.js b/frontend/src/page/context/create.js deleted file mode 100644 index f42ef571a4..0000000000 --- a/frontend/src/page/context/create.js +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; -import CreateContextField from '../../component/context/create-context-container'; -import PropTypes from 'prop-types'; - -const render = ({ history }) => ; - -render.propTypes = { - history: PropTypes.object.isRequired, -}; - -export default render; diff --git a/frontend/src/page/context/edit.js b/frontend/src/page/context/edit.js deleted file mode 100644 index bf3a02ed06..0000000000 --- a/frontend/src/page/context/edit.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; -import CreateContextField from '../../component/context/edit-context-container'; -import PropTypes from 'prop-types'; - -const render = ({ match: { params }, history }) => ( - -); - -render.propTypes = { - match: PropTypes.object.isRequired, - history: PropTypes.object.isRequired, -}; - -export default render; diff --git a/frontend/src/page/context/index.js b/frontend/src/page/context/index.js deleted file mode 100644 index 983f66ccfe..0000000000 --- a/frontend/src/page/context/index.js +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; -import ContextList from '../../component/context/ContextList'; -import PropTypes from 'prop-types'; - -const render = ({ history }) => ; - -render.propTypes = { - history: PropTypes.object.isRequired, -}; - -export default render; diff --git a/frontend/src/page/features/copy.js b/frontend/src/page/features/copy.js index 935c55fe38..7afe17a487 100644 --- a/frontend/src/page/features/copy.js +++ b/frontend/src/page/features/copy.js @@ -1,5 +1,5 @@ import React from 'react'; -import CopyFeatureToggleForm from '../../component/feature/create/CopyFeature'; +import CopyFeatureToggleForm from '../../component/feature/CopyFeature'; import PropTypes from 'prop-types'; const render = ({ history, match: { params } }) => ( diff --git a/frontend/src/page/features/redirect.js b/frontend/src/page/features/redirect.js deleted file mode 100644 index 9e123be7af..0000000000 --- a/frontend/src/page/features/redirect.js +++ /dev/null @@ -1,24 +0,0 @@ -import React, { PureComponent } from 'react'; -import PropTypes from 'prop-types'; -import RedirectFeatureView from '../../component/feature/RedirectFeatureView'; - -export default class RedirectFeatureViewPage extends PureComponent { - static propTypes = { - match: PropTypes.object.isRequired, - history: PropTypes.object.isRequired, - }; - - render() { - const { - match: { params }, - history, - } = this.props; - return ( - - ); - } -} diff --git a/frontend/src/page/features/show.js b/frontend/src/page/features/show.js deleted file mode 100644 index 76f743f9d3..0000000000 --- a/frontend/src/page/features/show.js +++ /dev/null @@ -1,24 +0,0 @@ -import React, { PureComponent } from 'react'; -import PropTypes from 'prop-types'; -import FeatureView from '../../component/feature/FeatureView'; - -export default class Features extends PureComponent { - static propTypes = { - match: PropTypes.object.isRequired, - history: PropTypes.object.isRequired, - }; - - render() { - const { - match: { params }, - history, - } = this.props; - return ( - - ); - } -} diff --git a/frontend/src/utils/get-strategy-object.ts b/frontend/src/utils/get-strategy-object.ts index ac16a3f939..b6df4a41ee 100644 --- a/frontend/src/utils/get-strategy-object.ts +++ b/frontend/src/utils/get-strategy-object.ts @@ -1,5 +1,5 @@ -import { resolveDefaultParamValue } from '../component/feature/strategy/AddStrategy/utils'; import { IStrategy, IParameter } from '../interfaces/strategy'; +import { resolveDefaultParamValue } from './resolve-default-param-value'; export const getStrategyObject = ( selectableStrategies: IStrategy[], diff --git a/frontend/src/component/feature/strategy/AddStrategy/utils.js b/frontend/src/utils/resolve-default-param-value.ts similarity index 100% rename from frontend/src/component/feature/strategy/AddStrategy/utils.js rename to frontend/src/utils/resolve-default-param-value.ts diff --git a/frontend/src/utils/route-path-helpers.ts b/frontend/src/utils/route-path-helpers.ts index 6b06119d0d..4bdf3102ff 100644 --- a/frontend/src/utils/route-path-helpers.ts +++ b/frontend/src/utils/route-path-helpers.ts @@ -1,5 +1,5 @@ -export const getTogglePath = (projectId: string, featureToggleName: string, newPath: boolean) => { - return `/projects/${projectId}/features${newPath ? `2/${featureToggleName}` : `/${featureToggleName}/strategies`}`; +export const getTogglePath = (projectId: string, featureToggleName: string) => { + return `/projects/${projectId}/features/${featureToggleName}`; }; export const getToggleCopyPath = (