From 56c8560eda226b4acac3adb4fc5e03602d22730d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Thu, 15 Feb 2024 15:55:27 +0000 Subject: [PATCH 1/3] chore: Retire `DISABLE_SAVE_AND_RETURN` feature flag (#2797) --- .../src/@planx/components/Send/Public.tsx | 28 ---------- .../src/components/FeatureFlagBanner.tsx | 54 ------------------- editor.planx.uk/src/components/Header.tsx | 6 +-- editor.planx.uk/src/lib/featureFlags.ts | 2 +- editor.planx.uk/src/routes/utils.ts | 2 +- 5 files changed, 3 insertions(+), 89 deletions(-) delete mode 100644 editor.planx.uk/src/components/FeatureFlagBanner.tsx diff --git a/editor.planx.uk/src/@planx/components/Send/Public.tsx b/editor.planx.uk/src/@planx/components/Send/Public.tsx index 780cd47d04..992cc16fbd 100644 --- a/editor.planx.uk/src/@planx/components/Send/Public.tsx +++ b/editor.planx.uk/src/@planx/components/Send/Public.tsx @@ -1,6 +1,5 @@ import axios from "axios"; import DelayedLoadingIndicator from "components/DelayedLoadingIndicator"; -import { hasFeatureFlag } from "lib/featureFlags"; import { useStore } from "pages/FlowEditor/lib/store"; import React, { useEffect } from "react"; import { useAsync } from "react-use"; @@ -20,33 +19,6 @@ export type Props = PublicProps; const SendComponent: React.FC = ({ destinations = [DEFAULT_DESTINATION], ...props -}) => { - // If testing with the feature flag, skip scheduled event creation because no stored lowcal_session to generate payloads - const testSession = hasFeatureFlag("DISABLE_SAVE_AND_RETURN"); - - useEffect(() => { - if (testSession) { - props.handleSubmit?.({ - ...makeData(props, true, "skippedEvents"), - auto: true, - }); - } - }, []); - - if (testSession) { - return ( - - - - ); - } else { - return ; - } -}; - -const SendEvents: React.FC = ({ - destinations = [DEFAULT_DESTINATION], - ...props }) => { const [passport, sessionId, teamSlug] = useStore((state) => [ state.computePassport(), diff --git a/editor.planx.uk/src/components/FeatureFlagBanner.tsx b/editor.planx.uk/src/components/FeatureFlagBanner.tsx deleted file mode 100644 index 2ef337a446..0000000000 --- a/editor.planx.uk/src/components/FeatureFlagBanner.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import ReportIcon from "@mui/icons-material/Report"; -import Box from "@mui/material/Box"; -import Button from "@mui/material/Button"; -import Container from "@mui/material/Container"; -import { styled } from "@mui/material/styles"; -import Typography from "@mui/material/Typography"; -import { hasFeatureFlag } from "lib/featureFlags"; -import React, { useState } from "react"; - -const TestEnvironmentWarning = styled(Box)(({ theme }) => ({ - display: "flex", - backgroundColor: theme.palette.background.paper, - color: theme.palette.text.primary, - justifyContent: "space-between", - alignItems: "center", - padding: "0.2em 0", -})); - -const FeatureFlagBanner: React.FC = () => { - const [showWarning, setShowWarning] = useState(true); - - const isUsingFeatureFlag = () => hasFeatureFlag("DISABLE_SAVE_AND_RETURN"); - - return ( - <> - {isUsingFeatureFlag() && showWarning && ( - - - - - - You have disabled save and return via feature - flag. This means you cannot save or submit your test - applications. - - - - - - )} - - ); -}; - -export default FeatureFlagBanner; diff --git a/editor.planx.uk/src/components/Header.tsx b/editor.planx.uk/src/components/Header.tsx index 02a3690b34..fd45159732 100644 --- a/editor.planx.uk/src/components/Header.tsx +++ b/editor.planx.uk/src/components/Header.tsx @@ -19,7 +19,6 @@ import MuiToolbar from "@mui/material/Toolbar"; import Typography from "@mui/material/Typography"; import useMediaQuery from "@mui/material/useMediaQuery"; import { ComponentType as TYPES } from "@opensystemslab/planx-core/types"; -import { hasFeatureFlag } from "lib/featureFlags"; import { clearLocalFlow } from "lib/local"; import { capitalize } from "lodash"; import { Route } from "navi"; @@ -43,7 +42,6 @@ import { useStore } from "../pages/FlowEditor/lib/store"; import { rootFlowPath, rootTeamPath } from "../routes/utils"; import AnalyticsDisabledBanner from "./AnalyticsDisabledBanner"; import { ConfirmationDialog } from "./ConfirmationDialog"; -import FeatureFlagBanner from "./FeatureFlagBanner"; import TestEnvironmentBanner from "./TestEnvironmentBanner"; export const HEADER_HEIGHT = 74; @@ -274,8 +272,7 @@ const NavBar: React.FC = () => { ); const isSaveAndReturnLandingPage = path !== ApplicationPath.SingleSession && - !saveToEmail && - !hasFeatureFlag("DISABLE_SAVE_AND_RETURN"); + !saveToEmail; const isContentPage = useCurrentRoute()?.data?.isContentPage; const { node } = useAnalyticsTracking(); const isSectionCard = node?.type == TYPES.Section; @@ -378,7 +375,6 @@ const PublicToolbar: React.FC<{ - export const setPath = (flowData: Store.flow, req: NaviRequest) => { // XXX: store.path is SingleSession by default if (!isSaveReturnFlow(flowData)) return; - if (hasFeatureFlag("DISABLE_SAVE_AND_RETURN")) return; + const isEmailCaptured = Boolean(useStore.getState().saveToEmail); const path = req.params.sessionId && !isEmailCaptured From adf4c912ebd8a8e3d530fa1e2979e670f62b1865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Fri, 16 Feb 2024 09:14:54 +0000 Subject: [PATCH 2/3] docs: Add step to update `flows.analytics_link` column (#2800) --- doc/how-to/how-to-setup-metabase-for-a-new-team.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/how-to/how-to-setup-metabase-for-a-new-team.md b/doc/how-to/how-to-setup-metabase-for-a-new-team.md index 109186594f..03727a8d7a 100644 --- a/doc/how-to/how-to-setup-metabase-for-a-new-team.md +++ b/doc/how-to/how-to-setup-metabase-for-a-new-team.md @@ -55,5 +55,7 @@ query GetFlowIDsForTeam { ![Screenshot - Share Dashboard link with team](./images/setup-metabase/share_with_team.png) 8. Update "ODP Useful Links" document on Notion -* Link: https://www.notion.so/opensystemslab/Open-Digital-Planning-Useful-links-176e31a4d1274c82959d83fe503d274f -* Dashboards are listed under PlanX > BETA services & analytics > {Council}) \ No newline at end of file +* Link: [https://www.notion.so/opensystemslab/Open-Digital-Planning-Useful-links-176e31a4d1274c82959d83fe503d274f](https://www.notion.so/opensystemslab/Plan-Service-Content-d579ddc3f4f3472b8fe167865ede2e93?pvs=4#e637abed931d4697a2707455d81e4620)https://www.notion.so/opensystemslab/Plan-Service-Content-d579ddc3f4f3472b8fe167865ede2e93?pvs=4#e637abed931d4697a2707455d81e4620 +* Dashboards are listed under PlanX Service Content > BETA services & analytics > {Council}) + +9. Update the `flows.analytics_link` column in Hasura with the public URL (generated in step 6), for each flow a dashboard has been generated for From ed7d245f92e7727813de51c0f26df3ae059dd864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Fri, 16 Feb 2024 09:15:12 +0000 Subject: [PATCH 3/3] fix: Restore flow privacy pages (#2799) --- editor.planx.uk/src/pages/layout/PublicLayout.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/editor.planx.uk/src/pages/layout/PublicLayout.tsx b/editor.planx.uk/src/pages/layout/PublicLayout.tsx index d7527940ce..b22d450c1d 100644 --- a/editor.planx.uk/src/pages/layout/PublicLayout.tsx +++ b/editor.planx.uk/src/pages/layout/PublicLayout.tsx @@ -42,13 +42,6 @@ const PublicFooter: React.FC = () => { const setting = flowSettings?.elements && flowSettings?.elements[key]; if (setting?.show) { - if (key == "privacy") { - return { - title: setting.heading, - href: "https://www.planx.uk/privacy", - newTab: true, - }; - } return { title: setting.heading, href: makeHref(key),