From 3dc94a225d22cb27c6b1ebf0964bfe5e4e239694 Mon Sep 17 00:00:00 2001 From: aignatov-bio Date: Tue, 3 Mar 2020 14:21:16 +0100 Subject: [PATCH] Small visual improvments for current tasks widget --- .../javascripts/dashboard/current_tasks.js | 2 +- .../stylesheets/dashboard/calendar.scss | 2 +- .../stylesheets/dashboard/current_tasks.scss | 54 +++++++++++++++---- .../dashboard/current_tasks_controller.rb | 2 +- 4 files changed, 46 insertions(+), 14 deletions(-) diff --git a/app/assets/javascripts/dashboard/current_tasks.js b/app/assets/javascripts/dashboard/current_tasks.js index e8a2f873c..92181b1e7 100644 --- a/app/assets/javascripts/dashboard/current_tasks.js +++ b/app/assets/javascripts/dashboard/current_tasks.js @@ -47,7 +47,7 @@ var DasboardCurrentTasksWidget = (function() { } } currentTaskItem = ` -
${task.project}/${task.experiment}
+
${task.project}/${task.experiment}
${task.name}
${dueDate}
diff --git a/app/assets/stylesheets/dashboard/calendar.scss b/app/assets/stylesheets/dashboard/calendar.scss index 6eac76553..0eff5b590 100644 --- a/app/assets/stylesheets/dashboard/calendar.scss +++ b/app/assets/stylesheets/dashboard/calendar.scss @@ -80,7 +80,7 @@ width: 32px; &:hover { - background: $color-alto; + background: $color-concrete; color: inherit; } } diff --git a/app/assets/stylesheets/dashboard/current_tasks.scss b/app/assets/stylesheets/dashboard/current_tasks.scss index f6f811cfe..095b58f3f 100644 --- a/app/assets/stylesheets/dashboard/current_tasks.scss +++ b/app/assets/stylesheets/dashboard/current_tasks.scss @@ -146,13 +146,22 @@ .current-task-item { border-bottom: $border-tertiary; color: $color-volcano; - padding: 6px 0; + padding: 6px; text-decoration: none; .current-task-breadcrumbs { @include font-small; color: $color-silver-chalice; line-height: 14px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + + .slash { + display: inline-block; + text-align: center; + width: 16px; + } } .item-row { @@ -160,12 +169,16 @@ .task-name { flex-grow: 1; - font-size: $font-size-base; //not in styleguide + font-size: $font-size-base; font-weight: bold; + overflow: hidden; + padding-right: 10px; + text-overflow: ellipsis; + white-space: nowrap; } .task-due-date { - flex-basis: 260px; + flex-basis: 280px; flex-shrink: 0; font-size: 14px; @@ -178,6 +191,10 @@ } } } + + &:hover { + background: $color-concrete; + } } } @@ -277,9 +294,32 @@ } } +@media (max-width: 1500px) { + .dashboard-container .current-tasks-widget { + .task-progress-container { + max-width: 200px; + } + } +} + @media (max-width: 1250px) { .dashboard-container .current-tasks-widget { grid-column: 1 / span 8; + + .task-progress-container { + max-width: 150px; + } + + .current-tasks-list { + .current-task-item { + .item-row { + .task-due-date { + flex-basis: 230px; + } + } + } + } + } } @@ -289,11 +329,3 @@ grid-row: 1 / span 4; } } - -@media (max-width: 1200px) { - .dashboard-container .current-tasks-widget { - .task-progress-container { - max-width: 180px; - } - } -} diff --git a/app/controllers/dashboard/current_tasks_controller.rb b/app/controllers/dashboard/current_tasks_controller.rb index 885921576..5c6c143a9 100644 --- a/app/controllers/dashboard/current_tasks_controller.rb +++ b/app/controllers/dashboard/current_tasks_controller.rb @@ -46,7 +46,7 @@ module Dashboard experiment: escape_input(task.experiment.name), project: escape_input(task.experiment.project.name), name: escape_input(task.name), - due_date: task.due_date.present? ? I18n.l(task.due_date, format: :full_with_comma) : nil, + due_date: task.due_date.present? ? I18n.l(task.due_date, format: :full_date) : nil, overdue: task.is_overdue?, state: task.state, steps_state: { completed_steps: task.steps_completed,