Upgrade to Angular 16

Merge `angular-update-16` into `dev` branch
This commit is contained in:
Adam Saghy
2025-05-23 18:47:20 +02:00
parent c7c2f60182
commit 19a14e5b5b
882 changed files with 14895 additions and 14340 deletions
@@ -1,6 +1,6 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
import { ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
@@ -12,7 +12,7 @@ import { AccountingService } from '../accounting.service';
* Accounting rule data resolver.
*/
@Injectable()
export class AccountingRuleResolver implements Resolve<Object> {
export class AccountingRuleResolver {
/**
* @param {AccountingService} accountingService Accounting service.
*/
@@ -1,6 +1,5 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
@@ -12,7 +11,7 @@ import { AccountingService } from '../accounting.service';
* Accounting rules template data resolver.
*/
@Injectable()
export class AccountingRulesTemplateResolver implements Resolve<Object> {
export class AccountingRulesTemplateResolver {
/**
* @param {AccountingService} accountingService Accounting service.
*/
@@ -1,4 +1,4 @@
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
<div class="container m-b-20 layout-row align-end gap-20px">
<button mat-raised-button color="primary" [routerLink]="['create']" *mifosxHasPermission="'CREATE_ACCOUNTINGRULE'">
<fa-icon icon="plus" class="m-r-10"></fa-icon>
{{ 'labels.buttons.Add Rule' | translate }}
@@ -6,8 +6,8 @@
</div>
<div class="container">
<div fxLayout="row">
<mat-form-field fxFlex>
<div class="layout-row">
<mat-form-field class="flex-fill">
<mat-label>{{ 'labels.inputs.Filter' | translate }}</mat-label>
<input matInput (keyup)="applyFilter($event.target.value)" />
</mat-form-field>
@@ -1,6 +1,5 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
@@ -12,7 +11,7 @@ import { AccountingService } from '../accounting.service';
* Accounting rules data resolver.
*/
@Injectable()
export class AccountingRulesResolver implements Resolve<Object> {
export class AccountingRulesResolver {
/**
* @param {AccountingService} accountingService Accounting service.
*/
@@ -2,8 +2,8 @@
<mat-card>
<form [formGroup]="accountingRuleForm" (ngSubmit)="submit()">
<mat-card-content>
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="48%">
<div class="layout-row-wrap gap-2px responsive-column">
<mat-form-field class="flex-48">
<mat-label>{{ 'labels.inputs.Accounting Rule Name' | translate }}</mat-label>
<input matInput required formControlName="name" />
<mat-error *ngIf="accountingRuleForm.controls.name.hasError('required')">
@@ -12,7 +12,7 @@
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-form-field class="flex-48">
<mat-label>{{ 'labels.inputs.Office' | translate }}</mat-label>
<mat-select required formControlName="officeId">
<mat-option *ngFor="let office of officeData" [value]="office.id">
@@ -25,9 +25,14 @@
</mat-error>
</mat-form-field>
<div fxFlex="48%" fxLayout="row" fxLayout.lt-md="column" class="rule-wrapper">
<mat-label fxFlex="50%">{{ 'labels.inputs.Affected GL Entry (Debit) Rule Type' | translate }} *</mat-label>
<mat-radio-group fxFlex="50%" fxLayout="row" fxLayoutGap="5%" formControlName="debitRuleType">
<div class="rule-wrapper flex-48 layout-row responsive-column">
<mat-label class="flex-50"
>{{ 'labels.inputs.Affected GL Entry (Debit) Rule Type' | translate }} *</mat-label
>
<mat-radio-group
class="flex-50 layout-row gap-5percent radio-group-spacing"
formControlName="debitRuleType"
>
<mat-radio-button value="fixedAccount">{{ 'labels.inputs.Fixed Account' | translate }}</mat-radio-button>
<mat-radio-button value="listOfAccounts">{{
'labels.inputs.List of Accounts' | translate
@@ -35,7 +40,7 @@
</mat-radio-group>
</div>
<mat-form-field fxFlex="48%" *ngIf="accountingRuleForm.controls.debitRuleType.value === 'fixedAccount'">
<mat-form-field class="flex-48" *ngIf="accountingRuleForm.controls.debitRuleType.value === 'fixedAccount'">
<mat-label>{{ 'labels.inputs.Account to Debit' | translate }}</mat-label>
<mat-select formControlName="accountToDebit">
<mat-option *ngFor="let glAccount of glAccountData" [value]="glAccount.id">
@@ -45,13 +50,10 @@
</mat-form-field>
<div
fxFlex="48%"
fxLayout="row"
fxLayoutGap="2%"
fxLayout.lt-md="column"
class="flex-48 layout-row gap-2percent responsive-column"
*ngIf="accountingRuleForm.controls.debitRuleType.value === 'listOfAccounts'"
>
<mat-form-field fxFlex="50%">
<mat-form-field class="flex-50">
<mat-label>{{ 'labels.inputs.Debit Tags' | translate }}</mat-label>
<mat-select formControlName="debitTags" multiple>
<mat-option *ngFor="let debitTag of debitTagData" [value]="debitTag.id">
@@ -60,16 +62,21 @@
</mat-select>
</mat-form-field>
<div fxFlex="50%" ngClass.gt-md="entries-wrapper">
<div class="flex-50" ngClass.gt-md="entries-wrapper">
<mat-checkbox labelPosition="before" formControlName="allowMultipleDebitEntries" class="entries">
{{ 'labels.inputs.Multiple Debit Entries Allowed' | translate }}
</mat-checkbox>
</div>
</div>
<div fxFlex="48%" fxLayout="row" fxLayout.lt-md="column" class="rule-wrapper">
<mat-label fxFlex="50%">{{ 'labels.inputs.Affected GL Entry (Credit) Rule Type' | translate }} *</mat-label>
<mat-radio-group fxFlex="50%" fxLayout="row" fxLayoutGap="5%" formControlName="creditRuleType">
<div class="rule-wrapper flex-48 layout-row responsive-column">
<mat-label class="flex-50"
>{{ 'labels.inputs.Affected GL Entry (Credit) Rule Type' | translate }} *</mat-label
>
<mat-radio-group
class="flex-50 layout-row gap-5-percent radio-group-spacing"
formControlName="creditRuleType"
>
<mat-radio-button value="fixedAccount">{{ 'labels.inputs.Fixed Account' | translate }}</mat-radio-button>
<mat-radio-button value="listOfAccounts">{{
'labels.inputs.List of Accounts' | translate
@@ -77,7 +84,7 @@
</mat-radio-group>
</div>
<mat-form-field fxFlex="48%" *ngIf="accountingRuleForm.controls.creditRuleType.value === 'fixedAccount'">
<mat-form-field class="flex-48" *ngIf="accountingRuleForm.controls.creditRuleType.value === 'fixedAccount'">
<mat-label>{{ 'labels.inputs.Account to Credit' | translate }}</mat-label>
<mat-select formControlName="accountToCredit">
<mat-option *ngFor="let glAccount of glAccountData" [value]="glAccount.id">
@@ -87,13 +94,10 @@
</mat-form-field>
<div
fxFlex="48%"
fxLayout="row"
fxLayoutGap="2%"
fxLayout.lt-md="column"
class="flex-48 layout-row gap-2percent responsive-column"
*ngIf="accountingRuleForm.controls.creditRuleType.value === 'listOfAccounts'"
>
<mat-form-field fxFlex="50%">
<mat-form-field class="flex-50">
<mat-label>{{ 'labels.inputs.Credit Tags' | translate }}</mat-label>
<mat-select formControlName="creditTags" multiple>
<mat-option *ngFor="let creditTag of creditTagData" [value]="creditTag.id">
@@ -102,21 +106,21 @@
</mat-select>
</mat-form-field>
<div fxFlex="50%" ngClass.gt-md="entries-wrapper">
<div class="flex-50" ngClass.gt-md="entries-wrapper">
<mat-checkbox labelPosition="before" formControlName="allowMultipleCreditEntries" class="entries">
{{ 'labels.inputs.Multiple Credit Entries Allowed' | translate }}
</mat-checkbox>
</div>
</div>
<mat-form-field fxFlex="98%">
<mat-form-field class="flex-98">
<mat-label>{{ 'labels.inputs.Description' | translate }}</mat-label>
<textarea matInput formControlName="description" cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>
</mat-form-field>
</div>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<mat-card-actions class="layout-row align-center gap-5px responsive-column">
<button type="button" mat-raised-button [routerLink]="['../../']">
{{ 'labels.buttons.Cancel' | translate }}
</button>
@@ -12,3 +12,15 @@
right: 0;
}
}
.radio-group-spacing {
display: flex;
gap: 2rem;
flex-direction: row;
}
@media (width <= 768px) {
.radio-group-spacing {
flex-direction: column;
}
}
@@ -2,8 +2,8 @@
<mat-card>
<form [formGroup]="accountingRuleForm" (ngSubmit)="submit()">
<mat-card-content>
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="48%">
<div class="layout-row-wrap gap-2px responsive-column">
<mat-form-field class="flex-48">
<mat-label>{{ 'labels.inputs.Accounting Rule Name' | translate }}</mat-label>
<input matInput required formControlName="name" />
<mat-error *ngIf="accountingRuleForm.controls.name.hasError('required')">
@@ -12,7 +12,7 @@
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-form-field class="flex-48">
<mat-label>{{ 'labels.inputs.Office' | translate }}</mat-label>
<mat-select required formControlName="officeId">
<mat-option *ngFor="let office of officeData" [value]="office.id">
@@ -25,9 +25,14 @@
</mat-error>
</mat-form-field>
<div fxFlex="48%" fxLayout="row" fxLayout.lt-md="column" class="rule-wrapper">
<mat-label fxFlex="50%">{{ 'labels.inputs.Affected GL Entry (Debit) Rule Type' | translate }} *</mat-label>
<mat-radio-group fxFlex="50%" fxLayout="row" fxLayoutGap="5%" formControlName="debitRuleType">
<div class="rule-wrapper flex-48 layout-row responsive-column">
<mat-label class="flex-50"
>{{ 'labels.inputs.Affected GL Entry (Debit) Rule Type' | translate }} *</mat-label
>
<mat-radio-group
class="flex-50 layout-row gap-5percent radio-group-spacing"
formControlName="debitRuleType"
>
<mat-radio-button value="fixedAccount">{{ 'labels.inputs.Fixed Account' | translate }}</mat-radio-button>
<mat-radio-button value="listOfAccounts">{{
'labels.inputs.List of Accounts' | translate
@@ -35,7 +40,7 @@
</mat-radio-group>
</div>
<mat-form-field fxFlex="48%" *ngIf="accountingRuleForm.controls.debitRuleType.value === 'fixedAccount'">
<mat-form-field class="flex-48" *ngIf="accountingRuleForm.controls.debitRuleType.value === 'fixedAccount'">
<mat-label>{{ 'labels.inputs.Account to Debit' | translate }}</mat-label>
<mat-select formControlName="accountToDebit">
<mat-option *ngFor="let glAccount of glAccountData" [value]="glAccount.id">
@@ -45,13 +50,10 @@
</mat-form-field>
<div
fxFlex="48%"
fxLayout="row"
fxLayoutGap="2%"
fxLayout.lt-md="column"
class="flex-48 layout-row gap-2percent responsive-column"
*ngIf="accountingRuleForm.controls.debitRuleType.value === 'listOfAccounts'"
>
<mat-form-field fxFlex="50%">
<mat-form-field class="flex-50">
<mat-label>{{ 'labels.inputs.Debit Tags' | translate }}</mat-label>
<mat-select formControlName="debitTags" multiple>
<mat-option *ngFor="let debitTag of debitTagData" [value]="debitTag.id">
@@ -60,16 +62,21 @@
</mat-select>
</mat-form-field>
<div fxFlex="50%" ngClass.gt-md="entries-wrapper">
<div class="flex-50 entries-wrapper">
<mat-checkbox labelPosition="before" formControlName="allowMultipleDebitEntries" class="entries">
{{ 'labels.inputs.Multiple Debit Entries Allowed' | translate }}
</mat-checkbox>
</div>
</div>
<div fxFlex="48%" fxLayout="row" fxLayout.lt-md="column" class="rule-wrapper">
<mat-label fxFlex="50%">{{ 'labels.inputs.Affected GL Entry (Credit) Rule Type' | translate }} *</mat-label>
<mat-radio-group fxFlex="50%" fxLayout="row" fxLayoutGap="5%" formControlName="creditRuleType">
<div class="rule-wrapper flex-48 layout-row responsive-column">
<mat-label class="flex-50"
>{{ 'labels.inputs.Affected GL Entry (Credit) Rule Type' | translate }} *</mat-label
>
<mat-radio-group
class="flex-50 layout-row gap-5-percent radio-group-spacing"
formControlName="creditRuleType"
>
<mat-radio-button value="fixedAccount">{{ 'labels.inputs.Fixed Account' | translate }}</mat-radio-button>
<mat-radio-button value="listOfAccounts">{{
'labels.inputs.List of Accounts' | translate
@@ -77,7 +84,7 @@
</mat-radio-group>
</div>
<mat-form-field fxFlex="48%" *ngIf="accountingRuleForm.controls.creditRuleType.value === 'fixedAccount'">
<mat-form-field class="flex-48" *ngIf="accountingRuleForm.controls.creditRuleType.value === 'fixedAccount'">
<mat-label>{{ 'labels.inputs.Account to Credit' | translate }}</mat-label>
<mat-select formControlName="accountToCredit">
<mat-option *ngFor="let glAccount of glAccountData" [value]="glAccount.id">
@@ -87,13 +94,10 @@
</mat-form-field>
<div
fxFlex="48%"
fxLayout="row"
fxLayoutGap="2%"
fxLayout.lt-md="column"
class="flex-48 layout-row gap-2percent responsive-column"
*ngIf="accountingRuleForm.controls.creditRuleType.value === 'listOfAccounts'"
>
<mat-form-field fxFlex="50%">
<mat-form-field class="flex-50">
<mat-label>{{ 'labels.inputs.Credit Tags' | translate }}</mat-label>
<mat-select formControlName="creditTags" multiple>
<mat-option *ngFor="let creditTag of creditTagData" [value]="creditTag.id">
@@ -102,21 +106,21 @@
</mat-select>
</mat-form-field>
<div fxFlex="50%" ngClass.gt-md="entries-wrapper">
<div class="flex-50 entries-wrapper">
<mat-checkbox labelPosition="before" formControlName="allowMultipleCreditEntries" class="entries">
{{ 'labels.inputs.Multiple Credit Entries Allowed' | translate }}
</mat-checkbox>
</div>
</div>
<mat-form-field fxFlex="98%">
<mat-form-field class="flex-98">
<mat-label>{{ 'labels.inputs.Description' | translate }}</mat-label>
<textarea matInput formControlName="description" cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>
</mat-form-field>
</div>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<mat-card-actions class="layout-row align-center gap-5px responsive-column">
<button type="button" mat-raised-button [routerLink]="['../../']">
{{ 'labels.buttons.Cancel' | translate }}
</button>
@@ -12,3 +12,15 @@
right: 0;
}
}
.radio-group-spacing {
display: flex;
gap: 2rem;
flex-direction: row;
}
@media (width <= 768px) {
.radio-group-spacing {
flex-direction: column;
}
}
@@ -1,4 +1,4 @@
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column" class="container m-b-20">
<div class="layout-row align-end gap-2px responsive-column container m-b-20">
<button mat-raised-button color="primary" [routerLink]="['edit']" *mifosxHasPermission="'UPDATE_ACCOUNTINGRULE'">
<fa-icon icon="edit" class="m-r-10"></fa-icon>
{{ 'labels.buttons.Edit' | translate }}
@@ -14,40 +14,40 @@
</button>
</div>
<div class="container" fxLayout="row" fxLayoutGap="2%" fxLayout.lt-md="column">
<div fxFlex="48%">
<div class="container layout-row gap-2-percent responsive-column">
<div class="flex-48">
<mat-card>
<mat-card-content>
<div fxLayout="row wrap" class="content">
<div fxFlex="50%" class="header">
<div class="layout-row-wrap">
<div class="flex-50 header">
{{ 'labels.inputs.Office' | translate }}
</div>
<div fxFlex="50%">
<div class="flex-50">
{{ accountingRule.officeName }}
</div>
<div fxFlex="50%" class="header" *ngIf="accountingRule.description">
<div class="flex-50 header" *ngIf="accountingRule.description">
{{ 'labels.inputs.Description' | translate }}
</div>
<div fxFlex="50%" *ngIf="accountingRule.description">
<div class="flex-50" *ngIf="accountingRule.description">
{{ accountingRule.description }}
</div>
<div fxFlex="50%" class="header">
<div class="flex-50 header">
{{ 'labels.inputs.Multiple Debit Entries Allowed' | translate }}
</div>
<div fxFlex="50%">
<div class="flex-50">
{{ accountingRule.allowMultipleDebitEntries }}
</div>
<div fxFlex="50%" class="header">
<div class="flex-50 header">
{{ 'labels.inputs.Multiple Credit Entries Allowed' | translate }}
</div>
<div fxFlex="50%">
<div class="flex-50">
{{ accountingRule.allowMultipleCreditEntries }}
</div>
</div>
@@ -55,11 +55,11 @@
</mat-card>
</div>
<div fxFlex>
<div class="flex-fill">
<mat-card>
<mat-card-content>
<div fxLayout="row" class="content">
<div fxFlex="50%" fxLayout="column" *ngIf="accountingRule.debitTags">
<div class="layout-row content">
<div class="flex-50 layout-column" *ngIf="accountingRule.debitTags">
<div class="header">
{{ 'labels.inputs.Debit Tags' | translate }}
</div>
@@ -68,7 +68,7 @@
</div>
</div>
<div fxFlex="50%" fxLayout="column" *ngIf="accountingRule.debitAccounts">
<div class="flex-50 layout-column" *ngIf="accountingRule.debitAccounts">
<div class="header">
{{ 'labels.inputs.Debit Account Name' | translate }}
</div>
@@ -77,7 +77,7 @@
</div>
</div>
<div fxFlex="50%" fxLayout="column" *ngIf="accountingRule.creditTags">
<div class="flex-50 layout-column" *ngIf="accountingRule.creditTags">
<div class="header">
{{ 'labels.inputs.Credit Tags' | translate }}
</div>
@@ -86,7 +86,7 @@
</div>
</div>
<div fxFlex="50%" fxLayout="column" *ngIf="accountingRule.creditAccounts">
<div class="flex-50 layout-column" *ngIf="accountingRule.creditAccounts">
<div class="header">
{{ 'labels.inputs.Credit Account Name' | translate }}
</div>