-
Notifications
You must be signed in to change notification settings - Fork 16
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: UI table respond to non-primitive prop changes #1046
Conversation
|
||
const log = Log.module('@deephaven/js-plugin-ui/UITable'); | ||
|
||
function useDeepEquals<T>(value: T): T { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth placing this in it's own file so it can be used in other code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I think this and the other hook would be good in @deephaven/react-hooks
, but I was being lazy and avoiding needing to merge to web-client-ui, publish, then consume here. I can do that though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add JS docs for this hook as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small cleanup
|
||
const log = Log.module('@deephaven/js-plugin-ui/UITable'); | ||
|
||
function useDeepEquals<T>(value: T): T { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add JS docs for this hook as well.
|
||
const alwaysFetchColumns = useMemo(() => { | ||
if (alwaysFetchColumnsArray[0] === true) { | ||
if (modelColumns.length > 500) { | ||
if (columns.length > 500) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: The 500 should be a constant, as it's used in the error message below.
setError( | ||
`Table has ${modelColumns.length} columns, which is too many to always fetch. ` + | ||
`Table has ${columns.length} columns, which is too many to always fetch. ` + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use the useThrowError
hook above here. Looks like you only used in useUITableModel even though it applies here as well.
ui docs preview (Available for 14 days) |
I addressed the review comments, but left them unresolved so they are easier to verify since this PR was stale for a while |
ui docs preview (Available for 14 days) |
ui docs preview (Available for 14 days) |
Fixes #982
Also fixes a bug I found while implementing this where adding a custom column in the UI would cause formatting rule
if_
clauses to be removed.