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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: resolve #20728 customize header checkbox labels in Transfer #21139

Merged

Conversation

morenyang
Copy link
Contributor

@morenyang morenyang commented Jan 29, 2020

馃 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

馃敆 Related issue link

close #20728

馃挕 Background and solution

  • Add a new prop: selectAllLabels
export type SelectAllLabel =
  | React.ReactNode
  | ((info: { selectedCount: number; totalCount: number }) => React.ReactNode);

export interface TransferProps {
  // ...
  selectAllLabels?: SelectAllLabel[];
}
  • Render checkbox label if use provide content or rendering function.
if (selectAllLabel) {
  return typeof selectAllLabel === 'function'
    ? selectAllLabel({ selectedCount, totalCount })
    : selectAllLabel;
}

馃摑 Changelog

Language Changelog
馃嚭馃嚫 English Add selectAllLabels prop in Transfer component, allow users to customize header checkbox labels in Transfer.
馃嚚馃嚦 Chinese

鈽戯笍 Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

View rendered components/transfer/index.en-US.md
View rendered components/transfer/index.zh-CN.md

Copy link

@tests-checker tests-checker bot left a comment

Could you please add tests to make sure this change works as expected?

@morenyang morenyang changed the base branch from master to feature Jan 29, 2020
@ant-design-bot
Copy link
Contributor

@ant-design-bot ant-design-bot commented Jan 29, 2020

@codesandbox-ci
Copy link

@codesandbox-ci codesandbox-ci bot commented Jan 29, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4e8a2d6:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

@codecov codecov bot commented Jan 29, 2020

Codecov Report

Merging #21139 into feature will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           feature   #21139      +/-   ##
===========================================
+ Coverage    97.45%   97.45%   +<.01%     
===========================================
  Files          296      296              
  Lines         6912     6920       +8     
  Branches      1918     1912       -6     
===========================================
+ Hits          6736     6744       +8     
  Misses         176      176
Impacted Files Coverage 螖
components/transfer/list.tsx 100% <100%> (酶) 猬嗭笍
components/transfer/index.tsx 95.52% <100%> (+0.03%) 猬嗭笍

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 5fcd73c...4e8a2d6. Read the comment docs.

@zombieJ
Copy link
Member

@zombieJ zombieJ commented Feb 3, 2020

  • checkboxLabel => selectAllLabels
  • Add .md demo for this and mark as debug

@afc163 afc163 removed the enhancement label Feb 3, 2020
@morenyang
Copy link
Contributor Author

@morenyang morenyang commented Feb 3, 2020

  • Add .md demo for this and mark as debug

Should I change the base branch to master?

@yoyo837
Copy link
Contributor

@yoyo837 yoyo837 commented Feb 3, 2020

  • Add .md demo for this and mark as debug

Should I change the base branch to master?

No, continue adding demo in current branch.

@morenyang morenyang force-pushed the feature-transfer-checkbox-label branch from 483d54a to c64eae4 Compare Feb 3, 2020
components/transfer/index.en-US.md Outdated Show resolved Hide resolved
@morenyang morenyang requested a review from zombieJ Feb 3, 2020
zombieJ
zombieJ approved these changes Feb 4, 2020
@zombieJ
Copy link
Member

@zombieJ zombieJ commented Feb 4, 2020

LGTM
cc @afc163 @yoyo837 @shaodahong

afc163
afc163 approved these changes Feb 4, 2020
@zombieJ zombieJ merged commit 347fea6 into ant-design:feature Feb 4, 2020
18 checks passed
@morenyang morenyang deleted the feature-transfer-checkbox-label branch May 21, 2020
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

6 participants