From ea602214bb0e0ae1a79b381c8e12a424d58b085c Mon Sep 17 00:00:00 2001 From: stanislavh Date: Thu, 12 Jan 2023 13:29:38 +0100 Subject: [PATCH] SONAR-18145 Visual heading text is not marked up as heading --- .../app/components/search/SearchResults.tsx | 38 ++-- .../__snapshots__/SearchResults-test.tsx.snap | 39 ++-- .../main/js/app/styles/components/menu.css | 18 +- .../components/SimilarRulesFilter.tsx | 82 ++++---- .../SimilarRulesFilter-test.tsx.snap | 190 +++++++++--------- .../embed-docs-modal/EmbedDocsPopup.tsx | 40 ++-- 6 files changed, 220 insertions(+), 187 deletions(-) diff --git a/server/sonar-web/src/main/js/app/components/search/SearchResults.tsx b/server/sonar-web/src/main/js/app/components/search/SearchResults.tsx index b6183d3abe0..df1e70e1ac3 100644 --- a/server/sonar-web/src/main/js/app/components/search/SearchResults.tsx +++ b/server/sonar-web/src/main/js/app/components/search/SearchResults.tsx @@ -45,23 +45,29 @@ export default function SearchResults(props: Props): React.ReactElement { const more = props.more[qualifier]; renderedComponents.push( - + + + ); } }); diff --git a/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResults-test.tsx.snap b/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResults-test.tsx.snap index 136288b0952..c77831d661f 100644 --- a/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResults-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResults-test.tsx.snap @@ -2,16 +2,17 @@ exports[`renders "Show More" link 1`] = `
+

+ qualifiers.TRK +

    -
  • - qualifiers.TRK -
  • @@ -36,32 +37,34 @@ exports[`renders "Show More" link 1`] = ` exports[`renders different components and dividers between them 1`] = `
    +

    + qualifiers.FIL +

      -
    • - qualifiers.FIL -
    • zux
    +

    + qualifiers.TRK +

      -
    • - qualifiers.TRK -
    • diff --git a/server/sonar-web/src/main/js/app/styles/components/menu.css b/server/sonar-web/src/main/js/app/styles/components/menu.css index ce9440bf416..74286cf1c1c 100644 --- a/server/sonar-web/src/main/js/app/styles/components/menu.css +++ b/server/sonar-web/src/main/js/app/styles/components/menu.css @@ -31,7 +31,8 @@ padding-bottom: 12px; } -.menu + .menu { +.menu + .menu, +.menu + .menu-header { border-top: 1px solid var(--barBorderColor); } @@ -163,12 +164,25 @@ .menu-header { padding: var(--gridSize); + margin: -8px; font-size: 12px; color: var(--neutral600); white-space: nowrap; + line-height: unset; +} + +.menu-header + ul { + padding-top: 8px; +} + +.menu-header.no-margin + ul { + padding-top: 0; +} + +.menu-header.no-margin { + margin: 0; } -.menu-header:first-child, .divider + .menu-header { padding-top: calc(var(--gridSize) - 5px); } diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/SimilarRulesFilter.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/SimilarRulesFilter.tsx index 9396783fc36..0c3f8e462ea 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/SimilarRulesFilter.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/SimilarRulesFilter.tsx @@ -74,57 +74,61 @@ export default class SimilarRulesFilter extends React.PureComponent { -
    • {translate('coding_rules.filter_similar_rules')}
    • -
    • - - {rule.langName} - -
    • - -
    • - - - {translate('issue.type', rule.type)} - -
    • - - {severity && ( + <> +

      + {translate('coding_rules.filter_similar_rules')} +

      + + + {severity && ( +
    • + + + +
    • + )} + + {allTags.length > 0 &&
    • } + {allTags.map((tag) => ( +
    • + + + {tag} + +
    • + ))} +
    + } > -
  • +

    coding_rules.filter_similar_rules -

  • -
  • - - JavaScript - -
  • -
  • - - - + + + + b + + +
  • +
+ } > { } }; - renderTitle(text: string) { + renderTitle(text: string, labelId: string) { return ( -
  • +

    {text} -

  • + ); } @@ -59,20 +59,22 @@ export default class EmbedDocsPopup extends React.PureComponent { return null; } return ( -
      - {this.renderTitle(translate('docs.suggestion'))} - {suggestions.map((suggestion, i) => ( -
    • - - {suggestion.text} - -
    • - ))} -
    + <> + {this.renderTitle(translate('docs.suggestion'), 'suggestion')} +
      + {suggestions.map((suggestion, i) => ( +
    • + + {suggestion.text} + +
    • + ))} +
    + ); }; @@ -118,8 +120,8 @@ export default class EmbedDocsPopup extends React.PureComponent { -
      - {this.renderTitle(translate('docs.stay_connected'))} + {this.renderTitle(translate('docs.stay_connected'), 'stay_connected')} +
      • {this.renderIconLink( 'https://www.sonarqube.org/whats-new/?referrer=sonarqube', -- 2.39.5