Skip to content

Conversation

@pjeanjean
Copy link
Contributor

Jira URL

https://jira.xwiki.org/browse/XWIKI-23826

Changes

Description

This PR includes changes to some Cristal APIs (that are currently still in beta) to prepare for the release 1.0:

  • Force location of NavigationTreeNode to a SpaceReference instance
  • Remove no longer used XNavigationTree and XNavigationTreeSelect components definitions
  • Extend TreeProps definition and turn XTree into a generic component

Clarifications

This PR is tied to xwiki-contrib/cristal#1493 and both should be merged at the same time.

Screenshots & Video

N/A

Executed Tests

The new API packages were built locally and used to test the linked Cristal PR.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • N/A

* Force location of NavigationTreeNode to a SpaceReference instance
* Remove no longer used XNavigationTree and XNavigationTreeSelect
  components definitions
* Extend TreeProps definition and turn XTree into a generic component
XTabPanel: DefineComponent<TabPanelProps & HTMLAttributes>;
XTextField: DefineComponent<TextFieldProps & ImgHTMLAttributes>;
XTree: DefineComponent<TreeProps & HTMLAttributes>;
XTree: DefineComponent<TreeProps<DisplayableTreeNode & any> & HTMLAttributes>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't TreeProps<DisplayableTreeNode & any> equivalent to TreeProps<any>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a slight difference: it enforces the existing properties of DisplayableTreeNode to be present (which makes sense in this case since TreeProps is a generic type that requires a subclass of DisplayableTreeNode)

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, maybe add a comment in the source to explain the logic as I might not be the only one to be confused by this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

* Add missing comment
* Re-export TreeNode to make DisplayableTreeNode importable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants