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

fix(GridState): calling getAssociatedGridColumns should extend column (part2) #1015

Merged
merged 6 commits into from
Jun 29, 2023

Conversation

ghiscoding
Copy link
Owner

No description provided.

- the previous implementation was extending 3 defined properties but by doing so it was extending properly when a value was provided but it was returning an empty value instead of extending the original
- for example `{ ...gridCol, cssClass: currentCol }` would change the `cssClass` to undefined when `currentCol` doesn't have this `cssClass` and that is even when the original `gridCol` does have that same property. So instead of trying to extend specific properties we should just extend the entire objects, ie: `{ ...gridCol, ...currentCol }` would extend correctly whatever property is defined in `currentCol`
- also make sure to extend currentCol but without the `columnId` since that doesn't exist a regular Column property
- extends the previous PR #1014, but instead of merging all column properties, we will actually skip the `width` property since that property is changed internally by SlickGrid (auto-calculated) and that has an impact when using autoResizeColumnsByCellContent feature (for example it breaks our Salesforce grid that uses `enabledAutoResizeColumnsByCellContent` and uses much thinner column width, if we however skip the width then we make SlickGrid recalculate the width since we use `enabledAutoResizeColumnsByCellContent` and that fixes our problem)
@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Merging #1015 (d933e44) into master (77cec0c) will not change coverage.
The diff coverage is 100.00%.

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

@@            Coverage Diff            @@
##            master     #1015   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          244       244           
  Lines        16557     16558    +1     
  Branches      5929      5931    +2     
=========================================
+ Hits         16557     16558    +1     
Impacted Files Coverage Δ
packages/common/src/services/gridState.service.ts 100.00% <100.00%> (ø)

@ghiscoding ghiscoding merged commit 3ea1d02 into master Jun 29, 2023
3 checks passed
@ghiscoding ghiscoding deleted the bugfix/getAssociatedGridColumns-extending-part2 branch June 29, 2023 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant