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
dashboard-core-plugins typescript conversion #693
Conversation
@@ -46,6 +47,7 @@ | |||
"@fortawesome/react-fontawesome": "^0.1.18", | |||
"classnames": "^2.3.1", | |||
"deep-equal": "^2.0.5", | |||
"jszip": "^3.10.0", |
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.
As mentioned in another comment, we should be pinned to 3.2.2
for jszip
.
| ContextAction[] | ||
| (() => ContextAction[]) | ||
| (() => Promise<ContextAction[]>); | ||
actions: ResolvableContextAction[]; |
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.
Should be ResolvableContextAction | ResolvableContextAction[]
Codecov Report
@@ Coverage Diff @@
## main #693 +/- ##
==========================================
- Coverage 35.93% 35.75% -0.18%
==========================================
Files 399 400 +1
Lines 30093 30189 +96
Branches 7326 7389 +63
==========================================
- Hits 10814 10795 -19
- Misses 19179 19303 +124
+ Partials 100 91 -9
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
packages/dashboard-core-plugins/src/controls/markdown/MarkdownEditor.tsx
Show resolved
Hide resolved
packages/dashboard-core-plugins/src/panels/DropdownFilterPanel.tsx
Outdated
Show resolved
Hide resolved
packages/dashboard-core-plugins/src/panels/DropdownFilterPanel.tsx
Outdated
Show resolved
Hide resolved
packages/dashboard-core-plugins/src/panels/DropdownFilterPanel.tsx
Outdated
Show resolved
Hide resolved
packages/dashboard-core-plugins/src/panels/DropdownFilterPanel.tsx
Outdated
Show resolved
Hide resolved
packages/dashboard-core-plugins/src/panels/DropdownFilterPanel.tsx
Outdated
Show resolved
Hide resolved
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.
There's still a few test files that are still in jsx
format - was there difficulty in converting these?
packages/dashboard-core-plugins/src/redux/actions.js (should be deleted, .ts file already exists)
packages/dashboard-core-plugins/src/redux/selectors.js
packages/dashboard-core-plugins/src/panels/Panel.test.jsx
packages/dashboard-core-plugins/src/panels/IrisGridPanel.test.jsx
packages/dashboard-core-plugins/src/panels/PanelContextMenu.test.jsx
packages/dashboard-core-plugins/src/panels/ConsolePanel.test.jsx
packages/dashboard-core-plugins/src/panels/MarkdownPanel.test.jsx
import { PanelComponent } from '@deephaven/dashboard'; | ||
import { LinkColumn } from '../linker/LinkerUtils'; | ||
|
||
export type ColumnSelectionValidator = ( |
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.
This file should probably be in the linker
folder... or just even defined in LinkerUtils
.
|
||
export type ColumnSelectionValidator = ( | ||
panel: PanelComponent, | ||
tableColumn?: Partial<LinkColumn> |
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 think instead of using Partial<LinkColumn>
, you want to define a new type, LinkColumnSelection = { name: string, type?: string }
and use that.
With Partial
, you then also have to check that name is defined, which it always will be.
@@ -550,7 +551,7 @@ export class Linker extends Component<LinkerProps, LinkerState> { | |||
case ToolType.LINKER: | |||
setDashboardColumnSelectionValidator( | |||
localDashboardId, | |||
this.isColumnSelectionValid | |||
this.isColumnSelectionValid as ColumnSelectionValidator |
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.
Instead I think isColumnSelectionValid
should also take a Partial<LinkColumn>
rather than just LinkColumn
- you'll need to put the appropriate checks for undefineds in there as well.
In particular - in LinkerUtils, there's a check on the columnType
, checking for null
:
// Null columnType in ending link point allows linking to any type
const isCompatibleType =
endColumnType === null ||
TableUtils.isCompatibleType(startColumnType, endColumnType);
@@ -354,7 +353,7 @@ export class Linker extends Component<LinkerProps, LinkerState> { | |||
'endPanel no longer exists, ignoring unsetFilterValue', | |||
panelId | |||
); | |||
} else if (isLinkablePanel(endPanel)) { | |||
} else if (isLinkablePanel(endPanel) && columnType != null) { |
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.
unsetFilterValue
should just allow null columnType instead. By checking for null
here you're changing one of the code paths.
} else if (isLinkablePanel(endPanel) && columnType != null) { | |
} else if (isLinkablePanel(endPanel)) { |
Fixes #671