From c47f23a368580c818c3a7a7db425078f4eb3554c Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Thu, 14 Sep 2017 18:23:29 +0200 Subject: SONAR-9813 display "Private" badge tooltip based on qualifier --- .../js/app/components/nav/component/ComponentNavBreadcrumbs.js | 4 +++- .../src/main/js/apps/projects/components/ProjectCardLeak.tsx | 4 +++- .../src/main/js/apps/projects/components/ProjectCardOverall.tsx | 4 +++- .../sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx | 4 +++- .../__tests__/__snapshots__/ProjectRow-test.tsx.snap | 8 ++++++-- server/sonar-web/src/main/js/components/common/PrivateBadge.tsx | 7 +++++-- .../src/main/js/components/common/__tests__/PrivateBadge-test.tsx | 2 +- .../common/__tests__/__snapshots__/PrivateBadge-test.tsx.snap | 2 +- 8 files changed, 25 insertions(+), 10 deletions(-) (limited to 'server/sonar-web/src') diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBreadcrumbs.js b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBreadcrumbs.js index 27637b0f3ed..8bbd0a0c5ce 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBreadcrumbs.js +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBreadcrumbs.js @@ -93,7 +93,9 @@ class ComponentNavBreadcrumbs extends React.PureComponent { )} {items} - {component.visibility === 'private' && } + {component.visibility === 'private' && ( + + )} ); } diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectCardLeak.tsx b/server/sonar-web/src/main/js/apps/projects/components/ProjectCardLeak.tsx index 89e6dd61c78..1505bef784b 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/ProjectCardLeak.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectCardLeak.tsx @@ -57,7 +57,9 @@ export default function ProjectCardLeak({ organization, project }: Props) { {project.analysisDate && }
- {isPrivate && } + {isPrivate && ( + + )} {hasTags && }
{project.analysisDate && diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectCardOverall.tsx b/server/sonar-web/src/main/js/apps/projects/components/ProjectCardOverall.tsx index 135f71c3e35..80ce9ceadb0 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/ProjectCardOverall.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectCardOverall.tsx @@ -56,7 +56,9 @@ export default function ProjectCardOverall({ organization, project }: Props) { {project.analysisDate && }
- {isPrivate && } + {isPrivate && ( + + )} {hasTags && }
{project.analysisDate && ( diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx index c87abea71e4..ce7df2a1c43 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx @@ -64,7 +64,9 @@ export default class ProjectRow extends React.PureComponent { - {project.visibility === Visibility.Private && } + {project.visibility === Visibility.Private && ( + + )} diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/__snapshots__/ProjectRow-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/__snapshots__/ProjectRow-test.tsx.snap index d0e3ac5b4f8..87d61db023e 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/__snapshots__/ProjectRow-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/__snapshots__/ProjectRow-test.tsx.snap @@ -39,7 +39,9 @@ exports[`renders 1`] = ` - + - + +
{translate('visibility.private')}
diff --git a/server/sonar-web/src/main/js/components/common/__tests__/PrivateBadge-test.tsx b/server/sonar-web/src/main/js/components/common/__tests__/PrivateBadge-test.tsx index 02bdfcab213..93c199d8e25 100644 --- a/server/sonar-web/src/main/js/components/common/__tests__/PrivateBadge-test.tsx +++ b/server/sonar-web/src/main/js/components/common/__tests__/PrivateBadge-test.tsx @@ -22,5 +22,5 @@ import { shallow } from 'enzyme'; import PrivateBadge from '../PrivateBadge'; it('renders', () => { - expect(shallow()).toMatchSnapshot(); + expect(shallow()).toMatchSnapshot(); }); diff --git a/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/PrivateBadge-test.tsx.snap b/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/PrivateBadge-test.tsx.snap index d8f24f25b26..2ec0bd7a891 100644 --- a/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/PrivateBadge-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/PrivateBadge-test.tsx.snap @@ -2,7 +2,7 @@ exports[`renders 1`] = `