summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/onboard/Onboard.js
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/onboard/Onboard.js')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/onboard/Onboard.js27
1 files changed, 23 insertions, 4 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/onboard/Onboard.js b/openecomp-ui/src/sdc-app/onboarding/onboard/Onboard.js
index a1e0018114..ea70f9c0b8 100644
--- a/openecomp-ui/src/sdc-app/onboarding/onboard/Onboard.js
+++ b/openecomp-ui/src/sdc-app/onboarding/onboard/Onboard.js
@@ -22,7 +22,7 @@ import LicenseModelCreationActionHelper from '../licenseModel/creation/LicenseMo
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';
+import { itemStatus } from 'sdc-app/common/helpers/ItemsHelperConstants.js';
export const mapStateToProps = ({
onboard: { onboardingCatalog, activeTab, searchValue, filter },
@@ -32,7 +32,8 @@ export const mapStateToProps = ({
archivedSoftwareProductList,
finalizedLicenseModelList,
softwareProductList,
- finalizedSoftwareProductList
+ finalizedSoftwareProductList,
+ filteredItems
}) => {
const fullSoftwareProducts = softwareProductList
.filter(
@@ -50,6 +51,23 @@ export const mapStateToProps = ({
return accum;
};
+ const reduceFilteredLicenseModelList = (accum, vlm) => {
+ let currentSoftwareProductList = sortByStringProperty(
+ filteredItems.vspList.filter(vsp => vsp.vendorId === vlm.id),
+ 'name'
+ );
+ accum.push({ ...vlm, softwareProductList: currentSoftwareProductList });
+ return accum;
+ };
+
+ const updatedFilteredItems = {
+ vspList: [...filteredItems.vspList],
+ vlmList: sortByStringProperty(
+ filteredItems.vlmList.reduce(reduceFilteredLicenseModelList, []),
+ 'name'
+ )
+ };
+
licenseModelList = sortByStringProperty(
licenseModelList.reduce(reduceLicenseModelList, []),
'name'
@@ -72,7 +90,7 @@ export const mapStateToProps = ({
} = onboardingCatalog;
if (filter.byVendorView) {
catalogActiveTab = tabsMapping.BY_VENDOR;
- } else if (filter.itemsType && filter.itemsType === itemsType.ARCHIVED) {
+ } else if (filter.itemStatus && filter.itemStatus === itemStatus.ARCHIVED) {
catalogActiveTab = tabsMapping.ARCHIVE;
}
@@ -89,7 +107,8 @@ export const mapStateToProps = ({
searchValue,
vspOverlay,
selectedVendor,
- users: users.usersList
+ users: users.usersList,
+ filteredItems: updatedFilteredItems
};
};