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: prop headerRender should be optional for component Calendar #17063

Merged
merged 1 commit into from Jun 21, 2019

Conversation

Projects
None yet
3 participants
@wonderjar
Copy link
Contributor

commented Jun 12, 2019

馃 This is a ...

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

馃懟 What's the background?

In Release 13.19.0, new prop headerRender is added for component Calendar(#16535 ), but the ts definition define it mandatory. It's designed as optional in fact.

馃挕 Solution

馃摑 Changelog

Language Changelog
馃嚭馃嚫 English
馃嚚馃嚦 Chinese

鈽戯笍 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 Jun 12, 2019

@netlify

This comment has been minimized.

Copy link

commented Jun 12, 2019

Deploy preview for ant-design ready!

Built with commit 180ed01

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

@codecov

This comment has been minimized.

Copy link

commented Jun 12, 2019

Codecov Report

Merging #17063 into master will decrease coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17063      +/-   ##
==========================================
- Coverage      96%   95.96%   -0.05%     
==========================================
  Files         263      263              
  Lines        7340     7340              
  Branches     2009     2050      +41     
==========================================
- Hits         7047     7044       -3     
- Misses        291      294       +3     
  Partials        2        2
Impacted Files Coverage 螖
components/calendar/index.tsx 96.73% <酶> (酶) 猬嗭笍
components/calendar/Header.tsx 96.84% <100%> (酶) 猬嗭笍
components/_util/wave.tsx 85.84% <0%> (-2.84%) 猬囷笍

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 798d050...180ed01. Read the comment docs.

@@ -178,8 +180,8 @@ export default class Header extends React.Component<HeaderProps, any> {
);
};

headerRenderCustom = (): React.ReactNode => {
const { headerRender, type, onValueChange, value } = this.props;

This comment has been minimized.

Copy link
@yesmeck

yesmeck Jun 15, 2019

Member

I think this change is unnecessary.

This comment has been minimized.

Copy link
@wonderjar

wonderjar Jun 16, 2019

Author Contributor

I change here because
const { headerRender, type, onValueChange, value } = this.props;
Type of headerRender is HeaderRender | undefined

If I pass headerRender as function argument, because the func is called by
headerRender ? this.headerRenderCustom(headerRender) : (...)
the type of headerRender is HeaderRender

I just want to avoid the repeated undefined check in TS

@afc163 afc163 merged commit ce04af8 into ant-design:master Jun 21, 2019

27 of 31 checks passed

Header rules - ant-design No header rules processed
Details
Pages changed - ant-design 215 new files uploaded
Details
packtracker/css 480 KB 鈥 No Change
Details
packtracker/javascript 1.83 MB 鈥 鈻 0.00%
Details
CodeFactor No issues found.
Details
DEP All dependencies are resolved
LGTM analysis: JavaScript No new or fixed alerts
Details
Mixed content - ant-design No mixed content detected
Details
Redirect rules - ant-design 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 96%)
Details
codecov/project Absolute coverage decreased by -0.04% but relative coverage increased by +3.99% compared to 798d050
Details
netlify/ant-design/deploy-preview 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 Jun 21, 2019

@afc163 afc163 referenced this pull request Jun 21, 2019

Merged

docs: release 3.19.7 #17227

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.