diff options
author | andre.schmid <andre.schmid@est.tech> | 2021-07-22 11:54:07 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2021-08-12 07:44:53 +0000 |
commit | 36fa9cdd9fb26aa3fbd3a1f35b2d8344d1301c11 (patch) | |
tree | 636aef4d50e634b7eea17a93025c4836fce43469 /openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js | |
parent | ead5c383df30c94a83ee1d7e2c869cc5b23697a2 (diff) |
Specify a model while creating a VSP
Change-Id: I6ed0a3c979e14c62ecd6488dfd70589df40636e9
Issue-ID: SDC-3656
Signed-off-by: André Schmid <andre.schmid@est.tech>
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js')
-rw-r--r-- | openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js index 38600a60b8..29e278f928 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js @@ -1,6 +1,7 @@ /*! * Copyright © 2016-2018 European Support Limited * Modifications copyright (c) 2021 Nokia + * Modifications Copyright (C) 2021 Nordix Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -100,11 +101,17 @@ function baseUrl() { const restPrefix = Configuration.get('restPrefix'); return `${restPrefix}/v1.0/vendor-software-products/`; } + function softwareProductCategoriesUrl() { const restCatalogPrefix = Configuration.get('restCatalogPrefix'); return `${restCatalogPrefix}/v1/categories/resources/`; } +function getModelUrl() { + const restCatalogPrefix = Configuration.get('restCatalogPrefix'); + return `${restCatalogPrefix}/v1/catalog/model/`; +} + function uploadFile(vspId, formData, version) { return RestAPIUtil.post( `${baseUrl()}${vspId}/versions/${ @@ -135,6 +142,7 @@ function putSoftwareProduct({ softwareProduct, version }) { : undefined, icon: softwareProduct.icon, licenseType: softwareProduct.licenseType, + selectedModelList: softwareProduct.selectedModelList, licensingData: getLicensingData(softwareProduct.licensingData) } ); @@ -264,6 +272,17 @@ function fetchSoftwareProductCategories(dispatch) { .catch(() => handleResponse(null)); } +function fetchModelList(dispatch) { + let handleResponse = response => + dispatch({ + type: actionTypes.SOFTWARE_PRODUCT_MODELS_LOADED, + modelList: response + }); + RestAPIUtil.fetch(getModelUrl()) + .then(handleResponse) + .catch(() => handleResponse(null)); +} + function loadLicensingData(dispatch, { licenseModelId, licensingVersion }) { return ItemsHelper.fetchVersion({ itemId: licenseModelId, @@ -329,6 +348,7 @@ const SoftwareProductActionHelper = { loadSoftwareProductAssociatedData(dispatch) { fetchSoftwareProductCategories(dispatch); + fetchModelList(dispatch); LicenseModelActionHelper.fetchFinalizedLicenseModels(dispatch); }, |