From c636003314c4b53f41c20b2cc4cb71340219115a Mon Sep 17 00:00:00 2001 From: Yury Moladau Date: Wed, 22 Nov 2023 19:30:10 +0100 Subject: [PATCH 1/2] test: fix jest.config.js --- .config/jest.config.js | 4 ---- jest.config.js | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.config/jest.config.js b/.config/jest.config.js index 7ef91efc..1528f9c2 100755 --- a/.config/jest.config.js +++ b/.config/jest.config.js @@ -9,7 +9,6 @@ module.exports = { testMatch: [ '/src/**/__tests__/**/*.{js,jsx,ts,tsx}', '/src/**/*.{spec,test,jest}.{js,jsx,ts,tsx}', - '/src/**/*.{spec,test,jest}.{js,jsx,ts,tsx}', ], transform: { '^.+\\.(t|j)sx?$': [ @@ -28,7 +27,4 @@ module.exports = { ], }, setupFilesAfterEnv: ['/jest-setup.ts'], - transformIgnorePatterns: [ - "!node_modules/d3-interpolate" - ] }; diff --git a/jest.config.js b/jest.config.js index df0af6bd..8576ca08 100755 --- a/jest.config.js +++ b/jest.config.js @@ -2,7 +2,7 @@ module.exports = { // Jest configuration provided by Grafana scaffolding ...require('./.config/jest.config'), testTimeout: 300000, - "transformIgnorePatterns": [ - "node_modules/(?!monaco-promql/)" - ] + transformIgnorePatterns: [ + "node_modules/(?!(d3-color|d3-interpolate|monaco-promql|ol)/)" + ], }; From ef52e4af8bed094310e844e11d5e8194f2e3faf4 Mon Sep 17 00:00:00 2001 From: Yury Moladau Date: Wed, 22 Nov 2023 19:31:05 +0100 Subject: [PATCH 2/2] fix: change parsing interval in query builder --- src/querybuilder/parsing.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/querybuilder/parsing.ts b/src/querybuilder/parsing.ts index 52113e24..68c6f1d0 100755 --- a/src/querybuilder/parsing.ts +++ b/src/querybuilder/parsing.ts @@ -206,7 +206,7 @@ function handleFunction(expr: string, node: SyntaxNode, context: Context) { // the query model. // - it is easier to handle template variables this way as template variable is an error for the parser if (rangeFunctions.includes(funcName) || funcName.endsWith('_over_time')) { - let match = getString(expr, node).match(/\[(.+)\]/); + let match = getString(expr, node).match(/(?