Skip to content

Commit

Permalink
addressing comments
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Li <[email protected]>
  • Loading branch information
sejli committed Sep 13, 2024
1 parent a2b896c commit 3b77d5b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/plugins/data/public/ui/dataset_selector/configurator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
import React, { useEffect, useState } from 'react';
import { BaseDataset, Dataset, DatasetField } from '../../../common';
import { BaseDataset, DEFAULT_DATA, Dataset, DatasetField } from '../../../common';
import { getIndexPatterns, getQueryService } from '../../services';

export const Configurator = ({
Expand Down Expand Up @@ -112,16 +112,17 @@ export const Configurator = ({
text: field.displayName || field.name,
value: field.name,
})),
{ text: '-----', value: '', disabled: true },
{ text: 'No time field', value: undefined },
{ text: '-----', value: '-----', disabled: true },
{ text: 'I dont want to use time filter', value: '' },
]}
value={timeFieldName}
onChange={(e) => {
const value = e.target.value === 'undefined' ? undefined : e.target.value;
setTimeFieldName(value);
setTimeFieldName(e.target.value);
const value = e.target.value === '' ? undefined : e.target.value;
setDataset({ ...dataset, timeFieldName: value });
}}
disabled={dataset?.timeFieldName !== undefined}
hasNoInitialSelection={dataset.type === DEFAULT_DATA.SET_TYPES.INDEX}
disabled={dataset.type === DEFAULT_DATA.SET_TYPES.INDEX_PATTERN}
/>
</EuiFormRow>
)}
Expand Down Expand Up @@ -166,7 +167,7 @@ export const Configurator = ({
onConfirm(dataset);
}}
fill
disabled={timeFields && timeFields.length > 0 && timeFieldName === undefined}
disabled={timeFieldName === undefined && dataset.type === DEFAULT_DATA.SET_TYPES.INDEX}
>
<FormattedMessage
id="data.explorer.datasetSelector.advancedSelector.confirm"
Expand Down

0 comments on commit 3b77d5b

Please sign in to comment.