feat(module:table): add nzSortDirections to table global config (#6613)#8721
Conversation
…RRO#6613) add nzSortDirections to table global config
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8721 +/- ##
==========================================
+ Coverage 91.57% 91.89% +0.32%
==========================================
Files 538 546 +8
Lines 18459 19291 +832
Branches 2816 2850 +34
==========================================
+ Hits 16903 17728 +825
- Misses 1238 1251 +13
+ Partials 318 312 -6 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Laffery
left a comment
There was a problem hiding this comment.
please solve the CI error
remove reference to NzTableSortOrder in config
Done! |
| NzSizeMDSType, | ||
| NzTSType | ||
| } from 'ng-zorro-antd/core/types'; | ||
| import { NzTableSortOrder } from 'ng-zorro-antd/table'; |
There was a problem hiding this comment.
import type { NzTableSortOrder } from 'ng-zorro-antd/table';
There was a problem hiding this comment.
Still have the same error if using this import :
Entry point ng-zorro-antd/table has a circular dependency on ng-zorro-antd/core/config.
Laffery
left a comment
There was a problem hiding this comment.
Please mark nzSortDirections as global config in the documents components/table/doc/*.md
| nzShowSizeChanger?: boolean; | ||
| nzSimple?: boolean; | ||
| nzHideOnSinglePage?: boolean; | ||
| nzSortDirections?: Array<string | null>; |
There was a problem hiding this comment.
what about migrate NzTableSortOrder to ng-zorro-antd/core/types ?
if use Array<string | null>, code auto-completion and type check won't work
There was a problem hiding this comment.
I'm not sure about this, it would be a breaking change (if you use this type in your code) and it's not worth the bother.
Maybe we can simplify and replace all occurences of NzTableSortOrder with string | null?
Currently NzTableSortOrder is like that : export type NzTableSortOrder = string | 'ascend' | 'descend' | null;
There was a problem hiding this comment.
So, what should I do ?
There was a problem hiding this comment.
What about adding a document link here?
| nzSortDirections?: Array<string | null>; | |
| /** | |
| * @see {@link NzTableSortOrder} | |
| */ | |
| nzSortDirections?: Array<string | 'ascend' | 'descend' | null>; |
mark nzSortDirections as global config
It's done |
|
Could we discuss about what should I do to finish this PR ? |
add link to NzTableSortOrder in config
add nzSortDirections to table global config
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
We can't change nzSortDirections for table component globally
Issue Number: #6613
What is the new behavior?
We can now change nzSortDirections for table component globally in the TableConfig object
Does this PR introduce a breaking change?
Other information