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(module:core): fix global config not working in prod mode #4325

Merged
merged 2 commits into from Oct 23, 2019

Conversation

wzhudev
Copy link
Member

@wzhudev wzhudev commented Oct 20, 2019

close #4319

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] 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: #4319

What is the new behavior?

Global configuration works in prod env.

Snipaste_2019-10-20_10-58-43

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@netlify
Copy link

netlify bot commented Oct 20, 2019

Deploy preview for ng-zorro-master ready!

Built with commit 60f7b1b

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

@codecov
Copy link

codecov bot commented Oct 20, 2019

Codecov Report

Merging #4325 into master will increase coverage by 0.04%.
The diff coverage is 99.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4325      +/-   ##
==========================================
+ Coverage   92.15%   92.19%   +0.04%     
==========================================
  Files         520      520              
  Lines       11016    11038      +22     
  Branches     1997     1997              
==========================================
+ Hits        10152    10177      +25     
+ Misses        431      429       -2     
+ Partials      433      432       -1
Impacted Files Coverage Δ
components/core/config/config.service.ts 100% <ø> (ø) ⬆️
components/progress/nz-progress.component.ts 95.91% <100%> (+0.04%) ⬆️
components/modal/nz-modal.component.ts 94.95% <100%> (+0.02%) ⬆️
components/carousel/nz-carousel.component.ts 93.24% <100%> (+0.04%) ⬆️
components/collapse/nz-collapse.component.ts 100% <100%> (ø) ⬆️
components/rate/nz-rate.component.ts 96.77% <100%> (+0.03%) ⬆️
...otification/nz-notification-container.component.ts 96.29% <100%> (+3.7%) ⬆️
components/icon/nz-icon.service.ts 98.07% <100%> (ø) ⬆️
components/alert/nz-alert.component.ts 97.87% <100%> (+0.04%) ⬆️
components/drawer/nz-drawer.component.ts 96.35% <100%> (+0.02%) ⬆️
... and 21 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 f203afd...60f7b1b. Read the comment docs.

this.nzConfigService
.getConfigChangeEventForComponent(trimComponentName(this.constructor.name))
.subscribe(() => this.setConfig());
this.nzConfigService.getConfigChangeEventForComponent('message').subscribe(() => this.setConfig());
Copy link
Member

Choose a reason for hiding this comment

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

it would better to add an NZ_CONFIG_COMPONENT_NAME like other components here

@@ -64,7 +64,7 @@ export class NzNotificationContainerComponent extends NzMessageContainerComponen
const newConfig = (this.config = {
...this.config,
...config,
...this.nzConfigService.getConfigForComponent(trimComponentName(this.constructor.name))
...this.nzConfigService.getConfigForComponent('notification')
Copy link
Member

Choose a reason for hiding this comment

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

it would better to add an NZ_CONFIG_COMPONENT_NAME like other components here

@@ -82,7 +77,7 @@ export class NzSpinComponent implements OnChanges, OnDestroy, OnInit {
this.subscribeLoading();

this.nzConfigService
.getConfigChangeEventForComponent(trimComponentName(this.constructor.name))
.getConfigChangeEventForComponent('spin')
Copy link
Member

Choose a reason for hiding this comment

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

NZ_CONFIG_COMPONENT_NAME

@@ -60,7 +60,7 @@ export class NzSwitchComponent implements ControlValueAccessor, AfterViewInit, O
@Input() @InputBoolean() nzControl = false;
@Input() nzCheckedChildren: string | TemplateRef<void>;
@Input() nzUnCheckedChildren: string | TemplateRef<void>;
@Input() @WithConfig('default') nzSize: NzSizeDSType;
@Input() @WithConfig('switch', 'default') nzSize: NzSizeDSType;
Copy link
Member

Choose a reason for hiding this comment

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

it would better to add an NZ_CONFIG_COMPONENT_NAME like other components here

@@ -80,7 +80,7 @@ export class NzTypographyComponent implements OnInit, AfterViewInit, OnDestroy,
@Input() @InputBoolean() nzExpandable = false;
@Input() @InputBoolean() nzEllipsis = false;
@Input() nzContent: string;
@Input() @WithConfig(1) @InputNumber() nzEllipsisRows: number;
@Input() @WithConfig('typography', 1) @InputNumber() nzEllipsisRows: number;
Copy link
Member

Choose a reason for hiding this comment

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

it would better to add an NZ_CONFIG_COMPONENT_NAME like other components here

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.

left some comments

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

@vthinkxie vthinkxie merged commit cc9308d into NG-ZORRO:master Oct 23, 2019
@wzhudev wzhudev deleted the global-config-refac branch October 23, 2019 02:41
Ricbet pushed a commit to Ricbet/ng-zorro-antd that referenced this pull request Apr 9, 2020
…O#4325)

* fix(module:core): fix global config not working in prod mode

* chore: cleanup code
close NG-ZORRO#4319
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this pull request Aug 5, 2020
…O#4325)

* fix(module:core): fix global config not working in prod mode

* chore: cleanup code
close NG-ZORRO#4319
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.

通知提醒框全局配置在生产环境中不生效
3 participants