diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/quality-gates/delete-view.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/quality-gates/delete-view.js | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/delete-view.js b/server/sonar-web/src/main/js/apps/quality-gates/delete-view.js index d142b883c84..ca25708f342 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/delete-view.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/delete-view.js @@ -1,33 +1,31 @@ -define([ - 'components/common/modal-form', - './templates' -], function (ModalForm) { +import ModalForm from 'components/common/modal-form'; +import './templates'; - return ModalForm.extend({ - template: Templates['quality-gates-delete'], +export default ModalForm.extend({ + template: Templates['quality-gates-delete'], - onFormSubmit: function () { - ModalForm.prototype.onFormSubmit.apply(this, arguments); - this.disableForm(); - this.sendRequest(); - }, - - sendRequest: function () { - var that = this, - options = { - statusCode: { - // do not show global error - 400: null - } - }; - return this.model.destroy(options) - .done(function () { - that.destroy(); - }).fail(function (jqXHR) { - that.enableForm(); - that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings); - }); - } - }); + onFormSubmit: function () { + ModalForm.prototype.onFormSubmit.apply(this, arguments); + this.disableForm(); + this.sendRequest(); + }, + sendRequest: function () { + var that = this, + options = { + statusCode: { + // do not show global error + 400: null + } + }; + return this.model.destroy(options) + .done(function () { + that.destroy(); + }).fail(function (jqXHR) { + that.enableForm(); + that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings); + }); + } }); + + |