summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js
diff options
context:
space:
mode:
authorJoanna Jeremicz <joanna.jeremicz@nokia.com>2021-04-21 13:59:12 +0200
committerMichael Morris <michael.morris@est.tech>2021-05-14 14:58:14 +0000
commite3de4c9d214983d38a7d66e89dae5d4bba170ca3 (patch)
tree9f92e5fc15d06051ffff254588bbcc1e85214d3f /openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js
parentdf353be353e1ec25ac2a0e64a9eb617dcbc87703 (diff)
Integrate helm validator with SDC-BE
- Read helm validator configuration - Add call to helm validator during Helm validation - Add JUnit tests - Fix display message when CNF upload is unsuccessful - Show warning messages from validation after CNF upload Issue-ID: SDC-3185 Signed-off-by: Joanna Jeremicz <joanna.jeremicz@nokia.com> Change-Id: If197d557e6ddef4a07bef986d7cf133aedcb2cc5 Signed-off-by: Piotr Marcinkiewicz <piotr.marcinkiewicz@nokia.com>
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js
index 02e5a24f3b..38600a60b8 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js
@@ -242,6 +242,17 @@ function parseUploadErrorMsg(error) {
return message.replace(/\n$/, '');
}
+function showWarningValidationInfo(dispatch, errors) {
+ dispatch({
+ type: modalActionTypes.GLOBAL_MODAL_WARNING,
+ data: {
+ title: 'Validation messages',
+ msg: parseUploadErrorMsg(errors),
+ cancelButtonText: 'OK'
+ }
+ });
+}
+
function fetchSoftwareProductCategories(dispatch) {
let handleResponse = response =>
dispatch({
@@ -447,6 +458,12 @@ const SoftwareProductActionHelper = {
break;
}
closeTimingValidationInfo(dispatch);
+ if (
+ response.errors !== null &&
+ Object.keys(response.errors).length !== 0
+ ) {
+ showWarningValidationInfo(dispatch, response.errors);
+ }
} else {
throw new Error(parseUploadErrorMsg(response.errors));
}
@@ -460,7 +477,8 @@ const SoftwareProductActionHelper = {
msg:
error.message ||
(error.responseJSON &&
- error.responseJSON.message)
+ error.responseJSON.message) ||
+ parseUploadErrorMsg(error.responseJSON.errors)
}
},
closeTimingValidationInfo(dispatch)