-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(aci): set up monitor Disable action #96716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
c5c6e75
to
764b583
Compare
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
static/app/views/detectors/components/details/common/actions.tsx
Outdated
Show resolved
Hide resolved
return ( | ||
<Button size="sm" onClick={() => {}}> | ||
{detector.disabled ? t('Enable') : t('Disable')} | ||
<Button size="sm" onClick={toggleDisabled} busy={isUpdating}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you still need to set disabled={isUpdating}
so that the user can't click it twice, I'm not sure if busy does that for you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is handled by busy
!
sentry/static/app/components/core/button/useButtonFunctionality.tsx
Lines 27 to 33 in 412d1c0
const handleClick = (e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => { | |
// Don't allow clicks when disabled or busy | |
if (props.disabled || props.busy) { | |
e.preventDefault(); | |
e.stopPropagation(); | |
return; | |
} |
export function DeleteDetectorAction({detector}: {detector: Detector}) { | ||
const organization = useOrganization(); | ||
const navigate = useNavigate(); | ||
const {mutate: deleteDetector, isPending: isDeleting} = useDeleteDetectorMutation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use mutateAsync
instead for the onConfirm
, the modal will stay open until the request finishes which is slightly better UX
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shoot i forgot this again 🤦🏼
3123ad2
to
ca7d19c
Compare
connected Disable button to detector PUT endpoint
since we already have individual components for each action button now (file here), i figured we could take out the
EditDetectorActions
component and place the buttons intoEditDetectorLayout
directly