From d3370bd1388ec983a2f23822aacc5b7f4b9f478e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Aubert?= Date: Thu, 6 Jul 2017 11:55:22 +0200 Subject: [PATCH] Fix tooltip and events icon styling on project activity page --- .../projectActivity/components/EventInner.js | 2 +- .../components/GraphsTooltipsContentEvents.js | 12 ++-- .../GraphsTooltipsContentOverview.js | 2 +- .../components/ProjectActivityAnalysis.js | 7 +-- .../GraphsTooltipsContentEvents-test.js | 39 +++++++++++++ .../GraphsTooltipsContentEvents-test.js.snap | 58 +++++++++++++++++++ ...GraphsTooltipsContentOverview-test.js.snap | 4 +- .../components/projectActivity.css | 6 +- .../main/js/components/ui/FormattedDate.js | 5 +- 9 files changed, 119 insertions(+), 16 deletions(-) create mode 100644 server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltipsContentEvents-test.js create mode 100644 server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentEvents-test.js.snap diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/EventInner.js b/server/sonar-web/src/main/js/apps/projectActivity/components/EventInner.js index 13152f46f94..c6c5f8f09c1 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/EventInner.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/EventInner.js @@ -32,7 +32,7 @@ export default function EventInner(props: { event: EventType }) {
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentEvents.js b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentEvents.js index 589d607d2d8..4348f21e872 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentEvents.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentEvents.js @@ -33,12 +33,16 @@ export default function GraphsTooltipsContentEvents({ events }: Props) {
{events.map(event => ( - - + + - {translate('event.category', event.category)}: - {' '} {event.name} + + {translate('event.category', event.category)}: + + {event.name} ))} diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentOverview.js b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentOverview.js index cd9c643710f..f16476bd41e 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentOverview.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltipsContentOverview.js @@ -56,7 +56,7 @@ export default function GraphsTooltipsContentOverview(props: Props) { )} /> - + {props.value} {ratingValue && } diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.js b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.js index 4ccb7cb9718..842b3ff8a44 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.js @@ -60,12 +60,9 @@ export default class ProjectActivityAnalysis extends React.PureComponent { role="listitem" tabIndex="0">
- +
-
+
{canAdmin &&
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltipsContentEvents-test.js b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltipsContentEvents-test.js new file mode 100644 index 00000000000..0dc9d74cdb6 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/GraphsTooltipsContentEvents-test.js @@ -0,0 +1,39 @@ +/* + * SonarQube + * Copyright (C) 2009-2017 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import React from 'react'; +import { shallow } from 'enzyme'; +import GraphsTooltipsContentEvents from '../GraphsTooltipsContentEvents'; + +const EVENTS = [ + { + key: '1', + category: 'VERSION', + name: '6.5' + }, + { + key: '2', + category: 'OTHER', + name: 'Foo' + } +]; + +it('should render correctly', () => { + expect(shallow()).toMatchSnapshot(); +}); diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentEvents-test.js.snap b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentEvents-test.js.snap new file mode 100644 index 00000000000..af1efe60bde --- /dev/null +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentEvents-test.js.snap @@ -0,0 +1,58 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` + + + +
+ + + + + + + + + event.category.VERSION + : + + 6.5 + + + + + + + + + event.category.OTHER + : + + Foo + + + +`; diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentOverview-test.js.snap b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentOverview-test.js.snap index 71b89ced18e..e7f3e105fca 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentOverview-test.js.snap +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsTooltipsContentOverview-test.js.snap @@ -12,7 +12,7 @@ exports[`should render correctly 1`] = ` /> + ); -- 2.39.5