From 3b77d5b8cd1851b5aea80ddfbc86b5526083166c Mon Sep 17 00:00:00 2001 From: Sean Li Date: Thu, 12 Sep 2024 19:46:25 -0700 Subject: [PATCH] addressing comments Signed-off-by: Sean Li --- .../public/ui/dataset_selector/configurator.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/data/public/ui/dataset_selector/configurator.tsx b/src/plugins/data/public/ui/dataset_selector/configurator.tsx index afb1b6db061f..8d93a972fc99 100644 --- a/src/plugins/data/public/ui/dataset_selector/configurator.tsx +++ b/src/plugins/data/public/ui/dataset_selector/configurator.tsx @@ -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 = ({ @@ -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} /> )} @@ -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} >