From fd52ea47ca9353d13fa3f599154393a175669081 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Aubert?= Date: Thu, 22 Jun 2017 15:49:30 +0200 Subject: [PATCH] SONAR-9404 Rework the project activity list style --- .../apps/projectActivity/components/Event.css | 5 -- .../apps/projectActivity/components/Event.js | 6 +- .../projectActivity/components/EventInner.js | 25 ++++--- .../apps/projectActivity/components/Events.js | 4 +- .../components/ProjectActivityAnalysis.js | 36 ++++++---- .../components/forms/RemoveAnalysisForm.js | 10 +-- .../components/projectActivity.css | 70 ++++++++----------- .../icons-components}/ChangeIcon.js | 11 ++- .../icons-components}/DeleteIcon.js | 11 ++- server/sonar-web/src/main/less/init/type.less | 1 + .../resources/org/sonar/l10n/core.properties | 1 + 11 files changed, 98 insertions(+), 82 deletions(-) delete mode 100644 server/sonar-web/src/main/js/apps/projectActivity/components/Event.css rename server/sonar-web/src/main/js/{apps/projectActivity/components => components/icons-components}/ChangeIcon.js (83%) rename server/sonar-web/src/main/js/{apps/projectActivity/components => components/icons-components}/DeleteIcon.js (83%) diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/Event.css b/server/sonar-web/src/main/js/apps/projectActivity/components/Event.css deleted file mode 100644 index ee96a69b0c0..00000000000 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/Event.css +++ /dev/null @@ -1,5 +0,0 @@ -.project-activity-event {} - -.project-activity-event + .project-activity-event { - margin-top: 4px; -} diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/Event.js b/server/sonar-web/src/main/js/apps/projectActivity/components/Event.js index 2dc04fec94c..6e1a3878c88 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/Event.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/Event.js @@ -22,8 +22,8 @@ import React from 'react'; import EventInner from './EventInner'; import ChangeEventForm from './forms/ChangeEventForm'; import RemoveEventForm from './forms/RemoveEventForm'; -import DeleteIcon from './DeleteIcon'; -import ChangeIcon from './ChangeIcon'; +import DeleteIcon from '../../../components/icons-components/DeleteIcon'; +import ChangeIcon from '../../../components/icons-components/ChangeIcon'; import type { Event as EventType } from '../types'; type Props = { @@ -89,7 +89,7 @@ export default class Event extends React.PureComponent { {showActions && -
+
{canChange &&
    {version == null && @@ -67,19 +79,18 @@ export default function ProjectActivityAnalysis(props: Props) { addEventButtonText="project_activity.add_custom_event" /> + {!isFirst &&
  • } + {!isFirst && +
  • + +
  • }
- - {!isFirst && -
- -
}
} -
- -
- {events.length > 0 && } + ); } diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveAnalysisForm.js b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveAnalysisForm.js index 9b0e215c686..138274caefc 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveAnalysisForm.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/RemoveAnalysisForm.js @@ -49,7 +49,8 @@ export default class RemoveAnalysisForm extends React.PureComponent { this.mounted = false; } - openForm = () => { + openForm = (evt: Event) => { + evt.preventDefault(); if (this.mounted) { this.setState({ open: true }); } @@ -110,17 +111,16 @@ export default class RemoveAnalysisForm extends React.PureComponent { } - ); } render() { return ( - + ); } } diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/projectActivity.css b/server/sonar-web/src/main/js/apps/projectActivity/components/projectActivity.css index f8d35f22a26..6754b5dfa12 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/projectActivity.css +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/projectActivity.css @@ -9,6 +9,11 @@ margin-bottom: 0; } +.project-activity-page-side-outer > .boxed-group-inner { + padding-left: 12px; + padding-right: 12px; +} + .project-activity-layout-page-main { flex-grow: 1; min-width: 640px; @@ -53,7 +58,7 @@ .project-activity-days-list {} .project-activity-day { - margin-bottom: 40px; + margin-bottom: 32px; } .project-activity-day:last-child { @@ -71,8 +76,7 @@ .project-activity-analysis { position: relative; min-height: 20px; - padding-top: 6px; - padding-bottom: 6px; + padding: 4px; border-top: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6; } @@ -87,55 +91,23 @@ .project-activity-analysis-actions { float: right; - padding-right: 10px; -} - -.project-activity-analysis-actions:first-child, -.project-activity-analysis-actions:empty { - margin-top: 0; -} - -.project-activity-analysis-actions > button + button, -.project-activity-analysis-actions > button + form, -.project-activity-analysis-actions > form + button, -.project-activity-analysis-actions > form + form { - margin-left: 8px; -} - -.project-activity-analysis-form { - display: inline-block; - vertical-align: top; - line-height: 20px; - margin-bottom: 10px; - padding: 9px; - border: 1px solid #faebcc; - border-radius: 2px; - background-color: #fcf8e3; -} - -.project-activity-analysis-form + .project-activity-analysis-form { - margin-left: 8px; } .project-activity-time { float: left; - width: 130px; + width: 54px; line-height: 20px; - padding-right: 50px; box-sizing: border-box; font-size: 12px; font-weight: bold; text-align: right; } -.project-activity-time::after { - position: absolute; - z-index: 21; - top: 11px; - left: 100px; - display: block; +.project-activity-analysis-icon { + float: left; width: 10px; height: 10px; + margin-top: 4px; border: 2px solid #4b9fd5; border-radius: 10px; box-sizing: border-box; @@ -148,11 +120,29 @@ .project-activity-event { line-height: 20px; + display: flex; +} + +.project-activity-event + .project-activity-event { + margin-top: 4px; +} + +.project-activity-event-inner { + flex: 1; + display: flex; + flex-direction: row; +} + +.project-activity-event-inner-icon { + flex-shrink: 0; +} + +.project-activity-event-inner-text { + flex: 1; } .project-activity-event-actions { display: inline-block; - margin-left: 8px; } .project-activity-event-actions button { diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ChangeIcon.js b/server/sonar-web/src/main/js/components/icons-components/ChangeIcon.js similarity index 83% rename from server/sonar-web/src/main/js/apps/projectActivity/components/ChangeIcon.js rename to server/sonar-web/src/main/js/components/icons-components/ChangeIcon.js index e47455c3c1b..f6d5f894e4f 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ChangeIcon.js +++ b/server/sonar-web/src/main/js/components/icons-components/ChangeIcon.js @@ -20,10 +20,17 @@ // @flow import React from 'react'; -export default function ChangeIcon() { +type Props = { className?: string, size?: number }; + +export default function ChangeIcon({ className, size = 12 }: Props) { /* eslint-disable max-len */ return ( - + +