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

188618452 new table clean up #1653

Merged
merged 11 commits into from
Dec 5, 2024
Merged

188618452 new table clean up #1653

merged 11 commits into from
Dec 5, 2024

Conversation

eireland
Copy link
Contributor

@eireland eireland commented Nov 26, 2024

On new tables:

  • Removes "no cases" div
  • Removes empty case above the input line
  • Changes default attribute name to "Attribute Name" instead of "AttributeName"
  • Changes table created from the --new-- in the table menu default width to just show the one default column

Copy link

codecov bot commented Nov 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.73%. Comparing base (8d80b3b) to head (c228b2b).
Report is 82 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1653      +/-   ##
==========================================
+ Coverage   85.71%   85.73%   +0.02%     
==========================================
  Files         603      603              
  Lines       30591    30628      +37     
  Branches     8410     8426      +16     
==========================================
+ Hits        26221    26259      +38     
  Misses       4049     4049              
+ Partials      321      320       -1     
Flag Coverage Δ
cypress 75.26% <100.00%> (-0.02%) ⬇️
jest 52.80% <87.50%> (+0.03%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

cypress bot commented Nov 26, 2024

codap-v3    Run #5458

Run Properties:  status check passed Passed #5458  •  git commit 6e69e65eca: 188618452 new table clean up (#1653)
Project codap-v3
Branch Review main
Run status status check passed Passed #5458
Run duration 05m 47s
Commit git commit 6e69e65eca: 188618452 new table clean up (#1653)
Committer Evangeline Ireland
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 36
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 220
View all changes introduced in this branch ↗︎

@eireland eireland marked this pull request as ready for review November 27, 2024 20:25
@eireland eireland marked this pull request as draft November 27, 2024 20:25
…ibute name from "AttributeName" to "Attribute Name"
@eireland eireland marked this pull request as ready for review December 3, 2024 22:49
Copy link
Contributor

@tealefristoe tealefristoe left a comment

Choose a reason for hiding this comment

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

Overall looks good. I just had a few questions/suggestions that I think are worth addressing.

@@ -62,7 +63,10 @@ export function createTableOrCardForDataset (
}
caseMetadata.setLastShownTableOrCardTileId(tile.id)

const width = caseTableComponentInfo.defaultWidth || 0
const numAttributes = sharedDataSet.dataSet.attributes.length
const attributesWidth = Math.min(580, (numAttributes * 80) + kDropzoneWidth + kIndexColumnWidth)
Copy link
Contributor

Choose a reason for hiding this comment

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

Where do 580 and 80 come from? Seems like these should be named constants.

const width = caseTableComponentInfo.defaultWidth || 0
const numAttributes = sharedDataSet.dataSet.attributes.length
const attributesWidth = Math.min(580, (numAttributes * 80) + kDropzoneWidth + kIndexColumnWidth)
const width = Math.min(caseTableComponentInfo.defaultWidth || 0, attributesWidth)
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this should really use Math.min? If caseTableComponentInfo.defaultWidth is falsy, this will always be 0 (maybe that will never occur?). It also feels strange to have two Math.mins in a row. Could you just combine the two lines and replace 580 with caseTableComponentInfo.defaultWidth?

Comment on lines +335 to +339
// For tests involving drag and drop of components with attribute "Attribute Name",
// we use a different drag and drop code because the cy.command version includes a
// "contains" expectation of text "Attribute Name", which it cannot find because it is over
// two spans. This code omits the "contains" expectation because the selector already has enough
// information without needing to find a specific text in a span
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to change the existing drag function to handle an attribute with a name that is in two spans? If not, I think it would at least be good to create a function to do this special drag, rather than repeating the code three times.

I guess one higher level question is why does the default name not fit in the default width of a column?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default column width came from V2.
I couldn't get the existing function to work with the attribute name over 2 spans. I'll modify it and add it to the table element object.

@@ -83,15 +83,16 @@ context("Formula Engine", () => {
"❌ Undefined symbol v1"
])
})
it("Formula in a new dataset", () => {
// Skipped for now until insert cases on input row is implemnted
Copy link
Contributor

Choose a reason for hiding this comment

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

How difficult would it be to implement this? Isn't this already done in table.spec.ts lines 738-744?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Part of this PR removed the single case created when a new table is first created.
Input row index cell does not open the index column menu so new cases cannot be inserted without having to enter data.
The table.spec.ts lines 738-744 tests that a new case is created at the bottom when user enters data into the input line.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should use the code in table.spec.ts to add a case so you have access to the index column menu, then continue the test like before. It shouldn't be necessary to skip this test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@kswenson kswenson left a comment

Choose a reason for hiding this comment

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

👍 LGTM aside from the issues @tealefristoe pointed out.

Copy link
Contributor

@tealefristoe tealefristoe left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for addressing those issues 👍

@eireland eireland merged commit 6e69e65 into main Dec 5, 2024
20 of 21 checks passed
@eireland eireland deleted the 188618452-new-table-clean-up branch December 5, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants