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: List pagination is null should not crash #16231

Merged
merged 1 commit into from Apr 22, 2019

Conversation

Projects
None yet
4 participants
@zombieJ
Copy link
Member

commented Apr 22, 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?

https://codesandbox.io/s/p52mm2vj97

馃挕 Solution

pagination && typeof pagination === 'object'

馃摑 Changelog

Fix List pagination crash when is null

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

@pr-triage pr-triage bot added the PR: unreviewed label Apr 22, 2019

@ikobe

This comment has been minimized.

Copy link
Contributor

commented Apr 22, 2019

+1

@@ -93,7 +93,7 @@ export default class List<T> extends React.Component<ListProps<T>, ListState> {
super(props);

const { pagination } = props;
const paginationObj = typeof pagination === 'object' ? pagination : {};
const paginationObj = pagination && typeof pagination === 'object' ? pagination : {};

This comment has been minimized.

Copy link
@fengmk2

fengmk2 Apr 22, 2019

Contributor

涓嶆槸閮 ts 浜嗕箞銆傘傘傜粰 pagination 鍔犱釜绫诲瀷鏍¢獙锛屽氨涓嶉渶瑕佽繖鏍峰啓浜嗐pagination || {} 灏卞ソ浜嗐

This comment has been minimized.

Copy link
@afc163

afc163 Apr 22, 2019

Member

杩欐牱涓嶈鐨勶紝pagination 涓 false 鏃跺簲璇ユ槸涓嶅睍绀哄垎椤电殑锛屼篃鏄粯璁ら昏緫銆

image

null 鍏跺疄鏄笉鏀寔鐨勭被鍨嬶紝涓嶈繃涔嬪墠鐨勪唬鐮佹槸鑳借窇鐨勶紝鎴戜滑鐨勬敼鍔ㄦ病鑰冭檻鍒般

This comment has been minimized.

Copy link
@zombieJ

zombieJ Apr 22, 2019

Author Member

杩欓噷 pagination 鐨勫畾涔夋槸: pagination?: PaginationConfig | false;锛宼s 閲岃窇鏄細鎶ラ敊鐨勶細
灞忓箷蹇収 2019-04-22 涓嬪崍5 54 56

This comment has been minimized.

Copy link
@zombieJ

zombieJ Apr 22, 2019

Author Member

杩欒竟鏄垵濮嬪寲閫昏緫锛屽睍绀洪昏緫鍦ㄤ笅闈細妫鏌ャ

@netlify

This comment has been minimized.

Copy link

commented Apr 22, 2019

Deploy preview for ant-design ready!

Built with commit 0dcfb77

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

@codecov

This comment has been minimized.

Copy link

commented Apr 22, 2019

Codecov Report

Merging #16231 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #16231   +/-   ##
=======================================
  Coverage   95.26%   95.26%           
=======================================
  Files         252      252           
  Lines        6741     6741           
  Branches     1927     1962   +35     
=======================================
  Hits         6422     6422           
  Misses        318      318           
  Partials        1        1
Impacted Files Coverage 螖
components/list/index.tsx 97.53% <100%> (酶) 猬嗭笍

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 a530be1...0dcfb77. Read the comment docs.

@zombieJ zombieJ merged commit 440a3f4 into master Apr 22, 2019

29 of 31 checks passed

Header rules No header rules processed
Details
Pages changed 211 new files uploaded
Details
CodeFactor No issues found.
Details
DEP All dependencies are resolved
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
codebeat 5 issues resolved and 1 introduced
Details
codecov/patch 100% of diff hit (target 95.26%)
Details
codecov/project 95.26% (+0%) compared to a530be1
Details
deploy/netlify Deploy preview ready!
Details
security/snyk - package.json (paranoidjk) No manifest changes detected

@pr-triage pr-triage bot added PR: merged and removed PR: unreviewed labels Apr 22, 2019

@delete-merged-branch delete-merged-branch bot deleted the list-pagination branch Apr 22, 2019

@zombieJ zombieJ referenced this pull request Apr 22, 2019

Merged

docs: 3.16.5 changelog update #16233

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.