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 #1014

Merged
merged 2 commits into from Jun 29, 2023

Conversation

ghiscoding
Copy link
Owner

  • 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

- 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
@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Merging #1014 (f1b7998) into master (c203a2c) will not change coverage.
The diff coverage is 100.00%.

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

@ghiscoding ghiscoding merged commit 77cec0c into master Jun 29, 2023
5 checks passed
@ghiscoding ghiscoding deleted the bugfix/getAssociatedGridColumns-extending branch June 29, 2023 21:57
ghiscoding added a commit that referenced this pull request Jun 29, 2023
- 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)
ghiscoding added a commit that referenced this pull request Jun 29, 2023
… (part2) (#1015)

* fix(GridState): calling `getAssociatedGridColumns` should extend column
- 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)
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.

None yet

1 participant