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:calendar): custom header #8418

Merged

Conversation

ParsaArvanehPA
Copy link
Contributor

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?

Custom Header feature for the Calendar component has been added.

What is the new behavior?

described above.

Does this PR introduce a breaking change?

[ ] Yes
[✔] No

Other information

Copy link

codecov bot commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.60%. Comparing base (fdfc816) to head (39f75d0).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8418      +/-   ##
==========================================
- Coverage   91.61%   91.60%   -0.02%     
==========================================
  Files         519      519              
  Lines       18076    18074       -2     
  Branches     2848     2761      -87     
==========================================
- Hits        16561    16557       -4     
- Misses       1216     1218       +2     
  Partials      299      299              

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


@if (mode === 'month') {
@if (nzCustomHeader) {
<ng-container [ngTemplateOutlet]="nzCustomHeader"></ng-container>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use nzStringTemplateOutlet instead of ngTemplateOutlet, which allows nzCustomHeader to accept both strings and TemplateRef types.

Comment on lines 261 to 269
<nz-calendar-header
[nzCustomHeader]="customHeader"
(yearChange)="year = $event"
(monthChange)="month = $event"
></nz-calendar-header>

<ng-template #custom>
<p>custom</p>
</ng-template>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<nz-calendar-header
[nzCustomHeader]="customHeader"
(yearChange)="year = $event"
(monthChange)="month = $event"
></nz-calendar-header>
<ng-template #custom>
<p>custom</p>
</ng-template>
<nz-calendar-header
[nzCustomHeader]="customHeader"
(yearChange)="year = $event"
(monthChange)="month = $event"
></nz-calendar-header>
<ng-template #customHeader>
<p>custom</p>
</ng-template>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that ng-template should not have the same name as customHeader because customHeader is already declared in here.

The reason as to why I have declared two diffrent set of custom header is because of this line.
Although I changed the name to avoid confusion.

@ParsaArvanehPA
Copy link
Contributor Author

ParsaArvanehPA commented Mar 8, 2024

@HyperLife1119
Thank you for cheking my PR; all the changes are done.

Copy link
Collaborator

@HyperLife1119 HyperLife1119 left a comment

Choose a reason for hiding this comment

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

LGTM

@HyperLife1119 HyperLife1119 merged commit ec7ec35 into NG-ZORRO:master Mar 10, 2024
8 of 9 checks passed
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