Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table acceleration flyout #128

Merged
merged 6 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"id": "queryWorkbenchDashboards",
"version": "3.0.0.0",
"opensearchDashboardsVersion": "3.0.0",
ps48 marked this conversation as resolved.
Show resolved Hide resolved
"version": "2.9.0.0",
"opensearchDashboardsVersion": "2.9.0",
"server": true,
"ui": true,
"requiredPlugins": [
"navigation"
],
"optionalPlugins": []
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opensearch-query-workbench",
"version": "3.0.0.0",
ps48 marked this conversation as resolved.
Show resolved Hide resolved
"version": "2.9.0.0",
"description": "Query Workbench",
"main": "index.js",
"license": "Apache-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
EuiSpacer,
EuiText,
} from '@elastic/eui';
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';
import { CreateAccelerationForm } from '../../../../../common/types';
import _ from 'lodash';

Expand All @@ -25,14 +25,10 @@ export const CoveringIndexBuilder = ({
setAccelerationFormData,
}: CoveringIndexBuilderProps) => {
const [isPopOverOpen, setIsPopOverOpen] = useState(false);
const [columnsValue, setColumnsValue] = useState('');
const [columnsValue, setColumnsValue] = useState('(add columns here)');
const [selectedOptions, setSelected] = useState([]);

const onChange = (selectedOptions) => {
setSelected(selectedOptions);
};

useEffect(() => {
const onChange = (selectedOptions: any[]) => {
let expresseionValue = '(add columns here)';
if (selectedOptions.length > 0) {
expresseionValue =
Expand All @@ -49,7 +45,8 @@ export const CoveringIndexBuilder = ({
')';
}
setColumnsValue(expresseionValue);
}, [selectedOptions]);
setSelected(selectedOptions);
};

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export const IndexSettingOptions = ({
];
const [indexName, setIndexName] = useState('');
const [indexAlias, setIndexAlias] = useState('');
const [primaryShards, setPrimaryShards] = useState('5');
const [replicaCount, setReplicaCount] = useState('1');
const [primaryShards, setPrimaryShards] = useState(5);
const [replicaCount, setReplicaCount] = useState(1);
const [refreshTypeSelected, setRefreshTypeSelected] = useState(`${idPrefix}0`);
const [refreshIntervalSeconds, setRefreshIntervalSeconds] = useState('1');

Expand All @@ -53,12 +53,12 @@ export const IndexSettingOptions = ({

const onChangePrimaryShards = (e: ChangeEvent<HTMLInputElement>) => {
setAccelerationFormData({ ...accelerationFormData, primaryShardsCount: +e.target.value });
setPrimaryShards(e.target.value);
setPrimaryShards(+e.target.value);
};

const onChangeReplicaCount = (e: ChangeEvent<HTMLInputElement>) => {
setAccelerationFormData({ ...accelerationFormData, replicaShardsCount: +e.target.value });
setReplicaCount(e.target.value);
setReplicaCount(+e.target.value);
};

const onChangeRefreshType = (optionId: React.SetStateAction<string>) => {
Expand Down Expand Up @@ -86,7 +86,7 @@ export const IndexSettingOptions = ({
<EuiFieldText
placeholder="Enter Index Name"
value={indexName}
onChange={(e) => onChangeIndexName(e)}
onChange={onChangeIndexName}
aria-label="Enter Index Name"
/>
</EuiFormRow>
Expand Down Expand Up @@ -122,7 +122,7 @@ export const IndexSettingOptions = ({
<EuiFieldNumber
placeholder="Number of replicas"
value={replicaCount}
onChange={(e) => onChangeReplicaCount(e)}
onChange={onChangeReplicaCount}
aria-label="Number of replicas"
min={0}
max={100}
Expand All @@ -135,7 +135,7 @@ export const IndexSettingOptions = ({
<EuiRadioGroup
options={refreshOptions}
idSelected={refreshTypeSelected}
onChange={(id) => onChangeRefreshType(id)}
onChange={onChangeRefreshType}
name="refresh type radio group"
/>
</EuiFormRow>
Expand All @@ -148,7 +148,7 @@ export const IndexSettingOptions = ({
<EuiFieldNumber
placeholder="Refresh interval"
value={refreshIntervalSeconds}
onChange={(e) => onChangeRefreshIntervalSeconds(e)}
onChange={onChangeRefreshIntervalSeconds}
aria-label="Refresh interval"
append={'second(s)'}
min={1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const AddFieldsModal = ({
}: AddFieldsModalProps) => {
const [selectedFields, setSelectedFields] = useState([]);

const tableColumns = [
const tableColumns: Array<EuiTableFieldDataColumnType<DataTableFieldsType>> = [
{
field: 'fieldName',
name: 'Field name',
Expand All @@ -43,7 +43,7 @@ export const AddFieldsModal = ({
sortable: true,
truncateText: true,
},
] as Array<EuiTableFieldDataColumnType<DataTableFieldsType>>;
];

const pagination = {
initialPageSize: 20,
Expand Down
Loading