Skip to content

Commit

Permalink
* fixed default filter value with "Not" issue
Browse files Browse the repository at this point in the history
  • Loading branch information
agnybida committed Jun 9, 2024
1 parent 3b77823 commit 60fcd9d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deep-see-web",
"version": "3.2.25",
"version": "3.2.26",
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config=proxy.conf.json --port 4007",
Expand Down
23 changes: 21 additions & 2 deletions src/app/services/filter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export class FilterService {
flt.values = [];
}

// Check for exclude filter
this.checkForExclude(flt);

// Check for multiple filter in value
if (flt.value && flt.value?.toString().charAt(0) === '{') {
flt.value = flt.value.toString().slice(1, -1);
Expand Down Expand Up @@ -456,10 +459,10 @@ export class FilterService {
flt.values[i].default = true;
flt.defaultExclude = isExclude;
flt.isExclude = isExclude;
names.push(flt.values[i].name);
names.push(flt.values[i].name.toString());
}
}
return names.join(',');
return (flt.isExclude ? 'Not ' : '') + names.join(',');
}

/**
Expand Down Expand Up @@ -723,4 +726,20 @@ export class FilterService {
const value = flt.value || '';
return value.toString().split('|').map(v => v.replace('&[', '').replace(']', '')).join(':');
}

private checkForExclude(flt) {
flt.isExclude = (flt.value ?? '').toString().toLowerCase().startsWith('%not');
if (!flt.isExclude) {
return;
}
const path = flt.value.split(' ')[1];
if (!path) {
return;
}
const value = flt.values?.find(v => v.path === path);
if (!value) {
return;
}
flt.value = value.path + '.%NOT';
}
}
3 changes: 3 additions & 0 deletions src/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 3.2.26
* fixed default filter value with "Not" issue

#### 3.2.25
* fixed issue with slow data refresh on chart widgets

Expand Down

0 comments on commit 60fcd9d

Please sign in to comment.