mirror of https://github.com/grafana/grafana.git
				
				
				
			Alerting: Fix folder picker clear action (#56864)
This commit is contained in:
		
							parent
							
								
									527690d19a
								
							
						
					
					
						commit
						9d0380cbdd
					
				|  | @ -61,6 +61,7 @@ public/css/*.min.css | |||
| *.sublime-workspace | ||||
| *.swp | ||||
| .idea/ | ||||
| .fleet/ | ||||
| *.iml | ||||
| *.tmp | ||||
| .DS_Store | ||||
|  |  | |||
|  | @ -193,9 +193,8 @@ export function FolderPicker(props: Props) { | |||
|   }, [folder]); | ||||
| 
 | ||||
|   const onFolderChange = useCallback( | ||||
|     (newFolder: SelectableValue<number>, actionMeta: ActionMeta) => { | ||||
|       const value = newFolder.value; | ||||
|       if (value === VALUE_FOR_ADD) { | ||||
|     (newFolder: SelectableValue<number> | null | undefined, actionMeta: ActionMeta) => { | ||||
|       if (newFolder?.value === VALUE_FOR_ADD) { | ||||
|         setFolder({ | ||||
|           id: VALUE_FOR_ADD, | ||||
|           title: inputValue, | ||||
|  |  | |||
|  | @ -246,7 +246,7 @@ const unifiedAlertList = new PanelPlugin<UnifiedAlertListOptions>(UnifiedAlertLi | |||
|     .addCustomEditor({ | ||||
|       path: 'folder', | ||||
|       name: 'Folder', | ||||
|       description: 'Filter for alerts in the selected folder', | ||||
|       description: 'Filter for alerts in the selected folder (only for Grafana alerts)', | ||||
|       id: 'folder', | ||||
|       defaultValue: null, | ||||
|       editor: function RenderFolderPicker(props) { | ||||
|  | @ -279,7 +279,7 @@ const unifiedAlertList = new PanelPlugin<UnifiedAlertListOptions>(UnifiedAlertLi | |||
|             noDefault | ||||
|             current={props.value} | ||||
|             onChange={(ds) => props.onChange(ds.name)} | ||||
|             onClear={() => props.onChange('')} | ||||
|             onClear={() => props.onChange(null)} | ||||
|           /> | ||||
|         ); | ||||
|       }, | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue