Skip to content

feat(module:notification): support for more custom templates #8046

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

Merged

Conversation

HyperLife1119
Copy link
Collaborator

@HyperLife1119 HyperLife1119 commented Aug 7, 2023

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: N/A

  1. 要想自定义按钮,必须传递整个 Notification 模板。
  2. 不支持 title / content 模板

What is the new behavior?

  1. 使用 nzButton 实现自定义按钮。
  2. 支持 title / content 模板

Does this PR introduce a breaking change?

[x] Yes
[ ] No

一个微小的破坏性变更:
在使用字符串作为 title/content 时,ant-notification-notice-messageant-notification-notice-description 的内部会增加一层 div 节点

这可能会破坏用户自定义的 CSS 选择器(子节点选择器):

.ant-notification-notice-message > x { }
.ant-notification-notice-description > x { }

Other information

@zorro-bot
Copy link

zorro-bot bot commented Aug 7, 2023

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fa0312a) 91.64% compared to head (f98335e) 91.69%.
Report is 60 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8046      +/-   ##
==========================================
+ Coverage   91.64%   91.69%   +0.04%     
==========================================
  Files         515      519       +4     
  Lines       17640    17857     +217     
  Branches     2790     2735      -55     
==========================================
+ Hits        16167    16374     +207     
- Misses       1175     1184       +9     
- Partials      298      299       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HyperLife1119 HyperLife1119 force-pushed the feat/notification-template branch from 1857761 to e086d89 Compare August 7, 2023 16:11
@HyperLife1119 HyperLife1119 changed the title feat(module:notification): support for button template feat(module:notification): support for more custom templates Aug 7, 2023
@Nicoss54
Copy link
Collaborator

Nicoss54 commented Oct 7, 2023

LGTM! @simplejason could you take a look

@HyperLife1119
Copy link
Collaborator Author

This PR contains breaking changes and we should merge it before v17 is officially released. @simplejason @OriginRing

@HyperLife1119 HyperLife1119 added 💔 Breaking Change This PR or the solution to this issue would introduce breaking changes PR: target-major labels Nov 17, 2023
@HyperLife1119 HyperLife1119 force-pushed the feat/notification-template branch 2 times, most recently from 210051e to dee3d90 Compare November 18, 2023 05:54
@HyperLife1119
Copy link
Collaborator Author

我决定保留 NzNotificationService#template() 用法,作为 zorro 的一种特色功能存在。

@HyperLife1119 HyperLife1119 force-pushed the feat/notification-template branch from dee3d90 to f98335e Compare November 18, 2023 05:57
@HyperLife1119 HyperLife1119 merged commit 9689c42 into NG-ZORRO:master Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💔 Breaking Change This PR or the solution to this issue would introduce breaking changes PR: reviewed-approved PR: target-major
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants