Aman-Mittal opened a new pull request, #183:
URL: https://github.com/apache/fineract-backoffice-ui/pull/183

   Closes #182.
   
   ## Why
   
   Angular 22 makes `OnPush` the default, so a plain field assigned from an 
HTTP callback never marks its view dirty. `app-data-table` and the two 
structural permission directives sit underneath most of the application — every 
list screen renders through the table, and the directives decide what is on 
screen at all — so while they were built on decorator inputs, every new screen 
inherited the same failure mode.
   
   This is a prerequisite for the Group (#180) and Center (#181) detail views, 
which add several screens on top of these primitives.
   
   ## A live bug, not just old style
   
   `QueryList.changes` does not mark an OnPush view dirty, and 
`columnTemplates` was populated once in `ngAfterContentInit`. A cell template 
registered later — one inside an `@if` — was therefore never picked up, and its 
column silently kept rendering the plain value instead of the projected 
template.
   
   It is now a `contentChildren()` signal query feeding a computed map.
   
   The new spec covers exactly that case. It was verified to fail without the 
fix: reverting the map to snapshot-once semantics turns it red, and restoring 
`contentChildren()` turns it green. A test that passes either way would not be 
evidence of anything.
   
   ## `ngOnChanges` had to go
   
   It does not run for signal inputs, so removing it is part of the conversion 
rather than an optional tidy-up. It was doing two jobs:
   
   - **Syncing local page state from the input** is now `linkedSignal`, which 
is exactly the semantics it hand-rolled: writable locally, reset when the 
parent binds a new value. A parent that drives `pageIndex` back to `0` on a 
filter change keeps control.
   - **Recomputing rows** is now `computed`. `rows` and `displayedTotal` derive 
from the inputs rather than being imperatively refreshed on notification, so 
they cannot fall out of step with the data they are built from.
   
   ## One spec changed meaning — worth a reviewer's eye
   
   `still lets a parent drive the page index` set `pageIndex` to `0` after the 
table had moved to `3`, and expected a reset.
   
   That passed only because `componentRef.setInput` treats a first write as a 
change, so the old `ngOnChanges` fired on `0 -> 0`. A real parent binding a 
constant `0` never triggered it either — the assertion was pinning a harness 
artifact, not the contract.
   
   Parents mirror the index back from `(pageChange)` (see `onPage` in 
`clients-list` and `centers-list`), so the test now binds `3` first and asserts 
the genuine `3 -> 0` transition.
   
   ## Also
   
   `CellTemplateDirective.columnName` becomes a signal input, so the computed 
map is reactive in the value as well as in the set of templates.
   
   ## Verification
   
   - `tsc` (app + spec) clean
   - production build clean — this is the real check, since it type-checks all 
92 consumer templates
   - `npm run lint` clean; the suppressions baseline **shrinks by 23 entries**
   - `format:check`, `check-license.sh`, `i18n:check` clean
   - **687** unit tests pass (up from 686 — one added)
   - **192/192** mocked Playwright tests pass
   - `scripts/audit-async-state.mjs` unchanged at 429, as expected: this 
converts shared primitives, not feature fields
   
   ## Scope
   
   Out of scope: the remaining 429 fields across feature components, and 
`provideZonelessChangeDetection()` / dropping `zone.js`, which follow once 
those are converted.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to