]> source.dussan.org Git - sonarqube.git/commitdiff
display organization when searching for views
authorStas Vilchik <vilchiks@gmail.com>
Thu, 2 Feb 2017 16:39:10 +0000 (17:39 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 2 Feb 2017 16:39:10 +0000 (17:39 +0100)
server/sonar-web/src/main/js/app/components/nav/global/SearchView.js

index 070d80e993c4eac435d491cc639fd5c3e0a5cfdc..4976ff113487ea8a0e9a6c06ecc46fbd9bbc0ff0 100644 (file)
@@ -39,6 +39,8 @@ type Finding = {
   extra?: string
 };
 
+const SHOW_ORGANIZATION_FOR_QUALIFIERS = ['TRK', 'VW', 'SVW'];
+
 const SearchItemView = Marionette.ItemView.extend({
   tagName: 'li',
   template: SearchItemTemplate,
@@ -214,7 +216,8 @@ export default Marionette.LayoutView.extend({
       const collection = [];
       r.results.forEach(({ items, q }) => {
         items.forEach((item, index) => {
-          const showOrganization = customOrganizations && item.organization != null && q === 'TRK';
+          const showOrganization = customOrganizations && item.organization != null &&
+              SHOW_ORGANIZATION_FOR_QUALIFIERS.includes(q);
           const organization = showOrganization ? getOrganization(item.organization) : null;
           collection.push({
             ...item,