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: Upload support maxCount #28367

Merged
merged 3 commits into from
Dec 15, 2020
Merged

feat: Upload support maxCount #28367

merged 3 commits into from
Dec 15, 2020

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Dec 15, 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

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Upload support maxCount to limit file count.
🇨🇳 Chinese Upload 支持 maxCount 属性以限制文件数量。

☑️ 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/upload/demo/max-count.md

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Dec 15, 2020


## zh-CN

通过 `maxCount` 限制上传数量。当为 `1` 时,始终用最新上传的代替当前。
Copy link
Member

Choose a reason for hiding this comment

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

默认模式是替代还是禁止,感觉禁止比较好,类似 Select tags 或者 Checkbox 的最大限制,肯定不希望选了一个新的之后把旧的顶出去。

Copy link
Member Author

Choose a reason for hiding this comment

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

云凤蝶那边问下来单个的文件没有禁止的需求,只有自动替换的需求。所以这边给 maxCount=1 做了一个特殊的规则。

Copy link
Member

Choose a reason for hiding this comment

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

先上吧,看看社区反馈。

@codesandbox-ci
Copy link

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 04ad2c3:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Dec 15, 2020

Codecov Report

Merging #28367 (04ad2c3) into feature (c4bb71c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           feature   #28367   +/-   ##
========================================
  Coverage    99.98%   99.98%           
========================================
  Files          393      393           
  Lines         7392     7395    +3     
  Branches      2128     2129    +1     
========================================
+ Hits          7391     7394    +3     
  Misses           1        1           
Impacted Files Coverage Δ
components/upload/Upload.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 c4bb71c...04ad2c3. Read the comment docs.

@github-actions
Copy link
Contributor

Size Change: +94 B (0%)

Total Size: 790 kB

Filename Size Change
./dist/antd-with-locales.min.js 313 kB +49 B (0%)
./dist/antd.min.js 275 kB +45 B (0%)
ℹ️ View Unchanged
Filename Size Change
./dist/antd.compact.min.css 66.8 kB 0 B
./dist/antd.dark.min.css 68 kB 0 B
./dist/antd.min.css 66.8 kB 0 B

compressed-size-action

@afc163
Copy link
Member

afc163 commented Dec 15, 2020

feature 掉了一行测试覆盖。

@zombieJ
Copy link
Member Author

zombieJ commented Dec 15, 2020

modal 的 coverage 掉了和这个无关,外面发新 PR 修好了。

@zombieJ zombieJ merged commit d18e9b9 into feature Dec 15, 2020
@zombieJ zombieJ deleted the upload-max-count branch December 15, 2020 09:09
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.

3 participants