mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
* Fix dimension popover layout and color picker “Auto” * Created ToolbarButton * Move disabled help text to tooltip for missing values * Darker side panel backgrounds * Adding to .asciidoc about where to put the SASS import * Moving `SASS` guidelines to STYLEGUIDE.md * Fix keyboard focus of XY settings popover * Fix dark mode
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
*/
|
|
|
|
import React from 'react';
|
|
import { I18nProvider } from '@kbn/i18n/react';
|
|
import { DatasourceLayerPanelProps } from '../types';
|
|
import { IndexPatternPrivateState } from './types';
|
|
import { ChangeIndexPattern } from './change_indexpattern';
|
|
|
|
export interface IndexPatternLayerPanelProps
|
|
extends DatasourceLayerPanelProps<IndexPatternPrivateState> {
|
|
state: IndexPatternPrivateState;
|
|
onChangeIndexPattern: (newId: string) => void;
|
|
}
|
|
|
|
export function LayerPanel({ state, layerId, onChangeIndexPattern }: IndexPatternLayerPanelProps) {
|
|
const layer = state.layers[layerId];
|
|
|
|
return (
|
|
<I18nProvider>
|
|
<ChangeIndexPattern
|
|
data-test-subj="indexPattern-switcher"
|
|
trigger={{
|
|
label: state.indexPatterns[layer.indexPatternId].title,
|
|
title: state.indexPatterns[layer.indexPatternId].title,
|
|
'data-test-subj': 'lns_layerIndexPatternLabel',
|
|
size: 's',
|
|
fontWeight: 'normal',
|
|
}}
|
|
indexPatternId={layer.indexPatternId}
|
|
indexPatternRefs={state.indexPatternRefs}
|
|
onChangeIndexPattern={onChangeIndexPattern}
|
|
/>
|
|
</I18nProvider>
|
|
);
|
|
}
|