Skip to content

Grid JS to TS conversion #327

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

Merged
merged 20 commits into from
Dec 20, 2021
Merged

Grid JS to TS conversion #327

merged 20 commits into from
Dec 20, 2021

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Dec 7, 2021

  • Converted the rest of @deephaven/grid package to TypeScript
  • Separated GridModel into an abstract class, and two separate interfaces, ExpandableGridModel, EditableGridModel
  • Fixes Convert all js in grid to ts #21

@mofojed mofojed added this to the December 2021 milestone Dec 7, 2021
@mofojed mofojed self-assigned this Dec 7, 2021
@codecov
Copy link

codecov bot commented Dec 13, 2021

Codecov Report

Merging #327 (df41395) into main (ac363ec) will increase coverage by 46.08%.
The diff coverage is 58.13%.

Impacted file tree graph

@@            Coverage Diff            @@
##           main     #327       +/-   ##
=========================================
+ Coverage      0   46.08%   +46.08%     
=========================================
  Files         0       47       +47     
  Lines         0     7926     +7926     
  Branches      0     2121     +2121     
=========================================
+ Hits          0     3653     +3653     
- Misses        0     4026     +4026     
- Partials      0      247      +247     
Flag Coverage Δ
unit 46.08% <58.13%> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/grid/src/CellInputField.tsx 21.81% <0.00%> (ø)
packages/grid/src/GridRange.ts 91.82% <ø> (ø)
packages/grid/src/GridUtils.ts 51.13% <ø> (ø)
packages/grid/src/KeyHandler.ts 50.00% <0.00%> (ø)
packages/grid/src/errors/AssertionError.ts 0.00% <0.00%> (ø)
packages/grid/src/errors/PasteError.ts 100.00% <ø> (ø)
packages/grid/src/key-handlers/TreeKeyHandler.ts 0.00% <0.00%> (ø)
packages/iris-grid/src/IrisGridModel.js 10.81% <0.00%> (ø)
packages/iris-grid/src/IrisGridProxyModel.js 62.84% <ø> (ø)
packages/iris-grid/src/IrisGridTableModel.js 46.69% <0.00%> (ø)
... and 65 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac363ec...df41395. Read the comment docs.

@mofojed mofojed requested a review from mattrunyon December 14, 2021 21:24
@mofojed mofojed requested a review from mattrunyon December 15, 2021 14:22
@mofojed mofojed requested a review from mattrunyon December 17, 2021 15:25
mattrunyon
mattrunyon previously approved these changes Dec 17, 2021
Still need to do many other files and test it. GridRenderer still in progress.
I don't know why it fails with npm start but doesn't show the error in VS Code. It seems like it should be fine, but it's not tracking the condition through multiple ifs/variables? Will check with Matt tomorrow.
Also made sure the x/y properties of EditOperation are just deprecated so we don't break existing plugins
It wasn't doing the same if check as above, so it was doing a context.restore without a previous context.save and screwing everything up.

I don't know why unit tests complain about `column` or `row` possibly being null though, since VS Code doesn't complain and `isCursorVisible` already implies column/row are not null
- Moved delete from EditableGridModel to IrisGridModel. It deletes the ranges and shifts, which is functionality not accessible at all from Grid right now, so doesn't make sense to be in EditableGridModel. Will add a method to EditableGridModel when necessary, with a "shift" parameter as well to specify how to shift the data
- Cleaned up some other docs
Some of the events we listen to are not wrapped in SyntheticEvent. Create these types to be the union of the native event and synthetic event, since it doesn't really matter which one we get - the properties we read are common to both.
@mofojed
Copy link
Member Author

mofojed commented Dec 20, 2021

Rebased, just need that +1 again

@mofojed mofojed merged commit d5e1d0e into deephaven:main Dec 20, 2021
@mofojed mofojed deleted the 21-grid-ts branch December 20, 2021 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert all js in grid to ts
3 participants