Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Address several tree-view element issues #6572

Merged
merged 1 commit into from Jan 21, 2022

Conversation

hippee-lee
Copy link
Contributor

This change handles several isses that were encountered when triaging
usage of the cds-tree-item with angular's *ngIf structural directive.

  1. This change adds registration of for the new cds-button-expand
    element used in the temlate.
  2. This change adds a code comment to further describe both the
    automatic and manual use cases for expandable
  3. THis change adds a dynamic demo that demonstrates how to use the
    expandable with complex trees
  4. This change adds a test in the tree-item spec to make sure the button
    is in the DOM when a cds-tree-item element is expandable.

Signed-off-by: Matt Hippely mhippely@vmware.com

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • If applicable, have a visual design approval

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • clarity.design website / infrastructure changes
  • Other... Please describe:

As described above this adds a demo for conditional DOM on cds-tree-item elements. (think *ngIf for Angular apps). It also adds some context for the expandable property as it has an automatic and a manual use case. Finally, It adds a test into the spec to make sure the button is in the DOM when an element is 'expandable'.

What is the current behavior?

Missing register for cds-button-expand, no dev notes for the manual use case of the expandable property and there is no test to make sure the expand button is in the DOM when a cds-tree-item is expandable.
Issue Number: N/A

What is the new behavior?

Added register code, added dev context to the expandable property, added a spec for the expandable property. Finally, it adds a demo for conditional cds-tree-items in a complex tree.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@hippee-lee hippee-lee self-assigned this Jan 13, 2022
@@ -379,6 +383,78 @@ export const interactive = () => {
`;
};

export function conditionalItems() {
@customElement('demo-conditional-tree')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Complex tree demo for conditional DOM.

Copy link
Contributor

@bbogdanov bbogdanov left a comment

Choose a reason for hiding this comment

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

Awesome!

packages/core/src/tree-view/utils.ts Outdated Show resolved Hide resolved
packages/core/src/tree-view/tree.stories.ts Outdated Show resolved Hide resolved
This change handles several isses that were encountered when triaging
usage of the cds-tree-item with angular's *ngIf structural directive.

1. This change adds registration of for the new cds-button-expand
   element used in the temlate.
2. This change adds a code comment to further describe both the
   automatic and manual use cases for `expandable`
3. THis change adds a dynamic demo that demonstrates how to use the
   expandable with complex trees
4. This change adds a test in the tree-item spec to make sure the button
   is in the DOM when a cds-tree-item element is `expandable`.

Signed-off-by: Matt Hippely <mhippely@vmware.com>
@hippee-lee hippee-lee merged commit 2d5d1b2 into vmware-archive:next Jan 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants