diff --git a/forms-flow-web/src/actions/actionConstants.js b/forms-flow-web/src/actions/actionConstants.js index 089d1ba6bf..b46ba40759 100644 --- a/forms-flow-web/src/actions/actionConstants.js +++ b/forms-flow-web/src/actions/actionConstants.js @@ -137,6 +137,7 @@ const ACTION_CONSTANTS = { BPMN_SEARCH_TEXT: "BPMN_SEARCH_TEXT", DMN_SEARCH_TEXT: "DMN_SEARCH_TEXT", IS_BPMN_MODEL: "IS_BPMN_MODEL", + IS_PUBLIC_DIAGRAM: "IS_PUBLIC_DIAGRAM", //BPM FORMS BPM_FORM_LIST: "BPM_FORM_LIST", IS_BPM_FORM_LIST_LOADING: "IS_BPM_FORM_LIST_LOADING", diff --git a/forms-flow-web/src/actions/processActions.js b/forms-flow-web/src/actions/processActions.js index 0e50903bb7..146a0f9e90 100644 --- a/forms-flow-web/src/actions/processActions.js +++ b/forms-flow-web/src/actions/processActions.js @@ -154,4 +154,11 @@ export const setBpmnModel = (data) => (dispatch) => { type: ACTION_CONSTANTS.IS_BPMN_MODEL, payload: data, }); +}; + +export const setIsPublicDiagram = (data) => (dispatch) => { + dispatch({ + type: ACTION_CONSTANTS.IS_PUBLIC_DIAGRAM, + payload: data, + }); }; \ No newline at end of file diff --git a/forms-flow-web/src/components/Form/List.scss b/forms-flow-web/src/components/Form/List.scss index f20b4fcd13..d247a2b7f1 100644 --- a/forms-flow-web/src/components/Form/List.scss +++ b/forms-flow-web/src/components/Form/List.scss @@ -12,19 +12,18 @@ } .published-forms-label{ - color: #2F6846; + color: #52C41A; background: #EAFBE7 0% 0% no-repeat padding-box; - border: 1px solid #C6F0C2; + border: 1px solid #52C41A; border-radius: 7px; } .unpublished-forms-label{ - background: #EAF5FF 0% 0% no-repeat padding-box; + background: #E6F7FF 0% 0% no-repeat padding-box; border-radius: 7px; - border: 1px solid #B8E1FF; - color: #006096; + border: 1px solid #91D5FF; + color: #1890FF; } - .custom-grid { .col { min-height: 50px; diff --git a/forms-flow-web/src/components/Modeler/Create.js b/forms-flow-web/src/components/Modeler/Create.js index 494ac2d00a..ada16e44a0 100644 --- a/forms-flow-web/src/components/Modeler/Create.js +++ b/forms-flow-web/src/components/Modeler/Create.js @@ -43,7 +43,7 @@ import { /> ) : ( { //select typeOf workflow form useSelector / redux - const tenantKey = useSelector((state) => state.tenants?.tenantId); + const tenantKey = useSelector((state) => state.tenants?.tenantId); const {processId, type} = useParams(); const dispatch = useDispatch(); const [diagramLoading, setDiagramLoading] = useState(false); - const diagramXML = useSelector((state) => state.process.processDiagramXML); - + const diagramXML = useSelector((state) => state.process.processDiagramXML); + const isPublicDiagram = useSelector((state) => state.process.isPublicDiagram); + const redirectUrl = MULTITENANCY_ENABLED ? `/tenant/${tenantKey}/` : "/"; useEffect(()=>{ setDiagramLoading(true); - dispatch(fetchDiagram(processId, tenantKey, type === "bpmn" ? false : true,()=>{ - setDiagramLoading(false); - })); + if(MULTITENANCY_ENABLED && isPublicDiagram === null){ + dispatch(push(`${redirectUrl}processes`)); + } + else{ + const updatedTenantKey = (MULTITENANCY_ENABLED && !isPublicDiagram) ? null : tenantKey; + dispatch(fetchDiagram(processId,updatedTenantKey, type === "bpmn" ? false : true,()=>{ + setDiagramLoading(false); + })); + } },[processId]); useEffect(()=>{ return () => { dispatch(setProcessDiagramXML('')); + dispatch(setIsPublicDiagram(null)); }; },[]); @@ -39,20 +50,22 @@ const EditWorkflow = () => {
{type === "bpmn" ? ( + diagramXML ? + /> : null ) : ( + diagramXML ? + /> : null )}
); diff --git a/forms-flow-web/src/components/Modeler/Editors/BpmnEditor/index.js b/forms-flow-web/src/components/Modeler/Editors/BpmnEditor/index.js index 11efdb1c00..5bd5f12689 100644 --- a/forms-flow-web/src/components/Modeler/Editors/BpmnEditor/index.js +++ b/forms-flow-web/src/components/Modeler/Editors/BpmnEditor/index.js @@ -108,7 +108,7 @@ export default React.memo( if (diagramXML) { dispatch(setProcessDiagramLoading(true)); dispatch(setProcessDiagramXML(diagramXML)); - } else if (processKey && !isNewDiagram) { + } else if (processKey && !isNewDiagram && !bpmnXml) { dispatch(setProcessDiagramLoading(true)); dispatch(fetchDiagram(processKey, tenant)); } else { @@ -302,7 +302,7 @@ export default React.memo(