Skip to content
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

refactor: Cleanup component mappings and utils (python side) #523

Merged
merged 9 commits into from
Jun 13, 2024

Conversation

bmingles
Copy link
Contributor

@bmingles bmingles commented Jun 6, 2024

This is the first of 2 PRs to simplify our DH UI component mappings since we no longer have the Spectrum dependency. This one addresses the python modules + minimal re-mapping in the JS to make it still work. The next one will cleanup the .js side more holistically.

  • Removed components/spectrum subfolder and moved component modules to parent
  • Moved types into a components/types folder
  • Minimal changes to SpectrumUtils to make mapping still work
  • Added a broadstrokes e2e test to prove all components render

resolves #425

@bmingles bmingles marked this pull request as draft June 6, 2024 13:43
SPECTRUM_ELEMENT_TYPE_PREFIX
)
name.startsWith(SPECTRUM_ELEMENT_TYPE_PREFIX) &&
name.substring(SPECTRUM_ELEMENT_TYPE_PREFIX.length) in
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this check since the components are no longer differentiated by .spectrum namespace. All of this code will get removed in next PR anyway.

@bmingles bmingles marked this pull request as ready for review June 6, 2024 14:36
@bmingles bmingles requested a review from mofojed June 6, 2024 14:36
@bmingles bmingles changed the title refactor: Cleanup component mappings and utils refactor: Cleanup component mappings and utils (python side) Jun 6, 2024


def spectrum_element(name: str, /, *children: Any, **props: Any) -> BaseElement:
def base_element(name: str, /, *children: Any, **props: Any) -> BaseElement:
Copy link
Member

Choose a reason for hiding this comment

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

I'd probably just call this component_element and then have this used by all the other components as well (action_group, action_menu, list_view, etc) that are defining the full type currently.


function RadioGroup({
onFocus: serializedOnFocus,
onBlur: serializedOnBlur,
orientation: orientationMaybeUppercase,
Copy link
Member

Choose a reason for hiding this comment

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

What are we doing this for? I think should be part of a separate PR if this is something we want to handle.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's for consistency with other components + docs where most of our string enumerations are uppercase. I just missed it on radio PR and slipped it in. Doesn't have to be in this PR

tests/app.d/ui_render_all.py Outdated Show resolved Hide resolved
@bmingles
Copy link
Contributor Author

I addressed review comments. Split out #536 to separate the RadioGroup orientation prop

@bmingles bmingles force-pushed the 425-cleanup-component-mappings branch from d4088a8 to a7ee2fe Compare June 10, 2024 16:04
@bmingles bmingles requested a review from mofojed June 10, 2024 16:04
@bmingles bmingles merged commit 195f334 into deephaven:main Jun 13, 2024
13 checks passed
@bmingles bmingles deleted the 425-cleanup-component-mappings branch June 13, 2024 16:20
mofojed added a commit to mofojed/deephaven-plugins that referenced this pull request Jun 13, 2024
mofojed added a commit that referenced this pull request Jun 13, 2024
- Need to revert some changes that require a newer version of
@deephaven/components so that we can publish a version for Enterprise V+
  - Will publish and then add these back to main
- **Revert "refactor: Cleanup component mappings and utils (python side)
(#523)"**
- **Revert "feat: Make RadioGroup orientation prop case insensitive
(#536)"**
- **Revert "feat: ui.checkbox, ui.button, ui.button_group, ui.radio,
ui.radio_group, ui.icon (#512)"**
- **Revert "chore: Update DH packages to ^0.81.1 jsapi-types to
^1.0.0-dev0.34.3 (#511)"**
- Tested with a V+ branch on Enterprise and v0.78 of `@deephaven`
packages
mofojed added a commit that referenced this pull request Jun 13, 2024
…78 (#550)" (#551)

- This reverts commit 27414e1.
- Adds back the following reverted changes:
- **Revert "refactor: Cleanup component mappings and utils (python side)
(#523)"**
- **Revert "feat: Make RadioGroup orientation prop case insensitive
(#536)"**
- **Revert "feat: ui.checkbox, ui.button, ui.button_group, ui.radio,
ui.radio_group, ui.icon (#512)"**
- **Revert "chore: Update DH packages to ^0.81.1 jsapi-types to
^1.0.0-dev0.34.3 (#511)"**
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.

Cleanup component mappings and utils
2 participants