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 "Create a new campaign" modal #37044
Conversation
…paigns-card' into feature/34903-multichannel-marketing-frontend/34909-create-campaign-modal Conflicts: plugins/woocommerce-admin/client/marketing/hooks/index.ts plugins/woocommerce-admin/client/marketing/overview-multichannel/Campaigns/Campaigns.tsx plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/RecommendedChannels.tsx plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/useChannels.ts
…909-marketing-create-campaign-modal Conflicts: plugins/woocommerce-admin/client/marketing/components/RecommendedChannelsList.tsx plugins/woocommerce-admin/client/marketing/overview-multichannel/Campaigns/Campaigns.scss plugins/woocommerce-admin/client/marketing/overview-multichannel/Campaigns/Campaigns.tsx plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/Channels.tsx plugins/woocommerce-admin/client/marketing/overview-multichannel/Channels/RecommendedChannels.tsx
…909-marketing-create-campaign-modal Conflicts: plugins/woocommerce-admin/client/marketing/data-multichannel/action-types.ts plugins/woocommerce-admin/client/marketing/data-multichannel/actions.ts plugins/woocommerce-admin/client/marketing/data-multichannel/resolvers.ts
The previous text "Create a new campaign" can be a bit confusing with the other text "Create new campaign" in the test.
The code is copied from the Channels component, but in CreateNewCampaignModal, we don't need to display the divider, so we can just remove the divider code.
This helps us save indentation and make the code few lines shorter.
@eason9487 , thanks for the thorough review, great eyes as always! 😀 👍 I have addressed your code review comments in this PR, this is ready for another round of review. 🙏 The following is about the 6 points mentioned in your code review summary in #37044 (review). Thanks so much for bringing them up!
I'll fix it in a separate PR. I'm thinking to check through the marketing code base to make sure this is handled correctly. We recently just fixed a similar issue #37083.
This is related to #37044 (comment). The problem is I don't see the issue that you are seeing. We can talk about it in that comment thread.
Agree. I actually thought of doing some changes with
I couldn't reproduce this, it works as expected for me. 🤔 See my demo video below. demo-pr-activate-channel-refetch.mp4
Good point! I guess I can make the
This should not be a problem with issue #34907 and its PR #37126, because the extension should only appear in one card, it shouldn't appear in both Channels card and Installed extensions card. |
Just realized it's because of different WP versions. See #37044 (comment) and #37044 (comment). Considering the latest WC still states it supports WP 5.9, I guess it would still need to add the second parameter to the |
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 for the updates.
The two remaining concerns are about the compatibility with WP 5.9:
- Add "Create a new campaign" modal #37044 (comment)
- Add "Create a new campaign" modal #37044 (comment)
About the remaining issues mentioned in the main content of this #37044 (review), I also think they could be addressed in separate PRs. 👍
In WP 5.9, if we throw error, there would be an uncaught promise, and it causes UI to break.
This is to make it work with WP 5.9. See #37044 (comment).
Got it. I have created a separate issue #37176 for this.
Created issue #37175.
Created issue #37177. @eason9487 , all the code review comments are addressed. This is ready for another round of review. 🙂 🙏 |
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 for the further adjustments! LGTM.
All Submissions:
Changes proposed in this Pull Request:
Closes #34909. Previous draft PR and discussions are in PR #36130.
This PR implements the "Create a new campaign" modal.
The implemented modal here is different from the figma designs in #34909. Specifically, there are no borders within the modal component. This is to be more consistent with the WordPress Modal component which no longer has border under the modal title since PR WordPress/gutenberg#40781.
The new campaign types data is loaded from
GET /marketing/campaign-types
API. The API is called when the Campaigns card is rendered, so that when users click on the "Create new campaign" button, the data is already there and no additional waiting is required.How to test the changes in this Pull Request:
Pre-conditions:
/wp-admin/admin.php?page=wc-settings&tab=advanced§ion=features
/wp-admin/admin.php?page=wc-admin&path=%2Fmarketing
Other information:
pnpm --filter=<project> changelog add
?FOR PR REVIEWER ONLY: