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
Merged

fix: List pagination is null should not crash #16231

merged 1 commit into from Apr 22, 2019

Conversation

@zombieJ
Copy link
Member

@zombieJ zombieJ 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
@ikobe-zz
Copy link
Contributor

@ikobe-zz ikobe-zz 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 : {};
Copy link
Contributor

@fengmk2 fengmk2 Apr 22, 2019

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

Copy link
Member

@afc163 afc163 Apr 22, 2019

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

image

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

Copy link
Member Author

@zombieJ zombieJ Apr 22, 2019

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

Copy link
Member Author

@zombieJ zombieJ Apr 22, 2019

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

@netlify
Copy link

@netlify netlify bot commented Apr 22, 2019

Deploy preview for ant-design ready!

Built with commit 0dcfb77

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

@codecov
Copy link

@codecov codecov bot 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
31 checks passed
31 checks passed
@netlify[bot]
Header rules No header rules processed
Details
@netlify[bot]
Pages changed 211 new files uploaded
Details
CodeFactor No issues found.
Details
@dep[bot]
DEP All dependencies are resolved
LGTM analysis: JavaScript No new or fixed alerts
Details
License Compliance All checks passed.
Details
@netlify[bot]
Mixed content No mixed content detected
Details
@netlify[bot]
Redirect rules 18 redirect rules processed
Details
@semantic-pull-requests[bot]
Semantic Pull Request ready to be squashed
Details
@wip[bot]
WIP Ready for review
Details
ant-design.ant-design #ant design succeeded
Details
@buildsize[bot]
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[bot]
codecov/patch 100% of diff hit (target 95.26%)
Details
@codecov[bot]
codecov/project 95.26% (+0%) compared to a530be1
Details
@netlify[bot]
deploy/netlify Deploy preview ready!
Details
security/snyk - package.json (paranoidjk) No manifest changes detected
@delete-merged-branch delete-merged-branch bot deleted the list-pagination branch Apr 22, 2019
@zombieJ zombieJ mentioned this pull request Apr 22, 2019
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants