-
Notifications
You must be signed in to change notification settings - Fork 21
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
Sync MC address during account connection #2602
Comments
@joemcgill While working on the IB, I tested the "Refresh to sync" function. My understanding is that if the address in WC is different from MC, then the "Refresh to sync" button will update the MC address with the WC address. However when I was testing, this does not seem to work. The city is: Rose Hill The city is: Curepipe When I click on the refresh button, an API request is sent to Sep-16-2024.15-21-43.mp4When I query the data store, the address are still different (after clicking the refresh button): Let me know if am missing anything. Thanks! |
Thanks for flagging the concern, @asvinb. If syncing is indeed not working, we could file a bug report and that could be worked on in advance of this feature. For now, I've moved this back to definition while the design approach is being finalized. |
@asvinb rather than having this be part of the Card body added in #2597, the new designs have this being displayed as an additional Card body beneath the expanded cards for Ads and MC. Given that, I think we could do this before #2579 is completed since we're creating an MC account in #2567 and may need to sync the address for the new account. What do you think? |
I think that works @joemcgill . I've updated the IB to reflect that. |
@eason9487 I was able to validate the issue that @asvinb shared here: #2602 (comment) It looks to me that the "Refresh to sync" button in the To sync the address with MC, it seems that we should be calling the As a quick experiment, I've applied this diff locally and it seems to work, but can likely be improved: diff --git a/js/src/components/contact-information/store-address-card.js b/js/src/components/contact-information/store-address-card.js
index 482603b4c..ba2488d26 100644
--- a/js/src/components/contact-information/store-address-card.js
+++ b/js/src/components/contact-information/store-address-card.js
@@ -19,6 +19,7 @@ import AppButton from '.~/components/app-button';
import ValidationErrors from '.~/components/validation-errors';
import ContactInformationPreviewCard from './contact-information-preview-card';
import TrackableLink from '.~/components/trackable-link';
+import { useAppDispatch } from '.~/data';
import mapStoreAddressErrors from './mapStoreAddressErrors';
import { recordGlaEvent } from '.~/utils/tracks';
import './store-address-card.scss';
@@ -54,7 +55,8 @@ import './store-address-card.scss';
* @return {JSX.Element} Filled AccountCard component.
*/
const StoreAddressCard = ( { showValidation = false } ) => {
- const { loaded, data, refetch } = useStoreAddress();
+ const { loaded, data } = useStoreAddress();
+ const { updateGoogleMCContactInformation } = useAppDispatch();
const path = getPath();
const { subpath } = getQuery();
@@ -66,7 +68,7 @@ const StoreAddressCard = ( { showValidation = false } ) => {
}
const handleRefreshClick = () => {
- refetch();
+ updateGoogleMCContactInformation();
refetchedCallbackRef.current = ( storeAddress ) => {
const eventProps = {
Is there a reason that I'm not aware of why the button wasn't already using the |
Hi @joemcgill
I don't remember the reason, and I can't find the relevant discussion for a while. But I'm sure it's not a bug. The current implementation was based on the design at that time.
It could be handled in the same way as google-listings-and-ads/js/src/settings/edit-store-address.js Lines 45 to 53 in 0383264
|
I've just updated the description of this issue to communicate that one aspect of the designs are currently known to be incorrect. Warning The screenshot for this design is incorrect. The refresh button and text will be shown when we DO have a valid address, otherwise no button will be shown and the merchant will be directed to update their address in the WooCommerce settings. The Figma was never updated, but we'll fix it during the implementation by moving the Refresh button and text to the case where we DO have an adddress. |
I've updated the acceptance criteria for the settings screen after confirming the approach from this discussion. |
Part of #2509
As a follow-up to #2493, the requirement to validate a phone number is possibly going away, in which case, we can consider moving the process of syncing the store's address with the MC account to the
GoogleComboAccountCard
when the account is first connected, if we see that there is no address associated with the MC account or if it differs from the store's address.Screenshots:
Warning
Screenshots are out of date with the most recent change to the acceptance criteria
Acceptance Criteria (updated 11/5)
Onboarding
GoogleComboAccountsCard
.Settings screen
StoreAddressCardPreview
component with the "Edit" button to open the edit flow.Implementation Brief
SyncStoreAddress
component injs/src/components/google-combo-account-card/sync-store-address/index.js
to render theStoreAddressCard
component based on the following conditions:useGoogleMCAccount
hook and checking thestatus
useStoreAddress
hook to determine if the address needs to be synced.mc_address
should not be null.is_mc_address_different
istrue
which means the address needs to be synced.StoreAddressCard
component so that thehandleRefreshClick
callback uses theupdateGoogleMCContactInformation
hook, as demonstrated in [this comment] (Sync MC address during account connection #2602 (comment)) and this followup.GoogleComboAccountsCard
to includeSyncStoreAddress
as part of the card body.GoogleComboAccountsCard
should be disabled until the address has been synced, by using the above hooks.Test Coverage
The text was updated successfully, but these errors were encountered: