]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-19573 Update the standard facet's "No results" style
authorDavid Cho-Lerat <david.cho-lerat@sonarsource.com>
Wed, 14 Jun 2023 08:10:07 +0000 (10:10 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 14 Jun 2023 09:51:07 +0000 (09:51 +0000)
server/sonar-web/src/main/js/apps/issues/sidebar/StandardFacet.tsx

index 0fba1b26538c04ce611b6d9641bdb4fea4f56d49..9a33b8ab1b1c4aca03f44479a5caef0fb7037a2b 100644 (file)
@@ -19,7 +19,7 @@
  */
 /* eslint-disable react/no-unused-prop-types */
 
-import { FacetBox, FacetItem } from 'design-system';
+import { FacetBox, FacetItem, TextMuted } from 'design-system';
 import { omit, sortBy, without } from 'lodash';
 import * as React from 'react';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
@@ -267,11 +267,7 @@ export class StandardFacet extends React.PureComponent<Props, State> {
     onClick: (x: string, multiple?: boolean) => void
   ) => {
     if (!categories.length) {
-      return (
-        <div className="search-navigator-facet-empty little-spacer-top">
-          {translate('no_results')}
-        </div>
-      );
+      return <TextMuted className="sw-ml-2 sw-mt-1" text={translate('no_results')} />;
     }
 
     const getStat = (category: string) => {
@@ -347,6 +343,10 @@ export class StandardFacet extends React.PureComponent<Props, State> {
 
     const allItemShown = limitedList.length + selectedBelowLimit.length === sortedItems.length;
 
+    if (!(limitedList.length || selectedBelowLimit.length)) {
+      return <TextMuted className="sw-ml-2 sw-mt-1" text={translate('no_results')} />;
+    }
+
     return (
       <>
         {limitedList.map((item) => (