diff --git a/app/assets/javascripts/dashboard/current_tasks.js b/app/assets/javascripts/dashboard/current_tasks.js index 7c2f1aea9..2c7726965 100644 --- a/app/assets/javascripts/dashboard/current_tasks.js +++ b/app/assets/javascripts/dashboard/current_tasks.js @@ -38,6 +38,17 @@ var DasboardCurrentTasksWidget = (function() { return values; } + function markAppliedFilters(state) { + if (state.statuses.sort().toString() === getDefaultStatusValues().sort().toString() + && (state.project_id.length === 0) + && (state.sort === 'due_date') + && (state.experiment_id.length === 0)) { + $('.filter-container').removeClass('filters-applied'); + } else { + $('.filter-container').addClass('filters-applied'); + } + } + function initInfiniteScroll() { InfiniteScroll.init('.current-tasks-list', { url: $('.current-tasks-list').data('tasksListUrl'), @@ -73,6 +84,7 @@ var DasboardCurrentTasksWidget = (function() { }; if (filterState) { + markAppliedFilters(filterState); localStorage.setItem('current_tasks_filters_per_team/' + teamId, JSON.stringify(filterState)); } } @@ -100,6 +112,7 @@ var DasboardCurrentTasksWidget = (function() { // Select saved navbar state $('.current-tasks-navbar .navbar-link').removeClass('active'); $('.current-tasks-navbar').find(`[data-mode='${parsedFilterState.mode}']`).addClass('active'); + markAppliedFilters(parsedFilterState); } catch (e) { dropdownSelector.selectValues(statusFilter, getDefaultStatusValues()); } diff --git a/app/assets/stylesheets/dashboard/current_tasks.scss b/app/assets/stylesheets/dashboard/current_tasks.scss index 3efb8afe3..74f6ec8d2 100644 --- a/app/assets/stylesheets/dashboard/current_tasks.scss +++ b/app/assets/stylesheets/dashboard/current_tasks.scss @@ -111,6 +111,18 @@ width: 100%; } } + + &.filters-applied::after { + background: $brand-danger; + border: 1px solid $color-white; + border-radius: 50%; + content: ""; + height: 7px; + left: 22px; + position: absolute; + top: 6px; + width: 7px; + } } .widget-placeholder {