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

feat(module:anchor): url fragment change on click - nzReplace

Open ParsaArvanehPA opened this issue 11 months ago • 3 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [✔] The commit message follows our guidelines: https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/CONTRIBUTING.md#commit
  • [✔] 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
[✔] 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?

  • Unlike Ant's Anchor, click on an anchor's link does'nt update the fragment of the current URL.
  • We lack the replace option that Ant provides.

What is the new behavior?

  1. In contrast to the Ant's Anchor, the URL fragment now updates accordingly when an anchor link is activated.
  2. The addition of nzReplace provides an option that, when enabled, replaces the current history state without adding a new state to the browser's history stack.

Does this PR introduce a breaking change?

[ ] Yes
[✔] No

Other information

ParsaArvanehPA avatar Mar 24 '24 20:03 ParsaArvanehPA

This preview will be available after the AzureCI is passed.

zorro-bot[bot] avatar Mar 24 '24 20:03 zorro-bot[bot]

Codecov Report

Attention: Patch coverage is 96.61972% with 12 lines in your changes missing coverage. Please review.

Project coverage is 91.53%. Comparing base (6ec38a2) to head (7b9723c). Report is 68 commits behind head on master.

Files Patch % Lines
components/anchor/anchor.component.ts 84.61% 0 Missing and 2 partials :warning:
components/code-editor/code-editor.service.ts 0.00% 2 Missing :warning:
components/tabs/tab-link.directive.ts 33.33% 2 Missing :warning:
components/back-top/back-top.component.ts 66.66% 0 Missing and 1 partial :warning:
components/dropdown/dropdown-button.directive.ts 0.00% 1 Missing :warning:
components/rate/rate.component.ts 85.71% 0 Missing and 1 partial :warning:
...ts/table/src/table/table-inner-scroll.component.ts 85.71% 1 Missing :warning:
components/table/src/table/tbody.component.ts 66.66% 1 Missing :warning:
components/tabs/tabset.component.ts 83.33% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8464      +/-   ##
==========================================
+ Coverage   91.51%   91.53%   +0.02%     
==========================================
  Files         535      536       +1     
  Lines       18424    18446      +22     
  Branches     2814     2818       +4     
==========================================
+ Hits        16860    16884      +24     
+ Misses       1245     1241       -4     
- Partials      319      321       +2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 24 '24 20:03 codecov[bot]

unit tests failed with error, please solve this issue first @ParsaArvanehPA

anchor property (nzChange) should emit nzChange when scrolling to the anchor

Laffery avatar Jun 04 '24 04:06 Laffery