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:
@@ -6,136 +6,145 @@
|
||||
<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">
|
||||
{{ office.name }}
|
||||
</mat-option>
|
||||
@for (office of officeData; track office) {
|
||||
<mat-option [value]="office.id">
|
||||
{{ office.name }}
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
<mat-error *ngIf="frequentPostingsForm.controls.officeId.hasError('required')">
|
||||
{{ 'labels.inputs.Office' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
@if (frequentPostingsForm.controls.officeId.hasError('required')) {
|
||||
<mat-error>
|
||||
{{ 'labels.inputs.Office' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="flex-48">
|
||||
<mat-label>{{ 'labels.inputs.Accounting Rule' | translate }}</mat-label>
|
||||
<mat-select required formControlName="accountingRule">
|
||||
<mat-option *ngFor="let accountingRule of accountingRuleData" [value]="accountingRule">
|
||||
{{ accountingRule.name }}
|
||||
</mat-option>
|
||||
@for (accountingRule of accountingRuleData; track accountingRule) {
|
||||
<mat-option [value]="accountingRule">
|
||||
{{ accountingRule.name }}
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
<mat-error *ngIf="frequentPostingsForm.controls.accountingRule.hasError('required')">
|
||||
{{ 'labels.inputs.Accounting Rule' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
@if (frequentPostingsForm.controls.accountingRule.hasError('required')) {
|
||||
<mat-error>
|
||||
{{ 'labels.inputs.Accounting Rule' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="flex-48">
|
||||
<mat-label>{{ 'labels.inputs.Currency' | translate }}</mat-label>
|
||||
<mat-select required formControlName="currencyCode">
|
||||
<mat-option *ngFor="let currency of currencyData" [value]="currency.code">
|
||||
{{ currency.displayLabel }}
|
||||
</mat-option>
|
||||
@for (currency of currencyData; track currency) {
|
||||
<mat-option [value]="currency.code">
|
||||
{{ currency.displayLabel }}
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
<mat-error *ngIf="frequentPostingsForm.controls.currencyCode.hasError('required')">
|
||||
{{ 'labels.inputs.Currency' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
@if (frequentPostingsForm.controls.currencyCode.hasError('required')) {
|
||||
<mat-error>
|
||||
{{ 'labels.inputs.Currency' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
|
||||
<span class="flex-48 hide-lt-md"></span>
|
||||
|
||||
<div
|
||||
class="flex-fill layout-row-wrap responsive-column"
|
||||
formArrayName="debits"
|
||||
*ngFor="let debit of debits.controls; let i = index"
|
||||
>
|
||||
<div class="flex-fill layout-row-wrap gap-2percent responsive-column" [formGroupName]="i">
|
||||
<mat-form-field class="flex-48">
|
||||
<mat-label>{{ 'labels.inputs.Affected GL Entry (Debit)' | translate }}</mat-label>
|
||||
<mat-select required formControlName="glAccountId">
|
||||
<mat-option *ngFor="let affectedGLEntryDebit of debitAccountData" [value]="affectedGLEntryDebit.id">
|
||||
{{ affectedGLEntryDebit.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="debits.at(i).controls.glAccountId.hasError('required')">
|
||||
{{ 'labels.inputs.Affected GL Entry (Debit)' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="flex-43">
|
||||
<mat-label>{{ 'labels.inputs.Debit Amount' | translate }}</mat-label>
|
||||
<input type="number" matInput required formControlName="amount" />
|
||||
<mat-error *ngIf="debits.at(i).controls.amount.hasError('required')">
|
||||
{{ 'labels.inputs.Debit Amount' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<span class="flex-fill">
|
||||
<button *ngIf="i !== 0" type="button" mat-icon-button (click)="removeAffectedGLEntry(debits, i)">
|
||||
<fa-icon icon="minus-circle" size="lg"></fa-icon>
|
||||
</button>
|
||||
<button
|
||||
*ngIf="i === 0 && allowMultipleDebitEntries"
|
||||
type="button"
|
||||
mat-icon-button
|
||||
color="primary"
|
||||
(click)="addAffectedGLEntry(debits)"
|
||||
>
|
||||
<fa-icon icon="plus-circle" size="lg"></fa-icon>
|
||||
</button>
|
||||
</span>
|
||||
@for (debit of debits.controls; track debit; let i = $index) {
|
||||
<div class="flex-fill layout-row-wrap responsive-column" formArrayName="debits">
|
||||
<div class="flex-fill layout-row-wrap gap-2percent responsive-column" [formGroupName]="i">
|
||||
<mat-form-field class="flex-48">
|
||||
<mat-label>{{ 'labels.inputs.Affected GL Entry (Debit)' | translate }}</mat-label>
|
||||
<mat-select required formControlName="glAccountId">
|
||||
@for (affectedGLEntryDebit of debitAccountData; track affectedGLEntryDebit) {
|
||||
<mat-option [value]="affectedGLEntryDebit.id">
|
||||
{{ affectedGLEntryDebit.name }}
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
@if (debits.at(i).controls.glAccountId.hasError('required')) {
|
||||
<mat-error>
|
||||
{{ 'labels.inputs.Affected GL Entry (Debit)' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
<mat-form-field class="flex-43">
|
||||
<mat-label>{{ 'labels.inputs.Debit Amount' | translate }}</mat-label>
|
||||
<input type="number" matInput required formControlName="amount" />
|
||||
@if (debits.at(i).controls.amount.hasError('required')) {
|
||||
<mat-error>
|
||||
{{ 'labels.inputs.Debit Amount' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
<span class="flex-fill">
|
||||
@if (i !== 0) {
|
||||
<button type="button" mat-icon-button (click)="removeAffectedGLEntry(debits, i)">
|
||||
<fa-icon icon="minus-circle" size="lg"></fa-icon>
|
||||
</button>
|
||||
}
|
||||
@if (i === 0 && allowMultipleDebitEntries) {
|
||||
<button type="button" mat-icon-button color="primary" (click)="addAffectedGLEntry(debits)">
|
||||
<fa-icon icon="plus-circle" size="lg"></fa-icon>
|
||||
</button>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div
|
||||
class="flex-fill layout-row-wrap responsive-column"
|
||||
formArrayName="credits"
|
||||
*ngFor="let credit of credits.controls; let i = index"
|
||||
>
|
||||
<div class="flex-fill layout-row-wrap gap-2percent responsive-column" [formGroupName]="i">
|
||||
<mat-form-field class="flex-48">
|
||||
<mat-label>{{ 'labels.inputs.Affected GL Entry (Credit)' | translate }}</mat-label>
|
||||
<mat-select required formControlName="glAccountId">
|
||||
<mat-option
|
||||
*ngFor="let affectedGLEntryCredit of creditAccountData"
|
||||
[value]="affectedGLEntryCredit.id"
|
||||
>
|
||||
{{ affectedGLEntryCredit.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="credits.at(i).controls.glAccountId.hasError('required')">
|
||||
{{ 'labels.inputs.Affected GL Entry (Credit)' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="flex-43">
|
||||
<mat-label>{{ 'labels.inputs.Credit Amount' | translate }}</mat-label>
|
||||
<input type="number" matInput required formControlName="amount" />
|
||||
<mat-error *ngIf="credits.at(i).controls.amount.hasError('required')">
|
||||
{{ 'labels.inputs.Credit Amount' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<span class="flex-fill">
|
||||
<button *ngIf="i !== 0" type="button" mat-icon-button (click)="removeAffectedGLEntry(credits, i)">
|
||||
<fa-icon icon="minus-circle" size="lg"></fa-icon>
|
||||
</button>
|
||||
<button
|
||||
*ngIf="i === 0 && allowMultipleCreditEntries"
|
||||
type="button"
|
||||
mat-icon-button
|
||||
color="primary"
|
||||
(click)="addAffectedGLEntry(credits)"
|
||||
>
|
||||
<fa-icon icon="plus-circle" size="lg"></fa-icon>
|
||||
</button>
|
||||
</span>
|
||||
@for (credit of credits.controls; track credit; let i = $index) {
|
||||
<div class="flex-fill layout-row-wrap responsive-column" formArrayName="credits">
|
||||
<div class="flex-fill layout-row-wrap gap-2percent responsive-column" [formGroupName]="i">
|
||||
<mat-form-field class="flex-48">
|
||||
<mat-label>{{ 'labels.inputs.Affected GL Entry (Credit)' | translate }}</mat-label>
|
||||
<mat-select required formControlName="glAccountId">
|
||||
@for (affectedGLEntryCredit of creditAccountData; track affectedGLEntryCredit) {
|
||||
<mat-option [value]="affectedGLEntryCredit.id">
|
||||
{{ affectedGLEntryCredit.name }}
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
@if (credits.at(i).controls.glAccountId.hasError('required')) {
|
||||
<mat-error>
|
||||
{{ 'labels.inputs.Affected GL Entry (Credit)' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
<mat-form-field class="flex-43">
|
||||
<mat-label>{{ 'labels.inputs.Credit Amount' | translate }}</mat-label>
|
||||
<input type="number" matInput required formControlName="amount" />
|
||||
@if (credits.at(i).controls.amount.hasError('required')) {
|
||||
<mat-error>
|
||||
{{ 'labels.inputs.Credit Amount' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
<span class="flex-fill">
|
||||
@if (i !== 0) {
|
||||
<button type="button" mat-icon-button (click)="removeAffectedGLEntry(credits, i)">
|
||||
<fa-icon icon="minus-circle" size="lg"></fa-icon>
|
||||
</button>
|
||||
}
|
||||
@if (i === 0 && allowMultipleCreditEntries) {
|
||||
<button type="button" mat-icon-button color="primary" (click)="addAffectedGLEntry(credits)">
|
||||
<fa-icon icon="plus-circle" size="lg"></fa-icon>
|
||||
</button>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<mat-form-field class="flex-48">
|
||||
<mat-label>{{ 'labels.inputs.Reference Number' | translate }}</mat-label>
|
||||
@@ -154,18 +163,22 @@
|
||||
/>
|
||||
<mat-datepicker-toggle matSuffix [for]="transactionDatePicker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #transactionDatePicker></mat-datepicker>
|
||||
<mat-error *ngIf="frequentPostingsForm.controls.transactionDate.hasError('required')">
|
||||
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
@if (frequentPostingsForm.controls.transactionDate.hasError('required')) {
|
||||
<mat-error>
|
||||
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="flex-48">
|
||||
<mat-label>{{ 'labels.inputs.Payment Type' | translate }}</mat-label>
|
||||
<mat-select formControlName="paymentTypeId">
|
||||
<mat-option *ngFor="let paymentType of paymentTypeData" [value]="paymentType.id">
|
||||
{{ paymentType.name }}
|
||||
</mat-option>
|
||||
@for (paymentType of paymentTypeData; track paymentType) {
|
||||
<mat-option [value]="paymentType.id">
|
||||
{{ paymentType.name }}
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, inject } from '@angular/core';
|
||||
import {
|
||||
UntypedFormGroup,
|
||||
UntypedFormBuilder,
|
||||
@@ -32,6 +32,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
]
|
||||
})
|
||||
export class FrequentPostingsComponent implements OnInit {
|
||||
private formBuilder = inject(UntypedFormBuilder);
|
||||
private accountingService = inject(AccountingService);
|
||||
private settingsService = inject(SettingsService);
|
||||
private dateUtils = inject(Dates);
|
||||
private route = inject(ActivatedRoute);
|
||||
private router = inject(Router);
|
||||
|
||||
/** Minimum transaction date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum transaction date allowed. */
|
||||
@@ -63,14 +70,7 @@ export class FrequentPostingsComponent implements OnInit {
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
*/
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private accountingService: AccountingService,
|
||||
private settingsService: SettingsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router
|
||||
) {
|
||||
constructor() {
|
||||
this.route.data.subscribe((data: { offices: any; accountingRules: any; currencies: any; paymentTypes: any }) => {
|
||||
this.officeData = data.offices;
|
||||
this.accountingRuleData = data.accountingRules;
|
||||
|
||||
Reference in New Issue
Block a user