]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-15897 Adding IT for portfolio inaccessible project
authorMathieu Suen <mathieu.suen@sonarsource.com>
Wed, 19 Jan 2022 10:57:27 +0000 (11:57 +0100)
committersonartech <sonartech@sonarsource.com>
Thu, 20 Jan 2022 20:02:44 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx
server/sonar-web/src/main/js/apps/code/components/__tests__/__snapshots__/CodeApp-test.tsx.snap
server/sonar-web/src/main/js/apps/component-measures/components/App.tsx
server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/App-test.tsx.snap
server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx
server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesApp-test.tsx.snap

index c1d88989529367a4348e3da0a86e0b461cc34d00..9ad1391425d5587a789b3ebef33aa631f105ee64 100644 (file)
@@ -296,8 +296,9 @@ export class CodeApp extends React.Component<Props, State> {
 
     return (
       <div className="page page-limited">
+        <A11ySkipTarget anchor="code_main" />
         {!canBrowseAllChildProjects && isPortfolioLike(qualifier) && (
-          <StyledAlert variant="warning">
+          <StyledAlert variant="warning" className="it__portfolio_warning">
             <AlertContent>
               {translate('component_measures.not_all_measures_are_shown')}
               <HelpTooltip
@@ -313,8 +314,6 @@ export class CodeApp extends React.Component<Props, State> {
           defer={false}
           title={sourceViewer !== undefined ? sourceViewer.name : defaultTitle}
         />
-        <A11ySkipTarget anchor="code_main" />
-
         {!hasComponents && (
           <Search
             branchLike={branchLike}
index 04fb66277ed06d1c9d80413b7a457a6acb13ee5d..0e98dd30dc687ad67b8d90c68d305c36fd0534ef 100644 (file)
@@ -172,7 +172,11 @@ exports[`should render a warning message when user does not have access to all p
 <div
   className="page page-limited"
 >
+  <A11ySkipTarget
+    anchor="code_main"
+  />
   <Styled(Alert)
+    className="it__portfolio_warning"
     variant="warning"
   >
     <Styled(div)>
@@ -192,9 +196,6 @@ exports[`should render a warning message when user does not have access to all p
     encodeSpecialCharacters={true}
     title="projects.page"
   />
-  <A11ySkipTarget
-    anchor="code_main"
-  />
   <div
     className="code-components"
   >
@@ -215,6 +216,9 @@ exports[`should render correclty when no sub component for APP 1`] = `
 <div
   className="page page-limited"
 >
+  <A11ySkipTarget
+    anchor="code_main"
+  />
   <Suggestions
     suggestions="code"
   />
@@ -223,9 +227,6 @@ exports[`should render correclty when no sub component for APP 1`] = `
     encodeSpecialCharacters={true}
     title="projects.page"
   />
-  <A11ySkipTarget
-    anchor="code_main"
-  />
   <div
     className="code-components"
   >
@@ -246,6 +247,9 @@ exports[`should render correclty when no sub component for APP: no search 1`] =
 <div
   className="page page-limited"
 >
+  <A11ySkipTarget
+    anchor="code_main"
+  />
   <Suggestions
     suggestions="code"
   />
@@ -254,9 +258,6 @@ exports[`should render correclty when no sub component for APP: no search 1`] =
     encodeSpecialCharacters={true}
     title="projects.page"
   />
-  <A11ySkipTarget
-    anchor="code_main"
-  />
   <withRouter(Search)
     component={
       Object {
@@ -302,6 +303,9 @@ exports[`should render correclty when no sub component for APP: with sub compone
 <div
   className="page page-limited"
 >
+  <A11ySkipTarget
+    anchor="code_main"
+  />
   <Suggestions
     suggestions="code"
   />
@@ -310,9 +314,6 @@ exports[`should render correclty when no sub component for APP: with sub compone
     encodeSpecialCharacters={true}
     title="projects.page"
   />
-  <A11ySkipTarget
-    anchor="code_main"
-  />
   <withRouter(Search)
     component={
       Object {
@@ -408,6 +409,9 @@ exports[`should render correclty when no sub component for SVW 1`] = `
 <div
   className="page page-limited"
 >
+  <A11ySkipTarget
+    anchor="code_main"
+  />
   <Suggestions
     suggestions="code"
   />
@@ -416,9 +420,6 @@ exports[`should render correclty when no sub component for SVW 1`] = `
     encodeSpecialCharacters={true}
     title="projects.page"
   />
-  <A11ySkipTarget
-    anchor="code_main"
-  />
   <div
     className="code-components"
   >
@@ -439,6 +440,9 @@ exports[`should render correclty when no sub component for SVW: no search 1`] =
 <div
   className="page page-limited"
 >
+  <A11ySkipTarget
+    anchor="code_main"
+  />
   <Suggestions
     suggestions="code"
   />
@@ -447,9 +451,6 @@ exports[`should render correclty when no sub component for SVW: no search 1`] =
     encodeSpecialCharacters={true}
     title="projects.page"
   />
-  <A11ySkipTarget
-    anchor="code_main"
-  />
   <withRouter(Search)
     component={
       Object {
@@ -495,6 +496,9 @@ exports[`should render correclty when no sub component for SVW: with sub compone
 <div
   className="page page-limited"
 >
+  <A11ySkipTarget
+    anchor="code_main"
+  />
   <Suggestions
     suggestions="code"
   />
@@ -503,9 +507,6 @@ exports[`should render correclty when no sub component for SVW: with sub compone
     encodeSpecialCharacters={true}
     title="projects.page"
   />
-  <A11ySkipTarget
-    anchor="code_main"
-  />
   <withRouter(Search)
     component={
       Object {
@@ -591,6 +592,9 @@ exports[`should render correclty when no sub component for TRK 1`] = `
 <div
   className="page page-limited"
 >
+  <A11ySkipTarget
+    anchor="code_main"
+  />
   <Suggestions
     suggestions="code"
   />
@@ -599,9 +603,6 @@ exports[`should render correclty when no sub component for TRK 1`] = `
     encodeSpecialCharacters={true}
     title="code.page"
   />
-  <A11ySkipTarget
-    anchor="code_main"
-  />
   <div
     className="code-components"
   >
@@ -622,6 +623,9 @@ exports[`should render correclty when no sub component for TRK: no search 1`] =
 <div
   className="page page-limited"
 >
+  <A11ySkipTarget
+    anchor="code_main"
+  />
   <Suggestions
     suggestions="code"
   />
@@ -630,9 +634,6 @@ exports[`should render correclty when no sub component for TRK: no search 1`] =
     encodeSpecialCharacters={true}
     title="code.page"
   />
-  <A11ySkipTarget
-    anchor="code_main"
-  />
   <withRouter(Search)
     component={
       Object {
@@ -678,6 +679,9 @@ exports[`should render correclty when no sub component for TRK: with sub compone
 <div
   className="page page-limited"
 >
+  <A11ySkipTarget
+    anchor="code_main"
+  />
   <Suggestions
     suggestions="code"
   />
@@ -686,9 +690,6 @@ exports[`should render correclty when no sub component for TRK: with sub compone
     encodeSpecialCharacters={true}
     title="code.page"
   />
-  <A11ySkipTarget
-    anchor="code_main"
-  />
   <withRouter(Search)
     component={
       Object {
@@ -784,6 +785,9 @@ exports[`should render correclty when no sub component for VW 1`] = `
 <div
   className="page page-limited"
 >
+  <A11ySkipTarget
+    anchor="code_main"
+  />
   <Suggestions
     suggestions="code"
   />
@@ -792,9 +796,6 @@ exports[`should render correclty when no sub component for VW 1`] = `
     encodeSpecialCharacters={true}
     title="projects.page"
   />
-  <A11ySkipTarget
-    anchor="code_main"
-  />
   <div
     className="code-components"
   >
@@ -815,6 +816,9 @@ exports[`should render correclty when no sub component for VW: no search 1`] = `
 <div
   className="page page-limited"
 >
+  <A11ySkipTarget
+    anchor="code_main"
+  />
   <Suggestions
     suggestions="code"
   />
@@ -823,9 +827,6 @@ exports[`should render correclty when no sub component for VW: no search 1`] = `
     encodeSpecialCharacters={true}
     title="projects.page"
   />
-  <A11ySkipTarget
-    anchor="code_main"
-  />
   <withRouter(Search)
     component={
       Object {
@@ -871,6 +872,9 @@ exports[`should render correclty when no sub component for VW: with sub componen
 <div
   className="page page-limited"
 >
+  <A11ySkipTarget
+    anchor="code_main"
+  />
   <Suggestions
     suggestions="code"
   />
@@ -879,9 +883,6 @@ exports[`should render correclty when no sub component for VW: with sub componen
     encodeSpecialCharacters={true}
     title="projects.page"
   />
-  <A11ySkipTarget
-    anchor="code_main"
-  />
   <withRouter(Search)
     component={
       Object {
index 079f77ed1fbf6f834c02b3b715aced748097a989..080358d770f1564ec364bc8e15001297d96379d3 100644 (file)
@@ -307,7 +307,7 @@ export class App extends React.PureComponent<Props, State> {
                   <div className="layout-page-side-inner">
                     {!canBrowseAllChildProjects && isPortfolioLike(qualifier) && (
                       <Alert
-                        className="big-spacer-top big-spacer-right big-spacer-left"
+                        className="big-spacer-top big-spacer-right big-spacer-left it__portfolio_warning"
                         variant="warning">
                         <AlertContent>
                           {translate('component_measures.not_all_measures_are_shown')}
index 68daeb9cdb4756c3c07e02637e3f1900d7ff8a6e..fec80c054466f78f57cca799db55cd1378e6df55 100644 (file)
@@ -69,7 +69,7 @@ exports[`should render a warning message when user does not have access to all p
       className="layout-page-side-inner"
     >
       <Alert
-        className="big-spacer-top big-spacer-right big-spacer-left"
+        className="big-spacer-top big-spacer-right big-spacer-left it__portfolio_warning"
         variant="warning"
       >
         <Styled(div)>
index 62d45cd1d01acf59cc580b5acd33e5ca5461d36c..c64244bb8f68c8bc9adde36a5c680b96c4b737e6 100644 (file)
@@ -956,9 +956,16 @@ export default class App extends React.PureComponent<Props, State> {
             className="layout-page-side"
             style={{ top }}>
             <div className="layout-page-side-inner">
+              <A11ySkipTarget
+                anchor="issues_sidebar"
+                label={
+                  openIssue ? translate('issues.skip_to_list') : translate('issues.skip_to_filters')
+                }
+                weight={10}
+              />
               {!canBrowseAllChildProjects && isPortfolioLike(qualifier) && (
                 <Alert
-                  className="big-spacer-top big-spacer-right big-spacer-left"
+                  className="big-spacer-top big-spacer-right big-spacer-left it__portfolio_warning"
                   variant="warning">
                   <AlertContent>
                     {translate('issues.not_all_issue_show')}
@@ -970,13 +977,7 @@ export default class App extends React.PureComponent<Props, State> {
                   </AlertContent>
                 </Alert>
               )}
-              <A11ySkipTarget
-                anchor="issues_sidebar"
-                label={
-                  openIssue ? translate('issues.skip_to_list') : translate('issues.skip_to_filters')
-                }
-                weight={10}
-              />
+
               {openIssue ? this.renderConciseIssuesList() : this.renderFacets()}
             </div>
           </section>
index 01994952a65996c7fad1e5155cb7f34dabf22c1d..23f2efc6a8c7a90e4b9263f1a2db9a461351a5e1 100644 (file)
@@ -36,8 +36,13 @@ exports[`should show warnning when not all projects are accessible 1`] = `
     <div
       className="layout-page-side-inner"
     >
+      <A11ySkipTarget
+        anchor="issues_sidebar"
+        label="issues.skip_to_filters"
+        weight={10}
+      />
       <Alert
-        className="big-spacer-top big-spacer-right big-spacer-left"
+        className="big-spacer-top big-spacer-right big-spacer-left it__portfolio_warning"
         variant="warning"
       >
         <Styled(div)>
@@ -49,11 +54,6 @@ exports[`should show warnning when not all projects are accessible 1`] = `
           />
         </Styled(div)>
       </Alert>
-      <A11ySkipTarget
-        anchor="issues_sidebar"
-        label="issues.skip_to_filters"
-        weight={10}
-      />
       <div
         className="layout-page-filters"
       >