-
Notifications
You must be signed in to change notification settings - Fork 295
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
Add logic to trigger modal once user input questions have been updated #9439
Comments
@zutigrm AC LGTM, moving to IB |
@zutigrm, I think it would be better to add a new prop |
@eugene-manuilov makes sense, thanks. I updated IB to reflect this approach |
Thanks, IB ✔ |
Adding an update following internal sync and comms with @zutigrm: The logic needed to be tweaked as the current user input options are saved to the user input settings store, they're just not persisted. This affects the modal logic (specifically due to how we retrieve the user input values) as the old vs new would always be the same in this case. The solution was to introduce a temporary form and set the old/current site purpose. This value is in turn used in the modal to get the current values against the existing purpose slug stored in the temporary form store. The temporary form is reset on modal save so the logic can be repeated for future changes. |
Flagging further that additional logic needed to be introduced to the modal that resets the user input settings site purpose value to the prior purpose if the user dismisses the metric updates in the modal. |
QA Update ✅
|
Feature Description
Following the implementation of new modal in #9438 this issue should connect the trigger for that modal, once site purpose question is changed in the
Key metrics
admin settings. Once the save button is clicked, and answer was modified, modal should be triggeredDo not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Key metrics
admin settings and the save button is clicked, it should open the new modal implemented in the Implement a new modal component showing current vs new tailored suggestions #9438.conversionReporting
feature flag is enabledImplementation Brief
assets/js/components/user-input/UserInputPreviewGroup.js
onChange
submitChanges
callback, invokeonChange
prop if present within theif( ! response.error )
conditional checkassets/js/components/user-input/UserInputPreview.js
[isModalOpen, setIsModalOpen]
for example, with default value offalse
onChange
prop to thesite-kit-wp/assets/js/components/user-input/UserInputPreview.js
Lines 145 to 146 in 14f36cc
conversionReporting
feature flag is not enabled, otherwise set aisModalOpen
local state totrue
ConfirmSitePurposeChangeModal
component, wrapped withinPortal
component, so it is appended in the body outside the settings container.isModalOpen
value to thedialogActive
onClose
prop, use callback that resetsisModalOpen
tofalse
Test Coverage
QA Brief
Site Kit > Settings > Admin
.Key Metrics
settings group, edit the site purpose and change the value. ClickApply Changes
.Tailored metric suggestions
modal should display, showing current vs new metrics.Update metric selection
CTA should apply the changes, and the modal should reflect future changes made to the site purpose.Changelog entry
The text was updated successfully, but these errors were encountered: