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(addon-table): fix sorting on table with dynamic columns #6103

Merged
merged 3 commits into from
Nov 30, 2023

Conversation

vladimirpotekhin
Copy link
Member

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Refactoring
  • Build or CI related changes
  • Tests related changes
  • Documentation content changes

What is the current behaviour?

Closes #6070

What is the new behaviour?

Copy link

lumberjack-bot bot commented Nov 27, 2023

Pull request was closed ✔️

All saved screenshots (for current PR) were deleted 🗑️

Copy link
Contributor

github-actions bot commented Nov 27, 2023

Visit the preview URL for this PR (updated for commit f621ced):

https://taiga-ui--pr6103-table-dynamic-sort-zz06d87b.web.app

(expires Thu, 30 Nov 2023 14:56:50 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 4b5ece1e114386f6a105425ef799091475b249eb

Copy link

bundlemon bot commented Nov 27, 2023

BundleMon

Files updated (2)
Status Path Size Limits
demo/browser/runtime.(hash).js
41.15KB (+41B +0.1%) +10%
demo/browser/main.(hash).js
374.11KB (-682B -0.18%) +10%
Unchanged files (3)
Status Path Size Limits
demo/browser/vendor.(hash).js
198.18KB +10%
demo/browser/polyfills.(hash).js
11.22KB +10%
demo/browser/styles.(hash).css
1.22KB +10%

Total files change -641B -0.1%

Groups updated (1)
Status Path Size Limits
demo/browser/*..js
2.28MB (-1.71KB -0.07%) -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

Copy link

codecov bot commented Nov 27, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (0321cf6) 71.95% compared to head (f621ced) 60.37%.
Report is 25 commits behind head on main.

Files Patch % Lines
...e/components/table/directives/sort-by.directive.ts 20.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #6103       +/-   ##
===========================================
- Coverage   71.95%   60.37%   -11.58%     
===========================================
  Files        1462       46     -1416     
  Lines       15975      477    -15498     
  Branches     2269       29     -2240     
===========================================
- Hits        11495      288    -11207     
+ Misses       4109      184     -3925     
+ Partials      371        5      -366     
Flag Coverage Δ
addon-charts ∅ <ø> (∅)
addon-doc ∅ <ø> (∅)
addon-mobile ∅ <ø> (∅)
addon-table 60.37% <33.33%> (-0.39%) ⬇️
addon-tablebars ∅ <ø> (∅)
cdk ∅ <ø> (∅)
core ∅ <ø> (∅)
kit ∅ <ø> (∅)
summary 60.37% <33.33%> (-11.58%) ⬇️

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.

@vladimirpotekhin vladimirpotekhin marked this pull request as draft November 27, 2023 14:43
@vladimirpotekhin vladimirpotekhin marked this pull request as ready for review November 28, 2023 09:57
@@ -52,6 +53,9 @@ export class TuiThComponent<T extends Partial<Record<keyof T, any>>> {
@Optional()
@Inject(forwardRef(() => TuiTableDirective))
readonly table: TuiTableDirective<T> | null,
@Optional()
@Inject(forwardRef(() => TuiSortByDirective))
private readonly sortBy: TuiSortByDirective<T> | null,
Copy link
Collaborator

Choose a reason for hiding this comment

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

SortBy directive is kind of an extension over the regular table API to allow sorting by key, baseline table should not depend on it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I returned Th 👍

now I tried to invert the flow a little: we can call check and update parent table directive from TuiSortByDirective setter, instead of relying on ngDoCheck

@waterplea waterplea merged commit e0fc02b into main Nov 30, 2023
36 checks passed
@waterplea waterplea deleted the table-dynamic-sort branch November 30, 2023 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

🐞 - sorting doesn't work on table with dynamic columns
3 participants