site-kit-wp
site-kit-wp copied to clipboard
UX Updates to User Input Questionnaire
Feature Description
User input questionnaire needs to be updated, following the new UX design updates which are bringing a bit of polishing to the existing component. Minor functionality updates are required given the removal of the "Review your answers" step.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- Existing user input questionnaire component is updated to match the figma design
- The final "Review your answers" step is removed, and current save logic attached thereto is transferred to the last answer screen where the "Complete setup" CTA will match the current save behaviour.
Implementation Brief
- [x] Update
assets/js/components/user-input/util/constants.js- Include new helper function
getUserInputAnswersDescription- Similarly how answers are mapped now in
getUserInputAnswers, do the same here, but map the descriptions, as shown in the figma - For now map this only for the
USER_INPUT_ANSWERS_PURPOSE, as this is the only group which includes descriptions for now.
- Similarly how answers are mapped now in
- Include new helper function
- [x] In
assets/js/components/user-input/UserInputQuestionnaire.js- include new
descriptionsprop to the component rendering site purpose answers https://github.com/google/site-kit-wp/blob/8a6a275c708b3f2efbdb7cd809ae0dc792351b6e/assets/js/components/user-input/UserInputQuestionnaire.js#L169 and pass value retrieved fromgetUserInputAnswersDescription - In new design the left panel that renders
UserInputQuestionInfo, will now render static text for all questions. RemovetitleandquestionNumberprops fromUserInputQuestionWrappercomponent, and use staticdescriptionfrom figma for all occurrences of this component.- Usage of
titleandquestionNumberinUserInputQuestionInfoshould be removed, as they won't be needed any more
- Usage of
- include new
- [x] Update
assets/js/components/user-input/UserInputSelectOptions.js- Include new prop
descriptions - Extract the proper description based on the
optionSlugand pass it asdescriptionprop to existing item component https://github.com/google/site-kit-wp/blob/8a6a275c708b3f2efbdb7cd809ae0dc792351b6e/assets/js/components/user-input/UserInputSelectOptions.js#L169
- Include new prop
- [x] In
assets/js/components/user-input/UserInputQuestionWrapper.jsremove usage oftitleand renderUserInputQuestionInfounconditionally and removetitleprop fromUserInputQuestionInfo - [x] in
assets/js/components/user-input/UserInputQuestionInfo.js- Remove
titleandgooglesitekit-user-input__question-numbermarkup andquestionNumber, and move it to theassets/js/components/user-input/UserInputApp.js
- Remove
- [x] In
assets/js/components/user-input/UserInputApp.js- Move the question number to the above the
PageHeader - Implement the question number count using the
CORE_FORMSdatastore, by retrieving the data and storing in sayFORM_USER_INPUT_QUESTION_NUMBER - Remove subtitle
- Move the question number to the above the
- [x] In
assets/js/components/user-input/UserInputQuestionnaire.js- Update
nextCallbackandbackCallbackto store the currently active step (numerical step, not the slug) inFORM_USER_INPUT_QUESTION_NUMBER - Adjust the
ProgressBarcomponent to match the new look in the design
- Update
- [x] Update the styles in
assets/sass/components/user-input/googlesitekit-user-input-questions.scssto apply any needed changes- Have in mind that footer should be sticky at the bottom and takes full screen width
Remove the "Review your answers" step
- [x] Update
assets/js/components/user-input/UserInputQuestionWrapper.jsadd a new prop,complete, when passed the copy of the field should be "Complete setup" by rendering a new block, using aSpinnerButtoninstead of a standardButton: https://github.com/google/site-kit-wp/blob/db3699f1b5503195665a0e84a976d621bd44f3c7/assets/js/components/user-input/UserInputQuestionWrapper.js#L81-L89- This button should be disabled and show a spinner while answers are being saved by using the
isSavingUserInputSettingsandisNavigatingselectors, passing the resulting boolean todisabledandisSavingprop on the new spinner button.
- This button should be disabled and show a spinner while answers are being saved by using the
- [x] Update
assets/js/components/user-input/UserInputQuestionnaire.js:- Move the
onSaveClickfunction fromassets/js/components/user-input/UserInputPreview.jsinto this component. - Replace the
nextCallbackuse in the finalUserInputSelectOptionsto callonSaveClickinstead and use thecompleteprop instead of thenextprop in theUserInputQuestionWrappercomponent. https://github.com/google/site-kit-wp/blob/db3699f1b5503195665a0e84a976d621bd44f3c7/assets/js/components/user-input/UserInputQuestionnaire.js#L227-L238
- Move the
- [x] Refactor the
ErrorNoticefor any change submission errors to show in a fixed position banner. https://github.com/google/site-kit-wp/blob/db3699f1b5503195665a0e84a976d621bd44f3c7/assets/js/components/user-input/UserInputPreview.js#L181 - [ ] Remove the now unused
assets/js/components/user-input/UserInputPreview.jscomponent. - [x] Remove all uses and references to the
previewslug panel in this app.
Test Coverage
- Update any failing VRT
- Take special note of the changes to the user input questionnaire regarding removal of the "Review your answers" step.
- Update any failing test
QA Brief
- Check the updated designs for the User Input Questionnaire in storybook confirming it matches the Figma designs.
- Test the User Input Questionnaire by going to Settings -> Admin Settings -> Personalize your metrics (in the Key Metrics panel).
- To test the error banner you can run the following code in the developer console:
googlesitekit.data.dispatch('core/user').receiveError( { code: 'test_code', message: 'Test error message', data: { reason: '', }, }, 'saveUserInputSettings', [] ) - Confirm there are no regressions in the Key Metrics section and editing the user input questions in the settings after setup.
Changelog entry
AC ✔️
@zutigrm IB ✅ moving to EB
@zutigrm comment for your attention here, should I split the "Sell products or services" into the two new categories that are now in Figma?
Without doing this the copy for the description for this combined option will need to be created.
Based on call 7 October 2024, it would be best to stick to the combined question "Sell products or services" we use now if possible.
In this case I need new approved copy for that answer.
CC @sigal-teller @10upsimon @zutigrm
@benbowler following a sync with @sigal-teller , the decision to remove the final "Review answers" screen was made a while back in response to a UXR study. I am going to update AC, and upon approval, the IB as well.
QA Update ❌
- Tested on dev environment.
- Verified and compared Storybook Story with Figma.
- Verified complete user input flow and KMW functionality for regression.
- Verified user input flow admin settings.
- Verified user input flow settings for multiple admins.
- Verified main, view only and secondary admin dashboard and settings.
@benbowler
Issue 1 : Padding between radio button and content is not same as figma.
Figma -
Storybook
Issue 2 : The story is displaying "The question is answered by: Admin name" for the wrong question. It should show this text for the first question instead of the third.
PASS CASES
Error state
Hey @mohitwp, I've created a follow up to update the gap between the radio and content and fixed the stories to correctly show the multi admin case.
QA Update ✅
- Padding between radio button and content is same as figma.
- The story is no longer displaying "The question is answered by: Admin name" for the wrong question. It showed this text for the first question instead of the third.