From 76a6856c489a4b7686ad85952291818b81b5d4e6 Mon Sep 17 00:00:00 2001 From: rrozek Date: Thu, 11 Jul 2024 14:51:01 +0200 Subject: [PATCH 1/3] allow empty values in dapp analytics query filters --- .../dapp-analytics/dapp-analytics.validation.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/dapp-analytics/dapp-analytics.validation.ts b/src/components/dapp-analytics/dapp-analytics.validation.ts index e9f8a0c..073a60e 100644 --- a/src/components/dapp-analytics/dapp-analytics.validation.ts +++ b/src/components/dapp-analytics/dapp-analytics.validation.ts @@ -125,12 +125,18 @@ export const dappDataMetricsValidation = { operator: Joi.string() .valid('>', '<', '>=', '<=', '=', '!=') .required(), - value: Joi.alternatives() - .try(Joi.number(), Joi.string(), Joi.boolean()) - .required(), + value: Joi.alternatives().try( + Joi.boolean(), + Joi.number(), + Joi.string().allow(''), + ), }), ), - value: Joi.alternatives().try(Joi.string(), Joi.boolean()), + value: Joi.alternatives().try( + Joi.boolean(), + Joi.number(), + Joi.string().allow(''), + ), }), ), }), From 34f12aab3f222e44a74d2727284b3dfb7ca0cb8e Mon Sep 17 00:00:00 2001 From: rrozek Date: Thu, 11 Jul 2024 18:04:42 +0200 Subject: [PATCH 2/3] allow number as filter type --- src/components/dapp-analytics/dapp-analytics.validation.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/dapp-analytics/dapp-analytics.validation.ts b/src/components/dapp-analytics/dapp-analytics.validation.ts index 073a60e..26a94ea 100644 --- a/src/components/dapp-analytics/dapp-analytics.validation.ts +++ b/src/components/dapp-analytics/dapp-analytics.validation.ts @@ -119,7 +119,9 @@ export const dappDataMetricsValidation = { args: Joi.object().pattern( Joi.string(), Joi.object({ - type: Joi.string().valid('integer', 'string', 'boolean').required(), + type: Joi.string() + .valid('integer', 'number', 'string', 'boolean') + .required(), conditions: Joi.array().items( Joi.object({ operator: Joi.string() From 2fa7130d752838f289be807fa38b5ea372f343c5 Mon Sep 17 00:00:00 2001 From: rrozek Date: Thu, 11 Jul 2024 23:33:23 +0200 Subject: [PATCH 3/3] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fe8274a..bab864a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "dashboard-creator-server", "private": false, - "version": "3.1.0", + "version": "3.1.1", "license": "MIT", "main": "src/server.ts", "engines": {