@import "components/userNotifications";
@import "components/overlay";
@import "components/accordion";
+@import "components/vspDetailsVendorSelect";
%noselect {
-webkit-touch-callout: none;
color: $dark-gray;
}
}
+ .depricated-item-status {
+ color: $white;
+ background-color: $gray;
+ margin-left: 10px;
+ padding: 5px 8px;
+ border-radius: 5px;
+ }
}
.save-submit-cancel-container {
--- /dev/null
+.vsp-details-vendor-select {
+ .validation-form-content {
+ padding-top: 20px;
+ .vendor-selector-modal-title {
+ @extend .body-1;
+ }
+ .vendor-selector-modal-additional-text {
+ @extend .body-2;
+ margin-top: 10px;
+ margin-bottom: 20px;
+ }
+ }
+}
\ No newline at end of file
.svg-icon-wrapper {
justify-content: flex-start;
}
-
- .versions-page-title {
- @extend .heading-1;
- text-transform: uppercase;
- margin-bottom: 29px;
- color: $blue;
- }
-
+ .version-page-header {
+ display: flex;
+ justify-content: space-between;
+ .versions-page-title {
+ @extend .heading-1;
+ text-transform: uppercase;
+ margin-bottom: 29px;
+ color: $blue;
+ }
+ .depricate-btn-wrapper {
+ display: flex;
+ justify-content: flex-end;
+ margin-bottom: 10px;
+ }
+ }
.versions-page-permissions-view-wrapper {
@extend .body-1-semibold;
@include version-page-box-shadow();
.form-group {
margin-bottom: 10px;
}
+ .catalog-filter-items-type {
+ width: 100%;
+ background-color: $gray;
+ color: $white;
+ }
}
\ No newline at end of file
render() {
let {version = {}, viewableVersions = [], onVersionSwitching, onMoreVersionsClick, callVCAction, onSave, isReadOnlyMode, itemPermission,
- isFormDataValid, onClose, onManagePermissions, permissions = {}, userInfo, usersList, itemName,
- onOpenCommentCommitModal, onOpenRevisionsModal, isManual, candidateInProcess} = this.props;
+ isFormDataValid, onClose, onManagePermissions, permissions = {}, userInfo, usersList, itemName,
+ onOpenCommentCommitModal, onOpenRevisionsModal, isManual, candidateInProcess, isArchived} = this.props;
return (
<div className='version-controller-bar'>
<div className={`vc-container ${candidateInProcess ? 'disabled' : ''}`}>
version={version}
onVersionSwitching={onVersionSwitching}
onMoreVersionsClick={() => onMoreVersionsClick({itemName, users: usersList})}/>
- </div>
+ {isArchived && <div className='depricated-item-status'>{i18n('Archived')}</div>}
+ </div>
<div className='save-submit-cancel-container'>
<ActionButtons onSubmit={callVCAction ? () => this.submit(callVCAction, version) : undefined}
onRevert={callVCAction ? () => this.revert(callVCAction, version) : undefined}
onOpenRevisionsModal={onOpenRevisionsModal}
- onSave={onSave ? () => onSave() : undefined}
+ onSave={onSave ? () => onSave() : undefined}
permissions={permissions}
userInfo={userInfo}
onManagePermissions={onManagePermissions}
onCommit={callVCAction ? (comment) => this.commit(callVCAction, version, comment) : undefined}
isFormDataValid={isFormDataValid}
itemPermissions={itemPermission}
+ isArchived={isArchived}
isReadOnlyMode={isReadOnlyMode || candidateInProcess}
isManual={isManual} />
<div className='vc-separator'></div>
/*!
- * Copyright © 2016-2017 European Support Limited
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
);
-const ActionButtons = ({isReadOnlyMode, onSubmit, onRevert, onSave, isFormDataValid, onClickPermissions, onSync, onCommit,
+const ActionButtons = ({isReadOnlyMode, onSubmit, onRevert, onSave, isFormDataValid, onClickPermissions, onSync, onCommit, isArchived,
onOpenCommentCommitModal, showPermissions, onClosePermissions, permissions, onManagePermissions, userInfo, onOpenRevisionsModal, isManual,
itemPermissions: {isCertified, isCollaborator, isDirty, isOutOfSync, isUpToDate}}) => (
<div className='action-buttons'>
</Overlay>
}
</EnhancedClickOutsideWrapper>
- {isCollaborator && <div className='collaborator-action-buttons'>
+ {isCollaborator && !isArchived && <div className='collaborator-action-buttons'>
<Separator />
{onSave && <div className='vc-save-section'>
<VCButton dataTestId='vc-save-btn' onClick={() => onSave()}
<VCButton dataTestId='vc-revert-btn' onClick={onOpenRevisionsModal}
name='version-controller-revert' tooltipText={i18n('Revert')} disabled={isReadOnlyMode || isOutOfSync} />
}
- {onSubmit &&
+ {onSubmit &&
<div className='vc-submit-section'>
<Separator />
<SubmitButton onClick={onSubmit}
"New Software Product": "New Software Product",
"WORKSPACE": "WORKSPACE",
"ONBOARD CATALOG": "ONBOARD CATALOG",
+ "ARCHIVE": "ARCHIVE",
+ "RESTORE": "RESTORE",
"Component Dependencies": "Component Dependencies",
"This software product successfully submitted": "This software product successfully submitted",
"Submit Failed": "Submit Failed",
"Heat": "Heat",
"Volume": "Volume",
"Network": "Network",
- "Artifact": "Artifact",
"Environment": "Environment",
"{errorName}:": "{errorName}:",
"{message}": "{message}",
"Memory - RAM": "Memory - RAM",
"Commit error": "Commit error",
"Item version was certified by Owner": "Item version was certified by Owner",
-
+ "Recently Updated": "Recently Updated",
+ "ENTITY TYPE": "ENTITY TYPE",
+ "ROLE": "ROLE",
+ "Owner": "Owner",
+ "Contributer": "Contributer",
+ "Viewer": "Viewer",
+ "ONBOARDING PROCEDURE": "ONBOARDING PROCEDURE",
+ "Network Package": "Network Package",
+ "Available Versions": "Available Versions",
+ "Archived": "Archived",
+ "Change Archived VLM": "Change Archived VLM",
+ "(Archived)": "(Archived)",
+ "The VLM": "The VLM",
+ "assigned to this VSP is archived": "assigned to this VSP is archived",
+ "If you select a different VLM you will not be able to reselect the archived VLM": "If you select a different VLM you will not be able to reselect the archived VLM",
+ "Item was deleted": "Item was deleted",
+ "Item was archived": "Item was archived",
+ "Item was restored from archive": "Item was restored from archive",
+ "Your Copy Is Out Of Sync": "Your Copy Is Out Of Sync",
+ "Version Submitted": "Version Submitted",
+ "Granted": "Granted",
+ "Taken": "Taken",
+ "Permission": "Permission",
+
"VendorSoftwareProduct": "VSP",
"VendorSoftwareProduct/category": "Category",
"VendorSoftwareProduct/description": "Description",
import {permissionTypes} from 'sdc-app/onboarding/permissions/PermissionsConstants.js';
import {actionsEnum as VersionControllerActionsEnum} from 'nfvo-components/panel/versionController/VersionControllerConstants.js';
import {actionTypes as onboardingActionTypes} from 'sdc-app/onboarding/OnboardingConstants.js';
+import restToggle from 'sdc-app/features/restToggle.js';
+import {featureToggleNames} from 'sdc-app/features/FeaturesConstants.js';
+export const archiveActions = {
+ ARCHIVE: 'ARCHIVE',
+ RESTORE: 'RESTORE'
+};
+
+export const itemStatus = {
+ ARCHIVED: 'ARCHIVED',
+ DRAFT: 'Draft',
+ CERTIFIED: 'Certified'
+};
+
function baseUrl() {
const restPrefix = Configuration.get('restPrefix');
return RestAPIUtil.put(`${baseUrl()}/${itemId}/permissions/${permissionTypes.OWNER}`, {removedUsersIds: [], addedUsersIds: [ownerId]});
},
- checkItemStatus(dispatch, {itemId, versionId}) {
- return ItemsHelper.fetchVersion({itemId, versionId}).then(response => {
- let state = response && response.state || {};
- const {baseId, description, id, name, status} = response;
-
- dispatch({
- type: onboardingActionTypes.UPDATE_ITEM_STATUS,
- itemState: state,
- itemStatus: response.status,
- updatedVersion: {baseId, description, id, name, status}
- });
- return Promise.resolve(response);
+ async checkItemStatus(dispatch, {itemId, versionId}) {
+ const response = await ItemsHelper.fetchVersion({itemId, versionId});
+ let state = response && response.state || {};
+ const {baseId, description, id, name, status} = response;
+ const item = await ItemsHelper.fetchItem(itemId);
+ dispatch({
+ type: onboardingActionTypes.UPDATE_ITEM_STATUS,
+ itemState: state,
+ itemStatus: response.status,
+ archivedStatus: item.status,
+ updatedVersion: {baseId, description, id, name, status}
});
+ return Promise.resolve({...response, archivedStatus: item.status});
},
+
+ fetchItem(itemId) {
+ return restToggle({restFunction: () => RestAPIUtil.fetch(`${baseUrl()}/${itemId}`), featureName: featureToggleNames.ARCHIVE_ITEM, mockResult: {}});
+ },
+
+ archiveItem(itemId) {
+ return RestAPIUtil.put(`${baseUrl()}/${itemId}/actions`, {
+ action: archiveActions.ARCHIVE
+ });
+ },
+ restoreItem(itemId) {
+ return RestAPIUtil.put(`${baseUrl()}/${itemId}/actions`, {
+ action: archiveActions.RESTORE
+ });
+ }
};
export default ItemsHelper;
import {actionTypes as modalActionTypes} from 'nfvo-components/modal/GlobalModalConstants.js';
const ScreensHelper = {
- loadScreen(dispatch, {screen, screenType, props}) {
+ async loadScreen(dispatch, {screen, screenType, props}) {
if(screen === enums.SCREEN.ONBOARDING_CATALOG) {
OnboardingActionHelper.navigateToOnboardingCatalog(dispatch);
return;
}
-
+
screenType = !screenType ? this.getScreenType(screen) : screenType;
if(screenType === screenTypes.LICENSE_MODEL) {
const {licenseModelId, version, licenseModel, usersList} = props;
+ const item = await ItemsHelper.fetchItem(licenseModelId);
let itemStatusPromise = version && screen ?
ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id}) :
Promise.resolve();
versionPageActionHelper.fetchVersions(dispatch, {itemType: itemTypes.LICENSE_MODEL, itemId: licenseModelId});
}
let newVersion = updatedVersion ? updatedVersion : version;
+ const screenProps = {licenseModelId, version: newVersion, status: item.status};
switch (screen) {
case enums.SCREEN.LICENSE_MODEL_OVERVIEW:
- OnboardingActionHelper.navigateToLicenseModelOverview(dispatch, {licenseModelId, version: newVersion});
+ OnboardingActionHelper.navigateToLicenseModelOverview(dispatch, screenProps);
break;
case enums.SCREEN.LICENSE_AGREEMENTS:
- OnboardingActionHelper.navigateToLicenseAgreements(dispatch, {licenseModelId, version: newVersion});
+ OnboardingActionHelper.navigateToLicenseAgreements(dispatch, screenProps);
break;
case enums.SCREEN.FEATURE_GROUPS:
- OnboardingActionHelper.navigateToFeatureGroups(dispatch, {licenseModelId, version: newVersion});
+ OnboardingActionHelper.navigateToFeatureGroups(dispatch, screenProps);
break;
case enums.SCREEN.ENTITLEMENT_POOLS:
- OnboardingActionHelper.navigateToEntitlementPools(dispatch, {licenseModelId, version: newVersion});
+ OnboardingActionHelper.navigateToEntitlementPools(dispatch, screenProps);
break;
case enums.SCREEN.LICENSE_KEY_GROUPS:
- OnboardingActionHelper.navigateToLicenseKeyGroups(dispatch, {licenseModelId, version: newVersion});
+ OnboardingActionHelper.navigateToLicenseKeyGroups(dispatch, screenProps);
break;
case enums.SCREEN.ACTIVITY_LOG:
- OnboardingActionHelper.navigateToLicenseModelActivityLog(dispatch, {licenseModelId, version: newVersion});
+ OnboardingActionHelper.navigateToLicenseModelActivityLog(dispatch, screenProps);
break;
case enums.SCREEN.VERSIONS_PAGE:
default:
else if(screenType === screenTypes.SOFTWARE_PRODUCT) {
const {softwareProductId, componentId, version, softwareProduct, usersList} = props;
+ const item = await ItemsHelper.fetchItem(softwareProductId);
let itemStatusPromise = version && screen ?
ItemsHelper.checkItemStatus(dispatch, {itemId: softwareProductId, versionId: version.id}) :
Promise.resolve();
}
let newVersion = updatedVersion ? updatedVersion : version;
+
+ const props = {
+ softwareProductId,
+ componentId,
+ version: newVersion,
+ status: item.status
+ };
if (screen === screenTypes.SOFTWARE_PRODUCT_COMPONENT_DEFAULT_GENERAL) {
- OnboardingActionHelper.navigateToSoftwareProductComponentGeneralAndUpdateLeftPanel(dispatch, {
- softwareProductId,
- componentId,
- version: newVersion
- });
+ OnboardingActionHelper.navigateToSoftwareProductComponentGeneralAndUpdateLeftPanel(dispatch, props);
}
- if (componentId) {
- switch (screen) {
- case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS:
- OnboardingActionHelper.navigateToSoftwareProductComponentGeneralAndUpdateLeftPanel(dispatch, {
- softwareProductId,
- componentId,
- version: newVersion
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_GENERAL:
- OnboardingActionHelper.navigateToSoftwareProductComponentGeneral(dispatch, {
- softwareProductId,
- componentId,
- version: newVersion
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_COMPUTE:
- OnboardingActionHelper.navigateToComponentCompute(dispatch, {
- softwareProductId,
- componentId,
- version: newVersion
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_LOAD_BALANCING:
- OnboardingActionHelper.navigateToComponentLoadBalancing(dispatch, {
- softwareProductId,
- componentId,
- version: newVersion
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_NETWORK:
- OnboardingActionHelper.navigateToComponentNetwork(dispatch, {
- softwareProductId,
- componentId,
- version: newVersion
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_STORAGE:
- OnboardingActionHelper.navigateToComponentStorage(dispatch, {
- softwareProductId,
- componentId,
- version: newVersion
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_PROCESSES:
- OnboardingActionHelper.navigateToSoftwareProductComponentProcesses(dispatch, {
- softwareProductId,
- componentId,
- version: newVersion
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_MONITORING:
- OnboardingActionHelper.navigateToSoftwareProductComponentMonitoring(dispatch, {
- softwareProductId,
- componentId,
- version: newVersion
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_IMAGES:
- OnboardingActionHelper.navigateToComponentImages(dispatch, {
- softwareProductId,
- componentId,
- version: newVersion
- });
- break;
- }
- }
- else {
- switch (screen) {
- case enums.SCREEN.SOFTWARE_PRODUCT_LANDING_PAGE:
- OnboardingActionHelper.navigateToSoftwareProductLandingPage(dispatch, {
- softwareProductId,
- version: newVersion
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_DETAILS:
- OnboardingActionHelper.navigateToSoftwareProductDetails(dispatch, {
- softwareProductId,
- version: newVersion
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS_SETUP:
- OnboardingActionHelper.navigateToSoftwareProductAttachmentsSetupTab(dispatch, {
- softwareProductId,
- version
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS_VALIDATION:
- OnboardingActionHelper.navigateToSoftwareProductAttachmentsValidationTab(dispatch, {
- softwareProductId,
- version
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_PROCESSES:
- OnboardingActionHelper.navigateToSoftwareProductProcesses(dispatch, {
- softwareProductId,
- version: newVersion
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_DEPLOYMENT:
- OnboardingActionHelper.navigateToSoftwareProductDeployment(dispatch, {
- softwareProductId,
- version: newVersion
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_NETWORKS:
- OnboardingActionHelper.navigateToSoftwareProductNetworks(dispatch, {
- softwareProductId,
- version: newVersion
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_DEPENDENCIES:
- OnboardingActionHelper.navigateToSoftwareProductDependencies(dispatch, {
- softwareProductId,
- version: newVersion
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_ACTIVITY_LOG:
- OnboardingActionHelper.navigateToSoftwareProductActivityLog(dispatch, {
- softwareProductId,
- version: newVersion
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS:
- OnboardingActionHelper.navigateToSoftwareProductComponents(dispatch, {
- softwareProductId,
- version: newVersion
- });
- dispatch({
- type: SoftwareProductActionTypes.TOGGLE_NAVIGATION_ITEM,
- mapOfExpandedIds: {
- [enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS]: true
- }
- });
- break;
- case enums.SCREEN.SOFTWARE_PRODUCT_VERSIONS_PAGE:
- default:
- OnboardingActionHelper.navigateToVersionsPage(dispatch, {
- itemId: softwareProductId,
- itemType: itemTypes.SOFTWARE_PRODUCT,
- itemName: softwareProduct.name,
- users: usersList,
- additionalProps: {
- licenseModelId: softwareProduct.vendorId,
- licensingVersion: softwareProduct.licensingVersion
- }
- });
- break;
- }
+
+ switch (screen) {
+ case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS:
+ OnboardingActionHelper.navigateToSoftwareProductComponentGeneralAndUpdateLeftPanel(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_GENERAL:
+ OnboardingActionHelper.navigateToSoftwareProductComponentGeneral(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_COMPUTE:
+ OnboardingActionHelper.navigateToComponentCompute(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_LOAD_BALANCING:
+ OnboardingActionHelper.navigateToComponentLoadBalancing(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_NETWORK:
+ OnboardingActionHelper.navigateToComponentNetwork(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_STORAGE:
+ OnboardingActionHelper.navigateToComponentStorage(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_PROCESSES:
+ OnboardingActionHelper.navigateToSoftwareProductComponentProcesses(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_MONITORING:
+ OnboardingActionHelper.navigateToSoftwareProductComponentMonitoring(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_IMAGES:
+ OnboardingActionHelper.navigateToComponentImages(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_LANDING_PAGE:
+ OnboardingActionHelper.navigateToSoftwareProductLandingPage(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_DETAILS:
+ OnboardingActionHelper.navigateToSoftwareProductDetails(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS_SETUP:
+ OnboardingActionHelper.navigateToSoftwareProductAttachmentsSetupTab(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS_VALIDATION:
+ OnboardingActionHelper.navigateToSoftwareProductAttachmentsValidationTab(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_PROCESSES:
+ OnboardingActionHelper.navigateToSoftwareProductProcesses(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_DEPLOYMENT:
+ OnboardingActionHelper.navigateToSoftwareProductDeployment(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_NETWORKS:
+ OnboardingActionHelper.navigateToSoftwareProductNetworks(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_DEPENDENCIES:
+ OnboardingActionHelper.navigateToSoftwareProductDependencies(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_ACTIVITY_LOG:
+ OnboardingActionHelper.navigateToSoftwareProductActivityLog(dispatch, props);
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS:
+ OnboardingActionHelper.navigateToSoftwareProductComponents(dispatch, props);
+ dispatch({
+ type: SoftwareProductActionTypes.TOGGLE_NAVIGATION_ITEM,
+ mapOfExpandedIds: {
+ [enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS]: true
+ }
+ });
+ break;
+ case enums.SCREEN.SOFTWARE_PRODUCT_VERSIONS_PAGE:
+ default:
+ OnboardingActionHelper.navigateToVersionsPage(dispatch, {
+ itemId: softwareProductId,
+ itemType: itemTypes.SOFTWARE_PRODUCT,
+ itemName: softwareProduct.name,
+ users: usersList,
+ additionalProps: {
+ licenseModelId: softwareProduct.vendorId,
+ licensingVersion: softwareProduct.licensingVersion
+ }
+ });
+ break;
}
});
}
import Tree from 'nfvo-components/tree/Tree.jsx';
import MergeEditor from 'sdc-app/common/merge/MergeEditor.js';
import Revisions from 'sdc-app/onboarding/revisions/Revisions.js';
+import VendorSelector from 'sdc-app/onboarding/softwareProduct/details/SoftwareProductDetailsVendorSelector.jsx';
export const modalContentMapper = {
SOFTWARE_PRODUCT_CREATION: 'SOFTWARE_PRODUCT_CREATION',
COMMIT_COMMENT: 'COMMIT_COMMENT',
VERSION_TREE: 'VERSION_TREE',
MERGE_EDITOR: 'MERGE_EDITOR',
- REVISIONS_LIST: 'REVISIONS_LIST'
+ REVISIONS_LIST: 'REVISIONS_LIST',
+ VENDOR_SELECTOR: 'VENDOR_SELECTOR'
+
};
export const modalContentComponents = {
COMMIT_COMMENT: CommitCommentModal,
VERSION_TREE: Tree,
MERGE_EDITOR: MergeEditor,
- REVISIONS_LIST: Revisions
+ REVISIONS_LIST: Revisions,
+ VENDOR_SELECTOR: VendorSelector
};
export const actionTypes = keyMirror({
FEATURES_LIST_LOADED: null
-});
\ No newline at end of file
+});
+
+export const featureToggleNames = {
+ ARCHIVE_ITEM: 'ARCHIVE_ITEM',
+ FILTER: 'FILTER'
+};
\ No newline at end of file
import PropTypes from 'prop-types';
import {connect} from 'react-redux';
-export const FeatureComponent = ({features = [], featureName, InnerComponent}) => {
- return !!features.find(el => el.name === featureName && el.active) ? <InnerComponent/> : null;
+export const FeatureComponent = (props) => {
+ const {features = [], featureName, InnerComponent, ...otherProps} = props;
+ const AComp = InnerComponent.AComp ? InnerComponent.AComp : InnerComponent;
+
+ return !!features.find(el => el.name === featureName && el.active) ?
+ <AComp {...otherProps}/>
+ : InnerComponent.BComp ? <InnerComponent.BComp {...otherProps}/> : null;
};
FeatureComponent.propTypes = {
--- /dev/null
+/*!
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+import store from 'sdc-app/AppStore.js';
+
+
+export default ({featureName, restFunction, mockResult}) => {
+ const {features} = store.getState();
+ return !!features.find(el => el.name === featureName && el.active) ?
+ restFunction() : Promise.resolve(mockResult);
+};
\ No newline at end of file
loadItemsLists(dispatch) {
LicenseModelActionHelper.fetchLicenseModels(dispatch);
LicenseModelActionHelper.fetchFinalizedLicenseModels(dispatch);
+ LicenseModelActionHelper.fetchArchivedLicenseModels(dispatch);
SoftwareProductActionHelper.fetchSoftwareProductList(dispatch);
SoftwareProductActionHelper.fetchFinalizedSoftwareProductList(dispatch);
+ SoftwareProductActionHelper.fetchArchivedSoftwareProductList(dispatch);
},
navigateToOnboardingCatalog(dispatch) {
return Promise.resolve();
},
- navigateToLicenseModelOverview(dispatch, {licenseModelId, version}) {
+ navigateToLicenseModelOverview(dispatch, {licenseModelId, version, status}) {
/**
* TODO change to specific rest
LicenseModelActionHelper.fetchLicenseModelById(dispatch, {licenseModelId, version}).then(() => {
LicenseModelActionHelper.fetchLicenseModelItems(dispatch, {licenseModelId, version}).then(() => {
- setCurrentScreen(dispatch, enums.SCREEN.LICENSE_MODEL_OVERVIEW, {licenseModelId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.LICENSE_MODEL_OVERVIEW, {licenseModelId, version, status});
});
licenseModelOverviewActionHelper.selectVLMListView(dispatch, {buttonTab: null});
});
},
- navigateToLicenseAgreements(dispatch, {licenseModelId, version}) {
+ navigateToLicenseAgreements(dispatch, {licenseModelId, version, status}) {
LicenseAgreementActionHelper.fetchLicenseAgreementList(dispatch, {licenseModelId, version});
LicenseModelActionHelper.fetchLicenseModelById(dispatch, {licenseModelId, version}).then(() => {
- setCurrentScreen(dispatch, enums.SCREEN.LICENSE_AGREEMENTS, {licenseModelId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.LICENSE_AGREEMENTS, {licenseModelId, version, status});
});
},
- navigateToFeatureGroups(dispatch, {licenseModelId, version}) {
+ navigateToFeatureGroups(dispatch, {licenseModelId, version, status}) {
FeatureGroupsActionHelper.fetchFeatureGroupsList(dispatch, {licenseModelId, version});
- setCurrentScreen(dispatch, enums.SCREEN.FEATURE_GROUPS, {licenseModelId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.FEATURE_GROUPS, {licenseModelId, version, status});
},
- navigateToEntitlementPools(dispatch, {licenseModelId, version}) {
+ navigateToEntitlementPools(dispatch, {licenseModelId, version, status}) {
EntitlementPoolsActionHelper.fetchEntitlementPoolsList(dispatch, {licenseModelId, version});
- setCurrentScreen(dispatch, enums.SCREEN.ENTITLEMENT_POOLS, {licenseModelId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.ENTITLEMENT_POOLS, {licenseModelId, version, status});
},
- navigateToLicenseKeyGroups(dispatch, {licenseModelId, version}) {
+ navigateToLicenseKeyGroups(dispatch, {licenseModelId, version, status}) {
LicenseKeyGroupsActionHelper.fetchLicenseKeyGroupsList(dispatch, {licenseModelId, version});
- setCurrentScreen(dispatch, enums.SCREEN.LICENSE_KEY_GROUPS, {licenseModelId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.LICENSE_KEY_GROUPS, {licenseModelId, version, status});
},
- navigateToLicenseModelActivityLog(dispatch, {licenseModelId, version}){
+ navigateToLicenseModelActivityLog(dispatch, {licenseModelId, version, status}){
ActivityLogActionHelper.fetchActivityLog(dispatch, {itemId: licenseModelId, versionId: version.id});
- setCurrentScreen(dispatch, enums.SCREEN.ACTIVITY_LOG, {licenseModelId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.ACTIVITY_LOG, {licenseModelId, version, status});
},
- navigateToSoftwareProductLandingPage(dispatch, {softwareProductId, version}) {
+ navigateToSoftwareProductLandingPage(dispatch, {softwareProductId, version, status}) {
SoftwareProductComponentsActionHelper.clearComponentsStore(dispatch);
SoftwareProductActionHelper.fetchSoftwareProduct(dispatch, {softwareProductId, version}).then(response => {
let {vendorId: licenseModelId, licensingVersion} = response[0];
if(response[0].onboardingOrigin === onboardingOriginTypes.ZIP) {
SoftwareProductActionHelper.loadSoftwareProductHeatCandidate(dispatch, {softwareProductId, version: version});
}
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_LANDING_PAGE, {softwareProductId, licenseModelId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_LANDING_PAGE, {softwareProductId, licenseModelId, version, status});
});
},
- navigateToSoftwareProductDetails(dispatch, {softwareProductId, version}) {
+ navigateToSoftwareProductDetails(dispatch, {softwareProductId, version, status}) {
SoftwareProductActionHelper.fetchSoftwareProduct(dispatch, {softwareProductId, version}).then(response => {
let {vendorId: licenseModelId, licensingVersion} = response[0];
SoftwareProductActionHelper.loadLicensingVersionsList(dispatch, {licenseModelId});
SoftwareProductActionHelper.loadSoftwareProductDetailsData(dispatch, {licenseModelId, licensingVersion});
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_DETAILS, {softwareProductId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_DETAILS, {softwareProductId, version, status});
});
},
- navigateToSoftwareProductAttachmentsSetupTab(dispatch, {softwareProductId, version}) {
+ navigateToSoftwareProductAttachmentsSetupTab(dispatch, {softwareProductId, version, status}) {
SoftwareProductActionHelper.loadSoftwareProductHeatCandidate(dispatch, {softwareProductId, version});
SoftwareProductAttachmentsActionHelper.setActiveTab(dispatch, {activeTab: attachmentsTabsMapping.SETUP});
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS, {softwareProductId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS, {softwareProductId, version, status});
},
- navigateToSoftwareProductAttachmentsValidationTab(dispatch, {softwareProductId, version}) {
+ navigateToSoftwareProductAttachmentsValidationTab(dispatch, {softwareProductId, version, status}) {
SoftwareProductActionHelper.processAndValidateHeatCandidate(dispatch, {softwareProductId, version}).then(() => {
SoftwareProductAttachmentsActionHelper.setActiveTab(dispatch, {activeTab: attachmentsTabsMapping.VALIDATION});
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS, {softwareProductId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS, {softwareProductId, version, status});
});
},
- navigateToSoftwareProductProcesses(dispatch, {softwareProductId, version}) {
+ navigateToSoftwareProductProcesses(dispatch, {softwareProductId, version, status}) {
if (softwareProductId) {
SoftwareProductProcessesActionHelper.fetchProcessesList(dispatch, {softwareProductId, version});
}
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_PROCESSES, {softwareProductId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_PROCESSES, {softwareProductId, version, status});
},
- navigateToSoftwareProductNetworks(dispatch, {softwareProductId, version}) {
+ navigateToSoftwareProductNetworks(dispatch, {softwareProductId, version, status}) {
if (softwareProductId) {
SoftwareProductNetworksActionHelper.fetchNetworksList(dispatch, {softwareProductId, version});
}
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_NETWORKS, {softwareProductId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_NETWORKS, {softwareProductId, version, status});
},
- navigateToSoftwareProductDependencies(dispatch, {softwareProductId, version}) {
+ navigateToSoftwareProductDependencies(dispatch, {softwareProductId, version, status}) {
SoftwareProductComponentsActionHelper.fetchSoftwareProductComponents(dispatch, {softwareProductId, version}).then(result => {
if(result.listCount >= 2) {
SoftwareProductDependenciesActionHelper.fetchDependencies(dispatch, {softwareProductId, version});
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_DEPENDENCIES, {softwareProductId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_DEPENDENCIES, {softwareProductId, version, status});
}
else {
- this.navigateToSoftwareProductLandingPage(dispatch, {softwareProductId, version});
+ this.navigateToSoftwareProductLandingPage(dispatch, {softwareProductId, version, status});
}
});
},
- navigateToSoftwareProductComponents(dispatch, {softwareProductId, version}) {
+ navigateToSoftwareProductComponents(dispatch, {softwareProductId, version, status}) {
SoftwareProductComponentsActionHelper.fetchSoftwareProductComponents(dispatch, {softwareProductId, version});
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS, {softwareProductId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS, {softwareProductId, version, status});
},
- navigateToSoftwareProductDeployment(dispatch, {softwareProductId, version}) {
+ navigateToSoftwareProductDeployment(dispatch, {softwareProductId, version, status}) {
SoftwareProductDeploymentActionHelper.fetchDeploymentFlavorsList(dispatch, {softwareProductId, version});
ComputeFlavorActionHelper.fetchComputesListForVSP(dispatch, {softwareProductId, version});
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_DEPLOYMENT, {softwareProductId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_DEPLOYMENT, {softwareProductId, version, status});
},
- navigateToSoftwareProductActivityLog(dispatch, {softwareProductId, version}){
+ navigateToSoftwareProductActivityLog(dispatch, {softwareProductId, version, status}){
ActivityLogActionHelper.fetchActivityLog(dispatch, {itemId: softwareProductId, versionId: version.id});
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ACTIVITY_LOG, {softwareProductId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ACTIVITY_LOG, {softwareProductId, version, status});
},
- navigateToSoftwareProductComponentProcesses(dispatch, {softwareProductId, componentId, version}) {
+ navigateToSoftwareProductComponentProcesses(dispatch, {softwareProductId, componentId, version, status}) {
if (componentId && softwareProductId) {
SoftwareProductComponentProcessesActionHelper.fetchProcessesList(dispatch, {componentId, softwareProductId, version});
}
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_PROCESSES, {softwareProductId, componentId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_PROCESSES, {softwareProductId, componentId, version, status});
},
- navigateToSoftwareProductComponentMonitoring(dispatch, {softwareProductId, version, componentId}){
+ navigateToSoftwareProductComponentMonitoring(dispatch, {softwareProductId, version, componentId, status}){
if (componentId && softwareProductId && version) {
SoftwareProductComponentsMonitoringAction.fetchExistingFiles(dispatch, {componentId, softwareProductId, version});
}
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_MONITORING, {softwareProductId, componentId, version});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_MONITORING, {softwareProductId, componentId, version, status});
},
- navigateToComponentStorage(dispatch, {softwareProductId, componentId, version}) {
+ navigateToComponentStorage(dispatch, {softwareProductId, componentId, version, status}) {
SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(dispatch, {softwareProductId, vspComponentId: componentId, version});
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_STORAGE, {softwareProductId, version, componentId});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_STORAGE, {softwareProductId, version, componentId, status});
},
- navigateToComponentCompute(dispatch, {softwareProductId, componentId, version}) {
+ navigateToComponentCompute(dispatch, {softwareProductId, componentId, version, status}) {
SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(dispatch, {softwareProductId, vspComponentId: componentId, version});
if (componentId && softwareProductId) {
ComputeFlavorActionHelper.fetchComputesList(dispatch, {softwareProductId, componentId, version});
}
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_COMPUTE, {softwareProductId, version, componentId});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_COMPUTE, {softwareProductId, version, componentId, status});
},
- navigateToComponentNetwork(dispatch, {softwareProductId, componentId, version}) {
+ navigateToComponentNetwork(dispatch, {softwareProductId, componentId, version, status}) {
SoftwareProductComponentsNetworkActionHelper.fetchNICsList(dispatch, {softwareProductId, componentId, version});
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_NETWORK, {softwareProductId, version, componentId});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_NETWORK, {softwareProductId, version, componentId, status});
},
- navigateToSoftwareProductComponentGeneral(dispatch, {softwareProductId, componentId, version}) {
+ navigateToSoftwareProductComponentGeneral(dispatch, {softwareProductId, componentId, version, status}) {
if (componentId && softwareProductId) {
SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(dispatch, {softwareProductId, vspComponentId: componentId, version});
}
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_GENERAL, {softwareProductId, version, componentId});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_GENERAL, {softwareProductId, version, componentId, status});
},
- navigateToSoftwareProductComponentGeneralAndUpdateLeftPanel(dispatch, {softwareProductId, componentId, version}) {
- this.navigateToSoftwareProductComponentGeneral(dispatch, {softwareProductId, componentId, version});
+ navigateToSoftwareProductComponentGeneralAndUpdateLeftPanel(dispatch, {softwareProductId, componentId, version, status}) {
+ this.navigateToSoftwareProductComponentGeneral(dispatch, {softwareProductId, componentId, version, status});
dispatch({
type: SoftwareProductActionTypes.TOGGLE_NAVIGATION_ITEM,
mapOfExpandedIds: {
});
},
- navigateToComponentLoadBalancing(dispatch, {softwareProductId, componentId, version}) {
+ navigateToComponentLoadBalancing(dispatch, {softwareProductId, componentId, version, status}) {
SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(dispatch, {softwareProductId, vspComponentId: componentId, version});
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_LOAD_BALANCING, {softwareProductId, version, componentId});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_LOAD_BALANCING, {softwareProductId, version, componentId, status});
},
- navigateToComponentImages(dispatch, {softwareProductId, componentId, version}) {
+ navigateToComponentImages(dispatch, {softwareProductId, componentId, version, status}) {
SoftwareProductComponentsImageActionHelper.fetchImagesList(dispatch, {
softwareProductId,
componentId,
version
});
- setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_IMAGES, {softwareProductId, version, componentId});
+ setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_IMAGES, {softwareProductId, version, componentId, status});
},
navigateToVersionsPage(dispatch, {itemType, itemId, itemName, additionalProps, users}) {
PermissionsActionHelper.fetchItemUsers(dispatch, {itemId, allUsers: users});
VersionsPageActionHelper.selectNone(dispatch);
VersionsPageActionHelper.fetchVersions(dispatch, {itemType, itemId}).then(() => {
- setCurrentScreen(dispatch, enums.SCREEN.VERSIONS_PAGE, {itemType, itemId, itemName, additionalProps});
+ ItemsHelper.fetchItem(itemId).then(result => {
+ setCurrentScreen(dispatch, enums.SCREEN.VERSIONS_PAGE, {status: result.status, itemType, itemId, itemName, additionalProps});
+ });
+
});
+
},
checkMergeStatus(dispatch, {itemId, versionId, version}) {
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import keyMirror from 'nfvo-utils/KeyMirror.js';
/*
- * Copyright © 2016-2017 European Support Limited
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
});
}
this.rendered = true;
-
}
}
let dispatch = action => store.dispatch(action);
let {currentScreen, users: {usersList}, softwareProductList, finalizedSoftwareProductList, licenseModelList, finalizedLicenseModelList,
softwareProduct: {softwareProductEditor: {data: vspData = {}},
- softwareProductComponents = {}, softwareProductQuestionnaire = {}}} = store.getState();
+ softwareProductComponents = {}, softwareProductQuestionnaire = {}}, archivedLicenseModelList} = store.getState();
const wholeSoftwareProductList = [...softwareProductList, ...finalizedSoftwareProductList];
- const wholeLicenseModelList = [...licenseModelList, ...finalizedLicenseModelList];
+ const wholeLicenseModelList = [...licenseModelList, ...finalizedLicenseModelList, ...archivedLicenseModelList];
let {props: {version, isReadOnlyMode}, screen} = currentScreen;
let {componentEditor: {data: componentData = {}, qdata: componentQData = {}}} = softwareProductComponents;
let {currentScreen, licenseModelList, finalizedLicenseModelList, softwareProductList, finalizedSoftwareProductList, versionsPage:
{versionsList: {itemType, itemId}},
softwareProduct: {softwareProductEditor: {data: currentSoftwareProduct = {onboardingMethod: ''}},
- softwareProductComponents: {componentsList}}} = store.getState();
- const wholeSoftwareProductList = lodashUnionBy(softwareProductList, finalizedSoftwareProductList, 'id');
- const wholeLicenseModelList = lodashUnionBy(licenseModelList, finalizedLicenseModelList, 'id');
+ softwareProductComponents: {componentsList}}, archivedLicenseModelList, archivedSoftwareProductList} = store.getState();
+ const wholeSoftwareProductList = lodashUnionBy(softwareProductList, [...finalizedSoftwareProductList, ...archivedSoftwareProductList], 'id');
+ const wholeLicenseModelList = lodashUnionBy(licenseModelList, [...finalizedLicenseModelList, ...archivedLicenseModelList], 'id');
let breadcrumbsData = {itemType, itemId, currentScreen, wholeLicenseModelList, wholeSoftwareProductList, currentSoftwareProduct, componentsList};
if (currentScreen.forceBreadCrumbsUpdate || !isEqual(breadcrumbsData, this.prevBreadcrumbsData) || this.breadcrumbsPrefixSelected) {
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,
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;
props: {
...state.props,
version: action.version,
- isReadOnlyMode: checkReadOnly(state.itemPermission)
+ isReadOnlyMode: checkReadOnly({...state.itemPermission,itemStatus: state.props.status})
}
};
}
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}};
/*!
- * Copyright © 2016-2017 European Support Limited
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import currentScreenReducer from './OnboardingReducers.js';
import licenseModelListReducer from './licenseModel/LicenseModelListReducer.js';
import finalizedLicenseModelListReducer from './licenseModel/FinalizedLicenseModelListReducer.js';
+import archivedLicenseModelListReducer from './licenseModel/ArchivedLicenseModelListReducer.js';
import licenseModelReducer from './licenseModel/LicenseModelReducer.js';
import softwareProductReducer from './softwareProduct/SoftwareProductReducer.js';
import softwareProductListReducer from './softwareProduct/SoftwareProductListReducer.js';
import finalizedSoftwareProductReducer from './softwareProduct/FinalizedSoftwareProductReducer.js';
+import archivedSoftwareProductListReducer from './softwareProduct/ArchivedSoftwareProductReducer.js';
import onboardReducer from './onboard/OnboardReducer.js';
import versionsPageReducer from './versionsPage/VersionsPageReducer.js';
import usersReducer from './users/UsersReducers.js';
currentScreen: currentScreenReducer,
licenseModel: licenseModelReducer,
licenseModelList: licenseModelListReducer,
+ archivedLicenseModelList: archivedLicenseModelListReducer,
+ archivedSoftwareProductList: archivedSoftwareProductListReducer,
finalizedLicenseModelList: finalizedLicenseModelListReducer,
finalizedSoftwareProductList: finalizedSoftwareProductReducer,
mergeEditor: mergeEditorReducer,
--- /dev/null
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import {actionTypes} from './LicenseModelConstants.js';
+
+export default (state = [], action) => {
+ switch (action.type) {
+ case actionTypes.ARCHIVED_LICENSE_MODELS_LIST_LOADED:
+ return [...action.response.results];
+ default:
+ return state;
+ }
+};
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import {connect} from 'react-redux';
import {modalContentMapper} from 'sdc-app/common/modal/ModalContentMapper.js';
import {CommitModalType} from 'nfvo-components/panel/versionController/components/CommitCommentModal.jsx';
-
const buildNavigationBarProps = (licenseModel, screen) => {
const {id, vendorName, version} = licenseModel;
const meta = {version};
userInfo,
usersList,
permissions,
+ isArchived,
itemPermission,
isReadOnlyMode
}) => {
permissions,
userInfo,
usersList,
+ isArchived,
itemName: licenseModelEditor.data.vendorName,
itemPermission,
isReadOnlyMode
userInfo,
permissions,
usersList,
+ isArchived: itemPermission.isArchived,
itemPermission,
isReadOnlyMode
}),
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import RestAPIUtil from 'nfvo-utils/RestAPIUtil.js';
import Configuration from 'sdc-app/config/Configuration.js';
import FeatureGroupsActionHelper from './featureGroups/FeatureGroupsActionHelper.js';
import EntitlementPoolsActionHelper from './entitlementPools/EntitlementPoolsActionHelper.js';
import LicenseKeyGroupsActionHelper from './licenseKeyGroups/LicenseKeyGroupsActionHelper.js';
-import ItemsHelper from '../../common/helpers/ItemsHelper.js';
+import {default as ItemsHelper} from 'sdc-app/common/helpers/ItemsHelper.js';
import MergeEditorActionHelper from 'sdc-app/common/merge/MergeEditorActionHelper.js';
import {modalContentMapper} from 'sdc-app/common/modal/ModalContentMapper.js';
import {CommitModalType} from 'nfvo-components/panel/versionController/components/CommitCommentModal.jsx';
}
function fetchLicenseModels() {
- return RestAPIUtil.fetch(`${baseUrl()}?versionFilter=Draft`);
+ return RestAPIUtil.fetch(`${baseUrl()}?versionFilter=${catalogItemStatuses.DRAFT}`);
}
function fetchFinalizedLicenseModels() {
- return RestAPIUtil.fetch(`${baseUrl()}?versionFilter=Certified`);
+ return RestAPIUtil.fetch(`${baseUrl()}?versionFilter=${catalogItemStatuses.CERTIFIED}`);
+}
+function fetchArchivedLicenseModels() {
+ return RestAPIUtil.fetch(`${baseUrl()}?Status=${catalogItemStatuses.ARCHIVED}`);
}
-
function fetchLicenseModelById(licenseModelId, version) {
const {id: versionId} = version;
return RestAPIUtil.fetch(`${baseUrl()}${licenseModelId}/versions/${versionId}`);
},
+ fetchArchivedLicenseModels(dispatch) {
+ return fetchArchivedLicenseModels().then(response => dispatch({
+ type: actionTypes.ARCHIVED_LICENSE_MODELS_LIST_LOADED,
+ response
+ }));
+
+ },
+
fetchLicenseModelById(dispatch, {licenseModelId, version}) {
return fetchLicenseModelById(licenseModelId, version).then(response => {
performVCAction(dispatch, {licenseModelId, action, version, comment}) {
return MergeEditorActionHelper.analyzeSyncResult(dispatch, {itemId: licenseModelId, version}).then(({inMerge, isDirty, updatedVersion}) => {
- if (updatedVersion.status === catalogItemStatuses.CERTIFIED &&
+ if ( (updatedVersion.status === catalogItemStatuses.CERTIFIED || updatedVersion.archivedStatus === catalogItemStatuses.ARCHIVED) &&
(action === VersionControllerActionsEnum.COMMIT || action === VersionControllerActionsEnum.SYNC)) {
versionPageActionHelper.fetchVersions(dispatch, {itemType: itemTypes.LICENSE_MODEL, itemId: licenseModelId});
+ const msg = updatedVersion.archivedStatus === catalogItemStatuses.ARCHIVED ? i18n('Item was Archived') : i18n('Item version already Certified');
dispatch({
type: modalActionTypes.GLOBAL_MODAL_WARNING,
data: {
title: i18n('Commit error'),
- msg: i18n('Item version already Certified'),
+ msg,
cancelButtonText: i18n('Cancel')
}
});
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import keyMirror from 'nfvo-utils/KeyMirror.js';
import i18n from 'nfvo-utils/i18n/i18n.js';
LICENSE_MODEL_LOADED: null,
LICENSE_MODELS_LIST_LOADED: null,
FINALIZED_LICENSE_MODELS_LIST_LOADED: null,
+ ARCHIVED_LICENSE_MODELS_LIST_LOADED: null,
EDIT_LICENSE_MODEL: null
});
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import {connect} from 'react-redux';
import LicenseModelCreationActionHelper from './LicenseModelCreationActionHelper.js';
import {enums, screenTypes} from 'sdc-app/onboarding/OnboardingConstants.js';
import PermissionsActionHelper from 'sdc-app/onboarding/permissions/PermissionsActionHelper.js';
-export const mapStateToProps = ({users: {usersList}, licenseModelList, licenseModel: {licenseModelCreation}}) => {
+export const mapStateToProps = ({users: {usersList}, licenseModelList, finalizedLicenseModelList, archivedLicenseModelList, licenseModel: {licenseModelCreation}}) => {
let {genericFieldInfo} = licenseModelCreation;
let isFormValid = ValidationHelper.checkFormValid(genericFieldInfo);
-
let VLMNames = {};
- for (let i = 0; i < licenseModelList.length; i++) {
- VLMNames[licenseModelList[i].name.toLowerCase()] = licenseModelList[i].id;
- }
+
+ const allVlmList = [...licenseModelList, ...finalizedLicenseModelList,...archivedLicenseModelList];
+ allVlmList.map((item) => {
+ VLMNames[item.name.toLowerCase()] = item.id;
+ });
return {...licenseModelCreation, isFormValid: isFormValid, VLMNames, usersList};
};
type: entitlementPoolsActionTypes.DELETE_ENTITLEMENT_POOL,
entitlementPoolId
});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
},
type: entitlementPoolsActionTypes.EDIT_ENTITLEMENT_POOL,
entitlementPool
});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
}
else {
id: response.value
}
});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
}
},
type: limitEditorActions.CLOSE
});
this.fetchLimits(dispatch, {licenseModelId, version, entitlementPool});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
},
deleteLimit(dispatch, {licenseModelId, version, entitlementPool, limit}) {
return deleteLimit(licenseModelId,entitlementPool.id, version, limit.id).then(() => {
this.fetchLimits(dispatch, {licenseModelId, version, entitlementPool});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
}
};
type: featureGroupsActionConstants.DELETE_FEATURE_GROUPS,
featureGroupId
});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
},
});
EntitlementPoolsActionHelper.fetchEntitlementPoolsList(dispatch, {licenseModelId, version});
LicenseKeyGroupsActionHelper.fetchLicenseKeyGroupsList(dispatch, {licenseModelId, version});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
}
else {
});
EntitlementPoolsActionHelper.fetchEntitlementPoolsList(dispatch, {licenseModelId, version});
LicenseKeyGroupsActionHelper.fetchLicenseKeyGroupsList(dispatch, {licenseModelId, version});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
}
},
if (previousLicenseAgreement) {
return putLicenseAgreement(licenseModelId, previousLicenseAgreement, licenseAgreement, version).then(() => {
this.fetchLicenseAgreementList(dispatch, {licenseModelId, version});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
}
else {
return postLicenseAgreement(licenseModelId, licenseAgreement, version).then(() => {
this.fetchLicenseAgreementList(dispatch, {licenseModelId, version});
FeatureGroupsActionHelper.fetchFeatureGroupsList(dispatch, {licenseModelId, version});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
}
},
type: licenseAgreementActionTypes.DELETE_LICENSE_AGREEMENT,
licenseAgreementId
});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
},
type: licenseKeyGroupsConstants.EDIT_LICENSE_KEY_GROUP,
licenseKeyGroup
});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
}
else {
id: response.value
}
});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
}
type: licenseKeyGroupsConstants.DELETE_LICENSE_KEY_GROUP,
licenseKeyGroupId
});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
},
type: limitEditorActions.CLOSE
});
this.fetchLimits(dispatch, {licenseModelId, version, licenseKeyGroup});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
},
deleteLimit(dispatch, {licenseModelId, version, licenseKeyGroup, limit}) {
return deleteLimit(licenseModelId,licenseKeyGroup.id, version, limit.id).then(() => {
this.fetchLimits(dispatch, {licenseModelId, version, licenseKeyGroup});
- ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
+ return ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
}
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import React from 'react';
import i18n from 'nfvo-utils/i18n/i18n.js';
<div className='catalog-list'>
{vendorPageOptions && <SoftwareProductListHeader onBack={vendorPageOptions.onBack} selectedVendor={vendorPageOptions.selectedVendor}/>}
<div className='catalog-items'>
- <div className='create-catalog-item-wrapper'>
- {onAddVLM && <CreateItemTile onClick={onAddVLM} dataTestId={'catalog-add-new-vlm'} className='vlm-type' title={i18n('CREATE NEW VLM')}/>}
- {onAddVSP && <CreateItemTile onClick={() => onAddVSP()} dataTestId={'catalog-add-new-vsp'} className='vsp-type' title={i18n('CREATE NEW VSP')}/>}
- </div>
+ { (onAddVLM || onAddVSP) &&
+ <div className='create-catalog-item-wrapper'>
+ {onAddVLM && <CreateItemTile onClick={onAddVLM} dataTestId={'catalog-add-new-vlm'} className='vlm-type' title={i18n('CREATE NEW VLM')}/>}
+ {onAddVSP && <CreateItemTile onClick={() => onAddVSP()} dataTestId={'catalog-add-new-vsp'} className='vsp-type' title={i18n('CREATE NEW VSP')}/>}
+ </div>
+ }
{children}
</div>
</div>
/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
VSPList: PropTypes.array,
onSelectVLM: PropTypes.func.isRequired,
onSelectVSP: PropTypes.func.isRequired,
- onAddVLM: PropTypes.func.isRequired,
- onAddVSP: PropTypes.func.isRequired,
+ onAddVLM: PropTypes.func,
+ onAddVSP: PropTypes.func,
filter: PropTypes.string.isRequired
};
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import {connect} from 'react-redux';
import LicenseModelCreationActionHelper from '../licenseModel/creation/LicenseModelCreationActionHelper.js';
import SoftwareProductCreationActionHelper from '../softwareProduct/creation/SoftwareProductCreationActionHelper.js';
import sortByStringProperty from 'nfvo-utils/sortByStringProperty.js';
-
+import {tabsMapping} from './onboardingCatalog/OnboardingCatalogConstants.js';
+import {itemsType} from './filter/FilterConstants.js';
export const mapStateToProps = ({
onboard: {
onboardingCatalog,
activeTab,
- searchValue
+ searchValue,
+ filter
},
licenseModelList,
users,
+ archivedLicenseModelList,
+ archivedSoftwareProductList,
finalizedLicenseModelList,
softwareProductList,
finalizedSoftwareProductList
).concat(finalizedLicenseModelList);
let {activeTab: catalogActiveTab, vendorCatalog: {vspOverlay, selectedVendor}} = onboardingCatalog;
+ if (filter.byVendorView) {
+ catalogActiveTab = tabsMapping.BY_VENDOR;
+ }
+ else if (filter.itemsType && filter.itemsType === itemsType.ARCHIVED) {
+ catalogActiveTab = tabsMapping.ARCHIVE;
+ }
return {
finalizedLicenseModelList,
finalizedSoftwareProductList,
licenseModelList,
softwareProductList,
+ archivedLicenseModelList,
+ archivedSoftwareProductList,
fullLicenseModelList,
activeTab,
catalogActiveTab,
onVendorSelect: (vendor) => OnboardingCatalogActionHelper.onVendorSelect(dispatch, {vendor}),
onMigrate: ({softwareProduct}) => OnboardingCatalogActionHelper.onMigrate(dispatch, softwareProduct)
};
-
};
export default connect(mapStateToProps, mapActionsToProps)(OnboardView);
softwareProductList: PropTypes.array,
finalizedLicenseModelList: PropTypes.array,
finalizedSoftwareProductList: PropTypes.array,
+ archivedSoftwareProductList: PropTypes.array,
+ archivedLicenseModelList: PropTypes.array,
modalToShow: PropTypes.oneOf(objectValues(catalogItemTypes)),
onSelectLicenseModel: PropTypes.func.isRequired,
onSelectSoftwareProduct: PropTypes.func.isRequired,
case tabsMapping.WORKSPACE:
return <WorkspaceView {...this.props} />;
case tabsMapping.CATALOG:
- default:
return <OnboardingCatalogView {...this.props} />;
+ default:
+ return <WorkspaceView {...this.props} />;
}
}
<div className='catalog-parts'>
<OnboardHeader activeTab={activeTab} onTabClick={onTabClick} searchValue={searchValue} onSearch={value => onSearch(value)}/>
{this.renderViewByTab(activeTab)}
- </div>
+ </div>
</div>
);
}
import Accordion from 'nfvo-components/accordion/Accordion.jsx';
import {actionTypes} from './FilterConstants.js';
import featureToggle from 'sdc-app/features/featureToggle.js';
+import {featureToggleNames} from 'sdc-app/features/FeaturesConstants.js';
+import {tabsMapping as onboardTabsMapping} from '../OnboardConstants.js';
+import {itemsType as itemsTypeConstants} from './FilterConstants.js';
-const mapStateToProps = ({onboard: {filter}}) => {
+const mapStateToProps = ({onboard: {filter, activeTab}}) => {
return {
- data: filter
+ data: filter,
+ activeTab
};
};
};
const Filter = ({onDataChanged, data: {entityTypeVsp, entityTypeVlm, roleOwner, roleContributor, roleViewer,
- procedureNetwork, procedureManual, recentlyUpdated}}) => (
- <div className='catalog-filter'>
- <Input label={i18n('Recently Updated')} type='checkbox' checked={recentlyUpdated}
+ procedureNetwork, procedureManual, recentlyUpdated, byVendorView, itemsType}, activeTab}) => (
+ <div className='catalog-filter'>
+ {activeTab === onboardTabsMapping.CATALOG && <Input
+ type='select'
+ className='catalog-filter-items-type'
+ data-test-id='catalog-filter-items-type'
+ disabled={byVendorView}
+ value={itemsType}
+ onChange={e => onDataChanged({itemsType: e.target.value})}>
+ <option key={itemsTypeConstants.ACTIVE} value={itemsTypeConstants.ACTIVE}>Active Items</option>
+ <option key={itemsTypeConstants.ARCHIVED} value={itemsTypeConstants.ARCHIVED}>Archived Items</option>
+ </Input>}
+ {activeTab === onboardTabsMapping.CATALOG && <Input
+ label={i18n('By Vendor View')}
+ type='checkbox'
+ disabled={itemsType === itemsTypeConstants.ARCHIVED}
+ checked={byVendorView}
+ onChange={byVendorView => onDataChanged({byVendorView})}
+ data-test-id='filter-by-vendor-view' value='' />
+ }
+ <Input label={i18n('Recently Updated')} type='checkbox' checked={recentlyUpdated}
onChange={recentlyUpdated => onDataChanged({recentlyUpdated})} data-test-id='filter-recently-updated' value='' />
<Accordion title={i18n('ENTITY TYPE')}>
data: PropTypes.object
};
-export default featureToggle('ONBOARDING_FILTER')(connect(mapStateToProps, mapActionsToProps)(Filter));
+export default featureToggle(featureToggleNames.FILTER)(connect(mapStateToProps, mapActionsToProps)(Filter));
export const actionTypes = keyMirror({
FILTER_DATA_CHANGED: null
});
+
+export const itemsType = {
+ ACTIVE: '1',
+ ARCHIVED: '2'
+};
\ No newline at end of file
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import keyMirror from 'nfvo-utils/KeyMirror.js';
export const catalogItemStatuses = {
DRAFT: 'Draft',
- CERTIFIED: 'Certified'
+ CERTIFIED: 'Certified',
+ ARCHIVED: 'ARCHIVED'
};
export const modalMapper = {
export const tabsMapping = {
'BY_VENDOR': 1,
- 'ALL': 2
+ 'ACTIVE': 2,
+ 'ARCHIVE': 3
};
export const migrationStatusMapper = {
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import {actionTypes, tabsMapping} from './OnboardingCatalogConstants.js';
import {combineReducers} from 'redux';
const onboardingCatalogReducer = combineReducers({
vendorCatalog: vendorCatalogReducer,
- activeTab: (state = tabsMapping.ALL, action) => action.type === actionTypes.CHANGE_ACTIVE_CATALOG_TAB ? action.activeTab : state
+ activeTab: (state = tabsMapping.ACTIVE, action) => action.type === actionTypes.CHANGE_ACTIVE_CATALOG_TAB ? action.activeTab : state
});
export default (state, action) => {
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import React from 'react';
import i18n from 'nfvo-utils/i18n/i18n.js';
import VendorCatalogView from './VendorCatalogView.jsx';
import { tabsMapping} from './OnboardingCatalogConstants.js';
import {tabsMapping as WCTabsMapping} from 'sdc-app/onboarding/onboard/OnboardConstants.js';
+import featureToggle from 'sdc-app/features/featureToggle.js';
+import {featureToggleNames} from 'sdc-app/features/FeaturesConstants.js';
+
+const Separator = () => (
+ <div className='tab-separator'/>
+);
-const CatalogHeaderTabs = ({onTabPress, activeTab}) => (
+const Tab = ({onTabPress, title, dataTestId, activeTab, tabMapping}) => (
+ <div
+ className={classnames('catalog-header-tab', {'active': activeTab === tabMapping })}
+ onClick={() => onTabPress(tabMapping)}
+ data-test-id={dataTestId}>
+ {title}
+ </div>
+);
+
+const ArchiveTab = featureToggle(featureToggleNames.ARCHIVE_ITEM)(Tab);
+const ArchiveTabSeparator = featureToggle(featureToggleNames.ARCHIVE_ITEM)(Separator);
+
+const CatalogHeaderTabs = (props) => (
<div className='catalog-header-tabs'>
- <div
- className={classnames('catalog-header-tab', {'active': activeTab === tabsMapping.ALL })}
- onClick={() => onTabPress(tabsMapping.ALL)}
- data-test-id='catalog-all-tab'>
- {i18n('ALL')}
- </div>
- <div className='tab-separator'/>
- <div
- className={classnames('catalog-header-tab', {'active': activeTab === tabsMapping.BY_VENDOR })}
- onClick={() => onTabPress(tabsMapping.BY_VENDOR)}
- data-test-id='catalog-by-vendor-tab'>
- {i18n('BY VENDOR')}
- </div>
+ <Tab {...props} title={i18n('ACTIVE')} dataTestId='catalog-all-tab' tabMapping={tabsMapping.ACTIVE}/>
+ <Separator/>
+ <Tab {...props} title={i18n('BY VENDOR')} dataTestId='catalog-header-tab' tabMapping={tabsMapping.BY_VENDOR}/>
+ <ArchiveTabSeparator/>
+ <ArchiveTab {...props} title={i18n('ARCHIVE')} dataTestId='catalog-archive-tab' tabMapping={tabsMapping.ARCHIVE}/>
</div>
);
</div>
);
+const FilterCatalogHeader = () => (
+ <div className='catalog-header'>
+ <div className='catalog-header-tabs'>
+ <div className='catalog-header-tab active'>
+ {i18n('ONBOARD CATALOG')}
+ </div>
+ </div>
+ </div>
+);
+
+
+const FeaturedCatalogHeader = featureToggle(featureToggleNames.FILTER)({AComp: FilterCatalogHeader, BComp: CatalogHeader});
+
class OnboardingCatalogView extends React.Component {
renderViewByTab(activeTab){
const {finalizedLicenseModelList: licenseModelList, fullLicenseModelList, users, vspOverlay, finalizedSoftwareProductList: softwareProductList, onSelectLicenseModel, onSelectSoftwareProduct,
- onAddLicenseModelClick, onAddSoftwareProductClick, onVspOverlayChange, onVendorSelect, selectedVendor, searchValue, onMigrate} = this.props;
+ onAddLicenseModelClick, onAddSoftwareProductClick, onVspOverlayChange, onVendorSelect, selectedVendor, searchValue, onMigrate,
+ archivedSoftwareProductList, archivedLicenseModelList} = this.props;
switch (activeTab){
- case tabsMapping.ALL:
+ case tabsMapping.ARCHIVE:
+ return (
+ <DetailsCatalogView
+ VLMList={archivedLicenseModelList}
+ VSPList={archivedSoftwareProductList}
+ users={users}
+ onSelectVLM={(item, users) => onSelectLicenseModel(item, users, WCTabsMapping.CATALOG)}
+ onSelectVSP={(item, users) => onSelectSoftwareProduct(item, users, WCTabsMapping.CATALOG)}
+ filter={searchValue}
+ onMigrate={onMigrate}/>
+ );
+ case tabsMapping.ACTIVE:
return (
<DetailsCatalogView
VLMList={licenseModelList}
const {selectedVendor, catalogActiveTab: activeTab, onCatalogTabClick, onSearch, searchValue} = this.props;
return (
<div className='catalog-wrapper'>
- {!selectedVendor && <CatalogHeader
+ {!selectedVendor && <FeaturedCatalogHeader
onSearch={event => onSearch(event.target.value)}
activeTab={activeTab}
onTabPress={tab => onCatalogTabClick(tab)}
--- /dev/null
+/*!
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+import {actionTypes} from './SoftwareProductConstants.js';
+
+export default (state = [], action) => {
+ switch (action.type) {
+ case actionTypes.ARCHIVED_SOFTWARE_PRODUCT_LIST_LOADED:
+ return [...action.response.results];
+ default:
+ return state;
+ }
+};
import TabulatedEditor from 'src/nfvo-components/editor/TabulatedEditor.jsx';
import {enums, screenTypes} from 'sdc-app/onboarding/OnboardingConstants.js';
-
import {onboardingMethod as onboardingMethodTypes, onboardingOriginTypes} from './SoftwareProductConstants.js';
import SoftwareProductActionHelper from './SoftwareProductActionHelper.js';
import SoftwareProductComponentsActionHelper from './components/SoftwareProductComponentsActionHelper.js';
};
};
-const buildVersionControllerProps = ({softwareProduct, versions, currentVersion, permissions, userInfo, usersList, itemPermission, isReadOnlyMode}) => {
+const buildVersionControllerProps = ({softwareProduct, versions, currentVersion, permissions, userInfo, isArchived, usersList, itemPermission, isReadOnlyMode}) => {
const {softwareProductEditor = {data: {}}} = softwareProduct;
const {isValidityData = true, data: {name, onboardingMethod, candidateOnboardingOrigin}} = softwareProductEditor;
itemName: name,
itemPermission,
isReadOnlyMode,
+ isArchived,
userInfo,
usersList,
isManual: onboardingMethod === onboardingMethodType.MANUAL,
currentVersion,
userInfo,
usersList,
+ isArchived: itemPermission.isArchived,
permissions,
itemPermission: {...itemPermission, isDirty: true},
isReadOnlyMode
if((action === versionControllerActions.SYNC && !inMerge) ||
((action === versionControllerActions.COMMIT || action === versionControllerActions.SYNC) && updatedVersion.status === catalogItemStatuses.CERTIFIED)) {
ScreensHelper.loadLandingScreen(dispatch, {previousScreenName: screen, props: {softwareProductId, version: updatedVersion}});
-
} else {
ScreensHelper.loadScreen(dispatch, {screen, screenType: screenTypes.SOFTWARE_PRODUCT,
props: {softwareProductId, version: updatedVersion, componentId: currentComponentId}});
import ValidationHelper from 'sdc-app/common/helpers/ValidationHelper.js';
import {actionTypes as modalActionTypes} from 'nfvo-components/modal/GlobalModalConstants.js';
import {modalContentMapper} from 'sdc-app/common/modal/ModalContentMapper.js';
-import ItemsHelper from 'sdc-app/common/helpers/ItemsHelper.js';
+import {default as ItemsHelper} from 'sdc-app/common/helpers/ItemsHelper.js';
import ScreensHelper from 'sdc-app/common/helpers/ScreensHelper.js';
import {enums, screenTypes} from 'sdc-app/onboarding/OnboardingConstants.js';
import MergeEditorActionHelper from 'sdc-app/common/merge/MergeEditorActionHelper.js';
}
function fetchSoftwareProductList() {
- return RestAPIUtil.fetch(`${baseUrl()}?versionFilter=Draft`);
+ return RestAPIUtil.fetch(`${baseUrl()}?versionFilter=${catalogItemStatuses.DRAFT}`);
+}
+
+function fetchArchivedSoftwareProductList() {
+ return RestAPIUtil.fetch(`${baseUrl()}?Status=${catalogItemStatuses.ARCHIVED}`);
}
function fetchFinalizedSoftwareProductList() {
- return RestAPIUtil.fetch(`${baseUrl()}?versionFilter=Certified`);
+ return RestAPIUtil.fetch(`${baseUrl()}?versionFilter=${catalogItemStatuses.CERTIFIED}`);
}
function fetchSoftwareProduct(vspId, version) {
}));
},
+ fetchArchivedSoftwareProductList(dispatch) {
+ return fetchArchivedSoftwareProductList().then(response => dispatch({
+ type: actionTypes.ARCHIVED_SOFTWARE_PRODUCT_LIST_LOADED,
+ response
+ }));
+ },
+
loadSoftwareProductAssociatedData(dispatch) {
fetchSoftwareProductCategories(dispatch);
LicenseModelActionHelper.fetchFinalizedLicenseModels(dispatch);
performVCAction(dispatch, {softwareProductId, action, version, comment}) {
return MergeEditorActionHelper.analyzeSyncResult(dispatch, {itemId: softwareProductId, version}).then(({inMerge, isDirty, updatedVersion}) => {
- if (updatedVersion.status === catalogItemStatuses.CERTIFIED &&
+ if ((updatedVersion.status === catalogItemStatuses.CERTIFIED || updatedVersion.archivedStatus === catalogItemStatuses.ARCHIVED) &&
(action === VersionControllerActionsEnum.COMMIT || action === VersionControllerActionsEnum.SYNC)) {
versionPageActionHelper.fetchVersions(dispatch, {itemType: itemTypes.SOFTWARE_PRODUCT, itemId: softwareProductId});
+ const msg = updatedVersion.archivedStatus === catalogItemStatuses.ARCHIVED ? i18n('Item was Archived') : i18n('Item version already Certified');
dispatch({
type: modalActionTypes.GLOBAL_MODAL_WARNING,
data: {
title: i18n('Commit error'),
- msg: i18n('Item version already Certified'),
+ msg,
cancelButtonText: i18n('Cancel')
}
});
export const actionTypes = keyMirror({
SOFTWARE_PRODUCT_LOADED: null,
SOFTWARE_PRODUCT_LIST_LOADED: null,
+ ARCHIVED_SOFTWARE_PRODUCT_LIST_LOADED: null,
FINALIZED_SOFTWARE_PRODUCT_LIST_LOADED: null,
SOFTWARE_PRODUCT_LIST_EDIT: null,
SOFTWARE_PRODUCT_CATEGORIES_LOADED: null,
setActiveTab: PropTypes.func
};
- componentDidMount() {
- if (!this.props.goToOverview && this.props.candidateInProcess) {
+ componentDidMount() {
+ if (!this.props.goToOverview && this.props.candidateInProcess) {
this.props.setActiveTab({activeTab: tabsMapping.VALIDATION});
}
}
data-test-id='proceed-to-validation-btn'
disabled={!isValidationAvailable}
className='proceed-to-validation-btn'
- onClick={()=>this.validate()}>{i18n('PROCEED TO VALIDATION')}</Button>
- }
- {candidateInProcess && <SVGIcon
+ onClick={()=>this.validate()}>{i18n('PROCEED TO VALIDATION')}</Button>
+ }
+ {candidateInProcess && <SVGIcon
onClick={onUploadAbort}
name='close'
className='icon-component abort-btn'
labelPosition='right'
color='secondary'
data-test-id='abort-btn'/>
- }
-
+ }
{(activeTab === tabsMapping.VALIDATION && softwareProductId) &&
<Button btnType='outline'
data-test-id='go-to-overview'
disabled={this.props.goToOverview !== true}
className='go-to-overview-btn'
onClick={this.props.goToOverview ? () => onGoToOverview({version}) : undefined}>{i18n('GO TO OVERVIEW')}</Button>}
- <div className='separator'></div>
+ <div className='separator'></div>
<SVGIcon
disabled={heatDataExist ? false : true}
name='download'
- className='icon-component'
+ className='icon-component'
color='dark-gray'
onClick={heatDataExist ? () => onDownload({heatCandidate: heatSetup, isReadOnlyMode: isReadOnlyMode || !candidateInProcess, version}) : undefined}
data-test-id='download-heat'/>
-
<SVGIcon
name='upload'
- className='icon-component'
+ className='icon-component'
color='dark-gray'
disabled={isReadOnlyMode || candidateInProcess}
onClick={isReadOnlyMode ? undefined : evt => this.refs.hiddenImportFileInput.click(evt)}
);
}
save() {
-
return this.props.onboardingOrigin === onboardingOriginTypes.ZIP ?
this.props.onSave(this.props.heatSetup, this.props.version) :
Promise.resolve();
/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import {enums, screenTypes} from 'sdc-app/onboarding/OnboardingConstants.js';
import PermissionsActionHelper from 'sdc-app/onboarding/permissions/PermissionsActionHelper.js';
-export const mapStateToProps = ({finalizedLicenseModelList, users: {usersList}, softwareProductList, softwareProduct: {softwareProductCreation, softwareProductCategories} }) => {
+export const mapStateToProps = ({finalizedLicenseModelList, users: {usersList}, archivedSoftwareProductList,
+ softwareProductList, finalizedSoftwareProductList, softwareProduct: {softwareProductCreation, softwareProductCategories} }) => {
let {genericFieldInfo} = softwareProductCreation;
let isFormValid = ValidationHelper.checkFormValid(genericFieldInfo);
let VSPNames = {};
- for (let i = 0; i < softwareProductList.length; i++) {
- VSPNames[softwareProductList[i].name.toLowerCase()] = softwareProductList[i].id;
- }
+ const allVspList = [...softwareProductList, ...finalizedSoftwareProductList, ...archivedSoftwareProductList];
+ allVspList.map(item => {
+ VSPNames[item.name.toLowerCase()] = item.id;
+ });
+
return {
data: softwareProductCreation.data,
/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* permissions and limitations under the License.
*/
import {connect} from 'react-redux';
-
+import i18n from 'nfvo-utils/i18n/i18n.js';
import SoftwareProductActionHelper from 'sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js';
import SoftwareProductDetailsView from './SoftwareProductDetailsView.jsx';
import ValidationHelper from 'sdc-app/common/helpers/ValidationHelper.js';
import {PRODUCT_QUESTIONNAIRE} from 'sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js';
-
+import {actionTypes as modalActionTypes, modalSizes} from 'nfvo-components/modal/GlobalModalConstants.js';
+import {modalContentMapper} from 'sdc-app/common/modal/ModalContentMapper.js';
+import {forms} from 'sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js';
export const mapStateToProps = ({
finalizedLicenseModelList,
+ archivedLicenseModelList,
softwareProduct,
licenseModel: {licenseAgreement, featureGroup}
}) => {
let {qdata, qgenericFieldInfo : qGenericFieldInfo, dataMap} = softwareProductQuestionnaire;
let isFormValid = ValidationHelper.checkFormValid(genericFieldInfo);
-
+ const isVendorArchived = archivedLicenseModelList.find(item => item.id === currentSoftwareProduct.vendorId);
return {
currentSoftwareProduct,
softwareProductCategories,
isFormValid,
genericFieldInfo,
qGenericFieldInfo,
- dataMap
+ dataMap,
+ isVendorArchived: !!isVendorArchived
};
};
onVendorParamChanged: (deltaData, formName) => SoftwareProductActionHelper.softwareProductEditorVendorChanged(dispatch, {deltaData, formName}),
onQDataChanged: (deltaData) => ValidationHelper.qDataChanged(dispatch, {deltaData, qName: PRODUCT_QUESTIONNAIRE}),
onValidityChanged: isValidityData => SoftwareProductActionHelper.setIsValidityData(dispatch, {isValidityData}),
- onSubmit: (softwareProduct, qdata) => SoftwareProductActionHelper.updateSoftwareProduct(dispatch, {softwareProduct, qdata, version})
+ onSubmit: (softwareProduct, qdata) => SoftwareProductActionHelper.updateSoftwareProduct(dispatch, {softwareProduct, qdata, version}),
+ onArchivedVendorRemove: ({onVendorParamChanged, finalizedLicenseModelList, vendorName}) => dispatch({
+ type: modalActionTypes.GLOBAL_MODAL_SHOW,
+ data:{
+ title: i18n('Change Archived VLM'),
+ modalComponentName: modalContentMapper.VENDOR_SELECTOR,
+ modalComponentProps: {
+ size: modalSizes.MEDIUM,
+ finalizedLicenseModelList,
+ vendorName,
+ onClose: () => dispatch({type: modalActionTypes.GLOBAL_MODAL_CLOSE}),
+ onConfirm: (vendorId) => onVendorParamChanged({vendorId}, forms.VENDOR_SOFTWARE_PRODUCT_DETAILS)
+ }
+ }
+ })
};
};
--- /dev/null
+/*!
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+import React from 'react';
+import PropTypes from 'prop-types';
+import i18n from 'nfvo-utils/i18n/i18n.js';
+import Form from 'nfvo-components/input/validation/Form.jsx';
+import Input from 'nfvo-components/input/validation/Input.jsx';
+import sortByStringProperty from 'nfvo-utils/sortByStringProperty.js';
+
+class VendorSelector extends React.Component {
+ static propTypes = {
+ finalizedLicenseModelList: PropTypes.array,
+ vendorName: PropTypes.string,
+ onClose: PropTypes.func.isRequired,
+ onConfirm: PropTypes.func.isRequired
+ }
+ constructor(props){
+ super(props);
+ const selectedValue = props.finalizedLicenseModelList.length ? props.finalizedLicenseModelList[0].id : '';
+ this.state = {
+ selectedValue
+ };
+ }
+ submit() {
+ const vendor = this.props.finalizedLicenseModelList.find(item => item.id === this.state.selectedValue);
+ this.props.onConfirm(vendor.id);
+ this.props.onClose();
+ }
+ render() {
+ const {finalizedLicenseModelList, vendorName, onClose} = this.props;
+ const {selectedValue} = this.state;
+ return (
+ <div className='vsp-details-vendor-select'>
+ <Form
+ onSubmit={() => this.submit()}
+ onReset={() => onClose()}
+ isValid = {!!selectedValue}
+ submitButtonText={i18n('Save')}
+ hasButtons={true}>
+ <div className='vendor-selector-modal-title'>{`${i18n('The VLM')} '${vendorName}' ${i18n('assigned to this VSP is archived')}.`}</div>
+ <div className='vendor-selector-modal-additional-text'>{i18n('If you select a different VLM you will not be able to reselect the archived VLM.')}</div>
+ <Input
+ data-test-id='vsp-vendor-name-select'
+ label={i18n('Vendor')}
+ type='select'
+ onChange={e => {this.setState({
+ selectedValue: e.target.options[e.target.selectedIndex].value
+ });}}
+ value={selectedValue}>
+ <option key='emtyVendor' value=''>{i18n('please select...')}</option>
+ {sortByStringProperty(
+ finalizedLicenseModelList,
+ 'name'
+ ).map(lm => <option key={lm.id} value={lm.id}>{lm.name}</option>)
+ }
+ </Input>
+ </Form>
+ </div>
+ );
+ }
+}
+
+export default VendorSelector;
+
/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import SoftwareProductCategoriesHelper from 'sdc-app/onboarding/softwareProduct/SoftwareProductCategoriesHelper.js';
import {forms} from 'sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js';
+const DeprecatedVlmInfo = ({vendorName, onVendorRemove}) => {
+ return (
+ <div className='depricated-vlm-info'>
+ <Input
+ data-test-id='vsp-vendor-name'
+ isRequired={true}
+ onClick={() => onVendorRemove()}
+ label={i18n('Vendor')}
+ type='select'
+ value={`${vendorName} (Archived)`}>
+ <option key={vendorName} value={`${vendorName} (Archived)`}>{`${vendorName} (Archived)`}</option>
+ </Input>
+ </div>
+ );
+};
+
class GeneralSection extends React.Component {
static propTypes = {
vendorId: PropTypes.string,
finalizedLicenseModelList: PropTypes.array,
onDataChanged: PropTypes.func.isRequired,
onVendorParamChanged: PropTypes.func.isRequired,
- onSelectSubCategory: PropTypes.func.isRequired
+ onSelectSubCategory: PropTypes.func.isRequired,
+ isVendorArchived: PropTypes.bool,
+ onArchivedVendorRemove: PropTypes.func
};
onVendorParamChanged(e) {
const subCategory = e.target.options[selectedIndex].value;
this.props.onSelectSubCategory(subCategory);
}
+ onVendorRemove() {
+ const {finalizedLicenseModelList, vendorName, onVendorParamChanged} = this.props;
+ this.props.onArchivedVendorRemove({finalizedLicenseModelList, onVendorParamChanged, vendorName});
+ }
render (){
let {genericFieldInfo} = this.props;
errorText={genericFieldInfo.name.errorText}
isValid={genericFieldInfo.name.isValid}
onChange={name => name.length <= 25 && this.props.onDataChanged({name}, forms.VENDOR_SOFTWARE_PRODUCT_DETAILS)}/>
- <Input
- data-test-id='vsp-vendor-name'
- label={i18n('Vendor')}
- type='select'
- value={this.props.vendorId}
- onChange={e => this.onVendorParamChanged(e)}>
- {sortByStringProperty(
- this.props.finalizedLicenseModelList,
- 'name'
- ).map(lm => <option key={lm.id} value={lm.id}>{lm.name}</option>)
- }
- </Input>
+ {this.props.isVendorArchived ?
+ <DeprecatedVlmInfo onVendorRemove={()=>this.onVendorRemove()} vendorName={this.props.vendorName} /> :
+ <Input
+ data-test-id='vsp-vendor-name'
+ label={i18n('Vendor')}
+ type='select'
+ value={this.props.vendorId}
+ onChange={e => this.onVendorParamChanged(e)}>
+ {sortByStringProperty(
+ this.props.finalizedLicenseModelList,
+ 'name'
+ ).map(lm => <option key={lm.id} value={lm.id}>{lm.name}</option>)
+ }
+ </Input>
+ }
<Input
data-test-id='vsp-category-name'
label={i18n('Category')}
onFeatureGroupsChanged: PropTypes.func.isRequired,
onLicensingDataChanged: PropTypes.func.isRequired,
featureGroupsList: PropTypes.array,
- licenseAgreementList: PropTypes.array
+ licenseAgreementList: PropTypes.array,
+ isVendorArchived: PropTypes.bool
};
onVendorParamChanged(e) {
onChange={e => this.onVendorParamChanged(e)}
value={this.props.licensingVersion || ''}
label={i18n('Licensing Version')}
+ disabled={this.props.isVendorArchived}
type='select'>
{this.props.licensingVersionsList.map(version =>
<option
data-test-id='vsp-license-agreement'
label={i18n('License Agreement')}
type='select'
+ disabled={this.props.isVendorArchived}
value={this.props.licensingData.licenseAgreement ? this.props.licensingData.licenseAgreement : '' }
onChange={(e) => this.onLicensingDataChanged(e)}>
<option key='placeholder' value=''>{i18n('Select...')}</option>
type='select'
isMultiSelect={true}
onInputChange={()=>{}}
+ disabled={this.props.isVendorArchived}
onEnumChange={featureGroups => this.props.onFeatureGroupsChanged({featureGroups})}
multiSelectedEnum={this.props.licensingData.featureGroups}
name='feature-groups'
};
prepareDataForGeneralSection(){
- let {softwareProductCategories, finalizedLicenseModelList, onDataChanged, currentSoftwareProduct, genericFieldInfo} = this.props;
- let {name, description, vendorId, subCategory} = currentSoftwareProduct;
+ let {softwareProductCategories, finalizedLicenseModelList, onDataChanged, currentSoftwareProduct, genericFieldInfo, isVendorArchived, onArchivedVendorRemove} = this.props;
+ let {name, description, vendorId, subCategory, vendorName} = currentSoftwareProduct;
return {
name,
description,
onDataChanged,
onVendorParamChanged: args => this.onVendorParamChanged(args),
onSelectSubCategory: args => this.onSelectSubCategory(args),
- genericFieldInfo
+ genericFieldInfo,
+ vendorName,
+ isVendorArchived,
+ onArchivedVendorRemove
};
}
prepareDataForLicensesSection(){
- let { featureGroupsList, licenseAgreementList, currentSoftwareProduct } = this.props;
+ let { featureGroupsList, licenseAgreementList, currentSoftwareProduct, isVendorArchived} = this.props;
let {vendorId, licensingVersion, licensingData = {}} = currentSoftwareProduct;
return {
onVendorParamChanged: args => this.onVendorParamChanged(args),
onLicensingDataChanged: args => this.onLicensingDataChanged(args),
featureGroupsList,
licenseAgreementList,
+ isVendorArchived
};
}
}
onVendorParamChanged({vendorId, licensingVersion}) {
+
let {finalizedLicenseModelList, onVendorParamChanged} = this.props;
if(!licensingVersion) {
const licensingVersionsList = this.buildLicensingVersionsListItems();
licensingVersion = licensingVersionsList[0].enum;
}
+
+ if (!vendorId) {
+ vendorId = finalizedLicenseModelList[0].id;
+ }
+
let vendorName = finalizedLicenseModelList.find(licenseModelItem => licenseModelItem.id === vendorId).name || '';
let deltaData = {
vendorId,
</div>
<div className='notification-action'>
<div className={classnames('action-button', {'hidden': read})} onClick={() => onActionClicked(notification)}>
- {eventType === notificationType.PERMISSION_CHANGED ? i18n('OK') : i18n('Sync')}
+ {eventType === notificationType.PERMISSION_CHANGED
+ || eventType === notificationType.ITEM_DELETED
+ || eventType === notificationType.ITEM_ARCHIVED
+ || eventType === notificationType.ITEM_RESTORED ? i18n('OK') : i18n('Sync')}
</div>
</div>
</div>
function getNotificationTypeDesc(eventType, permission, granted) {
switch (eventType) {
case notificationType.PERMISSION_CHANGED:
- return i18n('Permission {granted}: {permission}', {granted: granted ? 'Granted' : 'Taken', permission: permission});
+ const grantedStr = granted ? i18n('Granted') : i18n('Taken');
+ return `${i18n('Permission')} ${grantedStr}: ${permission}`;
case notificationType.ITEM_CHANGED.COMMIT:
return i18n('Your Copy Is Out Of Sync');
case notificationType.ITEM_CHANGED.SUBMIT:
return i18n('Version Submitted');
+ case notificationType.ITEM_DELETED:
+ return i18n('Item was deleted');
+ case notificationType.ITEM_ARCHIVED:
+ return i18n('Item was archived');
+ case notificationType.ITEM_RESTORED:
+ return i18n('Item was restored from archive');
}
}
onActionClicked(notification) {
const {onSync, updateNotification, currentScreen, onLoadItemsLists} = this.props;
- const {eventType, eventAttributes: {itemId, itemName, versionId, versionName}} = notification;
- if(eventType !== notificationType.PERMISSION_CHANGED) {
+ const {eventType, eventAttributes: {itemId, itemName, versionId, versionName}} = notification;
+ if(eventType !== notificationType.PERMISSION_CHANGED &&
+ eventType !== notificationType.ITEM_DELETED &&
+ eventType !== notificationType.ITEM_ARCHIVED &&
+ eventType !== notificationType.ITEM_RESTORED) {
onSync({itemId, itemName, versionId, versionName, currentScreen});
}
else {
ITEM_CHANGED: {
COMMIT: 'commit',
SUBMIT: 'submit'
- }
+ },
+ ITEM_DELETED: 'delete',
+ ITEM_ARCHIVED: 'archive',
+ ITEM_RESTORED: 'restore'
});
\ No newline at end of file
/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
export const mapStateToProps = ({
users: {userInfo},
versionsPage: {permissions, versionsList},
- currentScreen: {itemPermission: {isCollaborator}, props: {itemId}},
+ currentScreen: {itemPermission: {isCollaborator, isArchived}, props: {itemId}},
softwareProductList = []
}) => {
- let {versions, selectedVersion} = versionsList;
+ let {versions = [], selectedVersion} = versionsList;
let {owner, contributors, viewers} = permissions;
// sorting the version list
return statusCompare;
}
- });
-
+ });
const curentSoftwareProduct = softwareProductList.find(item => item.id === itemId);
return {
versions,
currentUser: userInfo,
selectedVersion,
isCollaborator,
- isManual: curentSoftwareProduct && curentSoftwareProduct.onboardingMethod === onboardingMethodType.MANUAL
+ isManual: curentSoftwareProduct && curentSoftwareProduct.onboardingMethod === onboardingMethodType.MANUAL,
+ isArchived
};
};
onModalNodeClick({version}) {
VersionsPageActionHelper.selectVersionFromModal(dispatch, {version});
- }
+ },
+ onArchive: () => VersionsPageActionHelper.archiveItem(dispatch, itemId),
+ onRestore: () => VersionsPageActionHelper.restoreItemFromArchive(dispatch, itemId)
};
};
/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import PermissionsView from './components/PermissionsView.jsx';
import Tree from 'nfvo-components/tree/Tree.jsx';
import SVGIcon from 'sdc-ui/lib/react/SVGIcon.js';
+import Button from 'sdc-ui/lib/react/Button.js';
import i18n from 'nfvo-utils/i18n/i18n.js';
+import featureToggle from 'sdc-app/features/featureToggle.js';
+
+const DepricateButton = ({depricateAction, title}) => (
+ <div className='depricate-btn-wrapper'>
+ <Button data-test-id='depricate-action-btn' className='depricate-btn' onClick={depricateAction}>{title}</Button>
+ </div>
+);
+
+const FeatureDepricatedButton = featureToggle('ARCHIVE_ITEM')(DepricateButton);
+
+const VersionPageTitle = ({itemName, depricatedTitle, isArchived, onRestore, onArchive}) => {
+ return (
+ <div className='version-page-header'>
+ <div className='versions-page-title'>{`${i18n('Available Versions')} - ${itemName} ${depricatedTitle}`}</div>
+ <FeatureDepricatedButton depricateAction={isArchived ? () => onRestore() : () => onArchive() } title={i18n(isArchived ? 'RESTORE' : 'ARCHIVE')}/>
+ </div>
+ );
+};
class VersionsPage extends React.Component {
state = {
}
render() {
let { versions, owner, contributors, currentUser, isCollaborator, itemName = '', viewers, onSelectVersion, onNavigateToVersion,
- onTreeFullScreen, onManagePermissions, onCreateVersion, selectedVersion, onModalNodeClick, isManual} = this.props;
+ onTreeFullScreen, onManagePermissions, onCreateVersion, selectedVersion, onModalNodeClick, isManual, isArchived, onArchive, onRestore} = this.props;
+ const depricatedTitle = isArchived ? i18n('(Archived)') : '';
return (
<div className='versions-page-view'>
- <div className='versions-page-title'>{i18n('Available Versions - {itemName}', {itemName: itemName})}</div>
+ <VersionPageTitle
+ itemName={itemName}
+ depricatedTitle={depricatedTitle}
+ onArchive={onArchive}
+ isArchived={isArchived}
+ onRestore={onRestore}/>
<PermissionsView
owner={owner}
contributors={contributors}
versions={versions}
onSelectVersion={onSelectVersion}
onNavigateToVersion={onNavigateToVersion}
- onCreateVersion={onCreateVersion}
+ onCreateVersion={isArchived ? false : onCreateVersion}
selectedVersion={selectedVersion}
isCollaborator={isCollaborator} />
</div>
/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
type: modalActionTypes.GLOBAL_MODAL_CLOSE
});
this.selectVersion(dispatch, {version});
+ },
+
+ archiveItem(dispatch, itemId) {
+ ItemsHelper.archiveItem(itemId).then(() => {
+ ScreensHelper.loadScreen(dispatch, {
+ screen: enums.SCREEN.ONBOARDING_CATALOG
+ });
+ });
+ },
+
+ restoreItemFromArchive(dispatch, itemId) {
+ ItemsHelper.restoreItem(itemId).then(() => {
+ ScreensHelper.loadScreen(dispatch, {
+ screen: enums.SCREEN.ONBOARDING_CATALOG
+ });
+ });
}
};
/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
labelPosition='right' />
</div>
<div className='version-item-field item-create'>
- {!isHeader && isCollaborator && additionalInfo.OptionalCreationMethods.length > 0 &&
+ {!isHeader && isCollaborator && additionalInfo.OptionalCreationMethods.length > 0 && onCreateVersion &&
<SVGIcon
name='plus-circle'
data-test-id='versions-page-create-version'
onClick={e => { e.stopPropagation(); onCreateVersion(); }}
label={i18n('Create New Version')}
labelPosition='right'
- disabled={!isCollaborator} />
+ disabled={!isCollaborator || !onCreateVersion} />
}
</div>
</div>
}
-
-
</div>
);
data={version}
onSelectVersion={() => onSelectVersion({version})}
onNavigateToVersion={() => onNavigateToVersion({version})}
- onCreateVersion={() => onCreateVersion({version})}
+ onCreateVersion={onCreateVersion ? () => onCreateVersion({version}) : false}
isSelected={selectedVersion === version.id}
isCollaborator={isCollaborator} />
)}
.attrs({
'isDirty': false,
'isOutOfSync': false,
+ 'isArchived': false,
'isUpToDate': true
});
.option('isCertified', false)
.option('inMerge', false)
.option('isCollaborator', true)
- .option('isReadOnlyMode', ['isCertified', 'inMerge', 'isCollaborator'], (isCertified, inMerge, isCollaborator) =>
+ .option('isArchived', false)
+ .option('isReadOnlyMode', ['isCertified', 'inMerge', 'isCollaborator', 'isArchived'], (isCertified, inMerge, isCollaborator, isArchived) =>
isCertified || inMerge || !isCollaborator
)
.attr('itemPermission', ['isCertified', 'inMerge', 'isCollaborator'], (isCertified, inMerge, isCollaborator) =>
.option('isUpToDate', true)
.option('version', ['isCertified'], (isCertified) => VersionFactory.build({isCertified}))
.attr('itemPermission', [
- 'isCertified', 'inMerge', 'isCollaborator', 'isDirty', 'isOutOfSync', 'isUpToDate'
- ], (isCertified, inMerge, isCollaborator, isDirty, isOutOfSync, isUpToDate) =>
- ItemPermissionFactory.build({isCollaborator, isCertified, inMerge, isDirty, isOutOfSync, isUpToDate})
+ 'isCertified', 'inMerge', 'isCollaborator', 'isDirty', 'isOutOfSync', 'isUpToDate', 'isArchived'
+ ], (isCertified, inMerge, isCollaborator, isDirty, isOutOfSync, isUpToDate, isArchived) =>
+ ItemPermissionFactory.build({isCollaborator, isCertified, inMerge, isDirty, isOutOfSync, isUpToDate, isArchived})
)
.attr('props', ['isReadOnlyMode', 'version'], (isReadOnlyMode, version) => {
return {isReadOnlyMode, version};
it ('should return empty data', () => {
let state = {
licenseModelList: [],
+ archivedLicenseModelList: [],
+ finalizedLicenseModelList: [],
licenseModel: {
licenseModelCreation: {
data: {}
it ('should return vlm names list', () => {
let state = {
+ archivedLicenseModelList: [],
+ finalizedLicenseModelList: [],
licenseModelList: [{
name: 'vlm1',
id: 'vlm1_id'
}
};
});
-
+
mockRest.addHandler('fetch', ({data, options, baseUrl}) => {
expect(baseUrl).toEqual(`/onboarding-api/v1.0/items/${LICENSE_MODEL_ID}/versions/${version.id}`);
expect(data).toEqual(undefined);
expect(options).toEqual(undefined);
return {...returnedVersionFields, state: {synchronizationState: SyncStates.UP_TO_DATE, dirty: true}};
});
-
+
return EntitlementPoolsActionHelper.deleteEntitlementPool(store.dispatch, {
licenseModelId: LICENSE_MODEL_ID,
version,
return {...returnedVersionFields, state: {synchronizationState: SyncStates.UP_TO_DATE, dirty: true}};
});
+
+
return EntitlementPoolsActionHelper.saveEntitlementPool(store.dispatch,
{
licenseModelId: LICENSE_MODEL_ID,
expect(elem.length).toBe(1);
});
+ it ('Do not show action buttons in case of archived item', () =>{
+ let propsForArchivedItem = {...props, isArchived: true};
+ let versionController = TestUtils.renderIntoDocument(<Provider store={store}><VersionController {...propsForArchivedItem} /></Provider>);
+ let saveBtn = TestUtils.scryRenderedDOMComponentsWithClass(versionController,'collaborator-action-buttons');
+ expect(saveBtn).toBeTruthy();
+ expect(saveBtn.length).toBe(0);
+ });
});
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import {storeCreator} from 'sdc-app/AppStore.js';
import {OnboardingCatalogStoreFactory} from 'test-utils/factories/onboard/OnboardingCatalogFactories.js';
it('should change active tab to All', () => {
const store = storeCreator();
- const expectedStore = OnboardingCatalogStoreFactory.build({activeTab: tabsMapping.ALL});
- OnboardingCatalogActionHelper.changeActiveTab(store.dispatch, tabsMapping.ALL);
+ const expectedStore = OnboardingCatalogStoreFactory.build({activeTab: tabsMapping.ACTIVE});
+ OnboardingCatalogActionHelper.changeActiveTab(store.dispatch, tabsMapping.ACTIVE);
expect(store.getState().onboard.onboardingCatalog).toEqual(expectedStore);
});
*/
import React from 'react';
+import {Provider} from 'react-redux';
+import {storeCreator} from 'sdc-app/AppStore.js';
+
import TestUtils from 'react-dom/test-utils';
import {defaultStoreFactory} from 'test-utils/factories/onboard/OnboardingCatalogFactories.js';
import {FinalizedLicenseModelFactory} from 'test-utils/factories/licenseModel/LicenseModelFactories.js';
};
let params = {...func, ...mapStateToProps(data)};
- let CatalogView = TestUtils.renderIntoDocument(<OnboardingCatalogView
- {...params}/>);
+ const store = storeCreator();
+
+ let CatalogView = TestUtils.renderIntoDocument(
+ <Provider store={store}>
+ <OnboardingCatalogView
+ {...params}/>
+ </Provider>);
expect(CatalogView).toBeTruthy();
});
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import {storeCreator} from 'sdc-app/AppStore.js';
import {OnboardStoreFactory} from 'test-utils/factories/onboard/OnboardFactories.js';
const expectedStore = OnboardStoreFactory.build();
OnboardActionHelper.changeSearchValue(store.dispatch, 'hello');
OnboardActionHelper.changeActiveTab(store.dispatch, onboardTabsMapping.CATALOG);
- OnboardingCatalogActionHelper.changeActiveTab(store.dispatch, onboardCatalogTabsMapping.ALL);
+ OnboardingCatalogActionHelper.changeActiveTab(store.dispatch, onboardCatalogTabsMapping.ACTIVE);
OnboardActionHelper.resetOnboardStore(store.dispatch, 'hello');
expect(store.getState().onboard).toEqual(expectedStore);
});
it ('should return empty data', () => {
let state = {
softwareProductList: [],
+ finalizedSoftwareProductList: [],
+ archivedSoftwareProductList: [],
softwareProduct: {
softwareProductCreation: {
data: {}
it ('should return vsp names list', () => {
let state = {
+ finalizedSoftwareProductList: [],
+ archivedSoftwareProductList: [],
softwareProductList: [{
name: 'vsp1',
id: 'vsp1_id'
let state = {
softwareProductList: [],
+ finalizedSoftwareProductList: [],
+ archivedSoftwareProductList: [],
softwareProduct: {
softwareProductCreation: SoftwareProductCreationFactory.build(),
softwareProductCategories: CategoryWithSubFactory.buildList({}, {quantity: 2})
let finalizedLicenseModelList = FinalizedLicenseModelFactory.buildList(3);
let state = {
softwareProductList: [],
+ finalizedSoftwareProductList: [],
+ archivedSoftwareProductList: [],
softwareProduct: {
softwareProductCreation: SoftwareProductCreationFactoryWithSelectedVendor.build({selectedVendorId: finalizedLicenseModelList[0].id}),
softwareProductCategories: CategoryWithSubFactory.buildList({}, {quantity: 2})
/*
* Copyright © 2016-2018 European Support Limited
*
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed under the Apache License, Version 2.0 (the 'License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
import {SchemaGenericFieldInfoFactory} from 'test-utils/factories/softwareProduct/SoftwareProductQSchemaFactory.js';
import {default as VspQdataFactory, VspDataMapFactory} from 'test-utils/factories/softwareProduct/VspQdataFactory.js';
import {FinalizedLicenseModelFactory} from 'test-utils/factories/licenseModel/LicenseModelFactories.js';
-import VersionFactory from 'test-utils/factories/common/VersionFactory.js';
import CurrentScreenFactory from 'test-utils/factories/common/CurrentScreenFactory.js';
describe('Software Product Details: ', function () {
licenseAgreementList = LicenseAgreementStoreFactory.buildList(2);
licensingVersionsList = [
{
- "id":"0127b419e9574a11aab8e031a78fc534",
- "name":"1.0","description":"Initial version",
- "baseId":"","status":"Certified","creationTime":1506409288390,"modificationTime":1506409288390,"additionalInfo":{"OptionalCreationMethods":["minor"]}},{"id":"ea159ffedd9a4f9a8a56d53ba66b7314","name":"2.0","description":"ggggg","baseId":"0127b419e9574a11aab8e031a78fc534","status":"Draft","creationTime":1508839019802,"modificationTime":1508839019802,"additionalInfo":{"OptionalCreationMethods":[]}}
+ 'id':'0127b419e9574a11aab8e031a78fc534',
+ 'name':'1.0','description':'Initial version',
+ 'baseId':'','status':'Certified','creationTime':1506409288390,
+ 'modificationTime':1506409288390,'additionalInfo':{'OptionalCreationMethods':['minor']}},
+ {'id':'ea159ffedd9a4f9a8a56d53ba66b7314','name':'2.0','description':'ggggg',
+ 'baseId':'0127b419e9574a11aab8e031a78fc534','status':'Draft','creationTime':1508839019802,
+ 'modificationTime':1508839019802,'additionalInfo':{'OptionalCreationMethods':[]}
+ }
];
featureGroupsList = FeatureGroupStoreFactory.buildList(2, {referencingLicenseAgreements: [licenseAgreementList[0].id]});
qdata = VspQdataFactory.build();
featureGroup: {
featureGroupsList: []
}
- }
+ },
+ archivedLicenseModelList: [],
+ archivedSoftwareProductList: []
};
var result = mapStateToProps(obj);
dataMap
}
},
- finalizedLicenseModelList: finalizedLicenseModelList,
+ finalizedLicenseModelList: finalizedLicenseModelList,
+ archivedLicenseModelList: [],
+ archivedSoftwareProductList: [],
licenseModel: {
licenseAgreement: {
licenseAgreementList: licenseAgreementList
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import deepFreeze from 'deep-freeze';
import mockRest from 'test-utils/MockRest.js';
import {InitializedCurrentScreenFactory} from 'test-utils/factories/common/CurrentScreenFactory.js';
describe('Software Product Details Module Tests', function () {
- it('Get Software Products List', () => {
+ it('Get Software Products List', async () => {
const store = storeCreator();
deepFreeze(store.getState());
const softwareProductList = VSPEditorFactory.buildList(2);
return {results: []};
});
- return SoftwareProductActionHelper.fetchSoftwareProductList(store.dispatch).then(() => {
- return SoftwareProductActionHelper.fetchFinalizedSoftwareProductList(store.dispatch);
- }).then(() => {
- expect(store.getState()).toEqual(expectedStore);
+ mockRest.addHandler('fetch', ({options, data, baseUrl}) => {
+ expect(baseUrl).toEqual('/onboarding-api/v1.0/vendor-software-products/?Status=ARCHIVED');
+ expect(data).toEqual(undefined);
+ expect(options).toEqual(undefined);
+ return {results: []};
});
+
+ await SoftwareProductActionHelper.fetchSoftwareProductList(store.dispatch);
+ await SoftwareProductActionHelper.fetchFinalizedSoftwareProductList(store.dispatch);
+ await SoftwareProductActionHelper.fetchArchivedSoftwareProductList(store.dispatch);
+
+ expect(store.getState()).toEqual(expectedStore);
});
it('Add Software Product', () => {
import React from 'react';
import ShallowRenderer from 'react-test-renderer/shallow';
+import {mount} from 'enzyme';
+import {Provider} from 'react-redux';
import deepFreeze from 'deep-freeze';
import mockRest from 'test-utils/MockRest.js';
import Configuration from 'sdc-app/config/Configuration.js';
import {storeCreator} from 'sdc-app/AppStore.js';
-
import {mapStateToProps, mapActionsToProps} from 'sdc-app/onboarding/versionsPage/VersionsPage.js';
import VersionsPageView from 'sdc-app/onboarding/versionsPage/VersionsPage.jsx';
import VersionsPageActionHelper from 'sdc-app/onboarding/versionsPage/VersionsPageActionHelper.js';
import VersionFactory from 'test-utils/factories/common/VersionFactory.js';
import {VersionsPageCreationFactory} from 'test-utils/factories/versionsPage/VersionsPageCreationFactories.js';
import {VersionsPageAdditionalPropsFactory} from 'test-utils/factories/versionsPage/VersionsPageFactories.js';
+import {cloneAndSet} from 'test-utils/Util.js';
describe('Versions Page Module Tests', () => {
userInfo: 'user123'
},
versionsPage: {
- permissions: {},
+ permissions: {
+ contributors: [],
+ owner: {
+ userId: 'fgfgfg',
+ permission: 'Owner',
+ fullName: 'Test User',
+ role: 'Test ROLE'
+ }
+ },
versionsList: {versions: []},
versionCreation: {}
}
const additionalProps = VersionsPageAdditionalPropsFactory.build();
- const props = Object.assign({}, mapStateToProps(state), mapActionsToProps(dispatch, additionalProps));
+ const props = {...mapStateToProps(state), ...mapActionsToProps(dispatch, additionalProps)};
const renderer = new ShallowRenderer();
renderer.render(<VersionsPageView {...props} />);
expect(renderedOutput).toBeTruthy();
});
+ /**
+ * turn on when ARCHIVE_ITEM feature toggle will be removed in VersionPage.jsx
+ */
+ // it('archive btn test', () => {
+
+ // const store = storeCreator();
+ // const dispatch = store.dispatch;
+
+ // const additionalProps = VersionsPageAdditionalPropsFactory.build();
+ // const props = {...mapStateToProps(state), ...mapActionsToProps(dispatch, additionalProps)};
+ // const wrapper = mount(<Provider store={store}><VersionsPageView {...props}/></Provider>);
+ // const depricateBtn = wrapper.find('.depricate-btn');
+ // expect(depricateBtn).toBeTruthy();
+ // expect(depricateBtn.text()).toBe('ARCHIVE');
+ // });
+
+
});