From 5029401c8f3d966ddadfd1eddf1922c46db55bd7 Mon Sep 17 00:00:00 2001 From: gnibeda Date: Mon, 2 Oct 2023 12:38:19 +0300 Subject: [PATCH] * added support for range filters with `NOW` keyword for all widgets (#403) --- package.json | 2 +- src/app/services/filter.service.ts | 15 +++++++++++++++ src/changelog.md | 5 ++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d245dcf8..36537ce7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "deep-see-web", - "version": "3.2.16", + "version": "3.2.17", "scripts": { "ng": "ng", "start": "ng serve --proxy-config=proxy.conf.json --port 4007", diff --git a/src/app/services/filter.service.ts b/src/app/services/filter.service.ts index c52b05f7..29e30d5b 100644 --- a/src/app/services/filter.service.ts +++ b/src/app/services/filter.service.ts @@ -73,6 +73,21 @@ export class FilterService { if (flt.value?.toString().indexOf(':') !== -1) { if (flt.isDate) { this.initDateFilter(flt); + } else { + const parts = flt.value?.toString().split(':'); + flt.fromIdx = flt.values?.findIndex(f => f.path === parts[0]); + flt.toIdx = flt.values?.findIndex(f => f.path === parts[1]); + if (flt.fromIdx === -1) { + flt.values.push({path: parts[0], name: parts[0].replace('&[', '').replace(']', '')}); + flt.fromIdx = flt.values.length - 1; + } + flt.values[flt.fromIdx].checked = true; + if (flt.toIdx === -1) { + flt.values.push({path: parts[1], name: parts[1].replace('&[', '').replace(']', '')}); + flt.toIdx = flt.values.length - 1; + } + flt.values[flt.toIdx].checked = true; + flt.isInterval = true; } } diff --git a/src/changelog.md b/src/changelog.md index 24df4c34..34dd095f 100644 --- a/src/changelog.md +++ b/src/changelog.md @@ -1,5 +1,8 @@ +#### 3.2.17 +* added support for range filters with `NOW` keyword for all widgets (#403) + #### 3.2.16 -* added `Accept-Language: en-US` to all requests +* added `Accept-Language: en-US` to all requests (#404) #### 3.2.15 * temporary fix for scorecard columns filtering when axis contains children