aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2017-02-07 11:22:13 +0100
committerStas Vilchik <vilchiks@gmail.com>2017-02-07 11:22:13 +0100
commit8a73d970ffc6fd334a1a88121e12790a85f12648 (patch)
treee73b8881e948e4edcfa66c49658fda317b93e090 /server/sonar-web/src/main
parentf5764b41dffa181327a098dccbf56773a76411f2 (diff)
downloadsonarqube-8a73d970ffc6fd334a1a88121e12790a85f12648.tar.gz
sonarqube-8a73d970ffc6fd334a1a88121e12790a85f12648.zip
SONAR-8661 display organizations for favorites
Diffstat (limited to 'server/sonar-web/src/main')
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/global/SearchView.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/global/SearchView.js b/server/sonar-web/src/main/js/app/components/nav/global/SearchView.js
index 4976ff11348..3b5801873c9 100644
--- a/server/sonar-web/src/main/js/app/components/nav/global/SearchView.js
+++ b/server/sonar-web/src/main/js/app/components/nav/global/SearchView.js
@@ -163,12 +163,16 @@ export default Marionette.LayoutView.extend({
},
fetchFavorite (): Promise<*> {
+ const customOrganizations = areThereCustomOrganizations();
return getFavorites().then(r => {
this.favorite = r.favorites.map(f => {
+ const showOrganization = customOrganizations && f.organization != null;
+ const organization = showOrganization ? getOrganization(f.organization) : null;
return {
url: window.baseUrl + '/dashboard/index?id=' + encodeURIComponent(f.key) + window.dashboardParameters(true),
name: f.name,
- icon: 'favorite'
+ icon: 'favorite',
+ organization
};
});
this.favorite = sortBy(this.favorite, 'name');
@@ -181,8 +185,7 @@ export default Marionette.LayoutView.extend({
const history = recentHistory.map((historyItem, index) => {
const url = window.baseUrl + '/dashboard/index?id=' + encodeURIComponent(historyItem.key) +
window.dashboardParameters(true);
- const showOrganization = customOrganizations && historyItem.organization != null &&
- historyItem.icon.toUpperCase() === 'TRK';
+ const showOrganization = customOrganizations && historyItem.organization != null;
// $FlowFixMe flow doesn't check the above condition on `historyItem.organization != null`
const organization = showOrganization ? getOrganization(historyItem.organization) : null;
return {