Closed gillibrand closed 1 year ago
Name | Link |
---|---|
Latest commit | e7215488c2bdfde64b6f2331c2d5e12a6335944f |
Latest deploy log | https://app.netlify.com/sites/carbon-addons-iot-react/deploys/6464fd65f56b2f00081b6181 |
Deploy Preview | https://deploy-preview-3782--carbon-addons-iot-react.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Closes #3781
Summary
When drag and drop is enabled for the table and extra column is injected into the tbody to house the "drag handle". In the normal table header and extra, empty cell/column is added to line up and match the number of columns in the body. This is the same technique used for the "checkbox" select columns.
The issues was that not all headers were updated. There is are "filter" and "select columns" headers that can be added to the table. They were not updated with the extra column, so were not aligned right.
The fix is just to pass the "hasDragAndDrop" prop into those components and add the extra cell there when enabled.
Change List (commits, features, bugs, etc)
ColumnHeaderRow.jsx and FilterHeaderRow.jsx were updated with that change. Other changes are just to the test snapshots that needed updating to account for the new header cell when enabled.
Acceptance Test (how to verify the PR)
View a table with DnD enabled and
hasFilter
prop on. Open the filter header row. If all the columns line up right, it's good. It's most obvious in Firefox, where a big white space was left on the right if the table was wide. The storybookTable > With drag and drop rows
was updated to enable the filter row and test this.Regression Test (how to make sure this PR doesn't break old functionality)
Existing unit tests pass.
Things to look for during review
iot
orbx
class prefix is using the prefix variabledata-testid
attribute. New test ids should have test written to ensure they are not changed or removed.