mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 08:05:43 -06:00
* Add and configure eslint-plugin-import * Fix the lint:ts npm command * Autofix + prettier all the files * Manually fix remaining files * Move jquery code in jest-setup to external file to safely reorder imports * Resolve issue caused by circular dependencies within Prometheus * Update .betterer.results * Fix missing // @ts-ignore * ignore iconBundle.ts * Fix missing // @ts-ignore
45 lines
1.4 KiB
TypeScript
45 lines
1.4 KiB
TypeScript
import { css } from '@emotion/css';
|
|
import React from 'react';
|
|
|
|
import { DataSourcePluginOptionsEditorProps, GrafanaTheme, updateDatasourcePluginJsonDataOption } from '@grafana/data';
|
|
import { InlineField, InlineFieldRow, InlineSwitch, useStyles } from '@grafana/ui';
|
|
|
|
import { TempoJsonData } from '../datasource';
|
|
|
|
interface Props extends DataSourcePluginOptionsEditorProps<TempoJsonData> {}
|
|
|
|
export function SearchSettings({ options, onOptionsChange }: Props) {
|
|
const styles = useStyles(getStyles);
|
|
|
|
return (
|
|
<div className={styles.container}>
|
|
<h3 className="page-heading">Search</h3>
|
|
<InlineFieldRow className={styles.row}>
|
|
<InlineField tooltip="Removes the Search tab from the Tempo query editor." label="Hide search" labelWidth={26}>
|
|
<InlineSwitch
|
|
id="hideSearch"
|
|
value={options.jsonData.search?.hide}
|
|
onChange={(event: React.SyntheticEvent<HTMLInputElement>) =>
|
|
updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'search', {
|
|
...options.jsonData.search,
|
|
hide: event.currentTarget.checked,
|
|
})
|
|
}
|
|
/>
|
|
</InlineField>
|
|
</InlineFieldRow>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
const getStyles = (theme: GrafanaTheme) => ({
|
|
container: css`
|
|
label: container;
|
|
width: 100%;
|
|
`,
|
|
row: css`
|
|
label: row;
|
|
align-items: baseline;
|
|
`,
|
|
});
|