Skip to content

Conversation

@sadaf895
Copy link
Contributor

@sadaf895 sadaf895 commented Dec 17, 2025

PR Checklist

Before you request a manual PR review from someone, please go through all of this list, check the points and mark them checked here.
This helps us reduce the number of review cycles and use the time of our core reviewers more effectively.

  • all automatic CI checks pass (🟢)
    • i.e. code formatting (ng lint) passes
    • i.e. unit tests (ng test) passes
    • in some cases unit test coverage can be difficult to achieve. If that or any other CI check fails, you can also leave a short comment here why this should be accepted anyway.
  • manually tested (all) required functionality described in the issue manually yourself on the final version of the code (developer)
  • reviewed the "Files changed" section of the PR briefly yourself to check for any unwanted changes
    • e.g. clean up debugging console.log statements, disabled tests, ...
    • please also avoid changes that are not directly related to the issue of the PR, even small code reformatings make the review process much more complex
  • 🚦 PR status is changed to "Ready for Review"
    • while you are still working on initial implementation, keep the PR in "Draft" status
    • once you are done with your initial work, change to "Ready for Review". This will trigger some additional automated checks and reviews.
    • (PR = "Ready for Review" does not immediately request a manual review yet, first complete the further checks below)
  • marked each code review comment as resolved OR commented on it with a question, if unsure
    • both implementing suggestions of automatic code review or discarding them as not applicable is okay
  • all checkboxes in this checklist are checked (to show the reviewer this really is ready)
  • 🚦 moved the issue related to this PR to Status "Functional Review" to request a personal review

⏪ if issues are commented from testing or code review, make changes. Please then re-check every item of the checklist here again.


Remaining TODOs:

  • fix unit tests (config not available)
  • check "Changed after checked" error in dev console when running the app

Summary by CodeRabbit

Release Notes

  • Chores
    • Upgraded Angular framework and ecosystem to version 21, including Material Design components, Keycloak authentication, and development tooling
    • Updated UI libraries (FontAwesome, ngx-markdown) to latest versions
    • Removed unused internal dependencies and simplified TypeScript configuration
    • Enhanced test infrastructure with improved async testing patterns

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 17, 2025

📝 Walkthrough

Walkthrough

Angular framework and ecosystem upgraded from v20 to v21, including Material, CDK, and dev tooling (Storybook, CLI, ESLint). CommonModule removed from standalone components, unused imports cleaned up, test utilities updated to async patterns, and deprecated TypeScript compiler options removed.

Changes

Cohort / File(s) Summary
Framework & Ecosystem Upgrades
package.json
Angular core, Material, CDK bumped from v20 → v21; Storybook v9 → v10; Sentry CLI v2 → v3; TypeScript ESLint, Angular CLI, and build tools updated to compatible versions; dependency overrides modified (keycloak-angular propagation added, chokidar override removed); buffer dependency added.
CommonModule Removal
src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts, src/app/child-dev-project/notes/dashboard-widgets/important-notes-dashboard-settings.component/important-notes-dashboard-settings.component.ts, src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts, src/app/core/admin/admin-list-manager/admin-list-manager.component.ts, src/app/core/admin/admin-primary-action/admin-primary-action.component.ts, src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts, src/app/features/dashboard-widgets/entity-count-dashboard-widget/entity-count-dashboard/entity-count-dashboard.component.ts, src/app/features/matching-entities/admin-matching-entities/edit-matching-entity-side/edit-matching-entity-side.component.ts
Removed CommonModule imports from standalone component declarations across multiple administrative and dashboard widgets; aligns with Angular 21 standalone component patterns.
Material Provider & Import Cleanup
src/app/core/basic-datatypes/date/date-range-filter/date-range-filter-panel/date-range-filter-panel.component.ts
Removed MAT\_RANGE\_DATE\_SELECTION\_MODEL\_PROVIDER from imports and providers array.
Localize & Unused Import Cleanup
src/app/child-dev-project/children/demo-data-generators/fixtures/religions.ts, src/app/core/entity/default-datatype/default.datatype.ts
Removed $localize initialization import (with comment noting necessity for e2e fixtures in one file); removed unused asArray utility import.
UI Component Refactoring
src/app/core/ui/ui/ui.component.ts
Removed IconButtonComponent from imports and component declarations.
Test Refactoring & Async Patterns
src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts, src/app/core/export/query.service.spec.ts
Updated test suites to use async patterns: firstValueFrom for observable assertions, fakeAsync/tick for controlled async execution; replaced callback-based helpers with direct async/await flows.
Initialization Flow Update
src/app/utils/database-testing.module.ts
Added firstValueFrom await to ensure configuration loading completes before entity setup initialization.
TypeScript Configuration
tsconfig.json
Removed deprecated compiler options: downlevelIteration and allowSyntheticDefaultImports.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • #3295: Storybook configuration and dependency updates align with the Storybook v9 → v10 bump included in this Angular 21 upgrade.
  • #3418: Modifies src/app/core/ui/ui/ui.component.ts with admin role signals and Admin Overview button functionality in the same component where IconButtonComponent is removed.
  • #3298: Changes src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts to implement AdminNoteDetailsComponent API in the same file where CommonModule is removed.

