From e24567dd588a096a827027a6521a2c0ee9ea42cc Mon Sep 17 00:00:00 2001 From: 8lane Date: Tue, 23 Jul 2024 17:16:10 +0100 Subject: [PATCH] chore: feature flag --- .../(pages)/feature-flags/page.tsx | 56 ++++++++++++++++++- .../(fullWidth)/switchboard/shared/schema.ts | 1 + .../(fullWidth)/switchboard/shared/state.ts | 1 + src/app/components/ui/ukhsa/Map/Map.tsx | 4 +- .../health-alerts/HealthAlertsMapDialog.tsx | 49 +++++++++++++--- .../health-alerts/HealthAlertsMapWrapper.tsx | 13 ++++- .../Map/shared/layers/ChoroplethLayer.tsx | 6 ++ src/app/constants/flags.constants.ts | 1 + src/app/types/index.ts | 10 ++++ .../handlers/flags/client/features.ts | 13 ++++- .../flags/client/fixtures/feature-flags.ts | 30 ++++++++++ 11 files changed, 171 insertions(+), 13 deletions(-) diff --git a/src/app/(fullWidth)/switchboard/(pages)/feature-flags/page.tsx b/src/app/(fullWidth)/switchboard/(pages)/feature-flags/page.tsx index 882823db1..700a93f7e 100644 --- a/src/app/(fullWidth)/switchboard/(pages)/feature-flags/page.tsx +++ b/src/app/(fullWidth)/switchboard/(pages)/feature-flags/page.tsx @@ -10,7 +10,7 @@ export default function SwitchBoard() { const cookieStore = cookies() const { - flags: { 'adverse-weather': adverseWeather }, + flags: { 'adverse-weather': adverseWeather, 'map-tile-provider': mapTileProvider }, } = getSwitchBoardState(cookieStore.get(UKHSA_SWITCHBOARD_COOKIE_NAME)?.value) return ( @@ -19,7 +19,13 @@ export default function SwitchBoard() { className="govuk-!-margin-top-3" action={async (form) => { 'use server' - syncState({}, { 'adverse-weather': form.get('flags.adverseWeather') as string }) + syncState( + {}, + { + 'adverse-weather': form.get('flags.adverseWeather') as string, + 'map-tile-provider': form.get('flags.mapTileProvider') as string, + } + ) }} >
@@ -58,6 +64,52 @@ export default function SwitchBoard() { +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+