ng-zorro-antd icon indicating copy to clipboard operation
ng-zorro-antd copied to clipboard

feat(module:modal): update global settings for the modal

Open volvachev opened this issue 3 years ago • 6 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/CONTRIBUTING.md#commit
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

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

What is the new behavior?

The NzModalModule now has a forRoot method, where you can set default settings for all kinds of modal.

The settings object can be changed as it is not clear which settings can be global and which can't.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

volvachev avatar May 24 '22 17:05 volvachev

Codecov Report

Merging #7461 (5633833) into master (1a16154) will decrease coverage by 0.45%. The diff coverage is 50.00%.

:exclamation: Current head 5633833 differs from pull request most recent head 696f7b2. Consider uploading reports for the commit 696f7b2 to get more accurate results

@@            Coverage Diff             @@
##           master    #7461      +/-   ##
==========================================
- Coverage   92.02%   91.56%   -0.46%     
==========================================
  Files         502      496       -6     
  Lines       16752    16318     -434     
  Branches     2634     2533     -101     
==========================================
- Hits        15416    14942     -474     
+ Misses       1065     1050      -15     
- Partials      271      326      +55     
Impacted Files Coverage Δ
components/core/config/config.ts 100.00% <ø> (ø)
components/modal/modal.service.ts 95.00% <50.00%> (-0.92%) :arrow_down:
components/date-picker/week-picker.component.ts 33.33% <0.00%> (-66.67%) :arrow_down:
components/date-picker/year-picker.component.ts 33.33% <0.00%> (-66.67%) :arrow_down:
components/date-picker/month-picker.component.ts 33.33% <0.00%> (-66.67%) :arrow_down:
components/tabs/tab-nav-operation.component.ts 62.50% <0.00%> (-6.25%) :arrow_down:
components/time-picker/time-picker.component.ts 88.75% <0.00%> (-5.31%) :arrow_down:
components/steps/steps.component.ts 94.80% <0.00%> (-5.20%) :arrow_down:
...omponents/date-picker/lib/month-table.component.ts 88.13% <0.00%> (-5.09%) :arrow_down:
components/slider/handle.component.ts 93.33% <0.00%> (-5.00%) :arrow_down:
... and 110 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar May 24 '22 18:05 codecov[bot]

I think you can use NZ_CONFIG instead of setting these properties with forRoot()

simplejason avatar May 26 '22 02:05 simplejason

I think you can use NZ_CONFIG instead of setting these properties with forRoot()

Yes, you're right. I have updated pr, added a new field to the nz config.

volvachev avatar May 26 '22 13:05 volvachev

I think you can use NZ_CONFIG instead of setting these properties with forRoot()

Yes, you're right. I have updated pr, added a new field to the nz config.

Please make sure all tests work as expected

simplejason avatar May 30 '22 07:05 simplejason

@hsuanxyz Please take time to review :)

simplejason avatar May 30 '22 07:05 simplejason

@volvachev are you able to add more tests for lines that have been marked as not covered? https://github.com/NG-ZORRO/ng-zorro-antd/pull/7461/checks?check_run_id=6652702744

tegola avatar Jun 27 '22 10:06 tegola