diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-08-24 13:50:18 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-08-26 10:12:03 +0200 |
commit | 223bcb955ba554be354f6b4b1ca0c1acb9431d66 (patch) | |
tree | c055f39d1cf688974d275877c5ff07490c32295f /server/sonar-web/src/main/js/apps/groups | |
parent | 4fa812ee4cb69d00e761b7887fdd30820d6748a9 (diff) | |
download | sonarqube-223bcb955ba554be354f6b4b1ca0c1acb9431d66.tar.gz sonarqube-223bcb955ba554be354f6b4b1ca0c1acb9431d66.zip |
use the single web app
Diffstat (limited to 'server/sonar-web/src/main/js/apps/groups')
12 files changed, 38 insertions, 29 deletions
diff --git a/server/sonar-web/src/main/js/apps/groups/app.js b/server/sonar-web/src/main/js/apps/groups/app.js index 55c6dfef534..abd897234a5 100644 --- a/server/sonar-web/src/main/js/apps/groups/app.js +++ b/server/sonar-web/src/main/js/apps/groups/app.js @@ -1,11 +1,12 @@ define([ + 'backbone.marionette', './layout', './groups', './header-view', './search-view', './list-view', './list-footer-view' -], function (Layout, Groups, HeaderView, SearchView, ListView, ListFooterView) { +], function (Marionette, Layout, Groups, HeaderView, SearchView, ListView, ListFooterView) { var App = new Marionette.Application(), init = function (options) { @@ -37,9 +38,7 @@ define([ }; App.on('start', function (options) { - window.requestMessages().done(function () { - init.call(App, options); - }); + init.call(App, options); }); return App; diff --git a/server/sonar-web/src/main/js/apps/groups/delete-view.js b/server/sonar-web/src/main/js/apps/groups/delete-view.js index 85b33a632b5..14c35a1873f 100644 --- a/server/sonar-web/src/main/js/apps/groups/delete-view.js +++ b/server/sonar-web/src/main/js/apps/groups/delete-view.js @@ -6,8 +6,8 @@ define([ return ModalForm.extend({ template: Templates['groups-delete'], - onFormSubmit: function (e) { - this._super(e); + onFormSubmit: function () { + ModalForm.prototype.onFormSubmit.apply(this, arguments); this.sendRequest(); }, @@ -28,10 +28,10 @@ define([ }); }, - showErrors: function (errors, warnings) { + showErrors: function () { this.$('.js-modal-text').addClass('hidden'); this.disableForm(); - this._super(errors, warnings); + ModalForm.prototype.showErrors.apply(this, arguments); } }); diff --git a/server/sonar-web/src/main/js/apps/groups/form-view.js b/server/sonar-web/src/main/js/apps/groups/form-view.js index 7e3c26b98ee..29a654db85e 100644 --- a/server/sonar-web/src/main/js/apps/groups/form-view.js +++ b/server/sonar-web/src/main/js/apps/groups/form-view.js @@ -7,17 +7,17 @@ define([ template: Templates['groups-form'], onRender: function () { - this._super(); + ModalForm.prototype.onRender.apply(this, arguments); this.$('[data-toggle="tooltip"]').tooltip({ container: 'body', placement: 'bottom' }); }, onDestroy: function () { - this._super(); + ModalForm.prototype.onDestroy.apply(this, arguments); this.$('[data-toggle="tooltip"]').tooltip('destroy'); }, - onFormSubmit: function (e) { - this._super(e); + onFormSubmit: function () { + ModalForm.prototype.onFormSubmit.apply(this, arguments); this.sendRequest(); } }); diff --git a/server/sonar-web/src/main/js/apps/groups/group.js b/server/sonar-web/src/main/js/apps/groups/group.js index aced6727b91..5d7807b51d2 100644 --- a/server/sonar-web/src/main/js/apps/groups/group.js +++ b/server/sonar-web/src/main/js/apps/groups/group.js @@ -1,8 +1,10 @@ -define(function () { +define([ + 'backbone' +], function (Backbone) { return Backbone.Model.extend({ urlRoot: function () { - return baseUrl + '/api/usergroups'; + return window.baseUrl + '/api/usergroups'; }, sync: function (method, model, options) { diff --git a/server/sonar-web/src/main/js/apps/groups/groups.js b/server/sonar-web/src/main/js/apps/groups/groups.js index dcfbb8c731b..46c46fe8078 100644 --- a/server/sonar-web/src/main/js/apps/groups/groups.js +++ b/server/sonar-web/src/main/js/apps/groups/groups.js @@ -1,12 +1,13 @@ define([ + 'backbone', './group' -], function (Group) { +], function (Backbone, Group) { return Backbone.Collection.extend({ model: Group, url: function () { - return baseUrl + '/api/usergroups/search'; + return window.baseUrl + '/api/usergroups/search'; }, parse: function (r) { @@ -19,7 +20,7 @@ define([ fetch: function (options) { var d = (options && options.data) || {}; this.q = d.q; - return this._super(options); + return Backbone.Collection.prototype.fetch.apply(this, arguments); }, fetchMore: function () { diff --git a/server/sonar-web/src/main/js/apps/groups/header-view.js b/server/sonar-web/src/main/js/apps/groups/header-view.js index da6f7f60919..a60f0c51f34 100644 --- a/server/sonar-web/src/main/js/apps/groups/header-view.js +++ b/server/sonar-web/src/main/js/apps/groups/header-view.js @@ -1,7 +1,8 @@ define([ + 'backbone.marionette', './create-view', './templates' -], function (CreateView) { +], function (Marionette, CreateView) { return Marionette.ItemView.extend({ template: Templates['groups-header'], diff --git a/server/sonar-web/src/main/js/apps/groups/layout.js b/server/sonar-web/src/main/js/apps/groups/layout.js index 18f6c7738d1..e6cddd674ce 100644 --- a/server/sonar-web/src/main/js/apps/groups/layout.js +++ b/server/sonar-web/src/main/js/apps/groups/layout.js @@ -1,6 +1,7 @@ define([ + 'backbone.marionette', './templates' -], function () { +], function (Marionette) { return Marionette.LayoutView.extend({ template: Templates['groups-layout'], diff --git a/server/sonar-web/src/main/js/apps/groups/list-footer-view.js b/server/sonar-web/src/main/js/apps/groups/list-footer-view.js index 3c0fbe198c5..ee4467b3e87 100644 --- a/server/sonar-web/src/main/js/apps/groups/list-footer-view.js +++ b/server/sonar-web/src/main/js/apps/groups/list-footer-view.js @@ -1,6 +1,7 @@ define([ + 'backbone.marionette', './templates' -], function () { +], function (Marionette) { return Marionette.ItemView.extend({ template: Templates['groups-list-footer'], @@ -23,7 +24,7 @@ define([ }, serializeData: function () { - return _.extend(this._super(), { + return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { total: this.collection.total, count: this.collection.length, more: this.collection.hasMore() diff --git a/server/sonar-web/src/main/js/apps/groups/list-item-view.js b/server/sonar-web/src/main/js/apps/groups/list-item-view.js index 45ce8b9688a..20a24cf3bc0 100644 --- a/server/sonar-web/src/main/js/apps/groups/list-item-view.js +++ b/server/sonar-web/src/main/js/apps/groups/list-item-view.js @@ -1,9 +1,10 @@ define([ + 'backbone.marionette', './update-view', './delete-view', './users-view', './templates' -], function (UpdateView, DeleteView, UsersView) { +], function (Marionette, UpdateView, DeleteView, UsersView) { var $ = jQuery; diff --git a/server/sonar-web/src/main/js/apps/groups/list-view.js b/server/sonar-web/src/main/js/apps/groups/list-view.js index 24878864d30..b56e64f951d 100644 --- a/server/sonar-web/src/main/js/apps/groups/list-view.js +++ b/server/sonar-web/src/main/js/apps/groups/list-view.js @@ -1,7 +1,8 @@ define([ + 'backbone.marionette', './list-item-view', './templates' -], function (ListItemView) { +], function (Marionette, ListItemView) { return Marionette.CollectionView.extend({ tagName: 'ul', diff --git a/server/sonar-web/src/main/js/apps/groups/search-view.js b/server/sonar-web/src/main/js/apps/groups/search-view.js index 1540d7eb36e..efcd9247db8 100644 --- a/server/sonar-web/src/main/js/apps/groups/search-view.js +++ b/server/sonar-web/src/main/js/apps/groups/search-view.js @@ -1,6 +1,7 @@ define([ + 'backbone.marionette', './templates' -], function () { +], function (Marionette) { return Marionette.ItemView.extend({ template: Templates['groups-search'], diff --git a/server/sonar-web/src/main/js/apps/groups/users-view.js b/server/sonar-web/src/main/js/apps/groups/users-view.js index de5901fc5f1..5db80139c8b 100644 --- a/server/sonar-web/src/main/js/apps/groups/users-view.js +++ b/server/sonar-web/src/main/js/apps/groups/users-view.js @@ -8,7 +8,8 @@ define([ template: Templates['groups-users'], onRender: function () { - this._super(); + Modal.prototype.onRender.apply(this, arguments); + //noinspection Eslint new window.SelectList({ el: this.$('#groups-users'), width: '100%', @@ -18,9 +19,9 @@ define([ return item.name + '<br><span class="note">' + item.login + '</span>'; }, queryParam: 'q', - searchUrl: baseUrl + '/api/usergroups/users?ps=100&id=' + this.model.id, - selectUrl: baseUrl + '/api/usergroups/add_user', - deselectUrl: baseUrl + '/api/usergroups/remove_user', + searchUrl: window.baseUrl + '/api/usergroups/users?ps=100&id=' + this.model.id, + selectUrl: window.baseUrl + '/api/usergroups/add_user', + deselectUrl: window.baseUrl + '/api/usergroups/remove_user', extra: { id: this.model.id }, @@ -35,7 +36,7 @@ define([ onDestroy: function () { this.model.collection.refresh(); - this._super(); + Modal.prototype.onDestroy.apply(this, arguments); } }); |