diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-05-05 09:57:21 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-05-05 09:57:28 +0200 |
commit | fafb1f05739f94bb846d3f7cd8f5663147b281d8 (patch) | |
tree | bac3683185a00990e9cd47de094838a6d768fabe /server/sonar-web | |
parent | 70746c3d69d26a6277abde58b357537d98e378fe (diff) | |
download | sonarqube-fafb1f05739f94bb846d3f7cd8f5663147b281d8.tar.gz sonarqube-fafb1f05739f94bb846d3f7cd8f5663147b281d8.zip |
SONAR-6138 apply feedback
Diffstat (limited to 'server/sonar-web')
-rw-r--r-- | server/sonar-web/src/main/js/nav/search-view.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/nav/search-view.js b/server/sonar-web/src/main/js/nav/search-view.js index 007a2ebf537..e7e4bc9e370 100644 --- a/server/sonar-web/src/main/js/nav/search-view.js +++ b/server/sonar-web/src/main/js/nav/search-view.js @@ -136,15 +136,15 @@ define([ fetchFavorite: function () { var that = this; return $.get(baseUrl + '/api/favourites').done(function (r) { - that.favorite = r.map(function (f, index) { + that.favorite = r.map(function (f) { var isFile = ['FIL', 'UTS'].indexOf(f.qualifier) !== -1; return { url: baseUrl + '/dashboard/index?id=' + encodeURIComponent(f.key) + dashboardParameters(true), name: isFile ? window.collapsedDirFromPath(f.lname) + window.fileFromPath(f.lname) : f.name, - icon: 'favorite', - extra: index === 0 ? t('favorite') : null + icon: 'favorite' }; }); + that.favorite = _.sortBy(that.favorite, 'name'); }); }, @@ -158,6 +158,9 @@ define([ extra: index === 0 ? t('browsed_recently') : null }; }), + favorite = _.first(this.favorite, 6).map(function (f, index) { + return _.extend(f, { extra: index === 0 ? t('favorite') : null }); + }), qualifiers = this.model.get('qualifiers').map(function (q, index) { return { url: baseUrl + '/all_projects?qualifier=' + encodeURIComponent(q), @@ -165,7 +168,7 @@ define([ extra: index === 0 ? '' : null }; }); - this.results.reset([].concat(history, _.first(this.favorite, 6), qualifiers)); + this.results.reset([].concat(history, favorite, qualifiers)); }, search: function (q) { |