From e9657fd9f7e20ca5c7e21a64872dbbc9e2061013 Mon Sep 17 00:00:00 2001 From: Stanislav Vishnevetskiy Date: Wed, 28 Nov 2018 15:30:14 +0200 Subject: workflow on context update Issue-ID: SDC-1953 Change-Id: Iede18ed487c3ccba920fa708c6ca3d4f2ef77b4c Signed-off-by: Stanislav Vishnevetskiy --- .../versionController/VersionControllerView.jsx | 18 ++++++++++++++---- .../versionController/views/OperationModeButtons.js | 17 +++++++++++------ .../src/features/workflow/workflowSelectors.js | 4 ++-- .../src/pluginContext/pluginContextConstants.js | 1 + 4 files changed, 28 insertions(+), 12 deletions(-) (limited to 'workflow-designer-ui') diff --git a/workflow-designer-ui/src/main/frontend/src/features/version/versionController/VersionControllerView.jsx b/workflow-designer-ui/src/main/frontend/src/features/version/versionController/VersionControllerView.jsx index 2f86db4e..f2511c08 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/version/versionController/VersionControllerView.jsx +++ b/workflow-designer-ui/src/main/frontend/src/features/version/versionController/VersionControllerView.jsx @@ -21,7 +21,10 @@ import OperationModeButtons from 'features/version/versionController/views/Opera import VersionContainer from 'features/version/versionController/views/VersionsContainer'; import WorkflowTitle from 'features/version/versionController/views/WorkflowTitle'; import { PluginPubSub } from 'shared/pubsub/plugin-pubsub.ts'; -import { notificationType } from 'wfapp/pluginContext/pluginContextConstants'; +import { + notificationType, + CATALOG_PATH +} from 'wfapp/pluginContext/pluginContextConstants'; export default class VersionControllerView extends Component { static propTypes = { location: PropTypes.object, @@ -64,12 +67,18 @@ export default class VersionControllerView extends Component { } = this.props; saveParamsToServer({ params: savedParams, workflowId, workflowName }); }; - handleSendMsgToCatalog = isCompeleted => { + handleSendMsgToCatalog = () => { const { - pluginContext: { eventsClientId, parentUrl } + pluginContext: { eventsClientId, parentUrl }, + workflowId, + isCertifyDisable } = this.props; const client = new PluginPubSub(eventsClientId, parentUrl); - client.notify(notificationType.CLOSE, { isCompleted: isCompeleted }); + client.notify(notificationType.CLOSE, { + isCompleted: isCertifyDisable, + workflowId, + path: CATALOG_PATH + }); }; certifyVersion = () => { const { @@ -133,6 +142,7 @@ export default class VersionControllerView extends Component { sendMsgToCatalog={this.handleSendMsgToCatalog} saveDisabled={isReadonly} onSaveClick={this.sendSaveParamsToServer} + onCertifyClick={this.certifyVersion} /> )} {!operationMode && ( diff --git a/workflow-designer-ui/src/main/frontend/src/features/version/versionController/views/OperationModeButtons.js b/workflow-designer-ui/src/main/frontend/src/features/version/versionController/views/OperationModeButtons.js index 20de95d8..ea943974 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/version/versionController/views/OperationModeButtons.js +++ b/workflow-designer-ui/src/main/frontend/src/features/version/versionController/views/OperationModeButtons.js @@ -21,9 +21,12 @@ import PropTypes from 'prop-types'; import SvgButton from 'features/version/versionController/views/SvgButton'; const OperationModeButtons = props => { - const { onSaveClick, saveDisabled, sendMsgToCatalog } = props; - const handleCompleteMsgToCatalog = () => sendMsgToCatalog(true); - const handleGoBackMsgToCatalog = () => sendMsgToCatalog(); + const { + onSaveClick, + saveDisabled, + sendMsgToCatalog, + onCertifyClick + } = props; return (
@@ -37,9 +40,10 @@ const OperationModeButtons = props => { /> @@ -48,7 +52,7 @@ const OperationModeButtons = props => { className="vs-back-btn" dataTestId="vc-back-btn" name="upload" - onClick={handleGoBackMsgToCatalog} + onClick={sendMsgToCatalog} />
@@ -59,7 +63,8 @@ const OperationModeButtons = props => { OperationModeButtons.propTypes = { onSaveClick: PropTypes.func, saveDisabled: PropTypes.bool, - sendMsgToCatalog: PropTypes.func + sendMsgToCatalog: PropTypes.func, + onCertifyClick: PropTypes.func }; export default OperationModeButtons; diff --git a/workflow-designer-ui/src/main/frontend/src/features/workflow/workflowSelectors.js b/workflow-designer-ui/src/main/frontend/src/features/workflow/workflowSelectors.js index e03bfbf0..53487012 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/workflow/workflowSelectors.js +++ b/workflow-designer-ui/src/main/frontend/src/features/workflow/workflowSelectors.js @@ -30,5 +30,5 @@ export const isWorkflowArchive = state => state && state.workflow && state.workflow.data && - state.workflow.data.status && - state.workflow.data.status === WORKFLOW_STATUS.ARCHIVE; + state.workflow.data.archiving && + state.workflow.data.archiving === WORKFLOW_STATUS.ARCHIVE; diff --git a/workflow-designer-ui/src/main/frontend/src/pluginContext/pluginContextConstants.js b/workflow-designer-ui/src/main/frontend/src/pluginContext/pluginContextConstants.js index 942555b8..0f8f409f 100644 --- a/workflow-designer-ui/src/main/frontend/src/pluginContext/pluginContextConstants.js +++ b/workflow-designer-ui/src/main/frontend/src/pluginContext/pluginContextConstants.js @@ -19,3 +19,4 @@ export const notificationType = { READY: 'READY', CLOSE: 'CLOSE' }; +export const CATALOG_PATH = 'workspace.interface_operation'; -- cgit 1.2.3-korg