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

feat: Add shared objects to embed-widget #2189

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jnumainville
Copy link
Contributor

Requires deephaven/deephaven-core#5854

Adds ability to fetch shared objects with embed-widget.
name takes the shared ticket, then shared specifies the type of shared object that needs to be fetched, which is required for getSharedObject.

Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

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

Need to clean up a few things.

Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

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

Need to clean up a few things.

);

const isLoaded =
(definition != null || sharedObject != null) && error == null;
const isLoading = definition == null && sharedObject == null && error == null;
(definition != null || sharedReady != false) && error == null;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
(definition != null || sharedReady != false) && error == null;
(definition != null || sharedReady) && error == null;

(definition != null || sharedObject != null) && error == null;
const isLoading = definition == null && sharedObject == null && error == null;
(definition != null || sharedReady != false) && error == null;
const isLoading = definition == null && sharedReady == false && error == null;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const isLoading = definition == null && sharedReady == false && error == null;
const isLoading = definition == null && !sharedReady && error == null;

Comment on lines +169 to +180
type ConnectionWithGetSharedObject = dh.IdeConnection & {
getSharedObject(name: string, type: string): Promise<unknown>;
};

function isConnectionWithGetSharedObject(
connection: dh.IdeConnection
): connection is ConnectionWithGetSharedObject {
return (
'getSharedObject' in connection &&
typeof connection.getSharedObject === 'function'
);
}
Copy link
Member

Choose a reason for hiding this comment

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

Move the type definition and typePredicate outside of/above this functional component.

}
throw new Error(
'Connection does not have getSharedObject method. Cannot fetch shared object.'
);
}
if (definition != null) {
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 personally put the definition != null case first.

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