Skip to content

Conversation

@BobobUnicorn
Copy link
Collaborator

@BobobUnicorn BobobUnicorn commented Oct 31, 2022

Based on #25729. Followed by #26585.


childrenAccessor = (dataNode: NestedFoodNode) => timer(100).pipe(mapTo(dataNode.children ?? []));

dataSource = new ArrayDataSource(NESTED_DATA);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can be readonly?

export class CdkTreeNestedLevelAccessorExample {
levelAccessor = (dataNode: FlatFoodNode) => dataNode.level;

dataSource = new ArrayDataSource(FLAT_DATA);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can be readonly?

@BobobUnicorn BobobUnicorn force-pushed the cdk-tree-redesign-nested-translation branch 5 times, most recently from f471445 to e875ce5 Compare February 17, 2023 21:23
@BobobUnicorn BobobUnicorn force-pushed the cdk-tree-redesign-nested-translation branch 2 times, most recently from b379b80 to 7d0b6a2 Compare February 17, 2023 22:00
*
* This controls what selection of data the tree will render.
*/
// NB: we're unable to determine this ourselves; Angular's ContentChildren
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"NB"?

*/
// NB: we're unable to determine this ourselves; Angular's ContentChildren
// unfortunately does not pick up the necessary information.
@Input() nodeType?: 'flat' | 'nested';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary at the node level? I would think that this is only needed at the entire tree level

.pipe(takeUntil(this._onDestroy))
.subscribe(data => this.renderNodeChanges(data));
.pipe(
switchMap(data => this._convertChildren(data)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite follow what's going on with this conversation here

Comment on lines +688 to +691
// The only situations where we have to convert children types is when
// they're mismatched; i.e. if the tree is using a childrenAccessor and the
// nodes are flat, or if the tree is using a levelAccessor and the nodes are
// nested.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite follow how this situation would come about- I would think we would only want to support either flat or nested for the entire free instance

@BobobUnicorn BobobUnicorn force-pushed the cdk-tree-redesign-nested-translation branch from 7d0b6a2 to 19df7fb Compare March 13, 2023 19:21
@andrewseguin andrewseguin force-pushed the cdk-tree-revamp branch 2 times, most recently from 565eb38 to fbe321d Compare April 4, 2023 21:45
@BobobUnicorn BobobUnicorn force-pushed the cdk-tree-redesign-nested-translation branch from 19df7fb to 79d0b69 Compare April 5, 2023 18:26
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Apr 5, 2023
@BobobUnicorn BobobUnicorn force-pushed the cdk-tree-redesign-nested-translation branch from 79d0b69 to f0e4ca6 Compare April 11, 2023 16:50
@BobobUnicorn BobobUnicorn force-pushed the cdk-tree-redesign-nested-translation branch from f0e4ca6 to bdbd7dd Compare April 11, 2023 18:51
@BobobUnicorn BobobUnicorn deleted the cdk-tree-redesign-nested-translation branch April 13, 2023 20:48
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants