Skip to content

Add settings toggle for “Enable Sign in with Google for user comments” to setup when open user registration is enabled AND user registration is required to leave a comment #11476

@tofumatt

Description

@tofumatt

Feature Description

Similar to #11469, a toggle for the "Show next to comments" setting should appear in setup when open user registration is enabled.

Originally the plan was also to require comments requiring user registration to use this setting, but it's probably enough to have open registrations on to show this setting. It should look similar to the "Enable one-tap" option in setup shown here:

Image

(The screenshots above serve as rough mock-ups only, the actual text will go below.)

The toggle, when shown, should be checked by default.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • When open user registration is enabled, the "Show next to comments" toggle should be shown (and checked by default) in Sign in with Google setup.
  • It should use the same text/component as the "Show next to comments" toggle in settings, but it should not send any tracking events when initially enabled, because the user isn't manually enabling the toggle.

Implementation Brief

  • Update assets/js/modules/sign-in-with-google/components/setup/SetupForm.js
    • Within existing condition checking for anyoneCanRegister - render ShowNextToCommentsToggle component after OneTapToggle
    • Add useMount hook:
      • If anyoneCanRegister is enabled, dispatch setShowNextToCommentsEnabled action from SiWG datastore with true as an argument

Test Coverage

  • Add new jest coverage for assets/js/modules/sign-in-with-google/components/setup/SetupMain.js, which doesn't have tests currently. Include only tests to verify that OneTapToggle and ShowNextToCommentsToggle are shown/hidden when anyoneCanRegister is enabled/disabled

QA Brief

  • Toggle the value of "Anyone can register" in the General WordPress settings.
  • When enabled:
    • Both, the One Tap and Show comments toggles should show on the set up form for SiwG module, and should be checked by default
    • The toggle values set on the setup form should be correctly saved once the module is set up
  • When disabled:
    • The toggles should not show

Changelog entry

  • Add the "Show next to comments" toggle to the Sign in with Google setup form.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Module: Sign in with GoogleSign in with Google (SiwG) related issues.P1Medium priorityTeam SIssues for Squad 1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions