]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20500 Validation fixes for rules page
authorRevanshu Paliwal <revanshu.paliwal@sonarsource.com>
Wed, 4 Oct 2023 14:10:58 +0000 (16:10 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 5 Oct 2023 20:02:48 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/coding-rules/components/AvailableSinceFacet.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/BulkChange.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetails.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx

index 7217043df4246865fdf87fe69d39aabbb3ddc598..9cd0a388148b6aec2341f3632b2648cb981f0f8f 100644 (file)
@@ -72,6 +72,7 @@ class AvailableSinceFacet extends React.PureComponent<Props & WrappedComponentPr
             value={value}
             showClearButton
             alignRight
+            size="auto"
           />
         )}
       </FacetBox>
index 0dde26c5ffbeefc7b7ffbc155bbb5a84e0da506d..d3cfbceceaedfb51b429e60b77feeaef6901d2c4 100644 (file)
@@ -100,6 +100,7 @@ export default class BulkChange extends React.PureComponent<Props, State> {
           size="auto"
           placement={PopupPlacement.BottomRight}
           zLevel={PopupZLevel.Global}
+          allowResizing
           overlay={
             <>
               <ItemButton onClick={this.handleActivateClick}>
index ec3ab6989bb04d1f6113d7a332ca36696d8a71dd..6948418aa2068ab6e100074a1274c3eb24567675 100644 (file)
@@ -27,6 +27,7 @@ import { formatMeasure } from '../../../helpers/measures';
 import { MetricType } from '../../../types/metrics';
 import { Dict } from '../../../types/types';
 import { FacetItemsList } from '../../issues/sidebar/FacetItemsList';
+import { MultipleSelectionHint } from '../../issues/sidebar/MultipleSelectionHint';
 import { FacetKey } from '../query';
 
 export interface BasicProps {
@@ -111,6 +112,9 @@ export default class Facet extends React.PureComponent<Props> {
           (key) => renderTextName(key).toLowerCase(),
         ));
     const headerId = `facet_${property}`;
+    const nbSelectableItems =
+      items?.filter((item) => (stats ? stats[item] : undefined)).length ?? 0;
+    const nbSelectedItems = values.length;
 
     return (
       <FacetBox
@@ -135,6 +139,11 @@ export default class Facet extends React.PureComponent<Props> {
         )}
 
         {open && this.props.renderFooter !== undefined && this.props.renderFooter()}
+
+        <MultipleSelectionHint
+          nbSelectableItems={nbSelectableItems}
+          nbSelectedItems={nbSelectedItems}
+        />
       </FacetBox>
     );
   }
index 49ca07211b6cb6879392c84c82bda14ce8b699a2..ab5b963062429cfc831519baddcb6e2b11afe7db 100644 (file)
@@ -22,6 +22,7 @@ import {
   ButtonSecondary,
   DangerButtonSecondary,
   HelperHintIcon,
+  Spinner,
   SubHeadingHighlight,
   themeBorder,
   themeColor,
@@ -32,7 +33,6 @@ import { deleteRule, getRuleDetails, updateRule } from '../../../api/rules';
 import ConfirmButton from '../../../components/controls/ConfirmButton';
 import HelpTooltip from '../../../components/controls/HelpTooltip';
 import DateFormatter from '../../../components/intl/DateFormatter';
-import Spinner from '../../../components/ui/Spinner';
 import { translate, translateWithParameters } from '../../../helpers/l10n';
 import { Dict, RuleActivation, RuleDetails as TypeRuleDetails } from '../../../types/types';
 import { Activation } from '../query';
index d104dd1514b13c0f351bac287e3b489830278713..5a87734539c39853d78c01e114c0cdc4f2a069b3 100644 (file)
@@ -111,7 +111,9 @@ export default class RuleDetailsCustomRules extends React.PureComponent<Props, S
   renderRule = (rule: Rule) => (
     <TableRow data-rule={rule.key} key={rule.key}>
       <ContentCell>
-        <Link to={getRuleUrl(rule.key)}>{rule.name}</Link>
+        <div>
+          <Link to={getRuleUrl(rule.key)}>{rule.name}</Link>
+        </div>
       </ContentCell>
 
       <ContentCell>