From 69c3c89a1ad09e9e863bcf993ed83ba9cb59182c Mon Sep 17 00:00:00 2001 From: Yarin Dekel Date: Thu, 13 Dec 2018 12:14:22 +0200 Subject: WF-disable new version when archive Issue-ID: SDC-2000 Change-Id: I29c988c22d047ef67c65385ef28beaae5714f7bb Signed-off-by: Yarin Dekel --- .../version/create/views/NewVersionContainer.jsx | 16 ++++++++++------ .../src/features/workflow/overview/OverviewView.jsx | 1 + .../workflow/overview/views/WorkflowVersions.jsx | 7 +++++-- 3 files changed, 16 insertions(+), 8 deletions(-) (limited to 'workflow-designer-ui/src/main/frontend') 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 (
@@ -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 {
{ return (
@@ -35,6 +36,7 @@ const WorkflowVersions = ({