-
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
2593: Update AppSelectControl to single select #2608
2593: Update AppSelectControl to single select #2608
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/2509-consolidate-google-account-cards #2608 +/- ##
=============================================================================
Coverage 62.7% 62.7%
=============================================================================
Files 319 319
Lines 5063 5071 +8
Branches 1233 1237 +4
=============================================================================
+ Hits 3173 3179 +6
- Misses 1716 1718 +2
Partials 174 174
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@joemcgill I have implemented the changes, but this needs a UX revisit due to the way the components are structured. The Label for the AppSelectControl is outside, and the options are only computed in the parent AdsAccountSelectControl, etc. The label will still say 'Select an existing account' even when we have preselected the option. cc @asvinb |
@dsawardekar @joemcgill In that case maybe we need to rename the label to what we have in the new designs which is more generic and it prompts the user to connect an account instead of selecting an account:
|
Thanks for flagging this @dsawardekar. When we use this control in the new |
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.
Small nitpick, but looks good.
After testing this PR, I think I misunderstood the concern. Since this sets Example: |
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 excellent work here. I have tested the functionality and it seems to be working fine. I have added few comments that needs to be addressed or may be needs to looked into.
className={ classNames( 'app-select-control', className, { | ||
'app-select-control--has-single-value': showSingleValue, | ||
} ) } |
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.
It's better to prefix the class names with gla
or g4w
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.
@ankitrox I see there are other parts where the app-
prefix it used. For e.g most of the js/src/components/app-*
components. Let's keep it as is.
Examples: https://github.com/search?q=repo%3Awoocommerce%2Fgoogle-listings-and-ads+.app-+language%3ASCSS&type=code&l=SCSS
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.
Please check this comment from Eason.
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 understand what you're saying @ankitrox , but if you look at the current codebase, there are components which have thegla-*
prefix class names and other specific components com which have the app-*
prefix. Clearly there is a reason to why this is so. In this particular case, we are editing an existing component which already uses the app-*
prefix, so I would be reluctant to change it. If you look at
Line 3 in 24044c5
width: $gla-width-medium; |
app-*
. @eason9487 Can you shed some light please, about why we have 2 different CSS prefix, i.e gla-*
and app-*
? Thanks!
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.
Early components often came with an app-
prefix, but that is unnecessary and can be omitted for new components as it becomes a bit verbose.
Regarding the CSS class naming, the main reason is to reduce the chance of CSS naming collisions. app-
has significantly higher generality, so gla-
or g4w-
would be more appropriate. The current app-
uses are almostly carry-over from earlier times, and newer code would be better to avoid using it as a prefix.
If it involves changing existing code, it is not necessary to modify it. However, if the change (scope) is minor, it would be appreciated if it could be adjusted in the meantime.
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 clarification @eason9487 . I think that helps a lot. For the scope of this ticket, I suggest we keep it as is. We can have a separate ticket to adjust the class 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.
@asvinb I have added only couple of comments, but you can decide whether to address those. I am approving this PR as other changes are looking fine to me.
Thanks
className={ classNames( 'app-select-control', className, { | ||
'app-select-control--has-single-value': showSingleValue, | ||
} ) } |
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.
Please check this comment from Eason.
…date-app-select-control-single-select
QA Status:
|
@ankitguptaindia I added a note in the "Technical decisions":
@joemcgill What do you think? It's mostly making the |
I think making these consistent sounds reasonable to me. So if none are already selected the first one in the list becomes the default, since that’s how the MC field already worked? |
Yes @joemcgill that's how the MC field works. @ankitguptaindia Can you confirm please? |
QA/Test Report- ✅Testing Environment -
Test Results - The PR is functioning as expected.
Functional Demo / Screencast - Googler.accounts.drop.down.876.mp4 |
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 work. Left a few comments about the possibility of simplifying code and improving consistency.
…ate/2593-update-app-select-control-single-select
Just noticed that this PR should be pointing at 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.
Found two new issues and it would be better to address them to avoid potential issues in the future.
7d31e5c
into
feature/2509-consolidate-google-account-cards
Changes proposed in this Pull Request:
This PR updates the AppSelectControl to show a single selection when only one choice is present.
Closes #2593
Screenshots:
Multi-select:
Single-select:
Detailed test instructions:
Technical decisions:
MerchantCenterSelectControl
, theSelect one
label has been removed fromAdsAccountSelectControl
: https://github.com/woocommerce/google-listings-and-ads/pull/2608/files#diff-3c83d48212438511a41629a8f6b02ac7666ca664d0c25a734497a1416856d115L17AdsAccountSelectControl
is set as the default value if none is provided (same behaviour asMerchantCenterSelectControl
).Connect to an existing account
Changelog entry