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

wzhudev
Copy link
Member

@wzhudev wzhudev 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
Copy link

netlify bot 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
Copy link

codecov bot 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
Copy link

netlify bot commented Jun 20, 2019

Deploy preview for ng-zorro-master ready!

Built with commit 4389643

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

@wzhudev
Copy link
Member Author

wzhudev 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.

@vthinkxie vthinkxie requested review from vthinkxie and hsuanxyz June 25, 2019 10:48
@vthinkxie vthinkxie removed the request for review from hsuanxyz June 25, 2019 12:00
@vthinkxie vthinkxie removed their assignment Jun 25, 2019
@vthinkxie vthinkxie requested review from hsuanxyz and removed request for vthinkxie June 25, 2019 12:00
components/cascader/nz-cascader.component.ts Outdated Show resolved Hide resolved
components/core/config/config.service.ts Outdated Show resolved Hide resolved
components/message/nz-message-container.component.ts Outdated Show resolved Hide resolved
components/message/nz-message-container.component.ts Outdated Show resolved Hide resolved
components/progress/nz-progress.component.ts Outdated Show resolved Hide resolved
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
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
Copy link
Member

@vthinkxie vthinkxie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hsuanxyz hsuanxyz merged commit 6eb041a into NG-ZORRO:master Sep 9, 2019
@wzhudev wzhudev deleted the global-config branch September 9, 2019 09:17
Ricbet pushed a commit to Ricbet/ng-zorro-antd that referenced this pull request Apr 9, 2020
* feat(module:*): global config

* feat(module:*): global config

* fix: lint

* fix: lint

* fix: rebase error

* fix: make some properties not configurable

* fix: tslint

* docs: fix version

* fix: progress component
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this pull request Aug 5, 2020
* feat(module:*): global config

* feat(module:*): global config

* fix: lint

* fix: lint

* fix: rebase error

* fix: make some properties not configurable

* fix: tslint

* docs: fix version

* fix: progress component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants