mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
wip: changes
This commit is contained in:
@@ -5,7 +5,7 @@ import { FadeIn } from 'app/core/components/Animations/FadeIn';
|
||||
interface Props {
|
||||
children: JSX.Element;
|
||||
heading: string;
|
||||
renderToolbar?: () => JSX.Element | JSX.Element[];
|
||||
renderToolbar?: () => JSX.Element;
|
||||
toolbarItems?: EditorToolBarView[];
|
||||
}
|
||||
|
||||
@@ -106,8 +106,12 @@ export class EditorTabBody extends PureComponent<Props, State> {
|
||||
<div className="toolbar">
|
||||
<div className="toolbar__heading">{heading}</div>
|
||||
{renderToolbar && renderToolbar()}
|
||||
<div className="gf-form--grow" />
|
||||
{toolbarItems.map(item => this.renderButton(item))}
|
||||
{toolbarItems.length > 0 && (
|
||||
<>
|
||||
<div className="gf-form--grow" />
|
||||
{toolbarItems.map(item => this.renderButton(item))}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<div className="panel-editor__scroll">
|
||||
<CustomScrollbar autoHide={false}>
|
||||
|
||||
@@ -169,6 +169,10 @@ export class VisualizationTab extends PureComponent<Props, State> {
|
||||
/>
|
||||
<i className="gf-form-input-icon fa fa-search" />
|
||||
</label>
|
||||
<div className="flex-grow" />
|
||||
<button className="btn btn-link" onClick={this.onCloseVizPicker}>
|
||||
<i className="fa fa-chevron-up" />
|
||||
</button>
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
@@ -183,14 +187,17 @@ export class VisualizationTab extends PureComponent<Props, State> {
|
||||
};
|
||||
|
||||
onTypeChanged = (plugin: PanelPlugin) => {
|
||||
// this.setState({ isVizPickerOpen: false });
|
||||
this.props.onTypeChanged(plugin);
|
||||
if (plugin.id === this.props.plugin.id) {
|
||||
this.setState({ isVizPickerOpen: false });
|
||||
} else {
|
||||
this.props.onTypeChanged(plugin);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { plugin } = this.props;
|
||||
const { isVizPickerOpen, searchQuery } = this.state;
|
||||
const toolbarItems: EditorToolBarView = [];
|
||||
const toolbarItems: EditorToolBarView[] = [];
|
||||
|
||||
if (!isVizPickerOpen) {
|
||||
toolbarItems.push({
|
||||
|
||||
@@ -62,7 +62,6 @@ export class VizTypePicker extends PureComponent<Props> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { onClose } = this.props;
|
||||
const filteredPluginList = this.getFilteredPluginList();
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user