From 7d4cc9ec02d1b09f633b9880b28a69fa7ae0f84e Mon Sep 17 00:00:00 2001 From: Mathieu Suen Date: Wed, 19 Jan 2022 11:57:27 +0100 Subject: [PATCH] SONAR-15897 Adding IT for portfolio inaccessible project --- .../main/js/apps/code/components/CodeApp.tsx | 5 +- .../__snapshots__/CodeApp-test.tsx.snap | 79 ++++++++++--------- .../component-measures/components/App.tsx | 2 +- .../__tests__/__snapshots__/App-test.tsx.snap | 2 +- .../js/apps/issues/components/IssuesApp.tsx | 17 ++-- .../__snapshots__/IssuesApp-test.tsx.snap | 12 +-- 6 files changed, 59 insertions(+), 58 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx b/server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx index c1d88989529..9ad1391425d 100644 --- a/server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx @@ -296,8 +296,9 @@ export class CodeApp extends React.Component { return (
+ {!canBrowseAllChildProjects && isPortfolioLike(qualifier) && ( - + {translate('component_measures.not_all_measures_are_shown')} { defer={false} title={sourceViewer !== undefined ? sourceViewer.name : defaultTitle} /> - - {!hasComponents && ( + @@ -192,9 +196,6 @@ exports[`should render a warning message when user does not have access to all p encodeSpecialCharacters={true} title="projects.page" /> -
@@ -215,6 +216,9 @@ exports[`should render correclty when no sub component for APP 1`] = `
+ @@ -223,9 +227,6 @@ exports[`should render correclty when no sub component for APP 1`] = ` encodeSpecialCharacters={true} title="projects.page" /> -
@@ -246,6 +247,9 @@ exports[`should render correclty when no sub component for APP: no search 1`] =
+ @@ -254,9 +258,6 @@ exports[`should render correclty when no sub component for APP: no search 1`] = encodeSpecialCharacters={true} title="projects.page" /> - + @@ -310,9 +314,6 @@ exports[`should render correclty when no sub component for APP: with sub compone encodeSpecialCharacters={true} title="projects.page" /> - + @@ -416,9 +420,6 @@ exports[`should render correclty when no sub component for SVW 1`] = ` encodeSpecialCharacters={true} title="projects.page" /> -
@@ -439,6 +440,9 @@ exports[`should render correclty when no sub component for SVW: no search 1`] =
+ @@ -447,9 +451,6 @@ exports[`should render correclty when no sub component for SVW: no search 1`] = encodeSpecialCharacters={true} title="projects.page" /> - + @@ -503,9 +507,6 @@ exports[`should render correclty when no sub component for SVW: with sub compone encodeSpecialCharacters={true} title="projects.page" /> - + @@ -599,9 +603,6 @@ exports[`should render correclty when no sub component for TRK 1`] = ` encodeSpecialCharacters={true} title="code.page" /> -
@@ -622,6 +623,9 @@ exports[`should render correclty when no sub component for TRK: no search 1`] =
+ @@ -630,9 +634,6 @@ exports[`should render correclty when no sub component for TRK: no search 1`] = encodeSpecialCharacters={true} title="code.page" /> - + @@ -686,9 +690,6 @@ exports[`should render correclty when no sub component for TRK: with sub compone encodeSpecialCharacters={true} title="code.page" /> - + @@ -792,9 +796,6 @@ exports[`should render correclty when no sub component for VW 1`] = ` encodeSpecialCharacters={true} title="projects.page" /> -
@@ -815,6 +816,9 @@ exports[`should render correclty when no sub component for VW: no search 1`] = `
+ @@ -823,9 +827,6 @@ exports[`should render correclty when no sub component for VW: no search 1`] = ` encodeSpecialCharacters={true} title="projects.page" /> - + @@ -879,9 +883,6 @@ exports[`should render correclty when no sub component for VW: with sub componen encodeSpecialCharacters={true} title="projects.page" /> - {
{!canBrowseAllChildProjects && isPortfolioLike(qualifier) && ( {translate('component_measures.not_all_measures_are_shown')} diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/App-test.tsx.snap index 68daeb9cdb4..fec80c05446 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/App-test.tsx.snap @@ -69,7 +69,7 @@ exports[`should render a warning message when user does not have access to all p className="layout-page-side-inner" > diff --git a/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx b/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx index 62d45cd1d01..c64244bb8f6 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx @@ -956,9 +956,16 @@ export default class App extends React.PureComponent { className="layout-page-side" style={{ top }}>
+ {!canBrowseAllChildProjects && isPortfolioLike(qualifier) && ( {translate('issues.not_all_issue_show')} @@ -970,13 +977,7 @@ export default class App extends React.PureComponent { )} - + {openIssue ? this.renderConciseIssuesList() : this.renderFacets()}
diff --git a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesApp-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesApp-test.tsx.snap index 01994952a65..23f2efc6a8c 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesApp-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesApp-test.tsx.snap @@ -36,8 +36,13 @@ exports[`should show warnning when not all projects are accessible 1`] = `
+ @@ -49,11 +54,6 @@ exports[`should show warnning when not all projects are accessible 1`] = ` /> -
-- 2.39.5