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

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

Merged

Conversation

nicobytes
Copy link
Contributor

@nicobytes nicobytes commented Oct 18, 2024

Parent Issue

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

Component Refactoring:

Checklist

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

Screenshots

This PR fixes: #30401

@nicobytes nicobytes requested review from oidacra and hmoreras October 18, 2024 17:56
@nicobytes nicobytes enabled auto-merge October 18, 2024 18:23
@nicobytes nicobytes added this pull request to the merge queue Oct 21, 2024
Merged via the queue into main with commit 0bae3dc Oct 21, 2024
21 checks passed
@nicobytes nicobytes deleted the 30401-use-new-angular-syntax-in-dotnavigationcomponent branch October 21, 2024 23:47
spbolton pushed a commit that referenced this pull request Nov 11, 2024
…#30403)

### Parent Issue

#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`](diffhunk://#diff-93a54f28d1e0bee7ef4548b64f4803d76086c903bcc0da2dafec62761c72c9fdL1-R5):
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`](diffhunk://#diff-1f36b07f7cdfbecc666246d6847285e225e96a1ee4802cd8c11c6bb149e484a0L2-R3):
Updated `*ngFor` to use the new `@for` syntax with tracking.
[[1]](diffhunk://#diff-1f36b07f7cdfbecc666246d6847285e225e96a1ee4802cd8c11c6bb149e484a0L2-R3)
[[2]](diffhunk://#diff-1f36b07f7cdfbecc666246d6847285e225e96a1ee4802cd8c11c6bb149e484a0R13)
*
[`core-web/apps/dotcms-ui/src/app/view/components/dot-navigation/dot-navigation.component.html`](diffhunk://#diff-536660425506325914cc437d2a9733660d2ea944540b0c354e4599435ad85e06L1-R12):
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`](diffhunk://#diff-6e9db9ff07d7bd661a702691aa91170567a42d0a9786902f91cdd899b7da1b51L3-R4):
Replaced constructor dependency injection with the `inject` function and
used `toSignal` to convert observables to signals.
[[1]](diffhunk://#diff-6e9db9ff07d7bd661a702691aa91170567a42d0a9786902f91cdd899b7da1b51L3-R4)
[[2]](diffhunk://#diff-6e9db9ff07d7bd661a702691aa91170567a42d0a9786902f91cdd899b7da1b51L16-R32)
*
[`core-web/apps/dotcms-ui/src/app/view/components/dot-navigation/dot-navigation.component.ts`](diffhunk://#diff-6e9db9ff07d7bd661a702691aa91170567a42d0a9786902f91cdd899b7da1b51L43-R47):
Updated method calls to use private fields for services.
[[1]](diffhunk://#diff-6e9db9ff07d7bd661a702691aa91170567a42d0a9786902f91cdd899b7da1b51L43-R47)
[[2]](diffhunk://#diff-6e9db9ff07d7bd661a702691aa91170567a42d0a9786902f91cdd899b7da1b51L56-R62)
[[3]](diffhunk://#diff-6e9db9ff07d7bd661a702691aa91170567a42d0a9786902f91cdd899b7da1b51L70-R74)

### Checklist
- [x] Tests
- [x] Translations
- [x] Security Implications Contemplated (add notes if applicable)


### Screenshots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use new Angular Syntax in DotNavigationComponent
3 participants