Skip to content

Commit

Permalink
WIP failing to create the dataset type
Browse files Browse the repository at this point in the history
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
  • Loading branch information
kavilla committed Nov 12, 2024
1 parent 995d986 commit be59172
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/plugins/data/common/datasets/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ export interface Dataset extends BaseDataset {
timeFieldName?: string;
/** Optional language to default to from the language selector */
language?: string;
/** Optional reference to the original dataset */
ref?: {
id: string;
type: string;
};
}

export interface DatasetField {
Expand Down
39 changes: 39 additions & 0 deletions src/plugins/data/public/ui/dataset_selector/configurator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,45 @@ export const Configurator = ({
/>
</EuiFormRow>
))}
<EuiFormRow
label={i18n.translate(
'data.explorer.datasetSelector.advancedSelector.configurator.indexedViewLabel',
{
defaultMessage: 'Available indexed views',
}
)}
helpText={i18n.translate(
'data.explorer.datasetSelector.advancedSelector.configurator.indexedViewHelpText',
{
defaultMessage: 'Select an indexed view to speed up your query.',
}
)}
>
<EuiSelect
options={[
{ name: 'Dummy Indexed View', value: 'dummy_index' },
{ name: '-----', value: '-----', disabled: true },
].map(({ name, value }) => ({

Check warning on line 206 in src/plugins/data/public/ui/dataset_selector/configurator.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/data/public/ui/dataset_selector/configurator.tsx#L206

Added line #L206 was not covered by tests
text: name,
value,
}))}
value={'dummy_index'}
onChange={(e) => {
const value = 'dummy_index';
setDataset({

Check warning on line 213 in src/plugins/data/public/ui/dataset_selector/configurator.tsx

View check run for this annotation

Codecov / codecov/patch

src/plugins/data/public/ui/dataset_selector/configurator.tsx#L212-L213

Added lines #L212 - L213 were not covered by tests
...dataset,
id: `${dataset.id}.${value}`,
title: value,
type: DEFAULT_DATA.SET_TYPES.INDEX,
ref: {
id: dataset.id,
type: dataset.type,
},
});
}}
hasNoInitialSelection
/>
</EuiFormRow>
</EuiForm>
</EuiModalBody>
<EuiModalFooter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export const DatasetSelector = ({
const { overlays } = services;
const datasetService = getQueryService().queryString.getDatasetService();
const datasetIcon =
datasetService.getType(selectedDataset?.type || '')?.meta.icon.type || 'database';
datasetService.getType(selectedDataset?.ref?.type || selectedDataset?.type || '')?.meta.icon
.type || 'database';

useEffect(() => {
isMounted.current = true;
Expand Down

0 comments on commit be59172

Please sign in to comment.