From 66a868f92cb3d10e054a5d8322f91d99bb6942d4 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 2 Jun 2015 16:11:19 +0200 Subject: [PATCH] SONAR-6602 use "q" for search --- server/sonar-web/src/main/js/apps/groups/users-view.js | 1 + server/sonar-web/src/main/js/apps/users/groups-view.js | 1 + .../src/main/js/components/common/select-list.js | 8 ++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) 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 59f84d74b08..cfe6468ce0e 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 @@ -17,6 +17,7 @@ define([ format: function (item) { return item.name + '
' + item.login + ''; }, + 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', diff --git a/server/sonar-web/src/main/js/apps/users/groups-view.js b/server/sonar-web/src/main/js/apps/users/groups-view.js index cf5f5da9eb6..1634fb1d244 100644 --- a/server/sonar-web/src/main/js/apps/users/groups-view.js +++ b/server/sonar-web/src/main/js/apps/users/groups-view.js @@ -18,6 +18,7 @@ define([ format: function (item) { return item.name + '
' + item.description + ''; }, + queryParam: 'q', searchUrl: baseUrl + '/api/users/groups?ps=100&login=' + this.model.id, selectUrl: baseUrl + '/api/usergroups/add_user', deselectUrl: baseUrl + '/api/usergroups/remove_user', diff --git a/server/sonar-web/src/main/js/components/common/select-list.js b/server/sonar-web/src/main/js/components/common/select-list.js index 480fbd9d690..5716ed2fa10 100644 --- a/server/sonar-web/src/main/js/components/common/select-list.js +++ b/server/sonar-web/src/main/js/components/common/select-list.js @@ -329,7 +329,8 @@ define(function () { search: function () { var query = this.$('.select-list-search-control input').val(), hasQuery = query.length > 0, - that = this; + that = this, + data = {}; this.$('.select-list-check-control').toggleClass('disabled', hasQuery); this.$('.select-list-search-control').toggleClass('disabled', !hasQuery); @@ -338,10 +339,11 @@ define(function () { this.showFetchSpinner(); this.currentFilter = 'all'; + data[this.settings.queryParam] = query; this.collection.fetch({ url: this.settings.searchUrl, reset: true, - data: { query: query }, + data: data, success: function () { that.hideFetchSpinner(); }, @@ -431,6 +433,8 @@ define(function () { return r.results; }, + queryParam: 'query', + labels: { selected: 'Selected', deselected: 'Deselected', -- 2.39.5