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: disable column sorting on unsupported types #1390

Merged
merged 7 commits into from
Jul 6, 2023

Conversation

ethanalvizo
Copy link
Contributor

Closes #1380

@ethanalvizo ethanalvizo requested review from mofojed and dsmmcken June 28, 2023 22:06
packages/iris-grid/src/AdvancedFilterCreator.tsx Outdated Show resolved Hide resolved
packages/iris-grid/src/IrisGrid.tsx Show resolved Hide resolved
packages/iris-grid/src/IrisGridModel.ts Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Merging #1390 (abeca3d) into main (e23695d) will decrease coverage by 0.02%.
The diff coverage is 9.09%.

❗ Current head abeca3d differs from pull request most recent head a6b9e03. Consider uploading reports for the commit a6b9e03 to get more accurate results

@@            Coverage Diff             @@
##             main    #1390      +/-   ##
==========================================
- Coverage   45.59%   45.57%   -0.02%     
==========================================
  Files         506      506              
  Lines       34975    34993      +18     
  Branches     8737     8749      +12     
==========================================
+ Hits        15947    15949       +2     
- Misses      18977    18993      +16     
  Partials       51       51              
Flag Coverage Δ
unit 45.57% <9.09%> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
packages/iris-grid/src/ColumnStatistics.tsx 3.33% <0.00%> (-0.08%) ⬇️
packages/iris-grid/src/IrisGrid.tsx 27.00% <0.00%> (-0.06%) ⬇️
packages/iris-grid/src/IrisGridModel.ts 31.74% <0.00%> (-1.05%) ⬇️
packages/iris-grid/src/IrisGridProxyModel.ts 66.76% <0.00%> (-0.40%) ⬇️
packages/iris-grid/src/IrisGridTableModel.ts 52.04% <0.00%> (-0.62%) ⬇️
...d/src/mousehandlers/IrisGridContextMenuHandler.tsx 3.09% <0.00%> (-0.02%) ⬇️
packages/iris-grid/src/AdvancedFilterCreator.tsx 40.29% <28.57%> (+0.19%) ⬆️

... and 12 files with indirect coverage changes

@ethanalvizo ethanalvizo requested a review from mofojed June 29, 2023 20:01
@ethanalvizo ethanalvizo enabled auto-merge (squash) June 29, 2023 20:08
packages/iris-grid/src/IrisGrid.tsx Outdated Show resolved Hide resolved
@ethanalvizo ethanalvizo requested a review from mofojed July 5, 2023 19:01
@@ -54,7 +54,7 @@ function makeAdvancedFilterCreatorWrapper(
selectedValues: [],
},
model: irisGridTestUtils.makeModel(),
column: irisGridTestUtils.makeColumn(),
column: irisGridTestUtils.makeColumn('0'), // needs to match column name in makeModel so that columnIndex can be found when rendering
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's probably a more fool-proof way to achieve this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe I should be handling that null/undefined case differently in AdvancedFilterCreator.tsx

Copy link
Member

Choose a reason for hiding this comment

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

I think this is fine. Anything else you'd do would be a bit long-winded and unnecessary. You could define the columns beforehand, for example, so something like:

const columns = irisGridTestUtils.makeColumns(3, 'test');
...
function makeAdvancedFilterCreatorWrapper(
....
    } = {
        model: irisGridTestUtils.makeModel(irisGridTestUtils.makeTable(columns)),
        column: column[0],

There's still a lot of tests here disabled, we should really look at re-enabling them.

@@ -54,7 +54,7 @@ function makeAdvancedFilterCreatorWrapper(
selectedValues: [],
},
model: irisGridTestUtils.makeModel(),
column: irisGridTestUtils.makeColumn(),
column: irisGridTestUtils.makeColumn('0'), // needs to match column name in makeModel so that columnIndex can be found when rendering
Copy link
Member

Choose a reason for hiding this comment

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

I think this is fine. Anything else you'd do would be a bit long-winded and unnecessary. You could define the columns beforehand, for example, so something like:

const columns = irisGridTestUtils.makeColumns(3, 'test');
...
function makeAdvancedFilterCreatorWrapper(
....
    } = {
        model: irisGridTestUtils.makeModel(irisGridTestUtils.makeTable(columns)),
        column: column[0],

There's still a lot of tests here disabled, we should really look at re-enabling them.

@ethanalvizo ethanalvizo merged commit 3a89bbf into deephaven:main Jul 6, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Columns without a sortable attribute should disable sort behaviours
3 participants