summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/OnboardingReducers.js
diff options
context:
space:
mode:
authorsvishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>2018-03-19 12:15:19 +0200
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2018-03-20 07:51:05 +0000
commit091edfdac90f66d91caff1b93131f99ba74f9aeb (patch)
treea6a24fc4a295b7f804aeb2a2211e58b38bbf922a /openecomp-ui/src/sdc-app/onboarding/OnboardingReducers.js
parentfefa3e408f77289594e47edc878d1bee61fca90b (diff)
ui support for archive items
Issue-ID: SDC-1088 Change-Id: I836e4896a8ec6bb065f9d2571f514916ccf6759f Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/OnboardingReducers.js')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/OnboardingReducers.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/OnboardingReducers.js b/openecomp-ui/src/sdc-app/onboarding/OnboardingReducers.js
index 2eb455f9dd..16c0e61491 100644
--- a/openecomp-ui/src/sdc-app/onboarding/OnboardingReducers.js
+++ b/openecomp-ui/src/sdc-app/onboarding/OnboardingReducers.js
@@ -23,7 +23,7 @@ import {SyncStates} from 'sdc-app/common/merge/MergeEditorConstants.js';
import {catalogItemStatuses} from './onboard/onboardingCatalog/OnboardingCatalogConstants.js';
import Configuration from 'sdc-app/config/Configuration.js';
-const checkReadOnly = ({isCollaborator = true, inMerge = false, isCertified = false}) => !isCollaborator || inMerge || isCertified;
+const checkReadOnly = ({isCollaborator = true, inMerge = false, isCertified = false, isArchived = false}) => !isCollaborator || inMerge || isCertified || isArchived;
const currentScreen = (state = {
forceBreadCrumbsUpdate: false,
@@ -37,6 +37,7 @@ const currentScreen = (state = {
case actionTypes.SET_CURRENT_SCREEN: {
let itemPermission = {...state.itemPermission};
let {currentScreen} = action;
+ itemPermission.isArchived = currentScreen.props.status === catalogItemStatuses.ARCHIVED;
if (currentScreen.props.version) {
let {status} = currentScreen.props.version;
@@ -70,7 +71,7 @@ const currentScreen = (state = {
props: {
...state.props,
version: action.version,
- isReadOnlyMode: checkReadOnly(state.itemPermission)
+ isReadOnlyMode: checkReadOnly({...state.itemPermission,itemStatus: state.props.status})
}
};
@@ -114,12 +115,13 @@ const currentScreen = (state = {
}
case actionTypes.UPDATE_ITEM_STATUS: {
- const {itemState: {synchronizationState, dirty}, itemStatus, updatedVersion} = action;
+ const {itemState: {synchronizationState, dirty}, itemStatus, updatedVersion, archivedStatus} = action;
const inMerge = synchronizationState === SyncStates.MERGE;
const isOutOfSync = synchronizationState === SyncStates.OUT_OF_SYNC;
const isUpToDate = synchronizationState === SyncStates.UP_TO_DATE;
const isCertified = itemStatus === catalogItemStatuses.CERTIFIED;
- const itemPermission = {...state.itemPermission, inMerge, isDirty: dirty, isOutOfSync, isUpToDate, isCertified};
+ const isArchived = archivedStatus === catalogItemStatuses.ARCHIVED;
+ const itemPermission = {...state.itemPermission, inMerge, isDirty: dirty, isOutOfSync, isUpToDate, isCertified, isArchived};
const isReadOnlyMode = checkReadOnly(itemPermission);
const props = {...state.props, isReadOnlyMode, version: {...state.props.version, ...updatedVersion}};