Display Fineract version and build (#1847)

Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
José Alberto Hernández
2023-08-23 20:55:59 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent dd3e89f117
commit 653473bf8a
12 changed files with 83 additions and 32 deletions
@@ -28,6 +28,10 @@ export class ApiPrefixInterceptor implements HttpInterceptor {
if (versionRegex.test(request.url)) { if (versionRegex.test(request.url)) {
baseUrl = this.settingsService.baseServerUrl; baseUrl = this.settingsService.baseServerUrl;
} }
if (request.url.includes('/actuator/')) {
baseUrl = this.settingsService.serverHost;
}
/** /**
* Ignore URLs that are complete for i18n * Ignore URLs that are complete for i18n
*/ */
@@ -18,7 +18,7 @@
<mat-label>Saving reference</mat-label> <mat-label>Saving reference</mat-label>
<mat-select formControlName="savingsReferenceAccountId" required> <mat-select formControlName="savingsReferenceAccountId" required>
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id"> <mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
{{ assetAccount.name }} ({{ assetAccount.glCode }}) {{ assetAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -34,7 +34,7 @@
<mat-label>Saving control</mat-label> <mat-label>Saving control</mat-label>
<mat-select formControlName="savingsControlAccountId" required> <mat-select formControlName="savingsControlAccountId" required>
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id"> <mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
{{ liabilityAccount.name }} ({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -46,7 +46,7 @@
<mat-label>Savings transfers in suspense</mat-label> <mat-label>Savings transfers in suspense</mat-label>
<mat-select formControlName="transfersInSuspenseAccountId" required> <mat-select formControlName="transfersInSuspenseAccountId" required>
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id"> <mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
{{ liabilityAccount.name }} ({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -62,7 +62,7 @@
<mat-label>Interest on savings</mat-label> <mat-label>Interest on savings</mat-label>
<mat-select formControlName="interestOnSavingsAccountId" required> <mat-select formControlName="interestOnSavingsAccountId" required>
<mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id"> <mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id">
{{ expenseAccount.name }} ({{ expenseAccount.glCode }}) {{ expenseAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -78,7 +78,7 @@
<mat-label>Income from fees</mat-label> <mat-label>Income from fees</mat-label>
<mat-select formControlName="incomeFromFeeAccountId" required> <mat-select formControlName="incomeFromFeeAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id"> <mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
{{ incomeAccount.name }} ({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -90,7 +90,7 @@
<mat-label>Income from penalties</mat-label> <mat-label>Income from penalties</mat-label>
<mat-select formControlName="incomeFromPenaltyAccountId" required> <mat-select formControlName="incomeFromPenaltyAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id"> <mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
{{ incomeAccount.name }} ({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -20,7 +20,7 @@
<mat-label>Saving reference</mat-label> <mat-label>Saving reference</mat-label>
<mat-select formControlName="savingsReferenceAccountId" required> <mat-select formControlName="savingsReferenceAccountId" required>
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id"> <mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
{{ assetAccount.name }} ({{ assetAccount.glCode }}) {{ assetAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -36,7 +36,7 @@
<mat-label>Saving control</mat-label> <mat-label>Saving control</mat-label>
<mat-select formControlName="savingsControlAccountId" required> <mat-select formControlName="savingsControlAccountId" required>
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id"> <mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
{{ liabilityAccount.name }} ({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -48,7 +48,7 @@
<mat-label>Savings transfers in suspense</mat-label> <mat-label>Savings transfers in suspense</mat-label>
<mat-select formControlName="transfersInSuspenseAccountId" required> <mat-select formControlName="transfersInSuspenseAccountId" required>
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id"> <mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
{{ liabilityAccount.name }} ({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -64,7 +64,7 @@
<mat-label>Interest on savings</mat-label> <mat-label>Interest on savings</mat-label>
<mat-select formControlName="interestOnSavingsAccountId" required> <mat-select formControlName="interestOnSavingsAccountId" required>
<mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id"> <mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id">
{{ expenseAccount.name }} ({{ expenseAccount.glCode }}) {{ expenseAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -80,7 +80,7 @@
<mat-label>Income from fees</mat-label> <mat-label>Income from fees</mat-label>
<mat-select formControlName="incomeFromFeeAccountId" required> <mat-select formControlName="incomeFromFeeAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id"> <mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
{{ incomeAccount.name }} ({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -92,7 +92,7 @@
<mat-label>Income from penalties</mat-label> <mat-label>Income from penalties</mat-label>
<mat-select formControlName="incomeFromPenaltyAccountId" required> <mat-select formControlName="incomeFromPenaltyAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id"> <mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
{{ incomeAccount.name }} ({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -18,7 +18,7 @@
<mat-label>Saving reference</mat-label> <mat-label>Saving reference</mat-label>
<mat-select formControlName="savingsReferenceAccountId" required> <mat-select formControlName="savingsReferenceAccountId" required>
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id"> <mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
{{ assetAccount.name }} ({{ assetAccount.glCode }}) {{ assetAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -30,7 +30,7 @@
<mat-label>Overdraft portfolio</mat-label> <mat-label>Overdraft portfolio</mat-label>
<mat-select formControlName="overdraftPortfolioControlId" required> <mat-select formControlName="overdraftPortfolioControlId" required>
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id"> <mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
{{ assetAccount.name }} ({{ assetAccount.glCode }}) {{ assetAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -46,7 +46,7 @@
<mat-label>Saving control</mat-label> <mat-label>Saving control</mat-label>
<mat-select formControlName="savingsControlAccountId" required> <mat-select formControlName="savingsControlAccountId" required>
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id"> <mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
{{ liabilityAccount.name }} ({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -58,7 +58,7 @@
<mat-label>Savings transfers in suspense</mat-label> <mat-label>Savings transfers in suspense</mat-label>
<mat-select formControlName="transfersInSuspenseAccountId" required> <mat-select formControlName="transfersInSuspenseAccountId" required>
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id"> <mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
{{ liabilityAccount.name }} ({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -70,7 +70,7 @@
<mat-label>Escheat liability</mat-label> <mat-label>Escheat liability</mat-label>
<mat-select formControlName="escheatLiabilityId" required> <mat-select formControlName="escheatLiabilityId" required>
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id"> <mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
{{ liabilityAccount.name }} ({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -86,7 +86,7 @@
<mat-label>Interest on savings</mat-label> <mat-label>Interest on savings</mat-label>
<mat-select formControlName="interestOnSavingsAccountId" required> <mat-select formControlName="interestOnSavingsAccountId" required>
<mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id"> <mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id">
{{ expenseAccount.name }} ({{ expenseAccount.glCode }}) {{ expenseAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -98,7 +98,7 @@
<mat-label>Write-off</mat-label> <mat-label>Write-off</mat-label>
<mat-select formControlName="writeOffAccountId" required> <mat-select formControlName="writeOffAccountId" required>
<mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id"> <mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id">
{{ expenseAccount.name }} ({{ expenseAccount.glCode }}) {{ expenseAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -114,7 +114,7 @@
<mat-label>Income from fees</mat-label> <mat-label>Income from fees</mat-label>
<mat-select formControlName="incomeFromFeeAccountId" required> <mat-select formControlName="incomeFromFeeAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id"> <mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
{{ incomeAccount.name }} ({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -126,7 +126,7 @@
<mat-label>Income from penalties</mat-label> <mat-label>Income from penalties</mat-label>
<mat-select formControlName="incomeFromPenaltyAccountId" required> <mat-select formControlName="incomeFromPenaltyAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id"> <mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
{{ incomeAccount.name }} ({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -138,7 +138,7 @@
<mat-label>Overdraft Interest Income</mat-label> <mat-label>Overdraft Interest Income</mat-label>
<mat-select formControlName="incomeFromInterestId" required> <mat-select formControlName="incomeFromInterestId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id"> <mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
{{ incomeAccount.name }} ({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -18,7 +18,7 @@
<mat-label>Share reference</mat-label> <mat-label>Share reference</mat-label>
<mat-select formControlName="shareReferenceId" required> <mat-select formControlName="shareReferenceId" required>
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id"> <mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
{{ assetAccount.name }} ({{ assetAccount.glCode }}) {{ assetAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -34,7 +34,7 @@
<mat-label>Share suspense control</mat-label> <mat-label>Share suspense control</mat-label>
<mat-select formControlName="shareSuspenseId" required> <mat-select formControlName="shareSuspenseId" required>
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id"> <mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
{{ liabilityAccount.name }} ({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -50,7 +50,7 @@
<mat-label>Equity</mat-label> <mat-label>Equity</mat-label>
<mat-select formControlName="shareEquityId" required> <mat-select formControlName="shareEquityId" required>
<mat-option *ngFor="let equityAccount of equityAccountData" [value]="equityAccount.id"> <mat-option *ngFor="let equityAccount of equityAccountData" [value]="equityAccount.id">
{{ equityAccount.name }} ({{ equityAccount.glCode }}) {{ equityAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
@@ -66,7 +66,7 @@
<mat-label>Income from fees</mat-label> <mat-label>Income from fees</mat-label>
<mat-select formControlName="incomeFromFeeAccountId" required> <mat-select formControlName="incomeFromFeeAccountId" required>
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id"> <mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
{{ incomeAccount.name }} ({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error> <mat-error>
+7
View File
@@ -162,6 +162,13 @@ export class SettingsService {
return this.server + environment.apiProvider + environment.apiVersion; return this.server + environment.apiProvider + environment.apiVersion;
} }
/**
* Returns server url with api path and version
*/
get serverHost() {
return this.server;
}
/** /**
* Returns current Business date server * Returns current Business date server
*/ */
+3 -2
View File
@@ -1,10 +1,11 @@
<div fxLayout="column" id="footer" class="m-b-20"> <div fxLayout="column" id="footer" class="m-b-20">
<mat-divider fxFlexAlign="center" class="divider"></mat-divider> <mat-divider fxFlexAlign="center" class="divider"></mat-divider>
<p fxFlexAlign="center" class="footer-content">{{ 'labels.texts.Version' | translate }} <b>{{ version }}</b> - <b>{{ <p fxFlexAlign="center" class="footer-content">Mifos <b>{{ versions.mifos }}</b> - <b>{{
hash }}</b></p> hash }}</b></p>
<p *ngIf="versions.fineract" fxFlexAlign="center" class="footer-content">Fineract <b>{{ versions.fineract.version }}</b></p>
<p fxFlexAlign="center" class="footer-content" *ngIf="isBusinessDateDefined">Current Business Date: <b>{{ businessDate <p fxFlexAlign="center" class="footer-content" *ngIf="isBusinessDateDefined">Current Business Date: <b>{{ businessDate
| date: 'EEEE, MMMM dd, y' }}</b></p> | date: 'EEEE, MMMM dd, y' }}</b></p>
<p fxFlexAlign="center" class="footer-content"><b>{{ server }}</b></p> <p fxFlexAlign="center" class="footer-content" *ngIf="displayBackEndInfo"><b>{{ server }}</b></p>
<mat-divider fxFlexAlign="center" class="divider"></mat-divider> <mat-divider fxFlexAlign="center" class="divider"></mat-divider>
<p fxFlexAlign="center" class="footer-content">{{ 'APP_NAME' | translate }} {{ 'labels.texts.by' | translate }} Mifos <p fxFlexAlign="center" class="footer-content">{{ 'APP_NAME' | translate }} {{ 'labels.texts.by' | translate }} Mifos
</p> </p>
+14 -2
View File
@@ -6,6 +6,7 @@ import { AuthenticationService } from 'app/core/authentication/authentication.se
import { Dates } from 'app/core/utils/dates'; import { Dates } from 'app/core/utils/dates';
import { SettingsService } from 'app/settings/settings.service'; import { SettingsService } from 'app/settings/settings.service';
import { SystemService } from 'app/system/system.service'; import { SystemService } from 'app/system/system.service';
import { VersionService } from 'app/system/version.service';
/** Environment Configuration */ /** Environment Configuration */
import { environment } from 'environments/environment'; import { environment } from 'environments/environment';
@@ -22,7 +23,9 @@ import { Subscription } from 'rxjs';
export class FooterComponent implements OnInit, OnDestroy { export class FooterComponent implements OnInit, OnDestroy {
/** Mifos X version. */ /** Mifos X version. */
version: string = environment.version; versions: any = {
mifos: environment.version
};
/** Mifos X hash */ /** Mifos X hash */
hash: string = environment.hash; hash: string = environment.hash;
server = ''; server = '';
@@ -35,11 +38,14 @@ export class FooterComponent implements OnInit, OnDestroy {
alert$: Subscription; alert$: Subscription;
timer: any; timer: any;
displayBackEndInfo: boolean = environment.displayBackEndInfo;
constructor(private systemService: SystemService, constructor(private systemService: SystemService,
private settingsService: SettingsService, private settingsService: SettingsService,
private authenticationService: AuthenticationService, private authenticationService: AuthenticationService,
private alertService: AlertService, private alertService: AlertService,
private dateUtils: Dates) { } private dateUtils: Dates,
private versionService: VersionService) { }
ngOnInit() { ngOnInit() {
this.alert$ = this.alertService.alertEvent.subscribe((alertEvent: Alert) => { this.alert$ = this.alertService.alertEvent.subscribe((alertEvent: Alert) => {
@@ -60,6 +66,12 @@ export class FooterComponent implements OnInit, OnDestroy {
}); });
this.getConfigurations(); this.getConfigurations();
this.server = this.settingsService.server; this.server = this.settingsService.server;
this.versionService.getBackendInfo().subscribe((data: any) => {
const regExp = /0.0.0/gi;
this.versions.fineract = {
version: data.git.build.replace(regExp, data.git.closest.tag.name)
}
});
} }
ngOnDestroy() { ngOnDestroy() {
+19
View File
@@ -0,0 +1,19 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
/** rxjs Imports */
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class VersionService {
constructor(private http: HttpClient) { }
getBackendInfo(): Observable<any> {
return this.http.get('/fineract-provider/actuator/info');
}
}
+4
View File
@@ -19,4 +19,8 @@
// Char delimiter to Export CSV options: ',' ';' '|' ' ' // Char delimiter to Export CSV options: ',' ';' '|' ' '
window['env']['defaultCharDelimiter'] = '$MIFOS_DEFAULT_CHAR_DELIMITER'; window['env']['defaultCharDelimiter'] = '$MIFOS_DEFAULT_CHAR_DELIMITER';
// Display or not the BackEnd Info
window['env']['displayBackEndInfo'] = '$MIFOS_DISPLAY_BACKEND_INFO';
})(this); })(this);
+3 -1
View File
@@ -25,7 +25,9 @@ export const environment = {
supportedLanguages: window['env']['supportedLanguages'] || 'en-US,es-MX,fr-FR', supportedLanguages: window['env']['supportedLanguages'] || 'en-US,es-MX,fr-FR',
preloadClients: window['env']['preloadClients'] || true, preloadClients: window['env']['preloadClients'] || true,
defaultCharDelimiter: window['env']['defaultCharDelimiter'] || ',' defaultCharDelimiter: window['env']['defaultCharDelimiter'] || ',',
displayBackEndInfo: window['env']['displayBackEndInfo'] || true
}; };
// Server URL // Server URL
+3 -1
View File
@@ -30,7 +30,9 @@ export const environment = {
supportedLanguages: window['env']['supportedLanguages'] || 'en-US,es-MX,fr-FR', supportedLanguages: window['env']['supportedLanguages'] || 'en-US,es-MX,fr-FR',
preloadClients: window['env']['preloadClients'] || true, preloadClients: window['env']['preloadClients'] || true,
defaultCharDelimiter: window['env']['defaultCharDelimiter'] || ',' defaultCharDelimiter: window['env']['defaultCharDelimiter'] || ',',
displayBackEndInfo: window['env']['displayBackEndInfo'] || true
}; };
// Server URL // Server URL