From 359a19c0ba3934c912c1429900a39585e3503882 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Aubert?= Date: Tue, 30 May 2017 15:18:37 +0200 Subject: [PATCH] SONAR-9254 Add last analysis on overall projects page --- .../main/js/apps/projects/components/ProjectCard.js | 13 +++++++------ .../components/__tests__/ProjectCard-test.js | 7 ++++++- .../__snapshots__/ProjectCard-test.js.snap | 9 +++++++++ .../sonar-web/src/main/js/apps/projects/styles.css | 9 +++++---- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectCard.js b/server/sonar-web/src/main/js/apps/projects/components/ProjectCard.js index b4f3296f382..94c65bd4a6f 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/ProjectCard.js +++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectCard.js @@ -93,10 +93,10 @@ export default function ProjectCard({ measures, organization, project, type }: P {isPrivate && } {hasTags && } - {isLeakView && - isProjectAnalyzed && + {isProjectAnalyzed &&
- {hasLeakPeriodStart && + {isLeakView && + hasLeakPeriodStart && {translateWithParameters( 'projects.leak_period_x', @@ -115,9 +115,10 @@ export default function ProjectCard({ measures, organization, project, type }: P {isProjectAnalyzed ?
- {areProjectMeasuresLoaded && isLeakView - ? - : } + {areProjectMeasuresLoaded && + (isLeakView + ? + : )}
:
diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCard-test.js b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCard-test.js index fca2a5926a9..a5e143fb5f0 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCard-test.js +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectCard-test.js @@ -41,9 +41,14 @@ jest.mock('moment', () => () => ({ })); describe('overall status project card', () => { - it('should never display analysis date', () => { + it('should display analysis date (and not leak period) when defined', () => { expect( shallow().find('.project-card-dates').exists() + ).toBeTruthy(); + expect( + shallow() + .find('.project-card-dates') + .exists() ).toBeFalsy(); }); diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/ProjectCard-test.js.snap b/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/ProjectCard-test.js.snap index 19805eb328a..322b86b25af 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/ProjectCard-test.js.snap +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/ProjectCard-test.js.snap @@ -94,6 +94,15 @@ exports[`overall status project card should display the overall measures and qua
+
+ + projects.last_analysis_on_x.March 1, 2017 9:36 AM + +