Skip to content

Commit

Permalink
Merge pull request #256 from KxSystems/KXI-37736
Browse files Browse the repository at this point in the history
KXI-37736 - GetDataAPI form changes: temporality/slice/fill inputs
  • Loading branch information
Philip-Carneiro-KX authored Mar 6, 2024
2 parents aa8330a + 40f51d2 commit da9db0e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 56 deletions.
12 changes: 0 additions & 12 deletions src/commands/dataSourceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/models/dataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ export interface DataSourceFiles {
optional?: {
filled: boolean;
temporal: boolean;
startTS: string;
endTS: string;
filters: Filter[];
labels: Label[];
sorts: Sort[];
Expand Down
38 changes: 4 additions & 34 deletions src/webview/components/kdbDataSourceView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand All @@ -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()];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -338,7 +330,7 @@ export class KdbDataSourceView extends LitElement {
value="${operator}"
?selected="${operator === filter.operator}"
>${operator}</vscode-option
>`
>`,
)}
</vscode-dropdown>
</div>
Expand Down Expand Up @@ -559,7 +551,7 @@ export class KdbDataSourceView extends LitElement {
value="${operator}"
?selected="${operator === agg.operator}"
>${operator}</vscode-option
>`
>`,
)}
</vscode-dropdown>
</div>
Expand Down Expand Up @@ -832,28 +824,6 @@ export class KdbDataSourceView extends LitElement {
>
</vscode-dropdown>
</div>
<vscode-text-field
type="time"
class="text-field"
value="${this.sliceStartTS}"
@input="${(event: Event) =>
(this.sliceStartTS = (
event.target as HTMLSelectElement
).value)}"
?hidden="${this.temporality !== "slice"}"
>Start Time</vscode-text-field
>
<vscode-text-field
type="time"
class="text-field"
value="${this.sliceEndTS}"
@input="${(event: Event) =>
(this.sliceEndTS = (
event.target as HTMLSelectElement
).value)}"
?hidden="${this.temporality !== "slice"}"
>End Time</vscode-text-field
>
</div>
<div class="col">
Expand Down Expand Up @@ -887,7 +857,7 @@ export class KdbDataSourceView extends LitElement {
event.target as HTMLSelectElement
).value)}">
${this.renderTargetOptions(
this.qsqlTarget
this.qsqlTarget,
)}</vscode-dropdown
>
</div>
Expand Down
6 changes: 0 additions & 6 deletions test/suite/commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,6 @@ describe("dataSourceCommand2", () => {
api.optional = {
filled: true,
temporal: true,
startTS: "",
endTS: "",
filters: [],
sorts: [],
groups: [],
Expand Down Expand Up @@ -368,8 +366,6 @@ describe("dataSourceCommand2", () => {
api.optional = {
filled: false,
temporal: true,
startTS: "10:00",
endTS: "11:00",
filters: [],
sorts: [],
groups: [],
Expand Down Expand Up @@ -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" },
],
Expand Down
2 changes: 0 additions & 2 deletions test/suite/webview.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ describe("KdbDataSourceView", () => {
dataSourceFile.dataSource.api.optional = {
filled: false,
temporal: false,
startTS: "",
endTS: "",
filters: [],
labels: [],
sorts: [],
Expand Down

0 comments on commit da9db0e

Please sign in to comment.