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

fix: Use ObjectFetcher to retrieve objects #234

Merged
merged 7 commits into from
Feb 5, 2024

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Jan 29, 2024

@mofojed mofojed requested a review from mattrunyon January 29, 2024 20:03
@mofojed mofojed self-assigned this Jan 29, 2024
plugins/ui/src/js/src/DashboardPlugin.tsx Show resolved Hide resolved
plugins/ui/src/js/src/DashboardPlugin.tsx Outdated Show resolved Hide resolved
plugins/ui/src/js/src/DashboardPlugin.tsx Outdated Show resolved Hide resolved
- In Enterprise environment, there may be multiple connections. We should not be accessing the connection directly from the plugin for fetching objects, instead use the ObjectFetcher registered by the app
- Pass in the object metadata to fetch the object
- Use the Descriptor type instead of the raw Definition type
- update to use alpha version of web packages
@mofojed mofojed requested a review from mattrunyon February 5, 2024 15:33
@mofojed mofojed marked this pull request as ready for review February 5, 2024 15:33
@@ -31,20 +34,21 @@ interface DashboardPluginData {
type: string;
title: string;
id: string;
metadata: Record<string, unknown>;
widget: WidgetDescriptor;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this can just be VariableDescriptor from jsapi-types. In my generated jsapi types branch I just rebased and replaced WidgetDescriptor with VariableDescriptor. Unless you want them to stay separate. The definitions are the same except the jsapi types uses its | undefined | null for nullable instead of just | undefined

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea the only reason I kept them separate is the @deephaven/dashboard package has no dependencies on the JS API, and therefore cannot reference VariableDescriptor. And I think I'm alright with that - there's nothing saying we can't use dashboard with a different backend entirely... that being said, to smooth it out I'd probably argue that the WidgetDescriptor should require type and id, and then name should just be a friendly display name. Then the VariableDescriptor maps the id to the id or name field depending on the type of WidgetDescriptor (e.g. v: VariableDescriptor = { name: 'fiz', type: 'foo' } => w: WidgetDescriptor = { name: 'fiz', id: 'fiz', type: 'foo', variableType: 'name' }). Kludginess of having a VariableDescriptor defined and requires exactly one of id or name is already odd though and I didn't feel like adding another layer of indirection at this time made sense.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ya that's fair. I'll put it back in on my jsapi-types branch

plugins/ui/src/js/src/DashboardPlugin.tsx Outdated Show resolved Hide resolved
@mofojed mofojed requested a review from mattrunyon February 5, 2024 17:52
@mofojed mofojed merged commit 728be7b into deephaven:main Feb 5, 2024
11 checks passed
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