paultofunmi opened a new pull request, #129:
URL: https://github.com/apache/fineract-backoffice-ui/pull/129

   ## Summary
   
   Implements issue #116: a `NavItemConfig` interface and 
`NavigationConfigService`, replacing the need for the sidebar's per-item 
`*appHasPermission`/`*appInstitutionFeature` directives with a single, 
centrally-filtered navigation data source.
   
   This is foundational work for the "Permission-Based Navigation Visibility" 
epic (#108) and is a direct dependency of #115, #117, #110, and #111.
   
   ## Changes
   
   - **`src/app/core/services/navigation-config.service.ts`** (new)
     - `NavItemConfig` interface: `route`, `labelKey`, `icon`, 
`requiredPermissions` (`string | string[]`), `requiredAllPermissions` (AND vs 
OR semantics), `featureFlag`, `children`, and `divider` (for the one visual 
separator in the current sidebar).
     - `NAV_CONFIG`: the full navigation tree, transcribed 1:1 from 
`sidebar.component.ts` — every route, icon, and label key preserved, and the 5 
existing permission gates + 3 institution-feature gates carried over exactly. 
No new gates introduced.
     - `filterNavItems()`: a pure, Angular-free recursive filter function — 
dividers always pass through, and a group whose children are all filtered out 
is dropped so consumers never need to special-case an empty header.
     - `NavigationConfigService`: exposes `navConfig` (unfiltered) and 
`filteredNavItems` (a `computed()` signal, reactive to 
`AuthService.currentUser()` and `InstitutionConfigService.institutionType()`).
   - **`src/app/core/services/navigation-config.service.spec.ts`** (new) — 19 
tests covering the pure filter function (divider passthrough, recursive 
filtering, empty-group dropping) and the service (rbacEnabled on/off, 
permission-gated visibility, institution-feature filtering, OR/AND permission 
semantics).


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