-
Notifications
You must be signed in to change notification settings - Fork 383
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
Update Settings page to include "Other" section #6501
Conversation
Plugin builds for 4b3a89a are ready 🛎️!
|
I've been trying to fix the failing E2E test but ran out of time. I'm pretty sure there's an easy fix for that. |
No worries. I'll take a look. |
Thanks so much, @pierlon! |
7f6e93b
to
0422246
Compare
@jwold Thanks for updating the component! @pierlon @westonruter I've been able to fix the E2E tests, increase the test coverage, and also resolve the merge conflicts. Now the PR is "green" and I think it's good to go through the final review. |
<section className="developer-tools"> | ||
<DevToolsToggle /> | ||
<p> | ||
{ __( 'Only enabled for your user account. This is not a sitewide setting.', 'amp' ) } |
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.
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.
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 addressed in 753175f
Per the comment from Weston on #5578 (comment), I'm suggesting a change to the new "Other" panel. The goal is that the design should now look like this: https://d.pr/i/CPtRce. Feedback is welcome, haven't submitted a PR in a while!
Saw an error to properly indent. Trying again.
753175f
to
2f7d0b5
Compare
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.
Great work @delawski. Passing onto @westonruter for a final review.
…578-add-new-settings * 'develop' of github.com:ampproject/amp-wp: (44 commits) Make placeholder dependency on video ID more explicit Fix adding start to placeholder link; improve coverage Let placeholder link point to YouTube permalink and not iframe src Prevent generating closing IMG tags Use coversDefaultClass Remove condition which cannot be reached since video ID is always provided Opt to pass-through iframe for unrecognized YouTube URL rather than convert to link Remove unreachable code Give more explicit array phpdoc type Fix issues identified by phpstan Try installing phpstan via shivammathur/setup-php Try downloading a specific version of phpstan instead of latest Fix yml syntax error Try removing phpstan before composer install Print phpstan version when running on GHA Revert "Revert phpstan ignores" Try adding phpstan version to composer cache key Revert phpstan ignores update unit test cases Sanitize attribute name Use original YouTube URL as placeholder when sanitizing raw embed Fix phpcs alignment warning Use constant instead of member variable Let Document::fromNode() obtain the ownerDocument Deduplicate iframe_props into constant ...
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.
* @param {string} props.userRestPath REST endpoint to retrieve options. | ||
* @param {Object} props Component props. | ||
* @param {?any} props.children Component children. | ||
* @param {boolean} props.allowConfiguredPluginOnly Provided only for functionality that requires the plugin to be configured. |
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 prop name and description are unclear to me. Can this be clarified?
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.
Yes, the description was totally wrong and the prop name could be better too.
In 418ec3c I've changed those. I'm still not convinced it's clear enough but maybe you can find a better wording?
To make it clearer, I've also replaced the REST route we used: /wp/v2/users/me
with a general users
path: /wp/v2/users
. This way, the prop name (usersResourceRestPath
) should now semantically match its value.
What do you think?
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 don't see that allowConfiguredPluginOnly
was changed.
The users REST path change looks good.
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.
Oh my! I have no idea why I looked at the wrong prop (and "fixed" it). I'll get the allowConfiguredPluginOnly
clarified.
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.
So this flag is used to allow fetching users data even if the plugin is not fully configured (the Onboarding Wizard has not been completed).
So far, the user data was fetched only after completing the Wizard but right now we need the user data earlier (it's possible to visit the AMP Settings page without going through the Wizard).
Naming is hard. Anything I come up with so far is long and may sound a bit awkward: skipFetchingIfUnconfiguredPlugin
, onlyFetchIfPluginIsConfigured
... Suggestions are well appreciated.
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.
onlyFetchIfPluginIsConfigured
sounds good to me!
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.
Perfect! It's been updated in 4b3a89a.
Oh, hold on, E2E tests are passing now! 🤷 Maybe they'll fail again when the above suggestions are applied. |
Co-authored-by: Weston Ruter <[email protected]>
Codecov Report
@@ Coverage Diff @@
## develop #6501 +/- ##
=============================================
+ Coverage 75.83% 76.26% +0.43%
Complexity 6060 6060
=============================================
Files 190 240 +50
Lines 18219 19001 +782
=============================================
+ Hits 13817 14492 +675
- Misses 4402 4509 +107
Flags with carried forward coverage won't be shown. Click here to find out more.
|
That's strange. I don't seem to be getting the E2E error locally. I think this may be some kind of hazard where the Puppeteer doesn't wait for a specific selector before assessing its existence. |
Summary
Fixes #5578
This PR removes the Mobile redirection toggle from the Onboarding Wizard and adds it to a new "Other" section on the AMP Settings page. The "Other" section also contains a Dev Tools toggle:
Checklist