aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/provisioning/create-view.js
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-09-17 16:15:28 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-09-18 10:47:27 +0200
commit890ab0b59cdb3902f4869eabf8ca534814f1b3dd (patch)
tree0ed74726957e590f6506e378366ea15bf21bfcbd /server/sonar-web/src/main/js/apps/provisioning/create-view.js
parentce60ac8d2e137f33bb111668e54e78c195c73d79 (diff)
downloadsonarqube-890ab0b59cdb3902f4869eabf8ca534814f1b3dd.tar.gz
sonarqube-890ab0b59cdb3902f4869eabf8ca534814f1b3dd.zip
migrate js apps to es2015 modules
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 }]);
+ });
+ }
});
+
+