Suggested reviewers

  • sadaf895
  • Abhinegi2

Poem

🐰 Whiskers twitching with Angular cheer,
From v20 to v21, the path is clear!
CommonModules pruned, imports align,
Tests now async, a future so fine!
Hop-hop-hooray, the upgrade's complete!

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

Deployed to https://pr-3527.aam-digital.net/

@argos-ci
Copy link

argos-ci bot commented Dec 17, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 14 removed Jan 9, 2026, 5:58 PM

@sadaf895 sadaf895 changed the title refactor: update to Angular21 chore: update to Angular21 Dec 18, 2025
@sadaf895 sadaf895 self-assigned this Dec 18, 2025
sadaf895 and others added 19 commits January 5, 2026 14:11
…ems (#3561)

by using pagination

fixes #3548

---------

Co-authored-by: Sebastian Leidig <[email protected]>
by a batch save and avoiding intermittent reloads of the list
closes #2843

---------

Co-authored-by: Sebastian <[email protected]>
to simplify use of icon + text

closes #3458
…arch text (#3538)

fixes #3526

---------

Co-authored-by: Sebastian Leidig <[email protected]>
@sleidig sleidig force-pushed the refactor/upgrade-Angular21 branch from cf781b7 to ac22fcd Compare January 9, 2026 17:39
@sleidig sleidig marked this pull request as ready for review January 9, 2026 17:48
Copilot AI review requested due to automatic review settings January 9, 2026 17:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request upgrades the application from Angular 20 to Angular 21, addressing issue #3476. The upgrade includes dependency updates, removal of deprecated configurations, and test improvements to handle timing issues.

  • Updates Angular framework and related packages from version 20 to 21
  • Removes CommonModule imports from standalone components (no longer needed in Angular 21)
  • Improves test reliability with better async handling using fakeAsync and firstValueFrom
  • Removes obsolete TypeScript compiler options and unused imports

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.json Updates Angular core, Material, CLI, and related dependencies to version 21, along with other library updates
tsconfig.json Removes deprecated compiler options (downlevelIteration, allowSyntheticDefaultImports)
src/app/utils/database-testing.module.ts Adds proper wait for ConfigService initialization to fix timing issues in tests
src/app/core/export/query.service.spec.ts Wraps tests in fakeAsync and adds tick() calls to handle async updates properly
src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts Refactors tests to use firstValueFrom for cleaner async handling
src/app/core/entity/default-datatype/default.datatype.ts Removes unused asArray import and adds clarifying comment
src/app/core/basic-datatypes/date/date-range-filter/date-range-filter-panel/date-range-filter-panel.component.ts Removes MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER (no longer needed)
Multiple component files Removes CommonModule imports from standalone components (automatic in Angular 21)
src/app/child-dev-project/children/demo-data-generators/fixtures/religions.ts Removes $localize import (requires fix)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,5 +1,3 @@
import { $localize } from "@angular/localize/init";

export const religions = [
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The import statement for $localize from "@angular/localize/init" was removed, but the code still uses $localize on lines 3-9. This will likely cause a runtime error unless $localize is available globally. Either the import should be restored, or this file needs to be updated to ensure $localize is available.

Copilot uses AI. Check for mistakes.

import { EntityMapperService } from "./entity-mapper.service";
import { Entity } from "../model/entity";
import { Entity, EntityConstructor } from "../model/entity";
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

Unused import EntityConstructor.

Suggested change
import { Entity, EntityConstructor } from "../model/entity";
import { Entity } from "../model/entity";

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @src/app/core/entity/default-datatype/default.datatype.ts:
- Line 18: Remove the inline import of "@angular/localize/init" from
default.datatype.ts (delete the import of $localize in
src/app/core/entity/default-datatype/default.datatype.ts) and instead add a
single top-level import of "@angular/localize/init" in your application
bootstrap (polyfills.ts or main.ts) so $localize is provided once for the whole
app; also ensure your e2e test bootstrap uses the same polyfills/main so tests
pick up the global $localize rather than importing it in the DefaultDatatype
class.
🧹 Nitpick comments (1)
src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts (1)

60-66: Consider migrating to signal-based inputs and outputs.

The component still uses @Input and @Output decorators. Consider migrating to the modern input() and output() functions for better type safety and consistency with Angular's signal-based APIs.

♻️ Example migration to signal-based APIs
-  @Input() config: PanelComponent;
-  @Input() entityType: EntityConstructor;
+  config = input.required<PanelComponent>();
+  entityType = input.required<EntityConstructor>();

   /**
    * emitted when a related entity's schema has been modified.
    */
-  @Output() relatedEntityModified = new EventEmitter<EntityConstructor>();
+  relatedEntityModified = output<EntityConstructor>();

Note: You'll need to update references from this.config to this.config() and this.entityType to this.entityType() throughout the component, and use this.relatedEntityModified.emit() as before.

As per coding guidelines: "Prefer input() and output() functions over @Input and @Output decorators in Angular components."

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9b0672 and ac22fcd.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (17)
  • package.json
  • src/app/child-dev-project/children/demo-data-generators/fixtures/religions.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
  • src/app/child-dev-project/notes/dashboard-widgets/important-notes-dashboard-settings.component/important-notes-dashboard-settings.component.ts
  • src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts
  • src/app/core/admin/admin-list-manager/admin-list-manager.component.ts
  • src/app/core/admin/admin-primary-action/admin-primary-action.component.ts
  • src/app/core/basic-datatypes/date/date-range-filter/date-range-filter-panel/date-range-filter-panel.component.ts
  • src/app/core/entity/default-datatype/default.datatype.ts
  • src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts
  • src/app/core/export/query.service.spec.ts
  • src/app/core/ui/ui/ui.component.ts
  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
  • src/app/features/dashboard-widgets/entity-count-dashboard-widget/entity-count-dashboard/entity-count-dashboard.component.ts
  • src/app/features/matching-entities/admin-matching-entities/edit-matching-entity-side/edit-matching-entity-side.component.ts
  • src/app/utils/database-testing.module.ts
  • tsconfig.json
💤 Files with no reviewable changes (6)
  • src/app/core/basic-datatypes/date/date-range-filter/date-range-filter-panel/date-range-filter-panel.component.ts
  • src/app/child-dev-project/notes/dashboard-widgets/important-notes-dashboard-settings.component/important-notes-dashboard-settings.component.ts
  • src/app/core/ui/ui/ui.component.ts
  • tsconfig.json
  • src/app/features/dashboard-widgets/entity-count-dashboard-widget/entity-count-dashboard/entity-count-dashboard.component.ts
  • src/app/child-dev-project/children/demo-data-generators/fixtures/religions.ts
🧰 Additional context used
📓 Path-based instructions (11)
**/*.component.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/*.component.ts: Use standalone components (default behavior, do NOT set standalone: true)
Prefer input() and output() functions over @Input and @Output decorators in Angular components
Use signals for reactive state management with computed() for derived state
Set changeDetection: ChangeDetectionStrategy.OnPush for all components
Prefer inline templates for small components in Angular
Prefer Reactive Forms over Template-driven forms in Angular
Use NgOptimizedImage for static images instead of base64 encoded images
Use Angular Material components for UI consistency following Material Design guidelines
Implement OnPush change detection strategy for performance optimization
Use trackBy functions for lists in Angular templates for performance optimization

Files:

  • src/app/core/admin/admin-primary-action/admin-primary-action.component.ts
  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
  • src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
  • src/app/core/admin/admin-list-manager/admin-list-manager.component.ts
  • src/app/features/matching-entities/admin-matching-entities/edit-matching-entity-side/edit-matching-entity-side.component.ts
**/*.{component,service,directive,guard,interceptor,resolver,pipe}.ts

📄 CodeRabbit inference engine (AGENTS.md)

Use inject() function instead of constructor injection for dependencies

Files:

  • src/app/core/admin/admin-primary-action/admin-primary-action.component.ts
  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
  • src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
  • src/app/core/admin/admin-list-manager/admin-list-manager.component.ts
  • src/app/features/matching-entities/admin-matching-entities/edit-matching-entity-side/edit-matching-entity-side.component.ts
**/*.{component,service}.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{component,service}.ts: Use update() or set() instead of mutate() when modifying signals in Angular
Create interfaces for configuration objects and let component classes implement them

Files:

  • src/app/core/admin/admin-primary-action/admin-primary-action.component.ts
  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
  • src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
  • src/app/core/admin/admin-list-manager/admin-list-manager.component.ts
  • src/app/features/matching-entities/admin-matching-entities/edit-matching-entity-side/edit-matching-entity-side.component.ts
**/*.{component,directive}.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{component,directive}.ts: Do NOT use @HostBinding and @HostListener decorators; put host bindings inside the host object of @Component or @Directive decorator
Implement proper permissions checking via CASL integration using EntityAbility and DisableEntityOperationDirective

Files:

  • src/app/core/admin/admin-primary-action/admin-primary-action.component.ts
  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
  • src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
  • src/app/core/admin/admin-list-manager/admin-list-manager.component.ts
  • src/app/features/matching-entities/admin-matching-entities/edit-matching-entity-side/edit-matching-entity-side.component.ts
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.ts: Use strict type checking with TypeScript and avoid any type; use unknown when type is uncertain
Prefer type inference in TypeScript when obvious

Files:

  • src/app/core/admin/admin-primary-action/admin-primary-action.component.ts
  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
  • src/app/core/export/query.service.spec.ts
  • src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
  • src/app/core/admin/admin-list-manager/admin-list-manager.component.ts
  • src/app/features/matching-entities/admin-matching-entities/edit-matching-entity-side/edit-matching-entity-side.component.ts
  • src/app/utils/database-testing.module.ts
  • src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts
  • src/app/core/entity/default-datatype/default.datatype.ts
src/**/*.{ts,js}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,js}: Use ESLint for linting (npm run lint)
Use Prettier for code formatting

Files:

  • src/app/core/admin/admin-primary-action/admin-primary-action.component.ts
  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
  • src/app/core/export/query.service.spec.ts
  • src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
  • src/app/core/admin/admin-list-manager/admin-list-manager.component.ts
  • src/app/features/matching-entities/admin-matching-entities/edit-matching-entity-side/edit-matching-entity-side.component.ts
  • src/app/utils/database-testing.module.ts
  • src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts
  • src/app/core/entity/default-datatype/default.datatype.ts
**/*.component.{ts,html}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.component.{ts,html}: All user-facing strings must be translatable using Angular i18n markers or $localize in Aam Digital
Follow existing translation key patterns in Aam Digital
Use Angular Material accessibility features in components

Files:

  • src/app/core/admin/admin-primary-action/admin-primary-action.component.ts
  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
  • src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
  • src/app/core/admin/admin-list-manager/admin-list-manager.component.ts
  • src/app/features/matching-entities/admin-matching-entities/edit-matching-entity-side/edit-matching-entity-side.component.ts
**/*.{component,service}.spec.ts

📄 CodeRabbit inference engine (AGENTS.md)

Write unit tests for all new components and services using Jasmine/Karma

Files:

  • src/app/core/export/query.service.spec.ts
  • src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts
**/*.spec.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/*.spec.ts: Mock dependencies properly using Angular testing utilities in unit tests
Use established testing patterns from the Aam Digital project in unit tests

Files:

  • src/app/core/export/query.service.spec.ts
  • src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts
**/*entity*.{service,component}.ts

📄 CodeRabbit inference engine (AGENTS.md)

Use proper generics for entity types in TypeScript

Files:

  • src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts
  • src/app/features/matching-entities/admin-matching-entities/edit-matching-entity-side/edit-matching-entity-side.component.ts
**/*entity*.spec.ts

📄 CodeRabbit inference engine (AGENTS.md)

Test entity operations with proper data setup/teardown in unit tests

Files:

  • src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts
🧠 Learnings (27)
📓 Common learnings
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.component.ts : Use Angular Material components for UI consistency following Material Design guidelines
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.component.{ts,html} : Use Angular Material accessibility features in components
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.component.ts : Use standalone components (default behavior, do NOT set `standalone: true`)

Applied to files:

  • src/app/core/admin/admin-primary-action/admin-primary-action.component.ts
  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
  • src/app/features/matching-entities/admin-matching-entities/edit-matching-entity-side/edit-matching-entity-side.component.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.component.ts : Implement OnPush change detection strategy for performance optimization

Applied to files:

  • src/app/core/admin/admin-primary-action/admin-primary-action.component.ts
  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to src/app/core/common-components/**/*.component.ts : Shared components belong in `src/app/core/common-components/`

Applied to files:

  • src/app/core/admin/admin-primary-action/admin-primary-action.component.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.component.ts : Use Angular Material components for UI consistency following Material Design guidelines

Applied to files:

  • src/app/core/admin/admin-primary-action/admin-primary-action.component.ts
  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
  • src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
  • src/app/core/admin/admin-list-manager/admin-list-manager.component.ts
  • src/app/features/matching-entities/admin-matching-entities/edit-matching-entity-side/edit-matching-entity-side.component.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.{component,service}.ts : Create interfaces for configuration objects and let component classes implement them

Applied to files:

  • src/app/core/admin/admin-primary-action/admin-primary-action.component.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*entity*.service.ts : Use entity services for data access and caching in Aam Digital

Applied to files:

  • src/app/core/admin/admin-primary-action/admin-primary-action.component.ts
  • src/app/core/export/query.service.spec.ts
  • src/app/utils/database-testing.module.ts
  • src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.component.{ts,html} : Use Angular Material accessibility features in components

Applied to files:

  • src/app/core/admin/admin-primary-action/admin-primary-action.component.ts
  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
  • src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts
  • src/app/core/admin/admin-list-manager/admin-list-manager.component.ts
  • src/app/features/matching-entities/admin-matching-entities/edit-matching-entity-side/edit-matching-entity-side.component.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.component.html : Use native control flow (`if`, `for`, `switch`) instead of structural directives (`*ngIf`, `*ngFor`, `*ngSwitch`)

Applied to files:

  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.component.ts : Prefer inline templates for small components in Angular

Applied to files:

  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.component.{ts,html} : All user-facing strings must be translatable using Angular i18n markers or `$localize` in Aam Digital

Applied to files:

  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
  • src/app/core/entity/default-datatype/default.datatype.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.component.ts : Prefer Reactive Forms over Template-driven forms in Angular

Applied to files:

  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.component.ts : Prefer `input()` and `output()` functions over `Input` and `Output` decorators in Angular components

Applied to files:

  • src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*entity*.spec.ts : Test entity operations with proper data setup/teardown in unit tests

Applied to files:

  • src/app/core/export/query.service.spec.ts
  • src/app/utils/database-testing.module.ts
  • src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts
  • src/app/core/entity/default-datatype/default.datatype.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.spec.ts : Mock dependencies properly using Angular testing utilities in unit tests

Applied to files:

  • src/app/core/export/query.service.spec.ts
  • src/app/utils/database-testing.module.ts
  • src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to src/app/core/demo-data/**/*.ts : Provide demo data generators for new entities using `faker-js/faker` following existing demo data patterns

Applied to files:

  • src/app/core/export/query.service.spec.ts
  • src/app/utils/database-testing.module.ts
  • src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts
  • src/app/core/entity/default-datatype/default.datatype.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.spec.ts : Use established testing patterns from the Aam Digital project in unit tests

Applied to files:

  • src/app/core/export/query.service.spec.ts
  • src/app/utils/database-testing.module.ts
  • src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.{component,service}.spec.ts : Write unit tests for all new components and services using Jasmine/Karma

Applied to files:

  • src/app/core/export/query.service.spec.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to e2e/tests/**/*.ts : Use realistic user scenarios in Playwright E2E tests

Applied to files:

  • src/app/core/export/query.service.spec.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.{component,directive}.ts : Implement proper permissions checking via CASL integration using `EntityAbility` and `DisableEntityOperationDirective`

Applied to files:

  • src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*entity*.{service,component}.ts : Use proper generics for entity types in TypeScript

Applied to files:

  • src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts
  • src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts
  • src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts
  • src/app/core/entity/default-datatype/default.datatype.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.component.ts : Use trackBy functions for lists in Angular templates for performance optimization

Applied to files:

  • src/app/core/admin/admin-list-manager/admin-list-manager.component.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/models/**/*.entity.ts : Define entity schemas through `DatabaseField()` annotations in model classes

Applied to files:

  • src/app/utils/database-testing.module.ts
  • src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts
  • src/app/core/entity/default-datatype/default.datatype.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*.{component,service,directive,guard,interceptor,resolver,pipe}.ts : Use `inject()` function instead of constructor injection for dependencies

Applied to files:

  • src/app/utils/database-testing.module.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/models/**/*.entity.ts : All data models must extend the base `Entity` class in Aam Digital

Applied to files:

  • src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts
  • src/app/core/entity/default-datatype/default.datatype.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to **/*datatype*.{service,component}.ts : Implement specific datatypes extending the `DefaultDatatype` class with 'edit' and 'display' components in Aam Digital

Applied to files:

  • src/app/core/entity/default-datatype/default.datatype.ts
📚 Learning: 2025-11-26T16:20:52.119Z
Learnt from: CR
Repo: Aam-Digital/ndb-core PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T16:20:52.119Z
Learning: Applies to src/**/*.{ts,js} : Use ESLint for linting (npm run lint)

Applied to files:

  • package.json
🧬 Code graph analysis (1)
src/app/core/export/query.service.spec.ts (1)
src/app/core/export/query.service.ts (1)
  • queryData (87-114)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Agent
  • GitHub Check: Seer Code Review
  • GitHub Check: qa / test-e2e
  • GitHub Check: build-webapp
  • GitHub Check: qa / test-unit
🔇 Additional comments (16)
src/app/features/matching-entities/admin-matching-entities/edit-matching-entity-side/edit-matching-entity-side.component.ts (1)

15-15: Verify CommonModule removal aligns with actual template usage.

CommonModule removal from standalone components is appropriate for Angular 21. However, ensure the component template doesn't rely on CommonModule structural directives (*ngIf, *ngFor, *ngSwitch) or pipes (DatePipe, CurrencyPipe, etc.). If using native control flow syntax (@if, @for, @switch), the removal is safe and aligns with project patterns.

src/app/core/admin/admin-list-manager/admin-list-manager.component.ts (1)

10-10: CommonModule removal requires template verification.

Confirm the template is compatible with CommonModule removal by verifying it does not use structural directives (*ngIf, *ngFor, *ngSwitch, etc.) or CommonModule pipes (date, currency, slice, uppercase, lowercase, titlecase, json, keyvalue, async). Use native control flow syntax (if, for, switch) per Angular standards.

src/app/child-dev-project/notes/admin-note-details/admin-note-details.component.ts (1)

2-2: CommonModule was never imported in this component; no removal occurred.

The component already uses standalone syntax with the imports array (line 17) and never included CommonModule. The template verification confirms compatibility—no structural directives or CommonModule pipes are present. However, the component does not implement the OnPush change detection strategy recommended in the coding guidelines, nor does it use the input() and output() functions instead of @Input and @Output decorators.

Likely an incorrect or invalid review comment.

src/app/core/admin/admin-primary-action/admin-primary-action.component.ts (1)

11-11: CommonModule removal is appropriate for Angular 21 standalone components.

Removing CommonModule is correct for this standalone component. The template uses only Angular Material components, custom app components, and modern native control flow (@if), with no dependency on CommonModule directives or pipes.

src/app/features/dashboard-widgets/birthday-dashboard-widget/birthday-dashboard-settings.component/birthday-dashboard-settings.component.ts (1)

3-3: CommonModule removal is correct for this standalone component.

Verified: The template uses modern control flow syntax (@for, @if) instead of structural directives, and contains no CommonModule pipes. The removal reduces the module surface area as intended.

src/app/core/admin/admin-entity-details/admin-entity-panel-component/admin-entity-panel-component.component.ts (1)

6-6: LGTM: CommonModule removal aligns with Angular 21.

The removal of CommonModule from the imports is correct for Angular 21 standalone components, as common directives like NgIf, NgFor, etc., are now automatically available without explicit imports.

src/app/utils/database-testing.module.ts (2)

14-14: LGTM: RxJS import added for async config handling.


37-48: Excellent async initialization improvement.

The explicit wait for ConfigService.configUpdates using firstValueFrom ensures configuration is fully loaded before setting up entities. This prevents race conditions in tests where Angular doesn't automatically await APP_INITIALIZER providers.

src/app/core/export/query.service.spec.ts (3)

1-1: LGTM: Testing utilities imported for async handling.


403-417: Proper async test pattern for entity updates.

The conversion to fakeAsync with explicit tick() calls correctly handles the asynchronous entity update propagation. The multiple tick() calls ensure both the save operation and the entityMapper.receiveUpdates observable complete before assertions run.


419-435: Proper async test pattern for entity deletion.

The fakeAsync pattern with tick() calls ensures the entity removal and update notifications complete before verifying the entity is no longer in the query results.

src/app/core/entity/entity-mapper/entity-mapper.service.spec.ts (3)

19-19: LGTM: EntityConstructor type imported.


30-31: LGTM: Testing utilities imported.


188-219: Excellent test refactoring with explicit async assertions.

The test now uses TestEntity to avoid interference from existing entities and firstValueFrom to explicitly convert the receiveUpdates observable to promises. This makes the test more reliable and easier to understand, with clear assertions for each CRUD operation.

package.json (2)

30-82: Angular 21 versions are valid and stable; no deprecation issues detected.

Verification confirms that Angular 21 (stable, released November 19, 2025) and the specified versions in package.json are legitimate and current:

All core Angular packages and related dependencies referenced in lines 30–82 are available in the npm registry with no deprecation flags.


139-144: Package overrides are appropriate for Angular 21 compatibility.

The keycloak-angular@^21.0.0 package officially supports Angular 21, using matching major-versioning with Angular starting from v19. The overrides correctly ensure keycloak-angular uses the specified Angular 21 versions (@angular/common, @angular/core, @angular/router).

*/

import { $localize } from "@angular/localize/init";
import { $localize } from "@angular/localize/init"; // import needed to make this file work in e2e test fixtures also
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's read the file to understand the context
cat -n src/app/core/entity/default-datatype/default.datatype.ts | head -70

Repository: Aam-Digital/ndb-core

Length of output: 3525


🏁 Script executed:

# Search for other usages of $localize in the project
rg '\$localize' --type ts -B 2 -A 2 | head -50

Repository: Aam-Digital/ndb-core

Length of output: 3889


🏁 Script executed:

# Check if there are any e2e test files or configurations
fd -e conf.js -e setup.ts -e test-setup | grep -E "(e2e|test)" | head -20

Repository: Aam-Digital/ndb-core

Length of output: 46


🌐 Web query:

Angular 21 localization $localize import configuration best practices

💡 Result:

Best-practice checklist for configuring $localize in Angular 21

  • Install via the CLI (adds types and the recommended import): run ng add @angular/localize. This updates package.json and tsconfig and (optionally) inserts the import for you. [1]

  • Where to import $localize:

    • For browser builds add the side-effect import once (polyfills.ts or main.ts): import '@angular/localize/init';.
    • For server-side rendering add the import in main.server.ts. [1][2]
  • Choose build-time vs runtime translation:

    • Default (recommended for production): merge translations at build time (Angular CLI localize/variants) so $localize is only a marker and translated strings are inlined — no runtime cost. Configure locales in angular.json and use ng build --localize / angular.json "localize" settings. [3]
    • If you need runtime translation (dynamic switching, fewer build outputs), use the runtime mode: put @angular/localize in dependencies (not devDependencies) or run ng add with --use-at-runtime; load translations at runtime with loadTranslations/clearTranslations. [1][4]
  • LOCALE_ID and locale data:

    • Import global locale data when needed (e.g. import '@angular/common/locales/global/fr';) or rely on CLI auto-inclusion when using --localize. Set LOCALE_ID appropriately. [2]
  • TypeScript and tooling:

    • Ensure tsconfig includes types: ["@angular/localize"] (ng add does this). If you manually add imports, also list @angular/localize in package.json dependencies. [1][5]
  • Avoid pitfalls:

    • Only import @angular/localize/init once per application (polyfills/main). Don’t add that import inside libraries; libraries should not force $localize on consumers.
    • Prefer build-time inlining for best performance and smallest bundles unless you explicitly need runtime features. [3][4]

If you want, I can show the exact angular.json snippets and main.ts/polyfills.ts examples for both build-time and runtime setups.

Sources: Angular docs — Add the localize package [1], Import global variants / locale data [2], Merge translations / build-time localize [3], @angular/localize API & runtime functions [4], $localize migration notes [5].


Move $localize import to application bootstrap.

The import on line 18 violates Angular 21 best practices. Per official documentation, @angular/localize/init should be imported once per application in bootstrap files (polyfills.ts or main.ts), not in source files or utility classes. Importing it here forces $localize on all consumers of this base class. The comment indicates this is a workaround for e2e test configuration—the proper fix is to configure the application bootstrap to make $localize globally available instead.

🤖 Prompt for AI Agents
In @src/app/core/entity/default-datatype/default.datatype.ts at line 18, Remove
the inline import of "@angular/localize/init" from default.datatype.ts (delete
the import of $localize in
src/app/core/entity/default-datatype/default.datatype.ts) and instead add a
single top-level import of "@angular/localize/init" in your application
bootstrap (polyfills.ts or main.ts) so $localize is provided once for the whole
app; also ensure your e2e test bootstrap uses the same polyfills/main so tests
pick up the global $localize rather than importing it in the DefaultDatatype
class.

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.

Upgrade to Angular 21

5 participants