Skip to content
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

feat(package actions): Update Enable/Disable RAI Withdraw UI to use ConfirmationModal #200

Closed
wants to merge 1 commit into from

Conversation

hannasage
Copy link

Purpose

This PR gets rid of our debounced reload on the ToggleRAIResponseWithdraw form page and replaces it with a ConfirmationModal.

Linked Issues to Close

N/A

Approach

N/A

Assorted Notes/Considerations/Learning

N/A

@hannasage hannasage self-assigned this Nov 17, 2023
Comment on lines -78 to -95
if (toggleSucceeded) {
// Clear actions for package from cache
qc.invalidateQueries(["actions", id]).then(() => {
setAwaitingNav(true); // Triggers LoadingSpinner
// Debounce back nav to give the data pipeline time to update
setTimeout(() => {
// Go back to package details and render success alert
navigate(`/details?id=${id}`, {
state: {
callout: {
heading: `Formal RAI Response Withdraw action has been ${ACTION_WORD.toLowerCase()}d`,
body: `You have successfully ${ACTION_WORD.toLowerCase()}d the Formal RAI Response Withdraw action for the State.`,
},
},
});
}, 2000);
});
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we not want to invalidate this query. just want to make sure we arent loosing functionality.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When testing it without this, it seemed to work just fine. We thought we'd have to invalidate the cached item and then redirect, but the real sauce was just that 2-second debounce on navigating...something the modal definitely handles through requiring interaction. Upon the details page re-loading, the actions updated 👍🏼

@mdial89f
Copy link
Contributor

hey @kevinhaube Our deploy workflow has this thing where if you put a namespace in your branch (idk what the term is, but like you have 'fix/') the workflow won't kick off. This is an inadvertent win to some degree, as it skips dependabot branches and i think forks.
Anyways, i pushed this branch to a branch 'enable-disable-conf-modal', so it would build and we could see how it looks.

@hannasage
Copy link
Author

Closing and handling via #204

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants