mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Update dependency prettier to v2.5.1 (#43473)
* Update dependency prettier to v2.5.1 * prettier fixes * chore(toolkit): bump prettier to 2.5.1 * style(eslint): bump grafana config to 2.5.2 in core and toolkit * style(mssql-datasource): fix no-inferrable-types eslint errors Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com> Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
@@ -47,24 +47,30 @@ export const DynamicConfigValueEditor: React.FC<DynamicConfigValueEditorProps> =
|
||||
const labelCategory = item.category?.filter((c) => c !== item.name);
|
||||
let editor;
|
||||
|
||||
// eslint-disable-next-line react/display-name
|
||||
const renderLabel = (includeDescription = true, includeCounter = false) => (isExpanded = false) => (
|
||||
<HorizontalGroup justify="space-between">
|
||||
<Label category={labelCategory} description={includeDescription ? item.description : undefined}>
|
||||
<Highlighter
|
||||
textToHighlight={item.name}
|
||||
searchWords={[searchQuery]}
|
||||
highlightClassName={'search-fragment-highlight'}
|
||||
/>
|
||||
{!isExpanded && includeCounter && item.getItemsCount && <Counter value={item.getItemsCount(property.value)} />}
|
||||
</Label>
|
||||
{!isSystemOverride && (
|
||||
<div>
|
||||
<IconButton name="times" onClick={onRemove} />
|
||||
</div>
|
||||
)}
|
||||
</HorizontalGroup>
|
||||
);
|
||||
/* eslint-disable react/display-name */
|
||||
const renderLabel =
|
||||
(includeDescription = true, includeCounter = false) =>
|
||||
(isExpanded = false) =>
|
||||
(
|
||||
<HorizontalGroup justify="space-between">
|
||||
<Label category={labelCategory} description={includeDescription ? item.description : undefined}>
|
||||
<Highlighter
|
||||
textToHighlight={item.name}
|
||||
searchWords={[searchQuery]}
|
||||
highlightClassName={'search-fragment-highlight'}
|
||||
/>
|
||||
{!isExpanded && includeCounter && item.getItemsCount && (
|
||||
<Counter value={item.getItemsCount(property.value)} />
|
||||
)}
|
||||
</Label>
|
||||
{!isSystemOverride && (
|
||||
<div>
|
||||
<IconButton name="times" onClick={onRemove} />
|
||||
</div>
|
||||
)}
|
||||
</HorizontalGroup>
|
||||
);
|
||||
/* eslint-enable react/display-name */
|
||||
|
||||
if (isCollapsible) {
|
||||
editor = (
|
||||
|
||||
@@ -25,21 +25,21 @@ describe('standardFieldConfigEditorRegistry', () => {
|
||||
describe('supportsDataQuery', () => {
|
||||
describe('when called with plugin that supports queries', () => {
|
||||
it('then it should return true', () => {
|
||||
const plugin = ({ meta: { skipDataQuery: false } } as unknown) as PanelPlugin;
|
||||
const plugin = { meta: { skipDataQuery: false } } as unknown as PanelPlugin;
|
||||
expect(supportsDataQuery(plugin)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when called with plugin that does not support queries', () => {
|
||||
it('then it should return false', () => {
|
||||
const plugin = ({ meta: { skipDataQuery: true } } as unknown) as PanelPlugin;
|
||||
const plugin = { meta: { skipDataQuery: true } } as unknown as PanelPlugin;
|
||||
expect(supportsDataQuery(plugin)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when called without skipDataQuery', () => {
|
||||
it('then it should return false', () => {
|
||||
const plugin = ({ meta: {} } as unknown) as PanelPlugin;
|
||||
const plugin = { meta: {} } as unknown as PanelPlugin;
|
||||
expect(supportsDataQuery(plugin)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user