/*!
* 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.
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/${
: undefined,
icon: softwareProduct.icon,
licenseType: softwareProduct.licenseType,
+ selectedModelList: softwareProduct.selectedModelList,
licensingData: getLicensingData(softwareProduct.licensingData)
}
);
.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,
loadSoftwareProductAssociatedData(dispatch) {
fetchSoftwareProductCategories(dispatch);
+ fetchModelList(dispatch);
LicenseModelActionHelper.fetchFinalizedLicenseModels(dispatch);
},