mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Search: minor fixes (#23984)
* Search: Use folder id as key when present * Search: Do not render modals if not open
This commit is contained in:
parent
88e9fccbc7
commit
dd31207ecf
@ -46,7 +46,7 @@ export const ConfirmDeleteModal: FC<Props> = ({ results, onDeleteItems, isOpen,
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
return isOpen ? (
|
||||
<ConfirmModal
|
||||
isOpen={isOpen}
|
||||
title="Delete"
|
||||
@ -59,7 +59,7 @@ export const ConfirmDeleteModal: FC<Props> = ({ results, onDeleteItems, isOpen,
|
||||
onConfirm={deleteItems}
|
||||
onDismiss={onDismiss}
|
||||
/>
|
||||
);
|
||||
) : null;
|
||||
};
|
||||
|
||||
const getStyles = stylesFactory((theme: GrafanaTheme) => {
|
||||
|
@ -44,7 +44,7 @@ export const MoveToFolderModal: FC<Props> = ({ results, onMoveItems, isOpen, onD
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
return isOpen ? (
|
||||
<Modal
|
||||
className={styles.modal}
|
||||
title="Choose Dashboard Folder"
|
||||
@ -71,7 +71,7 @@ export const MoveToFolderModal: FC<Props> = ({ results, onMoveItems, isOpen, onD
|
||||
</HorizontalGroup>
|
||||
</>
|
||||
</Modal>
|
||||
);
|
||||
) : null;
|
||||
};
|
||||
|
||||
const getStyles = stylesFactory((theme: GrafanaTheme) => {
|
||||
|
@ -36,7 +36,7 @@ export const SearchResults: FC<Props> = ({
|
||||
<div className={styles.wrapper}>
|
||||
{results.map(section => {
|
||||
return (
|
||||
<div aria-label="Search section" className={styles.section} key={section.title}>
|
||||
<div aria-label="Search section" className={styles.section} key={section.id || section.title}>
|
||||
<SectionHeader onSectionClick={onToggleSection} {...{ onToggleChecked, editable, section }} />
|
||||
<div aria-label="Search items" className={styles.sectionItems}>
|
||||
{section.expanded && section.items.map(item => <SearchItem key={item.id} {...itemProps} item={item} />)}
|
||||
|
Loading…
Reference in New Issue
Block a user