-
Notifications
You must be signed in to change notification settings - Fork 293
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
Scaffold Thank with Google module setup flow logic for different scenarios #5455
Labels
Module: Thank with Google
Thank with Google module related issues
P0
High priority
Rollover
Issues which role over to the next sprint
Type: Enhancement
Improvement of an existing feature
Comments
felixarntz
added
P0
High priority
Type: Enhancement
Improvement of an existing feature
Module: Thank with Google
Thank with Google module related issues
labels
Jun 27, 2022
This was referenced Jul 8, 2022
IB ✅ |
@felixarntz @tofumatt @hussain-t Very minor naming suggestion for consistency: is there any reason we removed the |
Merged
18 tasks
QA update ✅
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Module: Thank with Google
Thank with Google module related issues
P0
High priority
Rollover
Issues which role over to the next sprint
Type: Enhancement
Improvement of an existing feature
The TwG module setup comes with a few different scenarios that a user can be in, depending on whether they already have a TwG publication and where it is in the approval process. Since the TwG API to provide that information is not yet available, this will initially be testable using an upcoming version of the Site Kit tester plugin.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
The Thank with Google
SetupMain
component should be prepared for the full TwG module setup and its different scenarios, without implementing the actual UI. Below are some details. For reference, see the Figma file, however keep in mind that the purpose of this issue is not at all to implement the UI, only to implement the logic.viewComponent
should be based on the following logic relying on thegetCurrentPublication()
selector from Implement publications selectors inmodules/thank-with-google
store #5454:modules/thank-with-google
storehasErrors()
, display the correspondingStoreErrorNotices
component.undefined
(i.e. loading), display aProgressBar
.null
(i.e. there is none), display a new componentSetupCreatePublication
.state
isACTION_REQUIRED
, display a new componentSetupPublicationActionRequired
.state
isPENDING_VERIFICATION
, display a new componentSetupPublicationPendingVerification
.state
isACTIVE
and the TwGpublicationID
setting is not already set to this publication, display a new componentSetupPublicationActive
.state
isACTIVE
and the TwGpublicationID
setting is set to this publication), display a new componentSetupCustomize
.SetupPublicationActive
component should in addition include a primary CTA button Customize Thank with Google at the bottom of the screen which on click sets the TwGpublicationID
setting to the publication ID of the current publication (i.e.getCurrentPublication().publicationId
field). Per the above logic, this will then trigger the UI to change to showSetupCustomize
.SetupCustomize
component should receive thefinishSetup
callback as a required prop and include a primary CTA button Configure Thank with Google at the bottom of the screen which on click submits the changes in themodules/thank-with-google
store and then calls thefinishSetup
callback. The button should be disabled if the store! canSubmitChanges
(similar to the existing TwGSetupForm
component has it).SetupForm
component should be deleted as it is no longer used.Modules > Thank with Google > Setup
.Implementation Brief
Create the following functional components in
assets/js/modules/thank-with-google/components/setup
directory:SetupCreatePublication
that renders -<div>TODO: UI to create publication - SetupCreatePublication</div>
SetupPublicationActionRequired
that renders -<div>TODO: UI for publication action required - SetupPublicationActionRequired</div>
SetupPublicationPendingVerification
that renders -<div>TODO: UI for publication pending verification - SetupPublicationPendingVerification</div>
SetupPublicationActive
with the following details:<div>TODO: UI for setup publication active - SetupPublicationActive</div>
Button
component with the translated copyCustomize Thank with Google
.useCallback
.getCurrentPublication().publicationId
by dispatching thesetPublicationID()
action ofmodules/thank-with-google
store.onClick
prop of theButton
component.SetupCustomize
with the following details:finishSetup
as a callback function.<div>TODO: UI for setup customize - SetupCustomize</div>
Button
component with the translated copyConfigure Thank with Google
.canSubmitChanges
selector of themodules/thank-with-google
store.handleSubmit
usinguseCallback
.submitChanges()
action of themodules/thank-with-google
store.finishSetup
callback function.handleSubmit
callback function to theonClick
prop of theButton
component.In
assets/js/modules/thank-with-google/components/setup/SetupMain.js
, theviewComponent
should be set based on the following logic:hasErrors()
selector ofmodules/thank-with-google
store.StoreErrorNotices
component toviewComponent
and pass themoduleSlug
andstoreName
as props.publicationID
from thegetPublicationID
selector ofmodules/thank-with-google
store.getCurrentPublication()
selector ofmodules/thank-with-google
store.undefined
i.e., not loaded yet, set theProgressBar
component toviewComponent
.null
(i.e. there is none), set theSetupCreatePublication
component toviewComponent
.ACTION_REQUIRED
, set theSetupPublicationActionRequired
component toviewComponent
.PENDING_VERIFICATION
, set theSetupPublicationPendingVerification
component toviewComponent
.ACTIVE
and thepublicationID
is not already set/available, set theSetupPublicationActive
component toviewComponent
.ACTIVE
and thepublicationID
is already set/available, set theSetupCustomize
component toviewComponent
.Remove
SetupForm
related filesassets/js/modules/thank-with-google/components/setup/SetupForm.js
.assets/js/modules/thank-with-google/components/setup/SetupForm.test.js
.assets/js/modules/thank-with-google/components/setup/SetupForm.stories.js
.Test Coverage
assets/js/modules/thank-with-google/components/setup/SetupMain.stories.js
.Modules > Thank with Google > Setup
.QA Brief
develop
the stories can be tested hereChangelog entry
The text was updated successfully, but these errors were encountered: