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

fix: [M3-7880] - Properly reset rebuild modal state #10287

Merged
merged 3 commits into from
Mar 14, 2024

Conversation

abailly-akamai
Copy link
Contributor

@abailly-akamai abailly-akamai commented Mar 14, 2024

Description πŸ“

This PR fixes a bug where the "mode" state of the rebuild dialog wasn't reset when mounted. This isn't as bad a bug as initially thought, just a potential awkward experience for the user.

Changes πŸ”„

  • Reset state when closing modal

Target release date πŸ—“οΈ

3/18/2024

Preview πŸ“·

Before After
Screen.Recording.2024-03-14.at.16.24.33.mov
Screen.Recording.2024-03-14.at.16.22.19.mov

How to test πŸ§ͺ

Reproduction steps

  • Navigate to linode list, click on "Rebuild" action menu item for Linode A

  • Close modal, click on "Rebuild" action menu item for Linode A

    • Notice the previous mode selection
  • Navigate to linode list, click on "Rebuild" action menu item for Linode A

  • Close modal, click on "Rebuild" action menu item for Linode B

    • Notice the previous mode selection

Verification steps

  • Navigate to linode list, click on "Rebuild" action menu item for Linode A

  • Close modal, click on "Rebuild" action menu item for Linode A

    • Notice the mode selection was reset
  • Navigate to linode list, click on "Rebuild" action menu item for Linode A

  • Close modal, click on "Rebuild" action menu item for Linode B

    • Notice the mode selection was reset

As an Author I have considered πŸ€”

Check all that apply

  • πŸ‘€ Doing a self review
  • ❔ Our contribution guidelines
  • 🀏 Splitting feature into small PRs
  • βž• Adding a changeset
  • πŸ§ͺ Providing/Improving test coverage
  • πŸ” Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • πŸ‘£ Providing comprehensive reproduction steps
  • πŸ“‘ Providing or updating our documentation
  • πŸ•› Scheduling a pair reviewing session
  • πŸ“± Providing mobile support
  • β™Ώ Providing accessibility support

@abailly-akamai abailly-akamai self-assigned this Mar 14, 2024

const handleRebuildError = (status: string) => {
setRebuildError(status);
};

return (
<Dialog
TransitionProps={{ onExited: onExitDrawer }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could frankly stop reseting state with useEffect all together on modal/drawer by resetting it via onClose and TransitionProps

I used TransitionProps here to prevent a DOM change before the modal has closed, which is a nice bonus (you could maybe see the content very briefly otherwise)

data-qa-rebuild-desc
sx={{ paddingBottom: theme.spacing(2) }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

just alpha ordering - no other change

@abailly-akamai abailly-akamai marked this pull request as ready for review March 14, 2024 20:33
@abailly-akamai abailly-akamai requested a review from a team as a code owner March 14, 2024 20:33
@abailly-akamai abailly-akamai requested review from carrillo-erik and jaalah-akamai and removed request for a team March 14, 2024 20:33
@abailly-akamai abailly-akamai changed the title fix: [M3-7880] - Re-render rebuild drawer if Linode ID changes fix: [M3-7880] - Properly reset rebuild modal state Mar 14, 2024
Copy link
Contributor

@jaalah-akamai jaalah-akamai left a comment

Choose a reason for hiding this comment

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

Good suggestion, worth broadcasting to others again to let them know

Copy link
Contributor

@cpathipa cpathipa left a comment

Choose a reason for hiding this comment

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

Thank you @abailly-akamai

Copy link

Coverage Report: βœ…
Base Coverage: 81.42%
Current Coverage: 81.42%

@abailly-akamai abailly-akamai merged commit 9f1aae8 into linode:develop Mar 14, 2024
18 checks passed
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.

None yet

4 participants