mirror of
https://github.com/wekan/wekan.git
synced 2025-12-24 03:10:12 +01:00
Try to fix : Filter List by Title - prevent showing only the list title - Hiding empty lists in Swimlane view
This commit is contained in:
parent
89a7bb8bc8
commit
6c83cb5b44
3 changed files with 42 additions and 9 deletions
|
|
@ -682,9 +682,11 @@ Filter = {
|
|||
const filterSelector = {};
|
||||
const emptySelector = {};
|
||||
let includeEmptySelectors = false;
|
||||
let isFilterActive = false; // we don't want there is only Filter.lists
|
||||
this._fields.forEach(fieldName => {
|
||||
const filter = this[fieldName];
|
||||
if (filter._isActive()) {
|
||||
isFilterActive = true;
|
||||
if (filter.subField !== '') {
|
||||
filterSelector[
|
||||
`${fieldName}.${filter.subField}`
|
||||
|
|
@ -715,12 +717,23 @@ Filter = {
|
|||
)
|
||||
selectors.push(filterSelector);
|
||||
if (includeEmptySelectors) selectors.push(emptySelector);
|
||||
if (this.advanced._isActive())
|
||||
if (this.advanced._isActive()) {
|
||||
isFilterActive = true;
|
||||
selectors.push(this.advanced._getMongoSelector());
|
||||
}
|
||||
|
||||
return {
|
||||
$or: selectors,
|
||||
};
|
||||
if(isFilterActive) {
|
||||
return {
|
||||
$or: selectors,
|
||||
};
|
||||
}
|
||||
else {
|
||||
// we don't want there is only Filter.lists
|
||||
// otherwise no card will be displayed ...
|
||||
// selectors = [exceptionsSelector];
|
||||
// will return [{"_id":{"$in":[]}}]
|
||||
return {};
|
||||
}
|
||||
},
|
||||
|
||||
mongoSelector(additionalSelector) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue