-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add/35300 ces feedback product mvp #35690
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
Conversation
Test Results SummaryCommit SHA: fac751e
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
be6f3fc to
3952fbc
Compare
9e77e69 to
348e00c
Compare
| ( getOption( ADMIN_INSTALL_TIMESTAMP_OPTION_NAME ) as number ) || 0; | ||
|
|
||
| const resolving = | ||
| adminInstallTimestamp === null || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is adminInstallTimestamp ever null? Just curious since you're casting it as a number TS style just above.
joelclimbsthings
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @louwie17 ! Love centralizing some of this logic in the data store. Could we also implement that approach in the completed-header component?
I left a few minor comments, and a couple regarding needing to update some of the CES data to support the additional question changes merged earlier after a rebase.
|
|
||
| const resolving = | ||
| adminInstallTimestamp === null || | ||
| isResolving( 'getOption', [ ADMIN_INSTALL_TIMESTAMP_OPTION_NAME ] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to think hasFinishedResolution is more reliable than isResolving here, since isResolving will briefly be false initially, but perhaps it's working well enough in this context?
|
|
||
| return ( | ||
| <CustomerFeedbackModal | ||
| label={ visibleCESModalData.label } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you rebase on trunk this will need to be updated to include title instead of label, as well as firstQuestion and secondQuestion.
|
|
||
| const recordScore = ( score: number, comments: string ) => { | ||
| recordEvent( 'ces_feedback', { | ||
| action: visibleCESModalData.action, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also need to be updated to include the score for both questions, and score_combined.
| ), | ||
| visibleCESModalData.onSubmitNoticeProps || {} | ||
| ); | ||
| hideCesModal(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicky, but it feels like the hideCesModal() call shouldn't reside in the recordScore() function since it's not part of recording the score. Could throw it into an arrow function under the recordScoreCallback prop below.
| cesModalData: undefined, | ||
| }; | ||
| case TYPES.SHOW_CES_MODAL: | ||
| const cesModalData = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This as well as the other data store calls will need to be updated as outlined in other comments.
3952fbc to
4b5869f
Compare
| * @param {Object} props object for optional props | ||
| * @param {Object} onSubmitNoticeProps object for on submit notice props. | ||
| */ | ||
| export function showCesModal( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this function is accepting a number of arguments, some of which could be undefined, perhaps we should have this accept an object with optional properties instead?
export function showCesModal( {
action,
label,
onsubmitLabel = undefined,
props = {},
onSubmitNoticeProps = {}
} ) {
return {ccfe5fd to
e44dc68
Compare
|
Thanks for the review @joelclimbsthings, I believe I have addressed all your suggestions.
Yeah we certainly could, but I think it be a bit out of scope for this PR, I could certainly create a separate PR though once this is merged. |
joelclimbsthings
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @louwie17 , it's working well! ![]()
All Submissions:
Changes proposed in this Pull Request:
Hook in the CES modal to the share feedback button in the new product MVP
Closes #35300 .
How to test the changes in this Pull Request:
new-product-management-experiencefeature flag enabled (you can do so using the latest version of the Beta tester within the mono repo).ces_feedbacktrack with thenew_productaction.woocommerce_ces_product_mvp_ces_actionoption is removedOther information:
pnpm --filter=<project> changelog add?FOR PR REVIEWER ONLY: