mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Make folder filter clearable in Alert list panel (#50093)
This commit is contained in:
@@ -3,13 +3,13 @@ import React from 'react';
|
||||
import { PanelPlugin } from '@grafana/data';
|
||||
import { config, DataSourcePicker } from '@grafana/runtime';
|
||||
import { TagsInput } from '@grafana/ui';
|
||||
import { RuleFolderPicker } from 'app/features/alerting/unified/components/rule-editor/RuleFolderPicker';
|
||||
|
||||
import { FolderPicker } from 'app/core/components/Select/FolderPicker';
|
||||
import {
|
||||
ALL_FOLDER,
|
||||
GENERAL_FOLDER,
|
||||
ReadonlyFolderPicker,
|
||||
} from '../../../core/components/Select/ReadonlyFolderPicker/ReadonlyFolderPicker';
|
||||
} from 'app/core/components/Select/ReadonlyFolderPicker/ReadonlyFolderPicker';
|
||||
import { PermissionLevelString } from 'app/types';
|
||||
|
||||
import { AlertList } from './AlertList';
|
||||
import { alertListPanelMigrationHandler } from './AlertListMigrationHandler';
|
||||
@@ -238,12 +238,15 @@ const unifiedAlertList = new PanelPlugin<UnifiedAlertListOptions>(UnifiedAlertLi
|
||||
defaultValue: null,
|
||||
editor: function RenderFolderPicker(props) {
|
||||
return (
|
||||
<RuleFolderPicker
|
||||
{...props}
|
||||
<FolderPicker
|
||||
enableReset={true}
|
||||
onChange={({ title, id }) => {
|
||||
return props.onChange({ title, id });
|
||||
}}
|
||||
showRoot={false}
|
||||
allowEmpty={true}
|
||||
initialTitle={props.value?.title}
|
||||
initialFolderId={props.value?.id}
|
||||
permissionLevel={PermissionLevelString.View}
|
||||
onClear={() => props.onChange('')}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user