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

[Website] Hide Settings menu after clicking "Restore from .zip #1904

Merged
merged 7 commits into from
Oct 25, 2024

Conversation

ajotka
Copy link
Contributor

@ajotka ajotka commented Oct 16, 2024

Motivation for the change, related issues

Issue #1903

Implementation details

Because Modal was in the same component as Dropdown Menu it was always visible when Dropdown was open (and disappears when I tried to force close menu item, because of unmounting).

So I decided to wrap dropdown with context and move there whole logic.

Testing Instructions (or ideally a Blueprint)

Just open Playground and go to settigns.

Screen with results

image

@ajotka ajotka requested a review from a team as a code owner October 16, 2024 08:49
@adamziel
Copy link
Collaborator

Nice! Thank you for contributing!

One thing that stood out to me is the modal provider. The other buttons in that dropdown menu use the redux dispatch(setActiveModal('error-report')); to set the active modal. Could this one do the same? Then it could be displayed in layout.tsx:

if (currentModal === 'log') {
return <LogModal />;
} else if (currentModal === 'error-report') {
return <ErrorReportModal blueprint={blueprint} />;
} else if (currentModal === 'start-error') {
return <StartErrorModal />;
}

@bgrgicak bgrgicak changed the title Bugfix/1903 [Website] Hide Settings menu after clicking "Restore from .zip Oct 17, 2024
@bgrgicak bgrgicak added [Type] Bug An existing feature does not function as intended [Package][@wp-playground] Website labels Oct 17, 2024
@ajotka
Copy link
Contributor Author

ajotka commented Oct 22, 2024

@adamziel Improvements are ready.
Not sure why one test is failing, but I can't re-run them.

@adamziel
Copy link
Collaborator

That failing tests is an issue with GitHub CI setup, I just restarted it.

@adamziel
Copy link
Collaborator

adamziel commented Oct 23, 2024

The code change looks good to me, let me also loop in @brandonpayton for another review and merging. Thank you so much for contributing @ajotka !

@adamziel
Copy link
Collaborator

I'll go ahead and merge, @brandonpayton if you'll notice something later on feel free to still share your feedback

@adamziel adamziel merged commit 00ae887 into WordPress:trunk Oct 25, 2024
10 checks passed
@adamziel
Copy link
Collaborator

Thank you so much for your contribution @ajotka and congratulations on your first merged PR! 🎉

@brandonpayton
Copy link
Member

I'll go ahead and merge, @brandonpayton if you'll notice something later on feel free to still share your feedback

Thanks, Adam. I don't have any other feedback except that it is nice this PR moves the modal definition out of the button module. Thanks, @ajotka!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package][@wp-playground] Website [Type] Bug An existing feature does not function as intended
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants