diff --git a/src/Explorer/Tabs/QueryTablesTab/QueryTableEntityClause.tsx b/src/Explorer/Tabs/QueryTablesTab/QueryTableEntityClause.tsx index 057b0da2f..e9462813b 100644 --- a/src/Explorer/Tabs/QueryTablesTab/QueryTableEntityClause.tsx +++ b/src/Explorer/Tabs/QueryTablesTab/QueryTableEntityClause.tsx @@ -8,7 +8,7 @@ import { IStackTokens, Stack, TextField, - TooltipHost + TooltipHost, } from "@fluentui/react"; import React, { FunctionComponent } from "react"; import AddIcon from "../../../../images/Add.svg"; @@ -21,8 +21,8 @@ export interface IQueryTableEntityClauseProps { entityValuePlaceHolder?: string; selectedOperator: string; selectedOperation: string; - opertorOptions: IOption[]; - opertationOptions: IOption[]; + operatorOptions: IOption[]; + operationOptions: IOption[]; isQueryTableEntityChecked: boolean; selectedField: string; fieldOptions: IOption[]; @@ -42,14 +42,14 @@ export const QueryTableEntityClause: FunctionComponent, selectedOption: IDropdownOption) => onDropdownChange(selectedOption, "selectedOperation") } - options={opertationOptions} + options={operationOptions} id="operatorOptionId" styles={dropdownStyles} /> @@ -120,7 +120,7 @@ export const QueryTableEntityClause: FunctionComponent, selectedOption: IDropdownOption) => onDropdownChange(selectedOption, "selectedOperator") } - options={opertorOptions} + options={operatorOptions} id="operatorOptionId" styles={dropdownStyles} /> diff --git a/src/Explorer/Tabs/QueryTablesTab/QueryTableTabUtils.tsx b/src/Explorer/Tabs/QueryTablesTab/QueryTableTabUtils.tsx index 01f742605..5ee143b61 100644 --- a/src/Explorer/Tabs/QueryTablesTab/QueryTableTabUtils.tsx +++ b/src/Explorer/Tabs/QueryTablesTab/QueryTableTabUtils.tsx @@ -70,50 +70,15 @@ export interface IQueryTableRowsType { selectedOperation: string; selectedTimestamp: string; fieldOptions: IOption[]; - opertorOptions: IOption[]; + operatorOptions: IOption[]; entityTypeOptions: IOption[]; - opertionOptions: IOption[]; + operationOptions: IOption[]; timestampOptions: IOption[]; id: number; } -export const opertionOptions = [ - { key: "And", text: "And" }, - { key: "Or", text: "Or" }, -]; -export const opertorOptions = [ - { key: "=", text: "=" }, - { key: ">", text: ">" }, - { key: ">=", text: ">=" }, - { key: "<", text: "<" }, - { key: "<=", text: "<=" }, - { key: "<>", text: "<>" }, -]; - -export const fieldOptions = [ - { key: "PartitionKey", text: "PartitionKey" }, - { key: "RowKey", text: "RowKey" }, - { key: "Timestamp", text: "Timestamp" }, - { key: "t3PN", text: "t3PN" }, -]; - -export const entityTypeOptions = [ - { key: "String", text: "String" }, - { key: "Boolean", text: "Boolean" }, - { key: "Binary", text: "Binary" }, - { key: "DateTime", text: "DateTime" }, - { key: "Double", text: "Double" }, - { key: "Guid", text: "Guid" }, - { key: "Int32", text: "Int32" }, - { key: "Int64", text: "Int64" }, -]; - -export const timestampOptions = [ - { key: "Last hour", text: "Last hour" }, - { key: "Last 24 hours", text: "Last 24 hours" }, - { key: "Last 7 days", text: "Last 7 days" }, - { key: "Last 31 days", text: "Last 31 days" }, - { key: "Last 365 days", text: "Last 365 days" }, - { key: "Current month", text: "Current month" }, - { key: "Current year", text: "Current year" }, -]; +export const getformattedOptions = (options: Array): IOption[] => { + return options.map((option) => { + return { key: option, text: option }; + }); +}; diff --git a/src/Explorer/Tabs/QueryTablesTab/QueryTablesTabComponent.tsx b/src/Explorer/Tabs/QueryTablesTab/QueryTablesTabComponent.tsx index 8e1a6c0eb..e81b527fb 100644 --- a/src/Explorer/Tabs/QueryTablesTab/QueryTablesTabComponent.tsx +++ b/src/Explorer/Tabs/QueryTablesTab/QueryTablesTabComponent.tsx @@ -5,7 +5,7 @@ import { IDropdownOption, IDropdownStyles, Selection, - SelectionMode, + SelectionMode } from "@fluentui/react"; import * as ko from "knockout"; import React, { Component } from "react"; @@ -39,21 +39,18 @@ import { CassandraAPIDataClient, TableDataClient } from "../../Tables/TableDataC // import NewQueryTablesTab from "./QueryTablesTab"; import { QueryTableEntityClause } from "./QueryTableEntityClause"; import { - entityTypeOptions, - fieldOptions, + getformattedOptions, IDocument, IQueryTableRowsType, IQueryTablesTabComponentProps, - IQueryTablesTabComponentStates, - opertionOptions, - opertorOptions, - timestampOptions, + IQueryTablesTabComponentStates } from "./QueryTableTabUtils"; export interface Button { visible: boolean; enabled: boolean; isSelected?: boolean; } + // export interface IDocument { // partitionKey: string; // rowKey: string; @@ -175,12 +172,17 @@ class QueryTablesTabComponent extends Component { // console.log("items > ", this.state.tableEntityListViewModel.cache.data); @@ -322,7 +326,7 @@ class QueryTablesTabComponent extends Component ", this.state.tableEntityListViewModel.headers); // console.log("items1 > simple > ", this.tableEntityListViewModel1.items1); this.columns = []; - this.state.tableEntityListViewModel.headers.map((header) => { + tableEntityListViewModel.headers.map((header) => { this.columns.push({ key: header, name: header, @@ -337,11 +341,16 @@ class QueryTablesTabComponent extends Component { // console.log( // "🚀 ~ file: QueryTablesTabComponent.tsx ~ line 248 ~ QueryTablesTabComponent ~ setTimeout ~ columns", @@ -352,7 +361,7 @@ class QueryTablesTabComponent extends Component { @@ -632,12 +641,15 @@ class QueryTablesTabComponent extends Component
@@ -699,9 +712,8 @@ class QueryTablesTabComponent extends Component