diff --git a/api.planx.uk/modules/send/uniform/uniform.ts b/api.planx.uk/modules/send/uniform/uniform.ts index ce8e6b2dda..db6baf656a 100644 --- a/api.planx.uk/modules/send/uniform/uniform.ts +++ b/api.planx.uk/modules/send/uniform/uniform.ts @@ -309,6 +309,13 @@ async function attachArchive( const response = await axios.request(attachArchiveConfig); // successful upload returns 204 No Content without body const isSuccess = response.status === 204; + + // Temp additional logging to debug failures + console.log("*** Uniform attachArchive response ***"); + console.log({ status: response.status }); + console.log(JSON.stringify(response.data, null, 2)); + console.log("******"); + return isSuccess; } diff --git a/editor.planx.uk/src/@planx/components/Send/Public.tsx b/editor.planx.uk/src/@planx/components/Send/Public.tsx index b6d9dcd373..8b8be0b35f 100644 --- a/editor.planx.uk/src/@planx/components/Send/Public.tsx +++ b/editor.planx.uk/src/@planx/components/Send/Public.tsx @@ -26,7 +26,7 @@ const SendComponent: React.FC = ({ const fullProps = { destinations: destinations, ...props }; if ( window.location.pathname.endsWith("/draft") || - window.location.pathname.endsWith("/amber") + window.location.pathname.endsWith("/preview") ) { return ; } else { diff --git a/editor.planx.uk/src/components/Header.test.tsx b/editor.planx.uk/src/components/Header.test.tsx index 6bb571dc9f..73ea68818b 100644 --- a/editor.planx.uk/src/components/Header.test.tsx +++ b/editor.planx.uk/src/components/Header.test.tsx @@ -106,7 +106,7 @@ describe("Header Component - Editor Route", () => { }); }); -for (const route of ["/published", "/amber", "/draft", "/pay", "/invite"]) { +for (const route of ["/published", "/preview", "/draft", "/pay", "/invite"]) { describe(`Header Component - ${route} Routes`, () => { beforeAll(() => { jest.spyOn(ReactNavi, "useCurrentRoute").mockImplementation( diff --git a/editor.planx.uk/src/lib/graphql.ts b/editor.planx.uk/src/lib/graphql.ts index 5840785314..0e29fcaadd 100644 --- a/editor.planx.uk/src/lib/graphql.ts +++ b/editor.planx.uk/src/lib/graphql.ts @@ -214,7 +214,7 @@ export const client = new ApolloClient({ /** * Client used to make requests in all public interface - * e.g. /published, /amber, /draft, /pay + * e.g. /published, /preview, /draft, /pay */ export const publicClient = new ApolloClient({ link: from([retryLink, errorLink, publicHttpLink]), diff --git a/editor.planx.uk/src/pages/FlowEditor/components/PreviewBrowser.tsx b/editor.planx.uk/src/pages/FlowEditor/components/PreviewBrowser.tsx index 7ddebb07a2..2b94126ccb 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/PreviewBrowser.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/PreviewBrowser.tsx @@ -352,7 +352,7 @@ const AlteredNodesSummaryContent = (props: { {`Preview these content changes in-service before publishing `} - + {`here (opens in a new tab).`} @@ -426,7 +426,7 @@ const PreviewBrowser: React.FC<{ @@ -480,7 +480,7 @@ const PreviewBrowser: React.FC<{ import("./published")), // XXX: keeps old URL working, but only for the team listed in the domain. "/:flow": lazy(() => import("./published")), "/:flow/pay": mountPayRoutes(), - "/:team/:flow/preview": map(async (req) => - redirect( - `/${req.params.team}/${req.params.flow}/published${req?.search}`, - ), - ), // XXX: We're not sure where to redirect `/` to so for now we'll just return the default 404 // "/": redirect("somewhere?"), }) : mount({ "/:team/:flow/published": lazy(() => import("./published")), // loads current published flow if exists, or throws Not Found if unpublished - "/:team/:flow/amber": lazy(() => import("./preview")), // loads current draft flow and latest published external portals, or throws Not Found if any external portal is unpublished + "/:team/:flow/preview": lazy(() => import("./preview")), // loads current draft flow and latest published external portals, or throws Not Found if any external portal is unpublished "/:team/:flow/draft": lazy(() => import("./draft")), // loads current draft flow and draft external portals "/:team/:flow/pay": mountPayRoutes(), - "/:team/:flow/preview": map(async (req) => - redirect( - `/${req.params.team}/${req.params.flow}/published${req?.search}`, - ), - ), - "/:team/:flow/unpublished": map(async (req) => - redirect(`/${req.params.team}/${req.params.flow}/amber`), - ), "*": editorRoutes, }); diff --git a/editor.planx.uk/src/routes/views/preview.tsx b/editor.planx.uk/src/routes/views/preview.tsx index 4df368a05b..0cedf9545a 100644 --- a/editor.planx.uk/src/routes/views/preview.tsx +++ b/editor.planx.uk/src/routes/views/preview.tsx @@ -10,7 +10,7 @@ import { getTeamFromDomain } from "routes/utils"; import { fetchSettingsForPublishedView } from "./published"; /** - * View wrapper for /amber (in future /preview) + * View wrapper for /preview * Does not display Save & Return layout as progress is not persisted on this route */ export const previewView = async (req: NaviRequest) => { @@ -18,13 +18,13 @@ export const previewView = async (req: NaviRequest) => { const teamSlug = req.params.team || (await getTeamFromDomain(window.location.hostname)); - // /amber uses the same theme & global settings as /published + // /preview uses the same theme & global settings as /published const data = await fetchSettingsForPublishedView(flowSlug, teamSlug); const flow = data.flows[0]; if (!flow) throw new NotFoundError(`Flow ${flowSlug} not found for ${teamSlug}`); - // /amber fetches draft data of this flow and the latest published version of each external portal + // /preview fetches draft data of this flow and the latest published version of each external portal const flowData = await fetchFlattenedFlowData(flow.id); const state = useStore.getState();