WEB-1006: feat: move backend info to System Information - #3781
Conversation
|
Note
|
| Layer / File(s) | Summary |
|---|---|
System information aggregation src/app/system/system-info.service.ts, src/app/system/system-information/... |
SystemInfoService aggregates application, backend, server, tenant, user, render-time, and business-date data. The System Information page consumes the observable and displays optional version hashes. |
Footer system information integration src/app/shared/footer/... |
The footer uses systemInformation$ for backend details. Business-date handling and polling continue independently of backend-information visibility. |
System Information access and defaults src/app/core/shell/toolbar/toolbar.component.html, src/environments/..., src/assets/env.template.js, README.md |
The help menu links to System Information. Backend information defaults to disabled, and related documentation describes its display locations. |
Estimated code review effort: 3 (Moderate) | ~25 minutes
Suggested reviewers: alberto-art3ch
Sequence Diagram(s)
sequenceDiagram
participant User
participant Toolbar
participant SystemInformationComponent
participant SystemInfoService
participant Backend
User->>Toolbar: Select System Information
Toolbar->>SystemInformationComponent: Navigate to system-information
SystemInformationComponent->>SystemInfoService: getSystemInformation()
SystemInfoService->>Backend: Fetch backend version data
Backend-->>SystemInfoService: Return version and build data
SystemInfoService-->>SystemInformationComponent: Emit SystemInformation
SystemInformationComponent-->>User: Render system details
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title clearly and concisely describes the primary change: moving backend information to the System Information page. |
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
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.
Comment @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/shared/footer/footer.component.ts`:
- Around line 89-95: Update the polling setup in getConfigurations() to clear
the existing this.timer handle before assigning a new timeout, matching the
proposed guard and ensuring only one polling chain remains active and is cleaned
up by ngOnDestroy.
In `@src/app/system/system-info.service.ts`:
- Around line 83-99: Update getFineractVersion so failed getBackendInfo requests
are not cached by the shareReplay pipeline: ensure the empty fallback is emitted
per failed subscription or move error handling outside the shared
successful-response stream, while preserving the existing version/hash mapping
and successful response caching.
In `@src/environments/environment.ts`:
- Around line 69-70: Normalize displayBackEndInfo in both
src/environments/environment.ts lines 69-70 and
src/environments/environment.prod.ts lines 67-68 so only the boolean true or
string 'true' produces 'true'; convert unset, unresolved template literals, and
all other values to 'false' before assignment.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 249424dd-fc7d-4e4a-9084-51c35c0f4ed8
📒 Files selected for processing (11)
README.mdsrc/app/core/shell/toolbar/toolbar.component.htmlsrc/app/shared/footer/footer.component.htmlsrc/app/shared/footer/footer.component.tssrc/app/system/system-info.service.tssrc/app/system/system-information/system-information.component.htmlsrc/app/system/system-information/system-information.component.scsssrc/app/system/system-information/system-information.component.tssrc/assets/env.template.jssrc/environments/environment.prod.tssrc/environments/environment.ts
d346d58 to
d41dcf6
Compare
|
@YousufFFFF add a video for showing how it looks the application information |
4ad978c to
03bef6e
Compare
Sorry the video which I uploaded captured only one tab. |
|
Hello @IOhacker , |
|
@Aman-Mittal I addressed your comment too! |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/app/shared/footer/footer.component.ts (1)
111-140: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winGuard the configuration poll against callbacks firing after destroy.
getConfigurations()subscribes togetConfigurationByName(...)without tracking the subscription. If the footer component is destroyed while this HTTP call is in flight,ngOnDestroy()clearsthis.timer, but the pending callback still runs afterward. IfisBusinessDateEnabledis true at that point, the callback callsscheduleConfigurationsRefresh()(line 120), which sets a newthis.timer. That new timer is never cleared, becausengOnDestroy()already ran. The polling chain then keeps callinggetConfigurations()every 60 seconds for a destroyed component instance.Track the subscription (or a destroyed flag) and stop the callback from re-arming the timer once the component is destroyed.
🔧 Proposed fix using a destroyed flag
export class FooterComponent implements OnInit, OnDestroy { + private destroyed = false; ... ngOnDestroy() { clearTimeout(this.timer); this.alert$?.unsubscribe(); + this.destroyed = true; } getConfigurations(): void { if (this.authenticationService.isAuthenticated()) { this.systemService .getConfigurationByName(SettingsService.businessDateConfigName) .subscribe((configurationData: any) => { + if (this.destroyed) { + return; + } this.isBusinessDateEnabled = configurationData.enabled; this.settingsService.setBusinessDateConfig(configurationData.enabled); if (this.isBusinessDateEnabled) { this.setBusinessDate(); this.scheduleConfigurationsRefresh(); } else { clearTimeout(this.timer); } }); } else { clearTimeout(this.timer); } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/app/shared/footer/footer.component.ts` around lines 111 - 140, Update getConfigurations and ngOnDestroy to track component destruction, using the existing lifecycle symbols, and prevent the getConfigurationByName callback from calling scheduleConfigurationsRefresh after destruction. Ensure any pending timer and subscription are cleaned up so a destroyed FooterComponent cannot re-arm the polling chain.
🧹 Nitpick comments (1)
src/app/system/system-info.service.ts (1)
56-56: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueNon-nullable Observable fields are left unassigned or nulled at runtime. The app extends the root tsconfig for
src/, andtsconfig.jsondoes not enable strict null checks, so these declarations do not fail type checking currently. Treat this as an opportunity to remove these runtime nullable paths: initializefineractVersion$with the shared-Replay stream from the error path, and initializesystemInformation$before it may be read.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/app/system/system-info.service.ts` at line 56, Initialize fineractVersion$ in SystemInfoService with the shared-Replay stream used by the error path, and ensure systemInformation$ is initialized before any read so neither Observable remains undefined or null at runtime. Apply the corresponding initialization at src/app/system/system-info.service.ts:56-56 and src/app/shared/footer/footer.component.ts:60-60, using the existing stream/default symbols rather than introducing new fallback behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/app/shared/footer/footer.component.ts`:
- Around line 111-140: Update getConfigurations and ngOnDestroy to track
component destruction, using the existing lifecycle symbols, and prevent the
getConfigurationByName callback from calling scheduleConfigurationsRefresh after
destruction. Ensure any pending timer and subscription are cleaned up so a
destroyed FooterComponent cannot re-arm the polling chain.
---
Nitpick comments:
In `@src/app/system/system-info.service.ts`:
- Line 56: Initialize fineractVersion$ in SystemInfoService with the
shared-Replay stream used by the error path, and ensure systemInformation$ is
initialized before any read so neither Observable remains undefined or null at
runtime. Apply the corresponding initialization at
src/app/system/system-info.service.ts:56-56 and
src/app/shared/footer/footer.component.ts:60-60, using the existing
stream/default symbols rather than introducing new fallback behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0ee6338b-8896-476b-b042-04d8588ae05e
📒 Files selected for processing (11)
README.mdsrc/app/core/shell/toolbar/toolbar.component.htmlsrc/app/shared/footer/footer.component.htmlsrc/app/shared/footer/footer.component.tssrc/app/system/system-info.service.tssrc/app/system/system-information/system-information.component.htmlsrc/app/system/system-information/system-information.component.scsssrc/app/system/system-information/system-information.component.tssrc/assets/env.template.jssrc/environments/environment.prod.tssrc/environments/environment.ts
🚧 Files skipped from review as they are similar to previous changes (9)
- src/environments/environment.ts
- src/assets/env.template.js
- README.md
- src/app/system/system-information/system-information.component.html
- src/environments/environment.prod.ts
- src/app/system/system-information/system-information.component.scss
- src/app/core/shell/toolbar/toolbar.component.html
- src/app/shared/footer/footer.component.html
- src/app/system/system-information/system-information.component.ts
Description
The Home dashboard rendered the backend/release block (WebApp version, Fineract
version, server URL, username, tenant, render time) in the shell footer on every
page, taking up noticeable vertical space for information that is only needed
occasionally, for support and debugging.
Following the maintainer discussion, that information now lives in the existing
System Information page instead of the footer:
MIFOS_DISPLAY_BACKEND_INFOnow defaults tofalse, so the footer block andthe login version block are hidden out of the box. Setting it to
truerestores the previous rendering exactly — no visual or behavioural change for
deployments that opt in.
debugging set: tenant, WebApp version and build hash, Fineract version and
build hash, server URL, username, staff name, current business date and render
time. It previously showed only tenant, versions and server.
and Profile. Its route was already guarded by authentication only, while the
sole navigation path to it sat behind
READ_CONFIGURATION, so support staffhad no way to reach it once the footer was hidden.
SystemInfoServiceis the single source of truth for this data. Thegit.build.versionparsing was previously duplicated across the footer, theSystem Information page and the login page, each issuing its own
/actuator/inforequest; the service parses it once and replays the result.The Current Business Date chip is deliberately kept visible and is no longer
tied to
MIFOS_DISPLAY_BACKEND_INFO. That flag previously also gated the pollingthat writes
SettingsService.businessDate, which around 80 components read asmaxDate/ default transaction date. Changing the default without decoupling itwould have silently stopped business-date polling and pinned every date picker to
the browser's local "today" fallback.
Two small fixes were made in the same files: the footer's alert subscription is
now torn down in
ngOnDestroy(it previously leaked), and a mis-encodedseparator character in the compact footer variant was corrected.
No About page or dialog was added and
about-usis untouched — the existingSystem Information page is reused. No translation files changed: every key used
(
labels.version.*,labels.text.Current Business Date,labels.heading.System Information) already exists in all supported locales.Dependencies: none. No new packages, no API changes, no migrations.
Upgrade note for existing deployments: anyone relying on the footer block
must now set
MIFOS_DISPLAY_BACKEND_INFO=trueexplicitly.README.mdandenv.template.jshave been updated with the new default.Related issues and discussion
#WEB-1006
Screenshots, if any
After:
When displayBackEndInfo='' :
When displayBackEndInfo='true' :
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
Summary by CodeRabbit
New Features
Changes