-
Notifications
You must be signed in to change notification settings - Fork 40
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
Conversation
Changes case table default width to the width of one attribute
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
codap-v3 Run #5458
Run Properties:
|
Project |
codap-v3
|
Branch Review |
main
|
Run status |
Passed #5458
|
Run duration | 05m 47s |
Commit |
6e69e65eca: 188618452 new table clean up (#1653)
|
Committer | Evangeline Ireland |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
36
|
Skipped |
0
|
Passing |
220
|
View all changes introduced in this branch ↗︎ |
…gging. All other failing tests are fixed.
…ibute name from "AttributeName" to "Attribute Name"
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.
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) |
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.
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) |
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 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.min
s in a row. Could you just combine the two lines and replace 580
with caseTableComponentInfo.defaultWidth
?
// 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 |
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.
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?
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.
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 |
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.
How difficult would it be to implement this? Isn't this already done in table.spec.ts
lines 738-744?
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.
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.
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 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.
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.
done
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.
👍 LGTM aside from the issues @tealefristoe pointed out.
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.
Looks good, thanks for addressing those issues 👍
On new tables:
--new--
in the table menu default width to just show the one default column