diff --git a/editor.planx.uk/src/@planx/components/Send/Public.tsx b/editor.planx.uk/src/@planx/components/Send/Public.tsx index 8cebb52d20..b6d9dcd373 100644 --- a/editor.planx.uk/src/@planx/components/Send/Public.tsx +++ b/editor.planx.uk/src/@planx/components/Send/Public.tsx @@ -1,3 +1,5 @@ +import ErrorOutline from "@mui/icons-material/ErrorOutline"; +import Typography from "@mui/material/Typography"; import axios from "axios"; import DelayedLoadingIndicator from "components/DelayedLoadingIndicator"; import { useStore } from "pages/FlowEditor/lib/store"; @@ -5,6 +7,7 @@ import React, { useEffect } from "react"; import { useAsync } from "react-use"; import Card from "../shared/Preview/Card"; +import { WarningContainer } from "../shared/Preview/WarningContainer"; import { makeData } from "../shared/utils"; import { PublicProps } from "../ui"; import { @@ -19,6 +22,37 @@ export type Props = PublicProps; const SendComponent: React.FC = ({ destinations = [DEFAULT_DESTINATION], ...props +}) => { + const fullProps = { destinations: destinations, ...props }; + if ( + window.location.pathname.endsWith("/draft") || + window.location.pathname.endsWith("/amber") + ) { + return ; + } else { + return ; + } +}; + +/** + * Skip queuing up Send events on non-Save&Return layout routes because they don't record lowcal_session data + */ +const SkipSendWarning: React.FC = (props) => ( + + + + + You can only test submissions on published routes where + Save & Return is enabled. Click "Continue" to finish reviewing content + and skip submission. + + + +); + +const CreateSendEvents: React.FC = ({ + destinations = [DEFAULT_DESTINATION], + ...props }) => { const [passport, sessionId, teamSlug] = useStore((state) => [ state.computePassport(),