diff options
author | Yarin Dekel <yarind@amdocs.com> | 2018-12-13 12:14:22 +0200 |
---|---|---|
committer | Yarin Dekel <yarind@amdocs.com> | 2018-12-13 12:14:25 +0200 |
commit | 69c3c89a1ad09e9e863bcf993ed83ba9cb59182c (patch) | |
tree | 24761a51a546c90c012f09afc08388fda89032e5 /workflow-designer-ui/src | |
parent | 1be5fbc5286bf31098269a5e95a63df2f40a7c01 (diff) |
WF-disable new version when archive
Issue-ID: SDC-2000
Change-Id: I29c988c22d047ef67c65385ef28beaae5714f7bb
Signed-off-by: Yarin Dekel <yarind@amdocs.com>
Diffstat (limited to 'workflow-designer-ui/src')
3 files changed, 16 insertions, 8 deletions
diff --git a/workflow-designer-ui/src/main/frontend/src/features/version/create/views/NewVersionContainer.jsx b/workflow-designer-ui/src/main/frontend/src/features/version/create/views/NewVersionContainer.jsx index 2ea70a77..9e26793a 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/version/create/views/NewVersionContainer.jsx +++ b/workflow-designer-ui/src/main/frontend/src/features/version/create/views/NewVersionContainer.jsx @@ -18,11 +18,14 @@ import PropTypes from 'prop-types'; import { I18n } from 'react-redux-i18n'; import SVGIcon from 'sdc-ui/lib/react/SVGIcon'; -const NewVersionContainer = ({ onCreateVersion, isVersionsCertifies }) => { - const newVersionDisabledClass = isVersionsCertifies - ? '' - : 'newVersionDisabled'; - const svgColor = isVersionsCertifies ? 'primary' : 'secondary'; +const NewVersionContainer = ({ + onCreateVersion, + isVersionsCertifies, + isArchive +}) => { + const disableClass = isVersionsCertifies && !isArchive; + const newVersionDisabledClass = disableClass ? '' : 'newVersionDisabled'; + const svgColor = disableClass ? 'primary' : 'secondary'; return ( <div className={`create-new-version ${newVersionDisabledClass}`}> <div className="create-item-plus-icon" onClick={onCreateVersion}> @@ -35,7 +38,8 @@ const NewVersionContainer = ({ onCreateVersion, isVersionsCertifies }) => { NewVersionContainer.propTypes = { onCreateVersion: PropTypes.func, - isVersionsCertifies: PropTypes.bool + isVersionsCertifies: PropTypes.bool, + isArchive: PropTypes.bool }; export default NewVersionContainer; diff --git a/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/OverviewView.jsx b/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/OverviewView.jsx index 9cc1e737..1089e209 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/OverviewView.jsx +++ b/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/OverviewView.jsx @@ -119,6 +119,7 @@ class OverviewView extends Component { <div className={'separator overview-separator'} /> <WorkflowVersions + isArchive={isArchive} nodeVersions={nodeVersions} versions={versions} onCreateVersion={this.onCreateNewVersionFromTable} diff --git a/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/views/WorkflowVersions.jsx b/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/views/WorkflowVersions.jsx index b207bc8a..18e33bf1 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/views/WorkflowVersions.jsx +++ b/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/views/WorkflowVersions.jsx @@ -27,7 +27,8 @@ const WorkflowVersions = ({ onCreateVersion, onSelectVersion, selectedVersion, - isVersionsCertifies + isVersionsCertifies, + isArchive }) => { return ( <div className="workflow-versions"> @@ -35,6 +36,7 @@ const WorkflowVersions = ({ <NewVersionContainer onCreateVersion={onCreateVersion} isVersionsCertifies={isVersionsCertifies} + isArchive={isArchive} /> <div className="versions-page-list-and-tree"> <VersionTree @@ -58,7 +60,8 @@ WorkflowVersions.propTypes = { onCreateVersion: PropTypes.func, onSelectVersion: PropTypes.func, selectedVersion: PropTypes.string, - isVersionsCertifies: PropTypes.bool + isVersionsCertifies: PropTypes.bool, + isArchive: PropTypes.bool }; export default WorkflowVersions; |