From 7abe417b4b1e5edaeab58e954bcd6353e094251d Mon Sep 17 00:00:00 2001 From: fahad-aot Date: Thu, 19 Dec 2024 04:10:01 -0800 Subject: [PATCH] added set for future use & added helper fn in MF --- forms-flow-web/src/components/App.jsx | 9 +++++---- forms-flow-web/src/components/Form/EditForm/FormEdit.js | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/forms-flow-web/src/components/App.jsx b/forms-flow-web/src/components/App.jsx index 7f1df5835..66176b2bb 100644 --- a/forms-flow-web/src/components/App.jsx +++ b/forms-flow-web/src/components/App.jsx @@ -12,17 +12,18 @@ import { QueryClientProvider, } from 'react-query'; const queryClient = new QueryClient(); +import { HelperServices } from '@formsflow/service'; + const App = React.memo((props) => { const { store, history, publish, subscribe, getKcInstance } = props; const [isPreviewRoute,setIsPreviewRoute] = useState(false); useEffect(()=> { const location = window.location.pathname; - if(location.includes("view-edit")){ - setIsPreviewRoute(true); - } + const viewOnlyRoutes = new Set (["view-edit"]); + setIsPreviewRoute(() => HelperServices.isViewOnlyRoute(location,viewOnlyRoutes)); },[]); return ( -
+
{KEYCLOAK_URL ? : null} diff --git a/forms-flow-web/src/components/Form/EditForm/FormEdit.js b/forms-flow-web/src/components/Form/EditForm/FormEdit.js index eb99d97da..0a8ff4793 100644 --- a/forms-flow-web/src/components/Form/EditForm/FormEdit.js +++ b/forms-flow-web/src/components/Form/EditForm/FormEdit.js @@ -1090,6 +1090,7 @@ const EditComponent = () => { )}
+
{!createDesigns ? ( @@ -1119,6 +1120,7 @@ const EditComponent = () => { )}
+