core icon indicating copy to clipboard operation
core copied to clipboard

chore(edit-content): Use new Angular Syntax in DotNavigationComponent

Open nicobytes opened this issue 4 months ago • 1 comments

Parent Issue

https://github.com/dotCMS/core/issues/30401

Proposed Changes

This pull request includes some changes to the dot-navigation components in the dotcms-ui application. The primary focus is on refactoring the code to use Angular's new reactive primitives and simplifying the template syntax.

Template Refactoring:

  • core-web/apps/dotcms-ui/src/app/view/components/dot-navigation/components/dot-nav-icon/dot-nav-icon.component.html: Replaced *ngIf and ng-template with Angular's new @if and @else syntax.
  • core-web/apps/dotcms-ui/src/app/view/components/dot-navigation/components/dot-sub-nav/dot-sub-nav.component.html: Updated *ngFor to use the new @for syntax with tracking. [1] [2]
  • core-web/apps/dotcms-ui/src/app/view/components/dot-navigation/dot-navigation.component.html: Replaced *ngFor and async pipe with @for and reactive signals.

Component Refactoring:

  • core-web/apps/dotcms-ui/src/app/view/components/dot-navigation/dot-navigation.component.ts: Replaced constructor dependency injection with the inject function and used toSignal to convert observables to signals. [1] [2]
  • core-web/apps/dotcms-ui/src/app/view/components/dot-navigation/dot-navigation.component.ts: Updated method calls to use private fields for services. [1] [2] [3]

Checklist

  • [x] Tests
  • [x] Translations
  • [x] Security Implications Contemplated (add notes if applicable)

Screenshots

nicobytes avatar Oct 18 '24 17:10 nicobytes