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: notification): support top and bottom placement #7540

Merged
merged 1 commit into from Jul 11, 2022

Conversation

rorry121
Copy link
Contributor

@rorry121 rorry121 commented Jun 29, 2022

PR Checklist

Please check if your PR fulfills the following requirements:

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: #7389

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@zorro-bot
Copy link

zorro-bot bot commented Jun 29, 2022

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Jun 29, 2022

Codecov Report

Merging #7540 (54f768b) into master (64b7389) will decrease coverage by 0.04%.
The diff coverage is 80.64%.

❗ Current head 54f768b differs from pull request most recent head afcbc0e. Consider uploading reports for the commit afcbc0e to get more accurate results

@@            Coverage Diff             @@
##           master    #7540      +/-   ##
==========================================
- Coverage   91.75%   91.70%   -0.05%     
==========================================
  Files         502      502              
  Lines       16699    16723      +24     
  Branches     2604     2605       +1     
==========================================
+ Hits        15322    15336      +14     
- Misses       1047     1057      +10     
  Partials      330      330              
Impacted Files Coverage Δ
components/core/animation/notification.ts 100.00% <ø> (ø)
components/core/config/config.ts 100.00% <ø> (ø)
components/notification/notification.component.ts 90.00% <66.66%> (-10.00%) ⬇️
...s/notification/notification-container.component.ts 93.67% <84.00%> (-4.61%) ⬇️
components/table/src/table/tbody.component.ts 88.88% <0.00%> (-11.12%) ⬇️
...ts/table/src/table/table-inner-scroll.component.ts 79.41% <0.00%> (-4.42%) ⬇️
components/table/src/table/tr-measure.component.ts 86.95% <0.00%> (-4.35%) ⬇️
components/core/util/text-measure.ts 92.98% <0.00%> (+0.87%) ⬆️
components/table/src/table-style.service.ts 96.55% <0.00%> (+1.72%) ⬆️

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 64b7389...afcbc0e. Read the comment docs.

@@ -43,7 +43,7 @@ const NZ_NOTIFICATION_DEFAULT_CONFIG: Required<NotificationConfig> = {
<nz-notification
*ngFor="let instance of topLeftInstances"
[instance]="instance"
[placement]="config.nzPlacement"
[placement]="instance.options.nzPlacement"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is the fix for the wrong direction of the notifactionMotion

@@ -172,6 +202,8 @@ export class NzNotificationContainerComponent extends NzMNContainerComponent {
this.topRightInstances = this.instances.filter(m => m.options.nzPlacement === 'topRight' || !m.options.nzPlacement);
this.bottomLeftInstances = this.instances.filter(m => m.options.nzPlacement === 'bottomLeft');
this.bottomRightInstances = this.instances.filter(m => m.options.nzPlacement === 'bottomRight');
this.topInstances = this.instances.filter(m => m.options.nzPlacement === 'top');
this.bottomInstances = this.instances.filter(m => m.options.nzPlacement === 'bottom');
Copy link
Member

@wzhudev wzhudev Jul 1, 2022

Choose a reason for hiding this comment

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

Maybe we can do these in one loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated!

@rorry121 rorry121 force-pushed the feat/notifaction-placement branch from 055652d to afcbc0e Compare July 1, 2022 06:35
Copy link
Member

@wzhudev wzhudev left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@simplejason simplejason merged commit d8b26dd into NG-ZORRO:master Jul 11, 2022
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.

None yet

3 participants