From 39c89878601d62e180754e4ad7c9c4b32c7a94b8 Mon Sep 17 00:00:00 2001 From: Philip Carneiro Date: Tue, 5 Mar 2024 14:31:25 +0000 Subject: [PATCH 1/2] remove slice times --- src/webview/components/kdbDataSourceView.ts | 38 +++------------------ 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/src/webview/components/kdbDataSourceView.ts b/src/webview/components/kdbDataSourceView.ts index a0a613b8..b6ff86ea 100644 --- a/src/webview/components/kdbDataSourceView.ts +++ b/src/webview/components/kdbDataSourceView.ts @@ -54,8 +54,6 @@ export class KdbDataSourceView extends LitElement { @state() declare filled: boolean; @state() declare temporality: string; @state() declare temporal: boolean; - @state() declare sliceStartTS: string; - @state() declare sliceEndTS: string; @state() declare filters: Filter[]; @state() declare labels: Label[]; @state() declare sorts: Sort[]; @@ -82,8 +80,6 @@ export class KdbDataSourceView extends LitElement { this.filled = false; this.temporality = ""; this.temporal = false; - this.sliceStartTS = ""; - this.sliceEndTS = ""; this.filters = [createFilter()]; this.labels = [createLabel()]; this.sorts = [createSort()]; @@ -131,8 +127,6 @@ export class KdbDataSourceView extends LitElement { if (optional) { this.filled = optional.filled; this.temporal = optional.temporal; - this.sliceStartTS = optional.startTS; - this.sliceEndTS = optional.endTS; this.filters = optional.filters; this.labels = optional.labels; this.sorts = optional.sorts; @@ -163,8 +157,6 @@ export class KdbDataSourceView extends LitElement { optional: { filled: this.filled, temporal: this.temporal, - startTS: this.sliceStartTS, - endTS: this.sliceEndTS, filters: this.filters, labels: this.labels, sorts: this.sorts, @@ -223,7 +215,7 @@ export class KdbDataSourceView extends LitElement { if (this.isInsights && this.isMetaLoaded) { return this.insightsMeta.api .filter( - (api) => api.api === ".kxi.getData" //|| !api.api.startsWith(".kxi.") + (api) => api.api === ".kxi.getData", //|| !api.api.startsWith(".kxi.") ) .map((api) => { const value = @@ -338,7 +330,7 @@ export class KdbDataSourceView extends LitElement { value="${operator}" ?selected="${operator === filter.operator}" >${operator}` + >`, )} @@ -559,7 +551,7 @@ export class KdbDataSourceView extends LitElement { value="${operator}" ?selected="${operator === agg.operator}" >${operator}` + >`, )} @@ -832,28 +824,6 @@ export class KdbDataSourceView extends LitElement { > - Start Time - End Time
@@ -887,7 +857,7 @@ export class KdbDataSourceView extends LitElement { event.target as HTMLSelectElement ).value)}"> ${this.renderTargetOptions( - this.qsqlTarget + this.qsqlTarget, )}
From 40f51d2f80a0070c061add32d7b502c7229620b3 Mon Sep 17 00:00:00 2001 From: Philip Carneiro Date: Tue, 5 Mar 2024 14:48:06 +0000 Subject: [PATCH 2/2] fix the field removal --- src/commands/dataSourceCommand.ts | 12 ------------ src/models/dataSource.ts | 2 -- test/suite/commands.test.ts | 6 ------ test/suite/webview.test.ts | 2 -- 4 files changed, 22 deletions(-) diff --git a/src/commands/dataSourceCommand.ts b/src/commands/dataSourceCommand.ts index cd6c4965..5713a065 100644 --- a/src/commands/dataSourceCommand.ts +++ b/src/commands/dataSourceCommand.ts @@ -355,18 +355,6 @@ export function getApiBody( } if (optional.temporal) { apiBody.temporality = api.temporality; - if (api.temporality === "slice") { - const start = api.startTS.split("T"); - if (start.length === 2) { - start[1] = optional.startTS; - const end = api.endTS.split("T"); - if (end.length === 2) { - end[1] = optional.endTS; - apiBody.startTS = convertTimeToTimestamp(start.join("T")); - apiBody.endTS = convertTimeToTimestamp(end.join("T")); - } - } - } } const labels = optional.labels.filter((label) => label.active); diff --git a/src/models/dataSource.ts b/src/models/dataSource.ts index ab5ff7d2..9e8f778d 100644 --- a/src/models/dataSource.ts +++ b/src/models/dataSource.ts @@ -39,8 +39,6 @@ export interface DataSourceFiles { optional?: { filled: boolean; temporal: boolean; - startTS: string; - endTS: string; filters: Filter[]; labels: Label[]; sorts: Sort[]; diff --git a/test/suite/commands.test.ts b/test/suite/commands.test.ts index 2c27bc49..260df7d7 100644 --- a/test/suite/commands.test.ts +++ b/test/suite/commands.test.ts @@ -332,8 +332,6 @@ describe("dataSourceCommand2", () => { api.optional = { filled: true, temporal: true, - startTS: "", - endTS: "", filters: [], sorts: [], groups: [], @@ -368,8 +366,6 @@ describe("dataSourceCommand2", () => { api.optional = { filled: false, temporal: true, - startTS: "10:00", - endTS: "11:00", filters: [], sorts: [], groups: [], @@ -397,8 +393,6 @@ describe("dataSourceCommand2", () => { api.optional = { filled: true, temporal: true, - startTS: "10:00", - endTS: "11:00", filters: [ { active: true, column: "bid", operator: ">", values: "100" }, ], diff --git a/test/suite/webview.test.ts b/test/suite/webview.test.ts index adcfb4f4..a59bd52f 100644 --- a/test/suite/webview.test.ts +++ b/test/suite/webview.test.ts @@ -58,8 +58,6 @@ describe("KdbDataSourceView", () => { dataSourceFile.dataSource.api.optional = { filled: false, temporal: false, - startTS: "", - endTS: "", filters: [], labels: [], sorts: [],