From 922449c8c0759516eede17deb3d063eff3f3fe57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Thu, 4 Apr 2024 08:08:57 +0100 Subject: [PATCH] chore: Drop submissions view feature flag --- editor.planx.uk/src/lib/featureFlags.ts | 2 +- .../FlowEditor/components/Settings/index.tsx | 12 ++++++---- editor.planx.uk/src/routes/flowSettings.tsx | 24 +++++++------------ 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/editor.planx.uk/src/lib/featureFlags.ts b/editor.planx.uk/src/lib/featureFlags.ts index 52592ea1ad..9caeb92efe 100644 --- a/editor.planx.uk/src/lib/featureFlags.ts +++ b/editor.planx.uk/src/lib/featureFlags.ts @@ -1,5 +1,5 @@ // add/edit/remove feature flags in array below -const AVAILABLE_FEATURE_FLAGS = ["SUBMISSION_VIEW", "GOVPAY_METADATA"] as const; +const AVAILABLE_FEATURE_FLAGS = ["GOVPAY_METADATA"] as const; type FeatureFlag = (typeof AVAILABLE_FEATURE_FLAGS)[number]; diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Settings/index.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Settings/index.tsx index e4e83a13d3..46bf7a105d 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Settings/index.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Settings/index.tsx @@ -11,13 +11,15 @@ import { HEADER_HEIGHT } from "components/Header"; import React from "react"; import { Link, useNavigation } from "react-navi"; +export interface SettingsTab { + route: string; + name: string; + Component: React.FC; +} + interface SettingsProps { currentTab: string; - tabs: { - route: string; - name: string; - Component: React.FC; - }[]; + tabs: SettingsTab[]; } interface TabPanelProps { diff --git a/editor.planx.uk/src/routes/flowSettings.tsx b/editor.planx.uk/src/routes/flowSettings.tsx index de66efe0da..78ff6af05e 100644 --- a/editor.planx.uk/src/routes/flowSettings.tsx +++ b/editor.planx.uk/src/routes/flowSettings.tsx @@ -17,11 +17,11 @@ import Submissions from "pages/FlowEditor/components/Settings/Submissions"; import { useStore } from "pages/FlowEditor/lib/store"; import React from "react"; -import Settings from "../pages/FlowEditor/components/Settings"; +import Settings, { SettingsTab } from "../pages/FlowEditor/components/Settings"; import type { FlowSettings } from "../types"; import { makeTitle } from "./utils"; -const standardTabs = [ +const tabs: SettingsTab[] = [ { name: "Service", route: "service", @@ -37,14 +37,13 @@ const standardTabs = [ route: "data-manager", Component: DataManagerSettings, }, + { + name: "Submissions", + route: "submissions", + Component: Submissions, + }, ]; -const submissionsTab = { - name: "Submissions", - route: "submissions", - Component: Submissions, -}; - const flowSettingsRoutes = compose( withData((req) => ({ mountpath: req.mountpath, @@ -84,18 +83,11 @@ const flowSettingsRoutes = compose( const settings: FlowSettings = data.flows[0].settings; useStore.getState().setFlowSettings(settings); - function getTabs() { - const isUsingFeatureFlag = hasFeatureFlag("SUBMISSION_VIEW"); - return isUsingFeatureFlag - ? [...standardTabs, submissionsTab] - : standardTabs; - } - return { title: makeTitle( [req.params.team, req.params.flow, "Flow Settings"].join("/"), ), - view: , + view: , }; }); }),