aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/custom-measures/delete-view.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/custom-measures/delete-view.js')
-rw-r--r--server/sonar-web/src/main/js/apps/custom-measures/delete-view.js54
1 files changed, 26 insertions, 28 deletions
diff --git a/server/sonar-web/src/main/js/apps/custom-measures/delete-view.js b/server/sonar-web/src/main/js/apps/custom-measures/delete-view.js
index 1838b83e044..6798c1259a3 100644
--- a/server/sonar-web/src/main/js/apps/custom-measures/delete-view.js
+++ b/server/sonar-web/src/main/js/apps/custom-measures/delete-view.js
@@ -1,32 +1,30 @@
-define([
- 'components/common/modal-form',
- './templates'
-], function (ModalForm) {
+import ModalForm from 'components/common/modal-form';
+import './templates';
- return ModalForm.extend({
- template: Templates['custom-measures-delete'],
+export default ModalForm.extend({
+ template: Templates['custom-measures-delete'],
- onFormSubmit: function (e) {
- this._super(e);
- this.sendRequest();
- },
-
- sendRequest: function () {
- var that = this,
- collection = this.model.collection;
- return this.model.destroy({
- wait: true,
- statusCode: {
- // do not show global error
- 400: null
- }
- }).done(function () {
- collection.refresh();
- that.destroy();
- }).fail(function (jqXHR) {
- that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
- });
- }
- });
+ onFormSubmit: function (e) {
+ this._super(e);
+ this.sendRequest();
+ },
+ sendRequest: function () {
+ var that = this,
+ collection = this.model.collection;
+ return this.model.destroy({
+ wait: true,
+ statusCode: {
+ // do not show global error
+ 400: null
+ }
+ }).done(function () {
+ collection.refresh();
+ that.destroy();
+ }).fail(function (jqXHR) {
+ that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
+ });
+ }
});
+
+