Small fixes

This commit is contained in:
Mojca Lorber 2020-03-03 13:52:36 +01:00
parent 4d52fc9b45
commit 7dfd1d5ba6
3 changed files with 12 additions and 6 deletions

View file

@ -26,8 +26,10 @@ var DasboardCurrentTasksWidget = (function() {
stateText = I18n.t('dashboard.current_tasks.progress_bar.in_progress');
if (task.overdue) { stateText = I18n.t('dashboard.current_tasks.progress_bar.overdue'); }
if (task.steps_state.all_steps !== 0) {
stateText += I18n.t('dashboard.current_tasks.progress_bar.completed_steps',
{ steps: task.steps_state.completed_steps, total_steps: task.steps_state.all_steps });
stateText += I18n.t(
'dashboard.current_tasks.progress_bar.completed_steps',
{ steps: task.steps_state.completed_steps, total_steps: task.steps_state.all_steps }
);
}
}
currentTaskItem = `<a class="current-task-item" href="${task.link}">
@ -74,13 +76,13 @@ var DasboardCurrentTasksWidget = (function() {
mode: $('.current-tasks-navbar .active').data('mode')
};
animateSpinner($currentTasksList, true);
$.get($currentTasksList.data('tasksListUrl'), params, function(data) {
$.get($currentTasksList.data('tasksListUrl'), params, function(result) {
$currentTasksList.find('.current-task-item, .no-tasks').remove();
// Toggle empty state
if (data.data.length === 0) {
if (result.data.length === 0) {
$currentTasksList.append(emptyState);
}
generateTasksListHtml(data, $currentTasksList);
generateTasksListHtml(result, $currentTasksList);
PerfectSb().update_all();
if (newList) InfiniteScroll.resetScroll('.current-tasks-list');
animateSpinner($currentTasksList, false);

View file

@ -287,6 +287,10 @@
.dashboard-container .current-tasks-widget {
grid-column: 1 / span 12;
grid-row: 1 / span 4;
.no-tasks .fas {
margin-left: 500px;
}
}
}

View file

@ -59,7 +59,7 @@
</div>
<div class="widget-body">
<div id="current-tasks-list" class="current-tasks-list perfect-scrollbar"
<div class="current-tasks-list perfect-scrollbar"
data-tasks-list-url="<%= dashboard_current_tasks_path %>">
</div>
</div>