diff --git a/forms-flow-web/src/components/App.jsx b/forms-flow-web/src/components/App.jsx index a62d7a9d8..66176b2bb 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"; @@ -12,10 +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; + 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 = () => { )}
+