-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(module:table): add nzSortDirections to table global config (#6613) #8721
feat(module:table): add nzSortDirections to table global config (#6613) #8721
Conversation
…RRO#6613) add nzSortDirections to table global config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please solve the CI error
remove reference to NzTableSortOrder in config
Done! |
components/core/config/config.ts
Outdated
@@ -18,7 +18,6 @@ import { | |||
NzSizeMDSType, | |||
NzTSType | |||
} from 'ng-zorro-antd/core/types'; | |||
import { NzTableSortOrder } from 'ng-zorro-antd/table'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import type { NzTableSortOrder } from 'ng-zorro-antd/table';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please mark nzSortDirections
as global config in the documents components/table/doc/*.md
components/core/config/config.ts
Outdated
@@ -296,6 +296,7 @@ export interface TableConfig { | |||
nzShowSizeChanger?: boolean; | |||
nzSimple?: boolean; | |||
nzHideOnSinglePage?: boolean; | |||
nzSortDirections?: Array<string | null>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, what should I do ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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