From d053e1bb231569114df401c26908e6fc24531f2f Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 27 Jan 2016 15:44:24 +0100 Subject: [PATCH] SONAR-7230 improve rendering of notifications page --- .../account/components/GlobalNotifications.js | 12 ++- .../apps/account/components/Notifications.js | 2 +- .../account/components/ProjectNotification.js | 73 +++++++++++++++++++ .../components/ProjectNotifications.js | 66 ++++++----------- .../src/main/less/components/columns.less | 4 + server/sonar-web/src/main/less/init/misc.less | 5 +- 6 files changed, 109 insertions(+), 53 deletions(-) create mode 100644 server/sonar-web/src/main/js/apps/account/components/ProjectNotification.js diff --git a/server/sonar-web/src/main/js/apps/account/components/GlobalNotifications.js b/server/sonar-web/src/main/js/apps/account/components/GlobalNotifications.js index 5f5de5de9b4..180f22468f8 100644 --- a/server/sonar-web/src/main/js/apps/account/components/GlobalNotifications.js +++ b/server/sonar-web/src/main/js/apps/account/components/GlobalNotifications.js @@ -24,12 +24,10 @@ import { translate } from '../../../helpers/l10n'; export default function GlobalNotifications ({ notifications, channels }) { return ( -
-
-

- {translate('my_profile.overall_notifications.title')} -

-
+
+

+ {translate('my_profile.overall_notifications.title')} +

@@ -48,6 +46,6 @@ export default function GlobalNotifications ({ notifications, channels }) { checkboxId={(d, c) => `global_notifs_${d}_${c}`} checkboxName={(d, c) => `global_notifs[${d}.${c}]`}/>
-
+ ); } diff --git a/server/sonar-web/src/main/js/apps/account/components/Notifications.js b/server/sonar-web/src/main/js/apps/account/components/Notifications.js index 75784ae9aa1..853d64d3c35 100644 --- a/server/sonar-web/src/main/js/apps/account/components/Notifications.js +++ b/server/sonar-web/src/main/js/apps/account/components/Notifications.js @@ -32,7 +32,7 @@ export default function Notifications ({ globalNotifications, projectNotificatio {translate('notification.dispatcher.information')}

-
+
+ + + +

{data.project.name}

+ + + {channels.map(channel => ( + +

{translate('notification.channel', channel)}

+ + ))} + + + `project_notifs_${data.project.internalId}_${d}_${c}`} + checkboxName={(d, c) => `project_notifs[${data.project.internalId}][${d}][${c}]`}/> + + ); + } +} diff --git a/server/sonar-web/src/main/js/apps/account/components/ProjectNotifications.js b/server/sonar-web/src/main/js/apps/account/components/ProjectNotifications.js index 5683e50e1d8..acdd691e348 100644 --- a/server/sonar-web/src/main/js/apps/account/components/ProjectNotifications.js +++ b/server/sonar-web/src/main/js/apps/account/components/ProjectNotifications.js @@ -20,7 +20,7 @@ import React from 'react'; import Select from 'react-select'; -import NotificationsList from './NotificationsList'; +import ProjectNotification from './ProjectNotification'; import { translate } from '../../../helpers/l10n'; import { getProjectsWithInternalId } from '../../../api/components'; @@ -46,28 +46,11 @@ export default function ProjectNotifications ({ notifications, channels, onAddPr onAddProject(project); }; - const handleRemoveProject = (project) => ( - (e) => { - e.preventDefault; - onRemoveProject(project); - } - ); - return ( -
-
-

- {translate('my_profile.per_project_notifications.title')} -

-
- -
-
+
+

+ {translate('my_profile.per_project_notifications.title')} +

{!notifications.length && (
@@ -76,27 +59,24 @@ export default function ProjectNotifications ({ notifications, channels, onAddPr )} {notifications.map(p => ( - - - - - {channels.map(channel => ( - - ))} - - - `project_notifs_${p.project.internalId}_${d}_${c}`} - checkboxName={(d, c) => `project_notifs[${p.project.internalId}][${d}][${c}]`}/> -
- -

{p.project.name}

-
-

{translate('notification.channel', channel)}

-
+ ))} -
+ +
+ + Set notifications for: + + +
+
); } diff --git a/server/sonar-web/src/main/less/components/columns.less b/server/sonar-web/src/main/less/components/columns.less index dba2ee2a94e..03d50461145 100644 --- a/server/sonar-web/src/main/less/components/columns.less +++ b/server/sonar-web/src/main/less/components/columns.less @@ -28,6 +28,10 @@ overflow: hidden; } +.columns-overflow-visible { + overflow: visible !important; +} + .column-half { float: left; width: 50%; diff --git a/server/sonar-web/src/main/less/init/misc.less b/server/sonar-web/src/main/less/init/misc.less index d109674532f..2595e67a970 100644 --- a/server/sonar-web/src/main/less/init/misc.less +++ b/server/sonar-web/src/main/less/init/misc.less @@ -131,12 +131,13 @@ td.big-spacer-top { padding-top: 16px; } // Background Color -.bg-variant(@color) { +.bg-variant(@color, @fontColor: #fff) { background-color: @color; - color: #fff; + color: @fontColor; } .bg-danger { .bg-variant(@red); } .bg-warning { .bg-variant(@orange); } .bg-info { .bg-variant(@blue); } .bg-success { .bg-variant(@green); } +.bg-muted { .bg-variant(@barBackgroundColor, inherit); } -- 2.39.5