]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-18736 Drop and refactor UI BBTs for rules page
authorstanislavh <stanislav.honcharov@sonarsource.com>
Mon, 13 Mar 2023 13:01:57 +0000 (14:01 +0100)
committerPhilippe Perrin <philippe.perrin@sonarsource.com>
Fri, 17 Mar 2023 09:08:02 +0000 (10:08 +0100)
server/sonar-web/src/main/js/apps/coding-rules/components/ActivationFormModal.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsProfiles.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/SeveritySelect.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/ActivationFormModal-test.tsx.snap

index 98031fd32542d81831a3a536065fbfd7bd93bfd1..4568687ddb6be14baaed568622b6f4872d17c244 100644 (file)
@@ -181,10 +181,10 @@ export default class ActivationFormModal extends React.PureComponent<Props, Stat
               />
             </div>
             <div className="modal-field">
-              <label id="coding-rules-severity-select">{translate('severity')}</label>
+              <label id="coding-rules-severity-select-label">{translate('severity')}</label>
               <SeveritySelect
                 isDisabled={submitting}
-                ariaLabelledby="coding-rules-severity-select"
+                ariaLabelledby="coding-rules-severity-select-label"
                 onChange={this.handleSeverityChange}
                 severity={severity}
               />
index 4ac0260e43cb2239bc29ed2790142c0a98625a9a..5dffc23758c74ac4accaa6f331f3205cde8a3c15 100644 (file)
@@ -200,7 +200,7 @@ export default class RuleDetailsProfiles extends React.PureComponent<Props> {
     const parentActivation = activations.find((x) => x.qProfile === profile.parentKey);
 
     return (
-      <tr data-profile={profile.key} key={profile.key}>
+      <tr key={profile.key}>
         <td className="coding-rules-detail-quality-profile-name">
           <Link to={getQualityProfileUrl(profile.name, profile.language)}>{profile.name}</Link>
           {profile.isBuiltIn && <BuiltInQualityProfileBadge className="spacer-left" />}
index ff27e2ac8c546bd79bfeea01e89feb77e94d3d2e..69ce2fb8b60db5818d102e6bc6f685a6fd9e6906 100644 (file)
@@ -56,6 +56,7 @@ export function SeveritySelect(props: SeveritySelectProps) {
 
   return (
     <Select
+      id="coding-rules-severity-select"
       aria-labelledby={ariaLabelledby}
       isDisabled={isDisabled}
       onChange={props.onChange}
index 218e1a3d16ec0005e81ecf51b748e2e8a7a954a3..44237c4942edf7badb9656e8e4d8616417ab3ea2 100644 (file)
@@ -46,12 +46,12 @@ exports[`should render correctly: custom rule 1`] = `
         className="modal-field"
       >
         <label
-          id="coding-rules-severity-select"
+          id="coding-rules-severity-select-label"
         >
           severity
         </label>
         <SeveritySelect
-          ariaLabelledby="coding-rules-severity-select"
+          ariaLabelledby="coding-rules-severity-select-label"
           isDisabled={false}
           onChange={[Function]}
           severity="MAJOR"
@@ -132,12 +132,12 @@ exports[`should render correctly: default 1`] = `
         className="modal-field"
       >
         <label
-          id="coding-rules-severity-select"
+          id="coding-rules-severity-select-label"
         >
           severity
         </label>
         <SeveritySelect
-          ariaLabelledby="coding-rules-severity-select"
+          ariaLabelledby="coding-rules-severity-select-label"
           isDisabled={false}
           onChange={[Function]}
           severity="MAJOR"
@@ -253,12 +253,12 @@ exports[`should render correctly: submitting 1`] = `
         className="modal-field"
       >
         <label
-          id="coding-rules-severity-select"
+          id="coding-rules-severity-select-label"
         >
           severity
         </label>
         <SeveritySelect
-          ariaLabelledby="coding-rules-severity-select"
+          ariaLabelledby="coding-rules-severity-select-label"
           isDisabled={true}
           onChange={[Function]}
           severity="MAJOR"
@@ -372,12 +372,12 @@ exports[`should render correctly: update mode 1`] = `
         className="modal-field"
       >
         <label
-          id="coding-rules-severity-select"
+          id="coding-rules-severity-select-label"
         >
           severity
         </label>
         <SeveritySelect
-          ariaLabelledby="coding-rules-severity-select"
+          ariaLabelledby="coding-rules-severity-select-label"
           isDisabled={false}
           onChange={[Function]}
           severity="MAJOR"
@@ -527,12 +527,12 @@ exports[`should render correctly: with deep profiles 1`] = `
         className="modal-field"
       >
         <label
-          id="coding-rules-severity-select"
+          id="coding-rules-severity-select-label"
         >
           severity
         </label>
         <SeveritySelect
-          ariaLabelledby="coding-rules-severity-select"
+          ariaLabelledby="coding-rules-severity-select-label"
           isDisabled={false}
           onChange={[Function]}
           severity="MAJOR"