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

Introduce Site Review to the Onboarding Wizard #6596

Merged
merged 68 commits into from
Sep 29, 2021

Conversation

delawski
Copy link
Collaborator

@delawski delawski commented Sep 8, 2021

Summary

The main update this PR brings is adding a Site Review feature to the last step of the Onboarding Wizard:

Screenshot 2021-09-08 at 15 23 30

Along with the Site Review, a new panel has been added to the AMP Settings screen. It can be dismissed by a user (this gets stored in the user meta) and re-appears whenever a template mode is changed (after saving settings).

Screenshot 2021-09-08 at 15 24 33

Besides adding the Site Review feature, this PR updates some of the microcopy and styles in the Onboarding Wizard (which partially covers #4719).

Welcome Screen Technical Background Template Mode
Screenshot 2021-09-08 at 15 27 27 Screenshot 2021-09-08 at 15 27 33 Screenshot 2021-09-08 at 15 27 39

Note that the target branch for this PR is feature/5578-add-new-settings (#6501).

Fixes #6071

Checklist

  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@delawski delawski added this to the v2.2 milestone Sep 8, 2021
@delawski delawski self-assigned this Sep 8, 2021
@delawski delawski force-pushed the feature/6071-onboarding-site-review branch from 6bf38d4 to 0dce63a Compare September 8, 2021 13:58
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2021

Plugin builds for ce6c456 are ready 🛎️!

@delawski delawski requested a review from jwold September 8, 2021 17:49
@codecov
Copy link

codecov bot commented Sep 8, 2021

Codecov Report

Merging #6596 (308cd1f) into develop (73cfc46) will increase coverage by 0.07%.
The diff coverage is 98.82%.

❗ Current head 308cd1f differs from pull request most recent head 7f82ec9. Consider uploading reports for the commit 7f82ec9 to get more accurate results
Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #6596      +/-   ##
=============================================
+ Coverage      76.54%   76.61%   +0.07%     
- Complexity      6300     6313      +13     
=============================================
  Files            246      248       +2     
  Lines          19736    19796      +60     
=============================================
+ Hits           15107    15167      +60     
  Misses          4629     4629              
Flag Coverage Δ
javascript 79.06% <87.50%> (+0.10%) ⬆️
php 76.51% <100.00%> (+0.06%) ⬆️
unit 76.51% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
assets/src/components/amp-setting-toggle/index.js 100.00% <ø> (ø)
includes/amp-helper-functions.php 84.51% <ø> (ø)
src/AmpWpPlugin.php 100.00% <ø> (ø)
...g-wizard/components/navigation-context-provider.js 85.71% <75.00%> (ø)
assets/src/components/nav-menu/index.js 100.00% <100.00%> (ø)
includes/uninstall-functions.php 95.58% <100.00%> (+0.13%) ⬆️
src/Admin/OnboardingWizardSubmenuPage.php 84.76% <100.00%> (+0.92%) ⬆️
src/Admin/OptionsMenu.php 89.28% <100.00%> (+0.19%) ⬆️
src/Admin/UserRESTEndpointExtension.php 100.00% <100.00%> (ø)
src/Validation/ScannableURLProvider.php 97.29% <100.00%> (+0.20%) ⬆️

@delawski
Copy link
Collaborator Author

delawski commented Sep 13, 2021

(Note that this will get rebased once #6501 is approved and merged into develop.)

I've rebased and resolved conflicts already since this work is needed for the Site Scan feature (#4719).

@delawski delawski force-pushed the feature/6071-onboarding-site-review branch from 150976c to 418eeda Compare September 13, 2021 12:28
Base automatically changed from feature/5578-add-new-settings to develop September 13, 2021 19:37
Copy link
Collaborator

@jwold jwold left a comment

Choose a reason for hiding this comment

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

Looks great! Good work.

@delawski delawski force-pushed the feature/6071-onboarding-site-review branch from 418eeda to 2686f36 Compare September 15, 2021 07:20
@delawski delawski force-pushed the feature/6071-onboarding-site-review branch from b7af591 to ef7fed0 Compare September 22, 2021 11:34
The list of Onboarding Wizard pages can be dynamically changed depending on the theme mode. The actual pages list is memoized in the `adaptedPages` array. The `adaptedPages` list should be used as a source of truth (after all, the `activePageIndex` references the `adaptedPages` array).

In some cases the `activePageIndex` can get out of sync with the `adaptedPages` array. For instance, when viewing the last page and one of the previous pages gets removed the `activePageIndex` references a non-existent item.

With this commit, we're stop keeping active page index in the state and instead track current page itself. Based on the `currentPage` object and the `adaptedPages` array we can determine the `activePageIndex`. This eliminates a risk of referencing a non-existent array item.
@delawski
Copy link
Collaborator Author

@westonruter I've addressed your feedback. Unfortunately, there's (again) an issue with a failing E2E test. I can look into that in several hours (tomorrow morning).

@delawski
Copy link
Collaborator Author

Unfortunately, there's (again) an issue with a failing E2E test. I can look into that in several hours (tomorrow morning).

Argh! It passed on a second try.

src/Admin/UserRESTEndpointExtension.php Outdated Show resolved Hide resolved
src/Validation/ScannableURLProvider.php Outdated Show resolved Hide resolved
src/Admin/UserRESTEndpointExtension.php Outdated Show resolved Hide resolved
src/Validation/ScannableURLProvider.php Outdated Show resolved Hide resolved
src/Validation/ScannableURLProvider.php Outdated Show resolved Hide resolved
src/Admin/UserRESTEndpointExtension.php Outdated Show resolved Hide resolved
src/Admin/UserRESTEndpointExtension.php Show resolved Hide resolved
@delawski
Copy link
Collaborator Author

@westonruter I've addressed your feedback and also hopefully (I couldn't replicate the error locally) fixed that flaky E2E test.

Copy link
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

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

Great work!

@westonruter westonruter merged commit ed75d8b into develop Sep 29, 2021
@westonruter westonruter deleted the feature/6071-onboarding-site-review branch September 29, 2021 18:17
@delawski
Copy link
Collaborator Author

@westonruter Thanks for removing the redundant cap checks, improving the tests and pushing the PR through the finish line!

@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelogged Whether the issue/PR has been added to release notes. Site Scanning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Advise users to review site after enabling AMP to ensure working as expected
3 participants