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

feat(module:*): support global config #3613

Merged
merged 9 commits into from Sep 9, 2019

Conversation

@wendzhue
Copy link
Member

commented Jun 20, 2019

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[ ] No

Other information

@netlify

This comment has been minimized.

Copy link

commented Jun 20, 2019

Deploy preview for ng-zorro-master ready!

Built with commit b790b48

https://deploy-preview-3613--ng-zorro-master.netlify.com

@codecov

This comment has been minimized.

Copy link

commented Jun 20, 2019

Codecov Report

Merging #3613 into master will decrease coverage by 0.04%.
The diff coverage is 94.48%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3613      +/-   ##
==========================================
- Coverage   92.32%   92.28%   -0.05%     
==========================================
  Files         515      517       +2     
  Lines       10833    10961     +128     
  Branches     1962     1985      +23     
==========================================
+ Hits        10002    10115     +113     
- Misses        412      421       +9     
- Partials      419      425       +6
Impacted Files Coverage Δ
components/notification/nz-notification.service.ts 100% <ø> (ø) ⬆️
components/carousel/nz-carousel-definitions.ts 100% <ø> (ø) ⬆️
components/message/nz-message-base.service.ts 96.55% <ø> (ø) ⬆️
components/layout/nz-sider.component.ts 92% <ø> (ø) ⬆️
components/message/nz-message.service.ts 100% <ø> (ø) ⬆️
components/drawer/nz-drawer.component.ts 96.32% <100%> (+0.02%) ⬆️
components/tree/nz-tree.component.ts 97.79% <100%> (+0.01%) ⬆️
components/back-top/nz-back-top.component.ts 93.93% <100%> (-0.35%) ⬇️
components/modal/nz-modal.component.ts 94.93% <100%> (+0.07%) ⬆️
components/time-picker/nz-time-picker.component.ts 91.89% <100%> (+0.11%) ⬆️
... and 37 more

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 cc9a0c5...4389643. Read the comment docs.

@netlify

This comment has been minimized.

Copy link

commented Jun 20, 2019

Deploy preview for ng-zorro-master ready!

Built with commit 4389643

https://deploy-preview-3613--ng-zorro-master.netlify.com

@wendzhue

This comment has been minimized.

Copy link
Member Author

commented Jun 20, 2019

Introduction to the solution

NzConfigService. This service would hold the global config and provide methods to get or mutate the config.

WithConfig is decorator to help you extract default config for a specific pair of component and property. You should use it with a component name and a default value (optional), and remove the default value assigned value to that property.

@wendzhue wendzhue force-pushed the wendzhue:global-config branch from 0c98e91 to e1a9d34 Jun 21, 2019

@wendzhue wendzhue force-pushed the wendzhue:global-config branch from 51a07b1 to 20bac56 Jun 24, 2019

@vthinkxie vthinkxie requested review from vthinkxie and hsuanxyz Jun 25, 2019

@vthinkxie vthinkxie removed the request for review from hsuanxyz Jun 25, 2019

@vthinkxie vthinkxie removed their assignment Jun 25, 2019

@vthinkxie vthinkxie requested review from hsuanxyz and removed request for vthinkxie Jun 25, 2019

docs/global-config.en-US.md Outdated Show resolved Hide resolved
docs/global-config.zh-CN.md Outdated Show resolved Hide resolved
components/button/nz-button.component.ts Outdated Show resolved Hide resolved
components/button/doc/index.en-US.md Outdated Show resolved Hide resolved
components/button/doc/index.zh-CN.md Outdated Show resolved Hide resolved
components/grid/doc/index.en-US.md Show resolved Hide resolved
components/progress/doc/index.zh-CN.md Outdated Show resolved Hide resolved

@wendzhue wendzhue force-pushed the wendzhue:global-config branch 2 times, most recently from c472ef9 to 9b98be4 Aug 22, 2019

@wendzhue wendzhue force-pushed the wendzhue:global-config branch 2 times, most recently from 22fd3b9 to 51bde4d Sep 4, 2019

components/rate/doc/index.zh-CN.md Show resolved Hide resolved
components/tabs/doc/index.zh-CN.md Outdated Show resolved Hide resolved
components/tree-select/doc/index.zh-CN.md Outdated Show resolved Hide resolved
components/tree-select/doc/index.zh-CN.md Outdated Show resolved Hide resolved
components/tree/doc/index.zh-CN.md Outdated Show resolved Hide resolved
components/tree/doc/index.zh-CN.md Outdated Show resolved Hide resolved
components/button/doc/index.zh-CN.md Outdated Show resolved Hide resolved

@wendzhue wendzhue force-pushed the wendzhue:global-config branch from 08d31ae to 4389643 Sep 9, 2019

@vthinkxie
Copy link
Member

left a comment

LGTM

@hsuanxyz hsuanxyz merged commit 6eb041a into NG-ZORRO:master Sep 9, 2019

5 of 9 checks passed

CodeFactor 4 issues fixed. 5 issues found.
Details
Header rules No header rules processed
Details
Pages changed 76 new files uploaded
Details
Redirect rules No redirect rules processed
Details
Mixed content No mixed content detected
Details
codecov/patch 94.48% of diff hit (target 92.32%)
Details
codecov/project Absolute coverage decreased by -0.04% but relative coverage increased by +2.15% compared to cc9a0c5
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details

@pr-triage pr-triage bot added PR: merged and removed PR: reviewed-approved labels Sep 9, 2019

@wendzhue wendzhue deleted the wendzhue:global-config branch Sep 9, 2019

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.