-
Notifications
You must be signed in to change notification settings - Fork 22
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 contact information section and its edit subpage to the settings page #921
Add contact information section and its edit subpage to the settings page #921
Conversation
One note - we tweaked the wording on the message here: So it should say We took out the phrase about "owner of the business" because that could be confusing - it's not necessarily the owner who is setting up the integration or managing it. |
One more thing - link to documentation / all the "Read more" links should go here: https://docs.woocommerce.com/document/google-listings-and-ads/#contact-information Thank you @eason9487 ! |
Address #921 (comment)
05e45fc
to
2eca6d2
Compare
36ca377
to
53f1e64
Compare
<PhoneNumberCard | ||
isPreview | ||
initEditing={ false } | ||
onEditClick={ handleEditClick } | ||
/> |
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.
Dev note: follow the change of #917 (comment) to pass phone
as phoneNumber
prop before merging this PR.
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.
Added by 34e6f62.
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.
Tested as per test instructions, seems to be working good. Left one ❓ comment on external link and track event, and a few ❔ 💅 comments.
Think you would be able to handle the ❓ comment, approving this now as there isn't any real blocking issues.
getHistory().push( getEditContactInformationUrl() ); | ||
}; | ||
|
||
let sectionContent; |
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.
💅 Perhaps we can set a default sectionContent
(the one with AppSpinner
), then we don't need the else
block in Line 61-67.
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.
Changed by 3dbc1fa.
<Section.Card> | ||
<AppSpinner /> | ||
</Section.Card> |
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.
❔ Would the SpinnerCard
component be good here?
<Section.Card> | |
<AppSpinner /> | |
</Section.Card> | |
<SpinnerCard /> |
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.
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.
Just recalled that the <Section.Card> <AppSpinner /> </Section.Card>
was taken for aligning the height of all loading cards on the settings page.
But <SpinnerCard>
looks better, to make all loading UIs consistency in the Setting page, I adjusted the spinner in the DisconnectAccounts as well - ffba448
<SpinnerCard /> | ||
<SpinnerCard /> |
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.
Just a note: at first it looks weird to have two SpinnerCard
s like this, but after digging into the source code, I came to understand they correspond to the PhoneNumberCard
and StoreAddressCard
in Line 106-110.
/> | ||
<div className="gla-settings"> | ||
<ContactInformation | ||
view="settings" |
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.
❔ The value "settings"
is not really being used in this PR. I'm guessing it is used in the other PRs? 🤔
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.
Even though the value "settings"
is not be used, I thought it still good to indicate the view
prop because I think none of "settings"
and "setup-mc"
should be the default value. And I was planning to add JSDos for ContactInformation like this:
/**
* @param {Object} props React props.
* @param {'setup-mc'|'settings'} props.view
*/
<AppButton | ||
isTertiary | ||
target="_blank" | ||
href={ learnMoreUrl } | ||
> | ||
{ __( 'Learn more', 'google-listings-and-ads' ) } | ||
</AppButton> |
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 think we should do track event for this "Learn more" button here. Either we use AppButton
with eventName
and eventProps
, or AppDocumentationLink
(which I think is better in semantic, but I guess you would need to mingle with CSS layout a little).
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 reminding. Added by bf236cb.
Address #921 (comment) Co-authored-by: Gan Eng Chin <ecgan@users.noreply.github.com>
…g UIs consistency in the Setting page Address #921 (comment)
Changes proposed in this Pull Request:
Partial of #863 and based on #918
💡 Please note that this PR doesn't include the API integration.
Screenshots:
🎥 . When the phone number got from Google MC is empty
Kapture.2021-07-30.at.15.46.09.mp4
🎥 . When the phone number got from Google MC has already exist
Kapture.2021-07-30.at.15.48.10.mp4
Detailed test instructions:
For easier testing, there is a mock phone number that is 50% chance for an empty phone number and 50% for an existed phone number when every time reload the page.
google-listings-and-ads/js/src/data/selectors.js
Lines 71 to 78 in 4f5eb4e
PhoneNumberCard
andContactInformation
components for contact info #917 and ImplementStoreAddressCard
component for contact info #918 if want to test them further.Changelog entry