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 selection to the tree control #36435
Conversation
Test Results SummaryCommit SHA: 1ad730e
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
2a0480e
to
012d95e
Compare
e2268f7
to
ea7f37d
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## trunk #36435 +/- ##
========================================
Coverage 46.7% 46.7%
Complexity 17183 17183
========================================
Files 429 429
Lines 64799 64799
========================================
Hits 30251 30251
Misses 34548 34548
|
declare module '@wordpress/components' { | ||
declare namespace CheckboxControl { | ||
interface Props { | ||
indeterminate?: boolean; |
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.
Why was it necessary to add this?
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.
Because for @wordpress/components@19.8.5 there is not a TS definition for the prop indeterminate
. Also there is not such definition even in any version of @types/wordpress__components
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 testing well on my end! Code also looks good.
If anyone else wants to review it, I think it's a good idea, as I'm not that involved with this work.
*/ | ||
onSelect?( value: Item | Item[] ): void; | ||
/** | ||
* When `multipe` is true and a child item is unselected, all its |
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's a small typo here in multipe
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! done
.experimental-woocommerce-tree-item { | ||
margin: 0; | ||
|
||
&--highlighted { | ||
> .experimental-woocommerce-tree-item__heading { | ||
background-color: #f6f7f7; |
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.
If we ever implement dark mode I think we would have to go through all these "hard coded" values... But it's probably out of scope of 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.
Good catch, it's done now. Thanks
9185544
to
5795e0b
Compare
5795e0b
to
27ff71e
Compare
27ff71e
to
17b014c
Compare
…ed to the ResizeObserve feat
17b014c
to
1ad730e
Compare
Depends on #36590
All Submissions:
Changes proposed in this Pull Request:
Depends on #36476
Partialy closes #35851
How to test the changes in this Pull Request:
http://localhost:6007/?path=/story/woocommerce-admin-experimental-treecontrol--selection-single
for a single selection tree. Orhttp://localhost:6007/?path=/story/woocommerce-admin-experimental-treecontrol--selection-multiple
for a multiple selection tree.5.1. When selecting a leaf, all its ancestors should be selected also.
5.2 When selecting an item with children, the item and its children should be selected.
5.3 When selecting an item with parent and children, its parent and its children should be selected.
5.4 When unselecting a leaf, if it has selected siblings, then it becomes unselected and all its ancestors indeterminate.
5.5 When unselecting a leaf, if it has unselected siblings, then it becomes unselected and all its ancestors unselected.
5.6 When unselecting an item with children, all it children becomes unselected.
Other information:
pnpm --filter=<project> changelog add
?FOR PR REVIEWER ONLY: