WF-disable new version when archive
Issue-ID: SDC-2000
Change-Id: I29c988c22d047ef67c65385ef28beaae5714f7bb
Signed-off-by: Yarin Dekel <yarind@amdocs.com>
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 2ea70a7..9e26793 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 { 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 @@
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 9cc1e73..1089e20 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 @@
<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 b207bc8..18e33bf 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 @@
onCreateVersion,
onSelectVersion,
selectedVersion,
- isVersionsCertifies
+ isVersionsCertifies,
+ isArchive
}) => {
return (
<div className="workflow-versions">
@@ -35,6 +36,7 @@
<NewVersionContainer
onCreateVersion={onCreateVersion}
isVersionsCertifies={isVersionsCertifies}
+ isArchive={isArchive}
/>
<div className="versions-page-list-and-tree">
<VersionTree
@@ -58,7 +60,8 @@
onCreateVersion: PropTypes.func,
onSelectVersion: PropTypes.func,
selectedVersion: PropTypes.string,
- isVersionsCertifies: PropTypes.bool
+ isVersionsCertifies: PropTypes.bool,
+ isArchive: PropTypes.bool
};
export default WorkflowVersions;