Upgrading to Angular 20:

Replaced checked in package-lock.json by regenerated one.
Ran ng update @angular/core@20 @angular/cli@20
Ran npm install @angular-builders/jest@^20.0.0 @fortawesome/angular-fontawesome@^3.0.0 @swimlane/ngx-graph@^11
Ran npm install ngx-mat-select-search@^8.0.2.
Ran ng update @angular/material@20.
Updated all eslint and typescript to the latest versions.
Removed @angular-devkit/schematics.
Updated fontawesome.
Updated rxjs and tslib.
Moved required node version from 16 to 20.
Updated jest-preset-angular.
Set preserveWhitespaces to false.
Corrected two type declarations in two typescript files to make ng serve run without errors.
Removed unused angular-devkit/schematics from view-user.component.ts .
Updated list of supported browsers.
Upgraded prettier.
Ran prettier . --write the first time.
Ran prettier . --write the second time.
Ran ng generate @angular/core:inject with defaults, excepted a handful of files.
Fixed remaining eslint problems.
Added dist directory to ignores in eslint.config.js.
Let prettier fix formatting, almost everything is just line breaks.
Made htmlhint ignore @if and @for Angular constructs.
Updated node version in Github workflow to 22.12.0 (build.yml).
Updated .env.ts.
Updated Angular datetime format strings from YYYY-MM-DD to yyyy-MM-dd.
Merged changes from dev into angular20 branch.
This commit is contained in:
Felix van Hove
2025-12-08 11:01:01 +01:00
parent f1b4ec2cf2
commit 7fd1486c08
1516 changed files with 39367 additions and 36037 deletions
@@ -1,155 +1,158 @@
<div *ngIf="isJournalEntryLoaded">
<div *ngIf="dataSource?.data[0].manualEntry" class="layout-row layout-align-end container m-b-20">
<button
mat-raised-button
color="primary"
(click)="revertTransaction()"
*mifosxHasPermission="'REVERSE_JOURNALENTRY'"
[disabled]="dataSource?.data[0].reversed"
>
<span *ngIf="!dataSource.data[0].reversed">
<fa-icon icon="undo" class="m-r-10"></fa-icon>{{ 'labels.buttons.Revert Transaction' | translate }}
</span>
<span *ngIf="dataSource.data[0].reversed">{{ 'labels.buttons.Transaction Reverted' | translate }}</span>
</button>
@if (isJournalEntryLoaded) {
<div>
@if (dataSource?.data[0].manualEntry) {
<div class="layout-row layout-align-end container m-b-20">
<button
mat-raised-button
color="primary"
(click)="revertTransaction()"
*mifosxHasPermission="'REVERSE_JOURNALENTRY'"
[disabled]="dataSource?.data[0].reversed"
>
@if (!dataSource.data[0].reversed) {
<span>
<fa-icon icon="undo" class="m-r-10"></fa-icon>{{ 'labels.buttons.Revert Transaction' | translate }}
</span>
}
@if (dataSource.data[0].reversed) {
<span>{{ 'labels.buttons.Transaction Reverted' | translate }}</span>
}
</button>
</div>
}
@if (isViewTransaction()) {
<div class="container m-b-20">
@if (dataSource) {
<mat-card class="mat-elevation-z8" ngClass="{{ journalEntryColor() }}">
<mat-card-content>
<div class="layout-row-wrap">
<div class="flex-25 header">
{{ 'labels.inputs.Office' | translate }}
</div>
<div class="flex-25">
{{ dataSource.data[0].officeName }}
</div>
<div class="flex-25 header">
{{ 'labels.inputs.Transaction Date' | translate }}
</div>
<div class="flex-25">
{{ dataSource.data[0].transactionDate | dateFormat }}
</div>
<div class="flex-25 header">
{{ 'labels.inputs.Created By' | translate }}
</div>
<div class="flex-25">
{{ dataSource.data[0].createdByUserName }}
</div>
<div class="flex-25 header">
{{ 'labels.inputs.Submitted on' | translate }}
</div>
<div class="flex-25">
{{ dataSource.data[0].submittedOnDate | datetimeFormat }}
</div>
<div class="flex-25 header">
{{ 'labels.inputs.Manual Journal Entry' | translate }}
</div>
<div class="flex-25">
{{ dataSource.data[0].manualEntry | yesNo }}
</div>
@if (dataSource.data[0].externalAssetOwner) {
<div class="flex-25 header">
{{ 'labels.inputs.External Asset Owner' | translate }}
</div>
}
@if (dataSource.data[0].externalAssetOwner) {
<div class="flex-25">
{{ dataSource.data[0].externalAssetOwner }}
</div>
}
</div>
</mat-card-content>
</mat-card>
}
</div>
}
<div class="mat-elevation-z8 container layout-align-center layout-row-wrap">
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="id">
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header>
{{ 'labels.inputs.Entry ID' | translate }}
</th>
<td mat-cell *matCellDef="let transaction">{{ transaction.id }}</td>
</ng-container>
<ng-container matColumnDef="glAccountType">
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header>
{{ 'labels.inputs.Type' | translate }}
</th>
<td mat-cell *matCellDef="let transaction">{{ transaction.glAccountType.value }}</td>
</ng-container>
<ng-container matColumnDef="glAccountCode">
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header>
{{ 'labels.inputs.Account Code' | translate }}
</th>
<td mat-cell *matCellDef="let transaction">{{ transaction.glAccountCode }}</td>
</ng-container>
<ng-container matColumnDef="glAccountName">
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header>
{{ 'labels.inputs.Account Name' | translate }}
</th>
<td mat-cell *matCellDef="let transaction">{{ transaction.glAccountName }}</td>
</ng-container>
<ng-container matColumnDef="debit">
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header>
{{ 'labels.inputs.Debit' | translate }}
</th>
<td mat-cell *matCellDef="let transaction">
@if (transaction.entryType.value === 'DEBIT') {
<span>
{{ transaction.currency.displaySymbol || transaction.currency.code }}
{{ transaction.amount | formatNumber }}
</span>
}
</td>
</ng-container>
<ng-container matColumnDef="credit">
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header>
{{ 'labels.inputs.Credit' | translate }}
</th>
<td mat-cell *matCellDef="let transaction">
@if (transaction.entryType.value === 'CREDIT') {
<span>
{{ transaction.currency.displaySymbol || transaction.currency.code }}
{{ transaction.amount | formatNumber }}
</span>
}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr
mat-row
*matRowDef="let row; columns: displayedColumns"
(click)="viewJournalEntry(row)"
class="select-row"
></tr>
</table>
<div class="layout-row layout-align-center m-t-15 m-b-15 gap-5px layout-xs-column">
<button type="button" color="primary" mat-raised-button (click)="goBack()">
{{ 'labels.buttons.Back' | translate }}
</button>
</div>
</div>
</div>
}
<div class="container m-b-20" *ngIf="isViewTransaction()">
<mat-card class="mat-elevation-z8" ngClass="{{ journalEntryColor() }}" *ngIf="dataSource">
<mat-card-content>
<div class="layout-row-wrap">
<div class="flex-25 header">
{{ 'labels.inputs.Office' | translate }}
</div>
<div class="flex-25">
{{ dataSource.data[0].officeName }}
</div>
<div class="flex-25 header">
{{ 'labels.inputs.Transaction Date' | translate }}
</div>
<div class="flex-25">
{{ dataSource.data[0].transactionDate | dateFormat }}
</div>
<div class="flex-25 header">
{{ 'labels.inputs.Created By' | translate }}
</div>
<div class="flex-25">
{{ dataSource.data[0].createdByUserName }}
</div>
<div class="flex-25 header">
{{ 'labels.inputs.Submitted on' | translate }}
</div>
<div class="flex-25">
{{ dataSource.data[0].submittedOnDate | datetimeFormat }}
</div>
<div class="flex-25 header">
{{ 'labels.inputs.Manual Journal Entry' | translate }}
</div>
<div class="flex-25">
{{ dataSource.data[0].manualEntry | yesNo }}
</div>
<div class="flex-25 header" *ngIf="dataSource.data[0].externalAssetOwner">
{{ 'labels.inputs.External Asset Owner' | translate }}
</div>
<div class="flex-25" *ngIf="dataSource.data[0].externalAssetOwner">
{{ dataSource.data[0].externalAssetOwner }}
</div>
</div>
</mat-card-content>
</mat-card>
</div>
<div class="mat-elevation-z8 container layout-align-center layout-row-wrap">
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="id">
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header>
{{ 'labels.inputs.Entry ID' | translate }}
</th>
<td mat-cell *matCellDef="let transaction">{{ transaction.id }}</td>
</ng-container>
<ng-container matColumnDef="glAccountType">
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Type' | translate }}</th>
<td mat-cell *matCellDef="let transaction">{{ transaction.glAccountType.value }}</td>
</ng-container>
<ng-container matColumnDef="glAccountCode">
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header>
{{ 'labels.inputs.Account Code' | translate }}
</th>
<td mat-cell *matCellDef="let transaction">{{ transaction.glAccountCode }}</td>
</ng-container>
<ng-container matColumnDef="glAccountName">
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header>
{{ 'labels.inputs.Account Name' | translate }}
</th>
<td mat-cell *matCellDef="let transaction">{{ transaction.glAccountName }}</td>
</ng-container>
<ng-container matColumnDef="debit">
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header>
{{ 'labels.inputs.Debit' | translate }}
</th>
<td mat-cell *matCellDef="let transaction">
<span *ngIf="transaction.entryType.value === 'DEBIT'">
{{ transaction.currency.displaySymbol || transaction.currency.code }}
{{ transaction.amount | formatNumber }}
</span>
</td>
</ng-container>
<ng-container matColumnDef="credit">
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header>
{{ 'labels.inputs.Credit' | translate }}
</th>
<td mat-cell *matCellDef="let transaction">
<span *ngIf="transaction.entryType.value === 'CREDIT'">
{{ transaction.currency.displaySymbol || transaction.currency.code }}
{{ transaction.amount | formatNumber }}
</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr
mat-row
*matRowDef="let row; columns: displayedColumns"
(click)="viewJournalEntry(row)"
class="select-row"
></tr>
</table>
@if (!isJournalEntryLoaded) {
<div class="container m-b-20">
<div class="alert">
<div class="message">
<i class="fa fa-exclamation-circle alert-check"></i>
{{ 'labels.text.No data found' | translate }}
</div>
</div>
<div class="layout-row layout-align-center m-t-15 m-b-15 gap-5px layout-xs-column">
<button type="button" color="primary" mat-raised-button (click)="goBack()">
{{ 'labels.buttons.Back' | translate }}
</button>
</div>
</div>
</div>
<div class="container m-b-20" *ngIf="!isJournalEntryLoaded">
<div class="alert">
<div class="message">
<i class="fa fa-exclamation-circle alert-check"></i>
{{ 'labels.text.No data found' | translate }}
</div>
</div>
<div class="layout-row layout-align-center m-t-15 m-b-15 gap-5px layout-xs-column">
<button type="button" color="primary" mat-raised-button (click)="goBack()">
{{ 'labels.buttons.Back' | translate }}
</button>
</div>
</div>
}
@@ -1,4 +1,4 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, OnInit, ViewChild, inject } from '@angular/core';
import { ViewJournalEntryComponent } from '../view-journal-entry/view-journal-entry.component';
import { RevertTransactionComponent } from 'app/accounting/revert-transaction/revert-transaction.component';
import { AccountingService } from 'app/accounting/accounting.service';
@@ -19,7 +19,7 @@ import {
MatRowDef,
MatRow
} from '@angular/material/table';
import { Location, NgIf } from '@angular/common';
import { Location } from '@angular/common';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
import { DatetimeFormatPipe } from '../../../pipes/datetime-format.pipe';
@@ -53,6 +53,12 @@ import { YesnoPipe } from '@pipes/yesno.pipe';
]
})
export class ViewJournalEntryTransactionComponent implements OnInit {
private accountingService = inject(AccountingService);
private route = inject(ActivatedRoute);
private router = inject(Router);
dialog = inject(MatDialog);
private location = inject(Location);
title: string;
journalEntriesData: any[];
/** Transaction data. */
@@ -80,20 +86,6 @@ export class ViewJournalEntryTransactionComponent implements OnInit {
isManualJournalEntry = false;
/**
* @param {AccountingService} accountingService Accounting Service.
* @param {ActivatedRoute} route Activated Route.
* @param {Router} router Router for navigation.
* @param {MatDialog} dialog Dialog reference.
*/
constructor(
private accountingService: AccountingService,
private route: ActivatedRoute,
private router: Router,
public dialog: MatDialog,
private location: Location
) {}
/**
* Retrieves the transaction data from `resolve` and sets the transaction table.
*/