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,5 +1,5 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Injectable, inject } from '@angular/core';
/** rxjs Imports */
import { Observable } from 'rxjs';
@@ -12,10 +12,7 @@ import { OrganizationService } from 'app/organization/organization.service';
*/
@Injectable()
export class AdhocQueryTemplateResolver {
/**
* @param {OrganizationService} organizationService Organization service.
*/
constructor(private organizationService: OrganizationService) {}
private organizationService = inject(OrganizationService);
/**
* Returns the adhoc query template data.
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, OnInit, ViewChild, inject } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort, MatSortHeader } from '@angular/material/sort';
import {
@@ -50,6 +50,8 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class AdhocQueryComponent implements OnInit {
private route = inject(ActivatedRoute);
/** Adhoc Queries data. */
adhocQueriesData: any;
/** Columns to be displayed in adhoc queries table. */
@@ -74,7 +76,7 @@ export class AdhocQueryComponent implements OnInit {
* Retrieves the adhoc queries data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute) {
constructor() {
this.route.data.subscribe((data: { adhocQueries: any }) => {
this.adhocQueriesData = data.adhocQueries;
});
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Injectable, inject } from '@angular/core';
/** rxjs Imports */
import { Observable } from 'rxjs';
@@ -12,10 +12,7 @@ import { OrganizationService } from '../../organization.service';
*/
@Injectable()
export class AdhocQueriesResolver {
/**
* @param {OrganizationService} organizationService Organization service.
*/
constructor(private organizationService: OrganizationService) {}
private organizationService = inject(OrganizationService);
/**
* Returns the adhoc queries data.
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Injectable, inject } from '@angular/core';
import { ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
@@ -13,10 +13,7 @@ import { OrganizationService } from 'app/organization/organization.service';
*/
@Injectable()
export class AdhocQueryAndTemplateResolver {
/**
* @param {OrganizationService} organizationService Organization service.
*/
constructor(private organizationService: OrganizationService) {}
private organizationService = inject(OrganizationService);
/**
* Returns the adhoc query and template data.
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Injectable, inject } from '@angular/core';
import { ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
@@ -13,10 +13,7 @@ import { OrganizationService } from 'app/organization/organization.service';
*/
@Injectable()
export class AdhocQueryResolver {
/**
* @param {OrganizationService} organizationService Organization service.
*/
constructor(private organizationService: OrganizationService) {}
private organizationService = inject(OrganizationService);
/**
* Returns the adhoc query data.
@@ -6,69 +6,87 @@
<mat-form-field>
<mat-label>{{ 'labels.inputs.name' | translate }}</mat-label>
<input matInput required formControlName="name" />
<mat-error *ngIf="adhocQueryForm.controls.name.hasError('required')">
{{ 'labels.inputs.name' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (adhocQueryForm.controls.name.hasError('required')) {
<mat-error>
{{ 'labels.inputs.name' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.SQL Query' | translate }}</mat-label>
<textarea matInput required formControlName="query"></textarea>
<mat-error *ngIf="adhocQueryForm.controls.query.hasError('required')">
{{ 'labels.inputs.SQL Query' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (adhocQueryForm.controls.query.hasError('required')) {
<mat-error>
{{ 'labels.inputs.SQL Query' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Insert into table' | translate }}</mat-label>
<input matInput required formControlName="tableName" />
<mat-error *ngIf="adhocQueryForm.controls.tableName.hasError('required')">
{{ 'labels.inputs.Insert into table' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (adhocQueryForm.controls.tableName.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Insert into table' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Table Fields' | translate }}</mat-label>
<textarea matInput required formControlName="tableFields"></textarea>
<mat-error *ngIf="adhocQueryForm.controls.tableFields.hasError('required')">
{{ 'labels.inputs.Table Fields' | translate }} {{ 'labels.commons.are' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (adhocQueryForm.controls.tableFields.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Table Fields' | translate }} {{ 'labels.commons.are' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Email' | translate }}</mat-label>
<input matInput formControlName="email" />
<mat-error *ngIf="adhocQueryForm.controls.email.hasError('email')">
{{ 'labels.inputs.Email' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.invalid' | translate }}</strong>
</mat-error>
@if (adhocQueryForm.controls.email.hasError('email')) {
<mat-error>
{{ 'labels.inputs.Email' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.invalid' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Report Run Frequency' | translate }}</mat-label>
<mat-select formControlName="reportRunFrequency">
<mat-option *ngFor="let reportRunFrequency of reportRunFrequencyData" [value]="reportRunFrequency.id">
{{ reportRunFrequency.value }}
</mat-option>
@for (reportRunFrequency of reportRunFrequencyData; track reportRunFrequency) {
<mat-option [value]="reportRunFrequency.id">
{{ reportRunFrequency.value }}
</mat-option>
}
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="adhocQueryForm.controls.reportRunFrequency.value === 5">
<mat-label>{{ 'labels.inputs.Custom Report Run Frequency (Days)' | translate }}</mat-label>
<input type="number" matInput required formControlName="reportRunEvery" />
<mat-error *ngIf="adhocQueryForm.controls.reportRunEvery.hasError('required')">
{{ 'labels.inputs.Custom Report Run Frequency' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
<mat-error *ngIf="adhocQueryForm.controls.reportRunEvery.hasError('min')">
{{ 'labels.inputs.Custom Report Run Frequency' | translate }}
<strong>{{ 'labels.commons.must be larger than 0' | translate }}</strong>
</mat-error>
</mat-form-field>
@if (adhocQueryForm.controls.reportRunFrequency.value === 5) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Custom Report Run Frequency (Days)' | translate }}</mat-label>
<input type="number" matInput required formControlName="reportRunEvery" />
@if (adhocQueryForm.controls.reportRunEvery.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Custom Report Run Frequency' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
@if (adhocQueryForm.controls.reportRunEvery.hasError('min')) {
<mat-error>
{{ 'labels.inputs.Custom Report Run Frequency' | translate }}
<strong>{{ 'labels.commons.must be larger than 0' | translate }}</strong>
</mat-error>
}
</mat-form-field>
}
<mat-checkbox labelPosition="before" formControlName="isActive">
{{ 'labels.inputs.Active' | translate }}
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import {
UntypedFormGroup,
UntypedFormBuilder,
@@ -27,6 +27,11 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class CreateAdhocQueryComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private organizationService = inject(OrganizationService);
private route = inject(ActivatedRoute);
private router = inject(Router);
/** Adhoc Query form. */
adhocQueryForm: UntypedFormGroup;
/** Adhoc Query template data. */
@@ -41,12 +46,7 @@ export class CreateAdhocQueryComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
* @param {Router} router Router for navigation.
*/
constructor(
private formBuilder: UntypedFormBuilder,
private organizationService: OrganizationService,
private route: ActivatedRoute,
private router: Router
) {
constructor() {
this.route.data.subscribe((data: { adhocQueryTemplate: any }) => {
this.adhocQueryTemplateData = data.adhocQueryTemplate;
});
@@ -101,7 +101,8 @@ export class CreateAdhocQueryComponent implements OnInit {
'reportRunEvery',
new UntypedFormControl('', [
Validators.required,
Validators.min(1)])
Validators.min(1)
])
);
} else {
this.adhocQueryForm.removeControl('reportRunEvery');
@@ -6,69 +6,87 @@
<mat-form-field>
<mat-label>{{ 'labels.inputs.name' | translate }}</mat-label>
<input matInput required formControlName="name" />
<mat-error *ngIf="editAdhocQueryForm.controls.name.hasError('required')">
{{ 'labels.inputs.name' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (editAdhocQueryForm.controls.name.hasError('required')) {
<mat-error>
{{ 'labels.inputs.name' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.SQL Query' | translate }}</mat-label>
<textarea matInput required formControlName="query"></textarea>
<mat-error *ngIf="editAdhocQueryForm.controls.query.hasError('required')">
{{ 'labels.inputs.SQL Query' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (editAdhocQueryForm.controls.query.hasError('required')) {
<mat-error>
{{ 'labels.inputs.SQL Query' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Insert into table' | translate }}</mat-label>
<input matInput required formControlName="tableName" />
<mat-error *ngIf="editAdhocQueryForm.controls.tableName.hasError('required')">
{{ 'labels.inputs.Insert into table' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (editAdhocQueryForm.controls.tableName.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Insert into table' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Table Fields' | translate }}</mat-label>
<textarea matInput required formControlName="tableFields"></textarea>
<mat-error *ngIf="editAdhocQueryForm.controls.tableFields.hasError('required')">
{{ 'labels.inputs.Table Fields' | translate }} {{ 'labels.commons.are' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (editAdhocQueryForm.controls.tableFields.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Table Fields' | translate }} {{ 'labels.commons.are' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Email' | translate }}</mat-label>
<input matInput formControlName="email" />
<mat-error *ngIf="editAdhocQueryForm.controls.email.hasError('email')">
{{ 'labels.inputs.Email' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.invalid' | translate }}</strong>
</mat-error>
@if (editAdhocQueryForm.controls.email.hasError('email')) {
<mat-error>
{{ 'labels.inputs.Email' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.invalid' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Report Run Frequency' | translate }}</mat-label>
<mat-select formControlName="reportRunFrequency">
<mat-option *ngFor="let reportRunFrequency of reportRunFrequencyData" [value]="reportRunFrequency.id">
{{ reportRunFrequency.value }}
</mat-option>
@for (reportRunFrequency of reportRunFrequencyData; track reportRunFrequency) {
<mat-option [value]="reportRunFrequency.id">
{{ reportRunFrequency.value }}
</mat-option>
}
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="editAdhocQueryForm.controls.reportRunFrequency.value === 5">
<mat-label>{{ 'labels.inputs.Custom Report Run Frequency (Days)' | translate }}</mat-label>
<input type="number" matInput required formControlName="reportRunEvery" />
<mat-error *ngIf="editAdhocQueryForm.controls.reportRunEvery.hasError('required')">
{{ 'labels.inputs.Custom Report Run Frequency' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
<mat-error *ngIf="editAdhocQueryForm.controls.reportRunEvery.hasError('min')">
{{ 'labels.inputs.Custom Report Run Frequency' | translate }}
<strong>{{ 'labels.commons.must be larger than 0' | translate }}</strong>
</mat-error>
</mat-form-field>
@if (editAdhocQueryForm.controls.reportRunFrequency.value === 5) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Custom Report Run Frequency (Days)' | translate }}</mat-label>
<input type="number" matInput required formControlName="reportRunEvery" />
@if (editAdhocQueryForm.controls.reportRunEvery.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Custom Report Run Frequency' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
@if (editAdhocQueryForm.controls.reportRunEvery.hasError('min')) {
<mat-error>
{{ 'labels.inputs.Custom Report Run Frequency' | translate }}
<strong>{{ 'labels.commons.must be larger than 0' | translate }}</strong>
</mat-error>
}
</mat-form-field>
}
<mat-checkbox labelPosition="before" formControlName="isActive">
{{ 'labels.inputs.Active' | translate }}
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import {
UntypedFormGroup,
UntypedFormBuilder,
@@ -27,6 +27,11 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class EditAdhocQueryComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private organizationService = inject(OrganizationService);
private route = inject(ActivatedRoute);
private router = inject(Router);
/** Edit Adhoc Query form. */
editAdhocQueryForm: UntypedFormGroup;
/** Adhoc Query template data. */
@@ -41,12 +46,7 @@ export class EditAdhocQueryComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
* @param {Router} router Router for navigation.
*/
constructor(
private formBuilder: UntypedFormBuilder,
private organizationService: OrganizationService,
private route: ActivatedRoute,
private router: Router
) {
constructor() {
this.route.data.subscribe((data: { adhocQueryAndTemplate: any }) => {
this.adhocQueryTemplateData = data.adhocQueryAndTemplate;
});
@@ -101,7 +101,8 @@ export class EditAdhocQueryComponent implements OnInit {
'reportRunEvery',
new UntypedFormControl('', [
Validators.required,
Validators.min(1)])
Validators.min(1)
])
);
this.editAdhocQueryForm.get('reportRunEvery').patchValue(this.adhocQueryTemplateData.reportRunEvery);
} else {
@@ -37,13 +37,17 @@
{{ adhocQueryData.tableName }}
</div>
<div class="flex-50 mat-body-strong" *ngIf="adhocQueryData.reportRunFrequency">
{{ 'labels.inputs.Report Run Frequency' | translate }}
</div>
@if (adhocQueryData.reportRunFrequency) {
<div class="flex-50 mat-body-strong">
{{ 'labels.inputs.Report Run Frequency' | translate }}
</div>
}
<div class="flex-50" *ngIf="adhocQueryData.reportRunFrequency">
{{ reportRunFrequency }}
</div>
@if (adhocQueryData.reportRunFrequency) {
<div class="flex-50">
{{ reportRunFrequency }}
</div>
}
<div class="flex-50 mat-body-strong">
{{ 'labels.inputs.Status' | translate }}
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component } from '@angular/core';
import { Component, inject } from '@angular/core';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
@@ -24,6 +24,11 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class ViewAdhocQueryComponent {
private organizationService = inject(OrganizationService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dialog = inject(MatDialog);
/** Adhoc query data. */
adhocQueryData: any;
@@ -34,12 +39,7 @@ export class ViewAdhocQueryComponent {
* @param {Router} router Router for navigation.
* @param {MatDialog} dialog Dialog reference.
*/
constructor(
private organizationService: OrganizationService,
private route: ActivatedRoute,
private router: Router,
private dialog: MatDialog
) {
constructor() {
this.route.data.subscribe((data: { adhocQuery: any }) => {
this.adhocQueryData = data.adhocQuery;
});