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

fix: badge should accept negative number #15810

Merged
merged 4 commits into from Apr 2, 2019

Conversation

Projects
None yet
4 participants
@zombieJ
Copy link
Member

commented Apr 2, 2019

馃 This is a ...

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

馃懟 What's the background?

fix #15799

-10 will display as 010:
灞忓箷蹇収 2019-04-02 涓嬪崍3 03 36

馃挕 Solution

Check number. Not use scroll number if is negative.

馃摑 Changelog

Fix Badge display negative count incorrect.

鈽戯笍 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

@afc163 afc163 changed the title fix badge negative number Bug Fixes: fix badge negative number Apr 2, 2019

@afc163 afc163 changed the title Bug Fixes: fix badge negative number fix: badge negative number Apr 2, 2019

@afc163 afc163 changed the title fix: badge negative number fix: badge should accept negative number Apr 2, 2019

@netlify

This comment has been minimized.

Copy link

commented Apr 2, 2019

Deploy preview for ant-design ready!

Built with commit 5d6c8b7

https://deploy-preview-15810--ant-design.netlify.com

An enterprise-class UI design language and React-based implementation with a set of high-quality React components, one of best React UI library for enterprises
Show resolved Hide resolved components/badge/ScrollNumber.tsx Outdated
@ztplz

This comment has been minimized.

Copy link
Collaborator

commented Apr 2, 2019

https://github.com/ant-design/ant-design/blob/master/components/badge/ScrollNumber.tsx#L106
鏀硅繖閲屾庝箞鏍

isNaN(position) ? "-" : i % 10

鍒氱湅浜嗕笅 杩欎箞鏀规湁鍔ㄧ敾 浣嗘槸鍘熸潵鍔ㄧ敾鏄笉鏀寔璐熸暟鐨 鎵浠9鍒0鐨勫垏鎹㈡湁鐐瑰埆鎵

@zombieJ

This comment has been minimized.

Copy link
Member Author

commented Apr 2, 2019

@ztplz 锛岀洰鍓嶅姩鐢绘槸鍒 0 涓烘鐨勩傚皬浜 0 鐨勬暟瀛楋紝娓叉煋 number list 鎰忎箟涓嶅ぇ銆傜洿鎺ュ綋 string 澶勭悊灏卞浜嗐

@ztplz

This comment has been minimized.

Copy link
Collaborator

commented Apr 2, 2019

Untitled7

@netlify

This comment has been minimized.

Copy link

commented Apr 2, 2019

Deploy preview for ant-design ready!

Built with commit 2b605d2

https://deploy-preview-15810--ant-design.netlify.com

@zombieJ

This comment has been minimized.

Copy link
Member Author

commented Apr 2, 2019

鏈夐亾鐞嗭紝Why not锛 鎴戞敼涓涓

@codecov

This comment has been minimized.

Copy link

commented Apr 2, 2019

Codecov Report

Merging #15810 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15810      +/-   ##
==========================================
+ Coverage   95.04%   95.06%   +0.02%     
==========================================
  Files         251      251              
  Lines        6656     6663       +7     
  Branches     1911     1913       +2     
==========================================
+ Hits         6326     6334       +8     
+ Misses        329      328       -1     
  Partials        1        1
Impacted Files Coverage 螖
components/badge/ScrollNumber.tsx 98.66% <100%> (+1.6%) 猬嗭笍

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 4071455...2b605d2. Read the comment docs.

@zombieJ

This comment has been minimized.

Copy link
Member Author

commented Apr 2, 2019

鏈潵鎯冲仛鎴愬姩鐢荤炕婊氭柟鍚戠粺涓锛屽彂鐜板疄鐜板お鍥伴毦锛屽氨绠鍗曞仛浜嗐
@afc163 @ztplz

@afc163

afc163 approved these changes Apr 2, 2019

@zombieJ zombieJ merged commit 6b2d72e into master Apr 2, 2019

28 of 31 checks passed

codebeat 0 issues resolved and 2 introduced
Details
Header rules No header rules processed
Details
Pages changed 12 new files uploaded
Details
Codacy/PR Quality Review Up to standards. A positive pull request.
Details
CodeFactor No issues found.
Details
LGTM analysis: JavaScript No new or fixed alerts
Details
License Compliance All checks passed.
Details
Mixed content No mixed content detected
Details
Redirect rules 18 redirect rules processed
Details
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
ant-design.ant-design #ant design succeeded
Details
buildsize No change
Details
ci/circleci: compile Your tests passed on CircleCI!
Details
ci/circleci: dist Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: test_dist Your tests passed on CircleCI!
Details
ci/circleci: test_dist_15 Your tests passed on CircleCI!
Details
ci/circleci: test_dom Your tests passed on CircleCI!
Details
ci/circleci: test_dom_15 Your tests passed on CircleCI!
Details
ci/circleci: test_es Your tests passed on CircleCI!
Details
ci/circleci: test_es_15 Your tests passed on CircleCI!
Details
ci/circleci: test_lib Your tests passed on CircleCI!
Details
ci/circleci: test_lib_15 Your tests passed on CircleCI!
Details
ci/circleci: test_node Your tests passed on CircleCI!
Details
ci/circleci: test_node_15 Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 95.04%)
Details
codecov/project 95.06% (+0.02%) compared to 4071455
Details
deploy/netlify Deploy preview ready!
Details
security/snyk - package.json (paranoidjk) No manifest changes detected

@delete-merged-branch delete-merged-branch bot deleted the fix-badge branch Apr 2, 2019

@knanahassouna1

This comment has been minimized.

Copy link

commented Apr 3, 2019

thanks

@weekly-digest weekly-digest bot referenced this pull request Apr 14, 2019

Closed

Weekly Digest (7 April, 2019 - 14 April, 2019) #16069

1 of 9 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.