aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/licenseModel/creation/LicenseModelCreation.js
diff options
context:
space:
mode:
authortalig <talig@amdocs.com>2017-12-20 14:30:43 +0200
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2017-12-21 11:12:33 +0000
commit8e9c0653dd6c6862123c9609ae34e1206d86456e (patch)
tree5eeef00ec0677133baa439ca8d7ffd7aca4804b6 /openecomp-ui/src/sdc-app/onboarding/licenseModel/creation/LicenseModelCreation.js
parent785ebcc95de3e064e843bec04ba7a209d854fc7c (diff)
Add collaboration feature
Issue-ID: SDC-767 Change-Id: I14fb4c1f54086ed03a56a7ff7fab9ecd40381795 Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/licenseModel/creation/LicenseModelCreation.js')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/licenseModel/creation/LicenseModelCreation.js24
1 files changed, 16 insertions, 8 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/creation/LicenseModelCreation.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/creation/LicenseModelCreation.js
index 39b3c15c6a..71f41710db 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/creation/LicenseModelCreation.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/creation/LicenseModelCreation.js
@@ -14,34 +14,42 @@
* permissions and limitations under the License.
*/
import {connect} from 'react-redux';
-import OnboardingActionHelper from 'sdc-app/onboarding/OnboardingActionHelper.js';
import LicenseModelCreationActionHelper from './LicenseModelCreationActionHelper.js';
import LicenseModelCreationView from './LicenseModelCreationView.jsx';
import ValidationHelper from 'sdc-app/common/helpers/ValidationHelper.js';
import LicenseModelActionHelper from 'sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js';
+import VersionsPageActionHelper from 'sdc-app/onboarding/versionsPage/VersionsPageActionHelper.js';
+import {itemTypes as versionItemTypes} from 'sdc-app/onboarding/versionsPage/VersionsPageConstants.js';
+import ScreensHelper from 'sdc-app/common/helpers/ScreensHelper.js';
+import {enums, screenTypes} from 'sdc-app/onboarding/OnboardingConstants.js';
+import PermissionsActionHelper from 'sdc-app/onboarding/permissions/PermissionsActionHelper.js';
-export const mapStateToProps = ({licenseModelList, licenseModel: {licenseModelCreation}}) => {
+export const mapStateToProps = ({users: {usersList}, licenseModelList, licenseModel: {licenseModelCreation}}) => {
let {genericFieldInfo} = licenseModelCreation;
let isFormValid = ValidationHelper.checkFormValid(genericFieldInfo);
let VLMNames = {};
for (let i = 0; i < licenseModelList.length; i++) {
- VLMNames[licenseModelList[i].vendorName.toLowerCase()] = licenseModelList[i].id;
+ VLMNames[licenseModelList[i].name.toLowerCase()] = licenseModelList[i].id;
}
- return {...licenseModelCreation, isFormValid: isFormValid, VLMNames};
+ return {...licenseModelCreation, isFormValid: isFormValid, VLMNames, usersList};
};
export const mapActionsToProps = (dispatch) => {
return {
onDataChanged: (deltaData, formName, customValidations) => ValidationHelper.dataChanged(dispatch, {deltaData, formName, customValidations}),
onCancel: () => LicenseModelCreationActionHelper.close(dispatch),
- onSubmit: (licenseModel) => {
+ onSubmit: (licenseModel, usersList) => {
LicenseModelCreationActionHelper.close(dispatch);
LicenseModelCreationActionHelper.createLicenseModel(dispatch, {licenseModel}).then(response => {
- LicenseModelActionHelper.fetchLicenseModels(dispatch).then(() => {
- OnboardingActionHelper.navigateToLicenseModelOverview(dispatch, {licenseModelId: response.value});
- });
+ let {itemId, version} = response;
+ LicenseModelActionHelper.fetchLicenseModels(dispatch).then(() =>
+ PermissionsActionHelper.fetchItemUsers(dispatch, {itemId, allUsers: usersList}).then(() =>
+ VersionsPageActionHelper.fetchVersions(dispatch, {itemType: versionItemTypes.LICENSE_MODEL, itemId}).then(() =>
+ ScreensHelper.loadScreen(dispatch, {screen: enums.SCREEN.LICENSE_MODEL_OVERVIEW, screenType: screenTypes.LICENSE_MODEL,
+ props: {licenseModelId: itemId, version}})
+ )));
});
},
onValidateForm: (formName) => ValidationHelper.validateForm(dispatch, formName)