-
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
Update AppSelectControl
when only one account is available
#2593
Comments
AdsAccountSelectControl
for reuseMerchantCenterSelectControl
and AdsAccountSelectControl
to use AppSelectorTextControl
@eason9487 and @asvinb I've stubbed this out as a follow up to #2592. Would appreciate your thoughts. |
They were more consistent in their initial implementation. I don't recall any particular reason for this. They should have just been changed individually as per the later requirements. See: |
MerchantCenterSelectControl
and AdsAccountSelectControl
to use AppSelectorTextControl
AppSelectControl
when only one account is availalbe.
AppSelectControl
when only one account is availalbe.AppSelectControl
when only one account is available
@joemcgill I made a few updates to the PR. Can you kindly take a look please? |
AppSelectControl
when only one account is availableAppSelectControl
when only one account is available
Closing this as completed since it was part of the 2.9 release. |
Related to of #2509
To provide a consistent user experience in all places where a user might be selecting a Google account to connect from a list of existing accounts, we'll update
AppSelectControl
that is used in bothMerchantCenterSelectControl
andAdsAccountSelectControl
so that any time there is only one account to select from, that account will immediately shown and the select/dropdown UI will be hidden.Screenshot:
Acceptance Criteria
MerchantCenterSelectControl
orAdsAccountSelectControl
components are rendered with only one account, no dropdown icon is shown and the account is automatically selected.MerchantCenterSelectControl
orAdsAccountSelectControl
components are rendered with more than one account, the currentSelectControl
behavior is retained (i.e., users can select the account from a dropdown, and if a value is already set, that value will be selected).Implementation Brief
Per this suggestion, The current
AppSelectControl
component should be updated to be able to show a simplified UI whenever there is only one account to connect. The simplified UI should be controllable by a newselectSingleValue
prop that defaults tofalse
.The
MerchantCenterSelectControl
andAdsAccountSelectControl
components will both be updated to passselectSingleValue:true
.The
AdsAccountSelectControl
is currently located in/js/src/components/google-ads-account-card/connect-ads/ads-account-select-control.js
, as part of theGoogleAdsAccountCard
component. Since this will be reused, it should be moved tojs/src/components
to be consistent with the location of theMerchantCenterSelectControl
.A nice to have would be to make these two controls consistent in that if no accounts are passed to the
AdsAccountSelectControl
component, then it will make use of theuseExistingGoogleAdsAccounts()
hook to automatically populate the dropdown, similar to the wayMerchantCenterSelectControl
handles this here, as this consistency should make reusing this control in the newGoogleComboAccountsCard
component easier to implement.Test Coverage
Definition Questions
Is there a reason that the logic between
MerchantCenterSelectControl
andAdsAccountSelectControl
is not consistent? For example, the MC version handles fetching the existing MC accounts, sorting and setting the initial value (ref) while the Ads version requires the account fetching logic to happen by the consuming component.The text was updated successfully, but these errors were encountered: