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

fix(Layout): disable `hasSider` when specifically declared #15396

Merged
merged 1 commit into from Mar 14, 2019

Conversation

Projects
None yet
2 participants
@SoraYama
Copy link
Contributor

commented Mar 14, 2019

First of all, thank you for your contribution! 😄

New feature please send pull request to feature branch, and rest to master branch.
Pull request will be merged after one of collaborators approve.
Please makes sure that these form are filled before submitting your pull request, thank you!

[中文版模板 / Chinese template]

🤔 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?

  1. Describe the source of requirement, like related issue link.

Just find a bug (probably) when coding

  1. Describe the problem and the scenario.

In some situation Sider is deeply rendered in Children of Layout,
and if we don't want to judge whether Layout has sider, the attr hasSider
set to false should properly work. However hasSider || this.state.siders.length > 0
will ignore hasSider when it is false.

💡 Solution

  1. How to fix the problem, and list final API implementation and usage sample if that is an new feature.

Judge hasSider is type of Boolean first.

  1. GIF or snapshot should be provided if includes UI/interactive modification.

📝 Changelog description

Describe changes from userside, and list all potential break changes or other risks.

  1. English description

Fix a bug: Layout has classname ant-layout-has-sider even if hasFixer is set to false when sider is one of its descendants.

  1. Chinese description (optional)

修复即使在指定 Layout 的 hasSider 属性为 false 的时候依然会加 ant-layout-has-sider 的 classname 的问题

☑️ 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
fix(Layout): disable `hasSider` when specifically declared
In some situation `Sider` is deeply rendered in Children of `Layout`,
and if we don't want to judge whether `Layout` has sider, the attr `hasSider`
set to `false` should properly work. However `hasSider || this.state.siders.length > 0`
will ignore `hasSider` when it is `false`.
@netlify

This comment has been minimized.

Copy link

commented Mar 14, 2019

Deploy preview for ant-design ready!

Built with commit 2b7fce3

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

1 similar comment
@netlify

This comment has been minimized.

Copy link

commented Mar 14, 2019

Deploy preview for ant-design ready!

Built with commit 2b7fce3

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

@codecov

This comment has been minimized.

Copy link

commented Mar 14, 2019

Codecov Report

Merging #15396 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15396      +/-   ##
==========================================
+ Coverage   94.23%   94.26%   +0.03%     
==========================================
  Files         250      250              
  Lines        6645     6645              
  Branches     1943     1929      -14     
==========================================
+ Hits         6262     6264       +2     
+ Misses        382      380       -2     
  Partials        1        1
Impacted Files Coverage Δ
components/layout/layout.tsx 90.62% <100%> (ø) ⬆️
components/upload/UploadList.tsx 96.33% <0%> (+1.83%) ⬆️

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 98b10a7...2b7fce3. Read the comment docs.

@afc163 afc163 merged commit 4f0e6e6 into ant-design:master Mar 14, 2019

26 of 28 checks passed

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
Mixed content No mixed content detected
Details
Redirect rules 18 redirect rules processed
Details
WIP Ready for review
Details
ant-design.ant-design #ant design succeeded
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 no reportable quality changes
Details
codecov/patch 100% of diff hit (target 94.23%)
Details
codecov/project 94.26% (+0.03%) compared to 98b10a7
Details
deploy/netlify Deploy preview ready!
Details
security/snyk - package.json (paranoidjk) No manifest changes detected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.