WEB-1242: Add the tenant management administration UI - #4035
Merged
IOhacker merged 1 commit intoSep 22, 2026
Merged
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: openMF/web-app/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (44)
Note
|
YousufFFFF
force-pushed
the
WEB-1242-tenant-management-session-and-list
branch
from
September 22, 2026 20:45
19fb2fc to
b67e159
Compare
IOhacker
approved these changes
Sep 22, 2026
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a Tenant Management section under Administration → System that lists the tenants of a Fineract installation, backed by the tenant management plugin's
/v1/admin/tenantsAPI (MX-406).The web app has never had a tenants API binding: the login tenant selector renders a static list read from the
FINERACT_PLATFORM_TENANTS_IDENTIFIERenvironment variable. This is the first half of that work — master sign-in, the API binding, the list with search, status filter and server-side paging, and a read-only tenant detail page. Creating, editing, the lifecycle commands and the connection test follow in a second PR.Two things about the delivered backend shape the design and are worth calling out for review.
Tenant administration has its own credential. The plugin runs in a master context above every tenant: it authenticates HTTP Basic against master users in the tenant store and requires the
SUPER_MASTERrole. A tenant's own user is refused with 401 however privileged it is in that tenant —ALL_FUNCTIONSincluded. The web app session therefore cannot be reused here, andper-user permission gating is not available, so the section opens on its own sign-in card. The credential it obtains lives in
sessionStoragefor that tab only, with no "remember me", andAuthenticationServiceclears it on logout so signing out of the web app cannot leave a higher-privilege session behind.The API is called on a client with no interceptors.
AuthenticationInterceptorends withrequest.clone({ setHeaders }), which would overwrite the masterAuthorizationheader with the tenant session's and attach a tenant header this API is not addressed by. It sits on the DI interceptor chain, soHttpService's existing opt-outs do not reach it. The service builds its client fromHttpBackend, asRemittancesServiceand the ngx-translate loader already do for differently authenticated endpoints, and parses Fineract error bodies itself. That last part is deliberate rather than a gap: a 401 on the master credential is not the web app session expiring and must not raise the global alert that says it is. A 401 also ends the master session, so the sectionfalls back to its sign-in card instead of failing every later request the same way.
The section is behind
MIFOS_ENABLE_TENANT_MANAGEMENT, off by default: a server running stock Fineract has no tenant administration API at all, so the tile stays hidden rather than offering a feature that cannot work. The flag follows the existingMIFOS_ENABLE_COPILOTshape acrossenvironment.ts,environment.prod.ts,env.template.jsandenv.sample.Login tenant selector. Where the list is known to be complete and unfiltered, the identifiers it saw are remembered, so a deployment that registers tenants through the API does not have to list them in the environment as well. A filtered result or one page of a longer list is not the set of tenants on the installation and is not cached. They are kept under their own storage key, because the configured list is re-seeded from the environment on every bootstrap and on every visit to the login page, which would erase anything written into it.
calculateTenantSelectorVisibility()previously read the environment variable directly, so it now considers the union — otherwise a deployment configured with onlydefaultwould keep the selector hidden no matter what the API reported. With the feature flag off, both the getter and the visibility check return the configured list unchanged and nothing about the selector changes.No route resolvers are used anywhere in this feature, unlike the rest of System. The master credential may not exist when a route activates, and a resolver would fire an unauthenticated request before the sign-in card could render, so each page fetches its own data once the credential is in place. There is a comment in the routing module saying so.
All new copy is added to every one of the 13 locale files (31 keys each). Tenant statuses go through
labels.catalogs, so a status value the backend names falls back to itself.Covered by 11 new Jest tests: the master session keeps a credential only once the server has accepted it, encodes it as UTF-8 so a non-Latin-1 password does not throw, sends no tenant header, and drops everything on sign-out; the list renders the API's rows, offers the statuses the backend reported rather than a hardcoded list, and remembers identifiers only from a complete, unfiltered result.
Related issues and discussion
WEB-1242. Depends on the tenant management plugin from MX-406
(https://github.com/openMF/mifos-x-tenantmanagement-plugin), which is merged.
Screenshots, if any
Screen.Recording.2026-09-23.015538.mp4
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
If you have multiple commits please combine them into one commit by squashing them.
Read and understood the contribution guidelines at
web-app/.github/CONTRIBUTING.md.Summary by CodeRabbit