mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Fix bug in target selector UI (#3419)
This commit is contained in:
parent
1c4bc0954c
commit
c9e8f4aab0
3 changed files with 14 additions and 2 deletions
2
changes/issue-3047-cancel-select-targets
Normal file
2
changes/issue-3047-cancel-select-targets
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
* Fix UI bug in target selector for query editor and policy editor where cancel button did not reset
|
||||
selected targets
|
||||
|
|
@ -182,6 +182,11 @@ const SelectTargets = ({
|
|||
}
|
||||
);
|
||||
|
||||
const handleClickCancel = () => {
|
||||
setSelectedTargets([]);
|
||||
goToQueryEditor();
|
||||
};
|
||||
|
||||
const handleSelectedLabels = (entity: ILabel | ITeam) => (
|
||||
e: React.MouseEvent<HTMLButtonElement>
|
||||
): void => {
|
||||
|
|
@ -318,7 +323,7 @@ const SelectTargets = ({
|
|||
<div className={`${baseClass}__targets-button-wrap`}>
|
||||
<Button
|
||||
className={`${baseClass}__btn`}
|
||||
onClick={goToQueryEditor}
|
||||
onClick={handleClickCancel}
|
||||
variant="text-link"
|
||||
>
|
||||
Cancel
|
||||
|
|
|
|||
|
|
@ -190,6 +190,11 @@ const SelectTargets = ({
|
|||
}
|
||||
);
|
||||
|
||||
const handleClickCancel = () => {
|
||||
setSelectedTargets([]);
|
||||
goToQueryEditor();
|
||||
};
|
||||
|
||||
const handleSelectedLabels = (selectedLabel: ISelectTargetsEntity) => (
|
||||
e: React.MouseEvent<HTMLButtonElement>
|
||||
): void => {
|
||||
|
|
@ -330,7 +335,7 @@ const SelectTargets = ({
|
|||
<div className={`${baseClass}__targets-button-wrap`}>
|
||||
<Button
|
||||
className={`${baseClass}__btn`}
|
||||
onClick={goToQueryEditor}
|
||||
onClick={handleClickCancel}
|
||||
variant="text-link"
|
||||
>
|
||||
Cancel
|
||||
|
|
|
|||
Loading…
Reference in a new issue