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

feat: support Image element prop for Avatar component #27448

Merged
merged 4 commits into from
Oct 31, 2020

Conversation

headwindz
Copy link
Contributor

@headwindz headwindz commented Oct 29, 2020

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

#27360

💡 Background and solution

Add a new prop called image

📝 Changelog

Language Changelog
🇺🇸 English support Image element as prop for Avatar component
🇨🇳 Chinese Avatar组件支持直接传入Image元素

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • 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/avatar/demo/type.md
View rendered components/avatar/index.en-US.md
View rendered components/avatar/index.zh-CN.md

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Oct 29, 2020

@xrkffgg
Copy link
Member

xrkffgg commented Oct 29, 2020

feature branch

@headwindz headwindz changed the base branch from master to feature October 30, 2020 01:16
@afc163
Copy link
Member

afc163 commented Oct 30, 2020

冲突了。

@afc163
Copy link
Member

afc163 commented Oct 30, 2020

检查一下 ci,可以再 rebase 一下 feature。

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 31, 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 f427d93:

Sandbox Source
antd reproduction template Configuration

@headwindz
Copy link
Contributor Author

headwindz commented Oct 31, 2020

检查一下 ci,可以再 rebase 一下 feature。

@afc163 奇怪了。。重新rebase了一下feature分支。本地也跑了 npm run test -- -u 更新了snapshots. 但是 ci 里报了 Table 组件snapshot的测试用例失败。应该跟这个commit有关 feat: Row support wrap.

现在的现象是:

  1. 直接rebase feture分支后,本地跑单元测试的时候 Table snapshot测试用例报错 (本地分支 以及 upstream/feature)都是这种情况
// 本地报错信息
● renders ./components/table/demo/sticky.md correctly

    expect(received).toMatchSnapshot()

    Snapshot name: `renders ./components/table/demo/sticky.md correctly 1`

    - Snapshot  - 1
    + Received  + 1

    @@ -131,11 +131,11 @@
                      class="ant-table-tbody"
                    >
                      <tr
                        aria-hidden="true"
                        class="ant-table-measure-row"
    -                   style="height:0;font-size:0"
    +                   style="height:0"
                      >
                        <td
                          style="padding:0;border:0;height:0"
                        >
                          <div>

这里snapshot是 style 里带 font-size: 0, 实际不带

  1. 本地跑 npm run test -- -u, 更新 snapshots, 生成 fix: update snapshot, 新生成的snapshot里是不带 font-size:0

  2. git push -> 更新pr -> ci 测试用例失败

//ci 报错信息
renders ./components/table/demo/sticky.md correctly

    expect(received).toMatchSnapshot()

    Snapshot name: `renders ./components/table/demo/sticky.md correctly 1`

    - Snapshot  - 1
    + Received  + 1

    @@ -131,11 +131,11 @@
                      class="ant-table-tbody"
                    >
                      <tr
                        aria-hidden="true"
                        class="ant-table-measure-row"
    -                   style="height:0"
    +                   style="height:0;font-size:0"
                      >
                        <td
                          style="padding:0;border:0;height:0"
                        >
                          <div

这里snapshot是 style 里不带 font-size: 0, 实际带

怎么感觉本地跟线上的测试结论是反着来的= =。。。

@afc163
Copy link
Member

afc163 commented Oct 31, 2020

重新安装 node_modules 后再跑 npm run test -- -u

@codecov
Copy link

codecov bot commented Oct 31, 2020

Codecov Report

Merging #27448 into feature will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           feature    #27448   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          389       389           
  Lines         7397      7400    +3     
  Branches      2075      2083    +8     
=========================================
+ Hits          7397      7400    +3     
Impacted Files Coverage Δ
components/avatar/avatar.tsx 100.00% <100.00%> (ø)

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 d052543...f427d93. Read the comment docs.

@afc163 afc163 merged commit 0afb8de into ant-design:feature Oct 31, 2020
@headwindz headwindz deleted the avatar branch October 31, 2020 13:21
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.

4 participants