#7902 displaying messages on cancelled item creation (#7943)

* #7902 displaying messages on cancelled item creation

* remove debugger

Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
This commit is contained in:
Marta
2021-11-22 00:12:01 +01:00
committed by GitHub
parent 17f6899f5d
commit 3b0da9be55

View File

@@ -602,8 +602,6 @@
$scope.page.buttonGroupState = 'error';
handleHttpException(err);
});
},
close: function () {
overlayService.close();
@@ -641,13 +639,14 @@
overlayService.close();
return $q.when(data);
},
function (err) {
clearDirtyState($scope.content.variants);
model.submitButtonState = "error";
//re-map the dialog model since we've re-bound the properties
dialog.variants = $scope.content.variants;
handleHttpException(err);
});
function (err) {
clearDirtyState($scope.content.variants);
model.submitButtonState = "error";
//re-map the dialog model since we've re-bound the properties
dialog.variants = $scope.content.variants;
handleHttpException(err);
});
},
close: function () {
overlayService.close();
@@ -699,14 +698,18 @@
clearNotifications($scope.content);
overlayService.close();
return $q.when(data);
},
function (err) {
clearDirtyState($scope.content.variants);
model.submitButtonState = "error";
//re-map the dialog model since we've re-bound the properties
dialog.variants = $scope.content.variants;
handleHttpException(err);
});
}, function (err) {
clearDirtyState($scope.content.variants);
model.submitButtonState = "error";
//re-map the dialog model since we've re-bound the properties
dialog.variants = $scope.content.variants;
//ensure error messages are displayed
formHelper.showNotifications(err.data);
clearNotifications($scope.content);
handleHttpException(err);
});
},
close: function () {
overlayService.close();
@@ -760,20 +763,24 @@
clearNotifications($scope.content);
overlayService.close();
return $q.when(data);
},
function (err) {
clearDirtyState($scope.content.variants);
//model.submitButtonState = "error";
// Because this is the "save"-action, then we actually save though there was a validation error, therefor we will show success and display the validation errors politely.
if(err && err.data && err.data.ModelState && Object.keys(err.data.ModelState).length > 0) {
model.submitButtonState = "success";
} else {
model.submitButtonState = "error";
}
}, function (err) {
clearDirtyState($scope.content.variants);
//model.submitButtonState = "error";
// Because this is the "save"-action, then we actually save though there was a validation error, therefor we will show success and display the validation errors politely.
if(err && err.data && err.data.ModelState && Object.keys(err.data.ModelState).length > 0) {
model.submitButtonState = "success";
} else {
model.submitButtonState = "error";
//re-map the dialog model since we've re-bound the properties
dialog.variants = $scope.content.variants;
//ensure error messages are displayed
formHelper.showNotifications(err.data);
clearNotifications($scope.content);
handleHttpException(err);
});
}
})
},
close: function (oldModel) {
overlayService.close();