From 85be98c1b029e8d10da81f3dbd1940c34e0f2ced Mon Sep 17 00:00:00 2001 From: fahad-aot Date: Tue, 17 Dec 2024 11:33:18 -0800 Subject: [PATCH 1/3] bugfix/fwf-4035-Hid sidebar in preview page --- forms-flow-web/src/components/App.jsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/forms-flow-web/src/components/App.jsx b/forms-flow-web/src/components/App.jsx index a62d7a9d81..7122f6b089 100644 --- a/forms-flow-web/src/components/App.jsx +++ b/forms-flow-web/src/components/App.jsx @@ -1,4 +1,4 @@ -import React from "react"; +import React,{useState, useEffect} from "react"; import PropTypes from "prop-types"; import { Provider } from "react-redux"; import { ConnectedRouter } from "connected-react-router"; @@ -14,8 +14,15 @@ import { const queryClient = new QueryClient(); 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); + } + },[]); return ( -
+
{KEYCLOAK_URL ? : null} From e7664b0695bd1f1aa223c977727c37da57b6c35f Mon Sep 17 00:00:00 2001 From: fahad-aot Date: Wed, 18 Dec 2024 23:29:46 -0800 Subject: [PATCH 2/3] updated --- forms-flow-web/src/components/App.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forms-flow-web/src/components/App.jsx b/forms-flow-web/src/components/App.jsx index 7122f6b089..7f1df58355 100644 --- a/forms-flow-web/src/components/App.jsx +++ b/forms-flow-web/src/components/App.jsx @@ -22,7 +22,7 @@ const App = React.memo((props) => { } },[]); return ( -
+
{KEYCLOAK_URL ? : null} From 7abe417b4b1e5edaeab58e954bcd6353e094251d Mon Sep 17 00:00:00 2001 From: fahad-aot Date: Thu, 19 Dec 2024 04:10:01 -0800 Subject: [PATCH 3/3] 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 7f1df58355..66176b2bb1 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 eb99d97da9..0a8ff47937 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 = () => { )}
+