blob: b617e603358358b2df395160f037d46c44dac1a4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
import _ from 'underscore';
import Marionette from 'backbone.marionette';
import ModalForm from '../../components/common/modal-form';
import Template from './templates/quality-gates-condition-delete.hbs';
export default ModalForm.extend({
template: Template,
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);
});
},
serializeData: function () {
return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
metric: this.options.metric
});
}
});
|