aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/provisioning/create-view.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/provisioning/create-view.js')
-rw-r--r--server/sonar-web/src/main/js/apps/provisioning/create-view.js54
1 files changed, 26 insertions, 28 deletions
diff --git a/server/sonar-web/src/main/js/apps/provisioning/create-view.js b/server/sonar-web/src/main/js/apps/provisioning/create-view.js
index 2aba2786c3c..6c02f5a2281 100644
--- a/server/sonar-web/src/main/js/apps/provisioning/create-view.js
+++ b/server/sonar-web/src/main/js/apps/provisioning/create-view.js
@@ -1,31 +1,29 @@
-define([
- './project',
- './form-view'
-], function (Project, FormView) {
+import Project from './project';
+import FormView from './form-view';
- return FormView.extend({
-
- sendRequest: function () {
- var that = this,
- project = new Project({
- name: this.$('#create-project-name').val(),
- branch: this.$('#create-project-branch').val(),
- key: this.$('#create-project-key').val()
- });
- this.disableForm();
- return project.save(null, {
- statusCode: {
- // do not show global error
- 400: null
- }
- }).done(function () {
- that.collection.refresh();
- that.destroy();
- }).fail(function (jqXHR) {
- that.enableForm();
- that.showErrors([{ msg: jqXHR.responseJSON.err_msg }]);
- });
- }
- });
+export default FormView.extend({
+ sendRequest: function () {
+ var that = this,
+ project = new Project({
+ name: this.$('#create-project-name').val(),
+ branch: this.$('#create-project-branch').val(),
+ key: this.$('#create-project-key').val()
+ });
+ this.disableForm();
+ return project.save(null, {
+ statusCode: {
+ // do not show global error
+ 400: null
+ }
+ }).done(function () {
+ that.collection.refresh();
+ that.destroy();
+ }).fail(function (jqXHR) {
+ that.enableForm();
+ that.showErrors([{ msg: jqXHR.responseJSON.err_msg }]);
+ });
+ }
});
+
+