Display Fineract version and build (#1847)
Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
co-authored by
Jose Alberto Hernandez
parent
dd3e89f117
commit
653473bf8a
@@ -28,6 +28,10 @@ export class ApiPrefixInterceptor implements HttpInterceptor {
|
||||
if (versionRegex.test(request.url)) {
|
||||
baseUrl = this.settingsService.baseServerUrl;
|
||||
}
|
||||
if (request.url.includes('/actuator/')) {
|
||||
baseUrl = this.settingsService.serverHost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ignore URLs that are complete for i18n
|
||||
*/
|
||||
|
||||
+6
-6
@@ -18,7 +18,7 @@
|
||||
<mat-label>Saving reference</mat-label>
|
||||
<mat-select formControlName="savingsReferenceAccountId" required>
|
||||
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
|
||||
{{ assetAccount.name }}
|
||||
({{ assetAccount.glCode }}) {{ assetAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -34,7 +34,7 @@
|
||||
<mat-label>Saving control</mat-label>
|
||||
<mat-select formControlName="savingsControlAccountId" required>
|
||||
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
|
||||
{{ liabilityAccount.name }}
|
||||
({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -46,7 +46,7 @@
|
||||
<mat-label>Savings transfers in suspense</mat-label>
|
||||
<mat-select formControlName="transfersInSuspenseAccountId" required>
|
||||
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
|
||||
{{ liabilityAccount.name }}
|
||||
({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -62,7 +62,7 @@
|
||||
<mat-label>Interest on savings</mat-label>
|
||||
<mat-select formControlName="interestOnSavingsAccountId" required>
|
||||
<mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id">
|
||||
{{ expenseAccount.name }}
|
||||
({{ expenseAccount.glCode }}) {{ expenseAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -78,7 +78,7 @@
|
||||
<mat-label>Income from fees</mat-label>
|
||||
<mat-select formControlName="incomeFromFeeAccountId" required>
|
||||
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
|
||||
{{ incomeAccount.name }}
|
||||
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -90,7 +90,7 @@
|
||||
<mat-label>Income from penalties</mat-label>
|
||||
<mat-select formControlName="incomeFromPenaltyAccountId" required>
|
||||
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
|
||||
{{ incomeAccount.name }}
|
||||
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
|
||||
+6
-6
@@ -20,7 +20,7 @@
|
||||
<mat-label>Saving reference</mat-label>
|
||||
<mat-select formControlName="savingsReferenceAccountId" required>
|
||||
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
|
||||
{{ assetAccount.name }}
|
||||
({{ assetAccount.glCode }}) {{ assetAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -36,7 +36,7 @@
|
||||
<mat-label>Saving control</mat-label>
|
||||
<mat-select formControlName="savingsControlAccountId" required>
|
||||
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
|
||||
{{ liabilityAccount.name }}
|
||||
({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -48,7 +48,7 @@
|
||||
<mat-label>Savings transfers in suspense</mat-label>
|
||||
<mat-select formControlName="transfersInSuspenseAccountId" required>
|
||||
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
|
||||
{{ liabilityAccount.name }}
|
||||
({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -64,7 +64,7 @@
|
||||
<mat-label>Interest on savings</mat-label>
|
||||
<mat-select formControlName="interestOnSavingsAccountId" required>
|
||||
<mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id">
|
||||
{{ expenseAccount.name }}
|
||||
({{ expenseAccount.glCode }}) {{ expenseAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -80,7 +80,7 @@
|
||||
<mat-label>Income from fees</mat-label>
|
||||
<mat-select formControlName="incomeFromFeeAccountId" required>
|
||||
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
|
||||
{{ incomeAccount.name }}
|
||||
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -92,7 +92,7 @@
|
||||
<mat-label>Income from penalties</mat-label>
|
||||
<mat-select formControlName="incomeFromPenaltyAccountId" required>
|
||||
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
|
||||
{{ incomeAccount.name }}
|
||||
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
|
||||
+10
-10
@@ -18,7 +18,7 @@
|
||||
<mat-label>Saving reference</mat-label>
|
||||
<mat-select formControlName="savingsReferenceAccountId" required>
|
||||
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
|
||||
{{ assetAccount.name }}
|
||||
({{ assetAccount.glCode }}) {{ assetAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -30,7 +30,7 @@
|
||||
<mat-label>Overdraft portfolio</mat-label>
|
||||
<mat-select formControlName="overdraftPortfolioControlId" required>
|
||||
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
|
||||
{{ assetAccount.name }}
|
||||
({{ assetAccount.glCode }}) {{ assetAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -46,7 +46,7 @@
|
||||
<mat-label>Saving control</mat-label>
|
||||
<mat-select formControlName="savingsControlAccountId" required>
|
||||
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
|
||||
{{ liabilityAccount.name }}
|
||||
({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -58,7 +58,7 @@
|
||||
<mat-label>Savings transfers in suspense</mat-label>
|
||||
<mat-select formControlName="transfersInSuspenseAccountId" required>
|
||||
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
|
||||
{{ liabilityAccount.name }}
|
||||
({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -70,7 +70,7 @@
|
||||
<mat-label>Escheat liability</mat-label>
|
||||
<mat-select formControlName="escheatLiabilityId" required>
|
||||
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
|
||||
{{ liabilityAccount.name }}
|
||||
({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -86,7 +86,7 @@
|
||||
<mat-label>Interest on savings</mat-label>
|
||||
<mat-select formControlName="interestOnSavingsAccountId" required>
|
||||
<mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id">
|
||||
{{ expenseAccount.name }}
|
||||
({{ expenseAccount.glCode }}) {{ expenseAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -98,7 +98,7 @@
|
||||
<mat-label>Write-off</mat-label>
|
||||
<mat-select formControlName="writeOffAccountId" required>
|
||||
<mat-option *ngFor="let expenseAccount of expenseAccountData" [value]="expenseAccount.id">
|
||||
{{ expenseAccount.name }}
|
||||
({{ expenseAccount.glCode }}) {{ expenseAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -114,7 +114,7 @@
|
||||
<mat-label>Income from fees</mat-label>
|
||||
<mat-select formControlName="incomeFromFeeAccountId" required>
|
||||
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
|
||||
{{ incomeAccount.name }}
|
||||
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -126,7 +126,7 @@
|
||||
<mat-label>Income from penalties</mat-label>
|
||||
<mat-select formControlName="incomeFromPenaltyAccountId" required>
|
||||
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
|
||||
{{ incomeAccount.name }}
|
||||
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -138,7 +138,7 @@
|
||||
<mat-label>Overdraft Interest Income</mat-label>
|
||||
<mat-select formControlName="incomeFromInterestId" required>
|
||||
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
|
||||
{{ incomeAccount.name }}
|
||||
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
|
||||
+4
-4
@@ -18,7 +18,7 @@
|
||||
<mat-label>Share reference</mat-label>
|
||||
<mat-select formControlName="shareReferenceId" required>
|
||||
<mat-option *ngFor="let assetAccount of assetAccountData" [value]="assetAccount.id">
|
||||
{{ assetAccount.name }}
|
||||
({{ assetAccount.glCode }}) {{ assetAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -34,7 +34,7 @@
|
||||
<mat-label>Share suspense control</mat-label>
|
||||
<mat-select formControlName="shareSuspenseId" required>
|
||||
<mat-option *ngFor="let liabilityAccount of liabilityAccountData" [value]="liabilityAccount.id">
|
||||
{{ liabilityAccount.name }}
|
||||
({{ liabilityAccount.glCode }}) {{ liabilityAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -50,7 +50,7 @@
|
||||
<mat-label>Equity</mat-label>
|
||||
<mat-select formControlName="shareEquityId" required>
|
||||
<mat-option *ngFor="let equityAccount of equityAccountData" [value]="equityAccount.id">
|
||||
{{ equityAccount.name }}
|
||||
({{ equityAccount.glCode }}) {{ equityAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
@@ -66,7 +66,7 @@
|
||||
<mat-label>Income from fees</mat-label>
|
||||
<mat-select formControlName="incomeFromFeeAccountId" required>
|
||||
<mat-option *ngFor="let incomeAccount of incomeAccountData" [value]="incomeAccount.id">
|
||||
{{ incomeAccount.name }}
|
||||
({{ incomeAccount.glCode }}) {{ incomeAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error>
|
||||
|
||||
@@ -162,6 +162,13 @@ export class SettingsService {
|
||||
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
|
||||
*/
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<div fxLayout="column" id="footer" class="m-b-20">
|
||||
<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>
|
||||
<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
|
||||
| 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>
|
||||
<p fxFlexAlign="center" class="footer-content">{{ 'APP_NAME' | translate }} {{ 'labels.texts.by' | translate }} Mifos
|
||||
</p>
|
||||
|
||||
@@ -6,6 +6,7 @@ import { AuthenticationService } from 'app/core/authentication/authentication.se
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { SystemService } from 'app/system/system.service';
|
||||
import { VersionService } from 'app/system/version.service';
|
||||
|
||||
/** Environment Configuration */
|
||||
import { environment } from 'environments/environment';
|
||||
@@ -22,7 +23,9 @@ import { Subscription } from 'rxjs';
|
||||
export class FooterComponent implements OnInit, OnDestroy {
|
||||
|
||||
/** Mifos X version. */
|
||||
version: string = environment.version;
|
||||
versions: any = {
|
||||
mifos: environment.version
|
||||
};
|
||||
/** Mifos X hash */
|
||||
hash: string = environment.hash;
|
||||
server = '';
|
||||
@@ -35,11 +38,14 @@ export class FooterComponent implements OnInit, OnDestroy {
|
||||
alert$: Subscription;
|
||||
timer: any;
|
||||
|
||||
displayBackEndInfo: boolean = environment.displayBackEndInfo;
|
||||
|
||||
constructor(private systemService: SystemService,
|
||||
private settingsService: SettingsService,
|
||||
private authenticationService: AuthenticationService,
|
||||
private alertService: AlertService,
|
||||
private dateUtils: Dates) { }
|
||||
private dateUtils: Dates,
|
||||
private versionService: VersionService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.alert$ = this.alertService.alertEvent.subscribe((alertEvent: Alert) => {
|
||||
@@ -60,6 +66,12 @@ export class FooterComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
this.getConfigurations();
|
||||
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() {
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,4 +19,8 @@
|
||||
|
||||
// Char delimiter to Export CSV options: ',' ';' '|' ' '
|
||||
window['env']['defaultCharDelimiter'] = '$MIFOS_DEFAULT_CHAR_DELIMITER';
|
||||
|
||||
// Display or not the BackEnd Info
|
||||
window['env']['displayBackEndInfo'] = '$MIFOS_DISPLAY_BACKEND_INFO';
|
||||
|
||||
})(this);
|
||||
|
||||
@@ -25,7 +25,9 @@ export const environment = {
|
||||
supportedLanguages: window['env']['supportedLanguages'] || 'en-US,es-MX,fr-FR',
|
||||
preloadClients: window['env']['preloadClients'] || true,
|
||||
|
||||
defaultCharDelimiter: window['env']['defaultCharDelimiter'] || ','
|
||||
defaultCharDelimiter: window['env']['defaultCharDelimiter'] || ',',
|
||||
|
||||
displayBackEndInfo: window['env']['displayBackEndInfo'] || true
|
||||
};
|
||||
|
||||
// Server URL
|
||||
|
||||
@@ -30,7 +30,9 @@ export const environment = {
|
||||
supportedLanguages: window['env']['supportedLanguages'] || 'en-US,es-MX,fr-FR',
|
||||
preloadClients: window['env']['preloadClients'] || true,
|
||||
|
||||
defaultCharDelimiter: window['env']['defaultCharDelimiter'] || ','
|
||||
defaultCharDelimiter: window['env']['defaultCharDelimiter'] || ',',
|
||||
|
||||
displayBackEndInfo: window['env']['displayBackEndInfo'] || true
|
||||
};
|
||||
|
||||
// Server URL
|
||||
|
||||
Reference in New Issue
Block a user