Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Drop SUBMISSION_VIEW feature flag #2977

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion editor.planx.uk/src/lib/featureFlags.ts
Original file line number Diff line number Diff line change
@@ -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];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
24 changes: 8 additions & 16 deletions editor.planx.uk/src/routes/flowSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand Down Expand Up @@ -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: <Settings currentTab={req.params.tab} tabs={getTabs()} />,
view: <Settings currentTab={req.params.tab} tabs={tabs} />,
};
});
}),
Expand Down
Loading