Skip to content

Commit

Permalink
#1448 Fix dashboard to search page navigatio on widget click
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Jul 23, 2020
1 parent f572e51 commit b58d783
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
16 changes: 15 additions & 1 deletion frontend/app/scripts/directives/dashboard/counter.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,21 @@
return;
}

var filters = (scope.options.filters || []).concat(item.serie.filters || []);
var timeFrameFilter = [];
if(scope.filter) {
timeFrameFilter.push({
field: scope.filter._between._field,
type: 'date',
value: {
from: moment(scope.filter._between._from),
to: moment(scope.filter._between._to)
}
});
}

var filters = (scope.options.filters || [])
.concat(item.serie.filters || [])
.concat(timeFrameFilter || []);

$q.resolve(GlobalSearchSrv.saveSection(scope.options.entity, {
search: filters.length === 0 ? '*' : null,
Expand Down
16 changes: 15 additions & 1 deletion frontend/app/scripts/directives/dashboard/donut.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,21 @@
value: GlobalSearchSrv.buildDefaultFilterValue(fieldDef, d)
};

var filters = (scope.options.filters || []).concat([data]);
var timeFrameFilter = [];
if(scope.filter) {
timeFrameFilter.push({
field: scope.filter._between._field,
type: 'date',
value: {
from: moment(scope.filter._between._from),
to: moment(scope.filter._between._to)
}
});
}

var filters = (scope.options.filters || [])
.concat([data])
.concat(timeFrameFilter);

$q.resolve(GlobalSearchSrv.saveSection(scope.options.entity, {
search: null,
Expand Down

0 comments on commit b58d783

Please sign in to comment.