Aman-Mittal opened a new issue, #301:
URL: https://github.com/apache/fineract-backoffice-ui/issues/301

   Part of #299. Depends on #300 — parameter discovery must land first.
   
   ## Business value
   
   Several report parameters are only meaningful relative to another. Loan 
officer depends on the selected office. Product often depends on currency. 
Centre depends on branch.
   
   The current screen sends `rLoanOfficerId` as `undefined` explicitly 
(`run-report.component.ts:303`), so this has never worked. Once #300 renders 
the parameter, it will render as a flat list of every loan officer in the 
institution — which for a network of thirty branches is an unusable dropdown, 
and worse, lets a user pick an officer who does not work in the office they 
selected. The report then returns nothing, and the user has no way to know why.
   
   ## What to build
   
   Read each parameter's dependency from the template response — the platform 
declares which other parameter a parameter's lookup depends on — and:
   
   - disable a dependent control until its parent has a value
   - refetch its options whenever the parent changes
   - clear its value when the parent changes, so a stale selection cannot be 
submitted
   
   ## Two things to get right
   
   1. **Clear the child on parent change, do not merely refetch.** Leaving the 
previous officer selected after switching office is the failure this issue 
exists to prevent, and it produces an empty report with no explanation.
   2. **Handle a slow or failed lookup.** A dependent dropdown that silently 
stays empty looks identical to one with no options. `app-data-table` had 
exactly this problem and it took issue #223 to surface it — do not reintroduce 
the pattern here.
   
   ## Testing
   
   - **Unit spec:** a dependent control is disabled until its parent has a 
value.
   - **Unit spec:** changing the parent refetches options and clears the 
child's value.
   - **Unit spec:** a failed lookup shows an error state, not an empty dropdown.
   - **Mocked e2e:** select an office, assert the loan officer list is scoped; 
change office, assert the previous selection is gone.
   
   ## Scope
   
   In scope: parameter dependency resolution, refetch and clearing.
   
   Out of scope: parameter discovery itself (#300); output formats; report 
definition CRUD.
   
   ## Getting started
   
   - `src/app/features/reporting/run-report.component.ts`
   - Confirm how dependencies are expressed in the template response against a 
live instance — `npm run e2e:stack`.
   - `npm test`, `npm run lint:prune`, `npm run i18n:check`, `npm run build`
   


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