-
Notifications
You must be signed in to change notification settings - Fork 198
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
Store controls in state #7706
Draft
donnapep
wants to merge
7
commits into
trunk
Choose a base branch
from
tweak/student-action-menu-filter
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Store controls in state #7706
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8b198bf
Store controls in state
donnapep 2dd4a50
Refactor to use applyFiltersSync
donnapep ed8d87b
Merge branch 'trunk' into tweak/student-action-menu-filter
donnapep bb6c417
Update @wordpress/hooks
donnapep 9fb7fe6
Don't mutate the state
donnapep 2a5bbc7
Remove unnecessary use of spread operator
donnapep 4f124fa
Revert update to @wordpress/hooks package
donnapep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Although this code works, I have no idea why or how. 😅 It looks good in theory, but when setting breakpoints or adding log statements in the code, I noticed that when the
fetch
in Sensei Pro returns andsetControls
is called below, the component does not re-render as expected. Despite this, the "Add to Group" and "Remove from Group" options are there in the UI. 🤯Given I'm not clear on what is happening here, I'm somewhat averse to shipping this change.
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.
Maybe I'm missing something, but I didn't find where the
applyFiltersAsync
comes from. Checking the Gutenberg package, it doesn't seem to be there.I'm also seeing this error in my browser console:
Uncaught (in promise) TypeError: (0 , _wordpress_hooks__WEBPACK_IMPORTED_MODULE_2__.applyFiltersAsync) is not a function
.So I don't understand how the buttons are displayed for you. For me it's not being displayed. Maybe there is some other code adding them for you given a specific condition?
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.
It's in
@wordpress/hooks
, so you'll need do reinstallnpm
packages as I updated the version.Updated the testing instructions.
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.
Even with that it's not finding the function for me. 🤔
Are you using a WP beta version?
The
@wordpress/hooks
is not bundled in our scripts. It's imported directly from WP because of the dependency extraction plugin. I checked that the function was added 1 month ago, so we probably shouldn't use it.BTW, the link I used in my previous comment was the Gutenberg repo in the Automattic organization instead of the WordPress organization. That's the reason it wasn't there. :P
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.
Oof, yes I am. I wasn't able to downgrade in the Beta Tester plugin so had to stay on 6.7. Back to square one then I guess. 😄 Thanks for taking a look!