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:
@@ -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 { ReportsService } from '../reports.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class ReportsResolver {
|
||||
/**
|
||||
* @param {ReportsService} reportsService Reports service.
|
||||
*/
|
||||
constructor(private reportsService: ReportsService) {}
|
||||
private reportsService = inject(ReportsService);
|
||||
|
||||
/**
|
||||
* Returns the reports 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 { ReportsService } from '../reports.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class RunReportResolver {
|
||||
/**
|
||||
* @param {ReportsService} reportsService Reports service.
|
||||
*/
|
||||
constructor(private reportsService: ReportsService) {}
|
||||
private reportsService = inject(ReportsService);
|
||||
|
||||
/**
|
||||
* Returns the report parameters data.
|
||||
|
||||
@@ -46,7 +46,6 @@ const routes: Routes = [
|
||||
]
|
||||
}
|
||||
])
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 {
|
||||
@@ -43,6 +43,9 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
]
|
||||
})
|
||||
export class ReportsComponent implements OnInit {
|
||||
private route = inject(ActivatedRoute);
|
||||
private router = inject(Router);
|
||||
|
||||
/** Reports data. */
|
||||
reportsData: any;
|
||||
/** Report category filter. */
|
||||
@@ -67,10 +70,7 @@ export class ReportsComponent implements OnInit {
|
||||
* Prevents reuse of route parameter `filter`.
|
||||
* @param {Router} router: Router.
|
||||
*/
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router
|
||||
) {
|
||||
constructor() {
|
||||
this.router.routeReuseStrategy.shouldReuseRoute = () => false;
|
||||
this.route.data.subscribe((data: { reports: any }) => {
|
||||
this.reportsData = data.reports;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
|
||||
/** rxjs Imports */
|
||||
@@ -18,10 +18,7 @@ import { ChartData } from './common-models/chart-data.model';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ReportsService {
|
||||
/**
|
||||
* @param {HttpClient} http Http Client to send requests.
|
||||
*/
|
||||
constructor(private http: HttpClient) {}
|
||||
private http = inject(HttpClient);
|
||||
|
||||
/**
|
||||
* @returns {Observable<any>} Reports data
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnChanges, Input } from '@angular/core';
|
||||
import { Component, OnChanges, Input, inject } from '@angular/core';
|
||||
|
||||
/** Custom Services */
|
||||
import { ReportsService } from '../../reports.service';
|
||||
@@ -31,6 +31,8 @@ Chart.register(...registerables);
|
||||
]
|
||||
})
|
||||
export class ChartComponent implements OnChanges {
|
||||
private reportsService = inject(ReportsService);
|
||||
|
||||
/** Run Report Data */
|
||||
@Input() dataObject: any;
|
||||
|
||||
@@ -41,11 +43,6 @@ export class ChartComponent implements OnChanges {
|
||||
/** Data object for witching charts in view. */
|
||||
inputData: ChartData;
|
||||
|
||||
/**
|
||||
* @param {ReportsService} reportsService Reports Service
|
||||
*/
|
||||
constructor(private reportsService: ReportsService) {}
|
||||
|
||||
/**
|
||||
* Fetches run report data post changes in run report form.
|
||||
*/
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
<iframe *ngIf="!hideOutput" [src]="pentahoUrl" frameborder="0" width="100%" height="750px;"></iframe>
|
||||
@if (!hideOutput) {
|
||||
<iframe [src]="pentahoUrl" frameborder="0" width="100%" height="750px;"></iframe>
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnChanges, Input } from '@angular/core';
|
||||
import { Component, OnChanges, Input, inject } from '@angular/core';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
|
||||
/** Custom Services */
|
||||
@@ -20,6 +20,11 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
]
|
||||
})
|
||||
export class PentahoComponent implements OnChanges {
|
||||
private sanitizer = inject(DomSanitizer);
|
||||
private reportsService = inject(ReportsService);
|
||||
private settingsService = inject(SettingsService);
|
||||
private progressBarService = inject(ProgressBarService);
|
||||
|
||||
/** Run Report Data */
|
||||
@Input() dataObject: any;
|
||||
|
||||
@@ -28,18 +33,6 @@ export class PentahoComponent implements OnChanges {
|
||||
/** trusted resource url for pentaho output */
|
||||
pentahoUrl: any;
|
||||
|
||||
/**
|
||||
* @param {DomSanitizer} sanitizer DOM Sanitizer
|
||||
* @param {ReportsService} reportsService Reports Service
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(
|
||||
private sanitizer: DomSanitizer,
|
||||
private reportsService: ReportsService,
|
||||
private settingsService: SettingsService,
|
||||
private progressBarService: ProgressBarService
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Fetches run report data post changes in run report form.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, inject } from '@angular/core';
|
||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||
import {
|
||||
AbstractControl,
|
||||
@@ -49,6 +49,12 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
]
|
||||
})
|
||||
export class RunReportComponent implements OnInit {
|
||||
private route = inject(ActivatedRoute);
|
||||
private reportsService = inject(ReportsService);
|
||||
private settingsService = inject(SettingsService);
|
||||
private alertService = inject(AlertService);
|
||||
private dateUtils = inject(Dates);
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -94,13 +100,7 @@ export class RunReportComponent implements OnInit {
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
*/
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private reportsService: ReportsService,
|
||||
private settingsService: SettingsService,
|
||||
private alertService: AlertService,
|
||||
private dateUtils: Dates
|
||||
) {
|
||||
constructor() {
|
||||
this.report.name = this.route.snapshot.params['name'];
|
||||
this.route.queryParams.subscribe((queryParams: { type: any; id: any }) => {
|
||||
this.report.type = queryParams.type;
|
||||
|
||||
@@ -1,65 +1,79 @@
|
||||
<div class="container">
|
||||
<div *ngIf="!hideOutput && !toBeExportedToRepo">
|
||||
<div class="m-b-10 gap-45px" align="end" *ngIf="dataObject.report.type === 'Table'">
|
||||
<button
|
||||
mat-raised-button
|
||||
color="primary"
|
||||
(click)="exportFile()"
|
||||
[disabled]="notExistsReportData"
|
||||
matToolTip="{{ 'labels.text.Export the data to CSV file' | translate }}"
|
||||
>
|
||||
{{ 'labels.buttons.Export CSV' | translate }}
|
||||
</button>
|
||||
<button
|
||||
mat-raised-button
|
||||
color="primary"
|
||||
(click)="exportToXLS()"
|
||||
[disabled]="notExistsReportData"
|
||||
matToolTip="{{ 'labels.text.Export the data to XLS file' | translate }}"
|
||||
>
|
||||
{{ 'labels.buttons.Export XLS' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="table-output" [hidden]="notExistsReportData">
|
||||
<table id="report-table" mat-table [dataSource]="dataSource">
|
||||
<div *ngFor="let column of displayedColumns; index as i">
|
||||
<ng-container [matColumnDef]="column">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ column }}</th>
|
||||
<td mat-cell *matCellDef="let param">
|
||||
<span *ngIf="isDecimal(i)">{{ toDecimal(param.row[i]) }}</span>
|
||||
<span *ngIf="!isDecimal(i)">{{ param.row[i] }}</span>
|
||||
</td>
|
||||
</ng-container>
|
||||
@if (!hideOutput && !toBeExportedToRepo) {
|
||||
<div>
|
||||
@if (dataObject.report.type === 'Table') {
|
||||
<div class="m-b-10 gap-45px" align="end">
|
||||
<button
|
||||
mat-raised-button
|
||||
color="primary"
|
||||
(click)="exportFile()"
|
||||
[disabled]="notExistsReportData"
|
||||
matToolTip="{{ 'labels.text.Export the data to CSV file' | translate }}"
|
||||
>
|
||||
{{ 'labels.buttons.Export CSV' | translate }}
|
||||
</button>
|
||||
<button
|
||||
mat-raised-button
|
||||
color="primary"
|
||||
(click)="exportToXLS()"
|
||||
[disabled]="notExistsReportData"
|
||||
matToolTip="{{ 'labels.text.Export the data to XLS file' | translate }}"
|
||||
>
|
||||
{{ 'labels.buttons.Export XLS' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
<div class="table-output" [hidden]="notExistsReportData">
|
||||
<table id="report-table" mat-table [dataSource]="dataSource">
|
||||
@for (column of displayedColumns; track column; let i = $index) {
|
||||
<div>
|
||||
<ng-container [matColumnDef]="column">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ column }}</th>
|
||||
<td mat-cell *matCellDef="let param">
|
||||
@if (isDecimal(i)) {
|
||||
<span>{{ toDecimal(param.row[i]) }}</span>
|
||||
}
|
||||
@if (!isDecimal(i)) {
|
||||
<span>{{ param.row[i] }}</span>
|
||||
}
|
||||
</td>
|
||||
</ng-container>
|
||||
</div>
|
||||
}
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns" class="select-row"></tr>
|
||||
</table>
|
||||
<mat-paginator [pageSizeOptions]="[100, 200, 300]" showFirstLastButtons></mat-paginator>
|
||||
</div>
|
||||
<div class="alert" [hidden]="!notExistsReportData">
|
||||
<div class="message">
|
||||
<i class="fa fa-exclamation-circle alert-check"></i>
|
||||
{{ 'labels.text.No report data was generated' | translate }}
|
||||
</div>
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns" class="select-row"></tr>
|
||||
</table>
|
||||
<mat-paginator [pageSizeOptions]="[100, 200, 300]" showFirstLastButtons></mat-paginator>
|
||||
</div>
|
||||
|
||||
<div class="alert" [hidden]="!notExistsReportData">
|
||||
<div class="message">
|
||||
<i class="fa fa-exclamation-circle alert-check"></i>
|
||||
{{ 'labels.text.No report data was generated' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="alert" *ngIf="!hideOutput && toBeExportedToRepo">
|
||||
<div class="message">
|
||||
<i class="fa fa-exclamation-circle alert-check"></i>
|
||||
{{ 'labels.text.The report request' | translate }}
|
||||
@if (!hideOutput && toBeExportedToRepo) {
|
||||
<div class="alert">
|
||||
<div class="message">
|
||||
<i class="fa fa-exclamation-circle alert-check"></i>
|
||||
{{ 'labels.text.The report request' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div *ngIf="hideOutput" class="loader">
|
||||
<div class="loading"></div>
|
||||
</div>
|
||||
@if (hideOutput) {
|
||||
<div class="loader">
|
||||
<div class="loading"></div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="back-button" *ngIf="!hideOutput">
|
||||
<button type="button" color="primary" mat-raised-button [routerLink]="['../..']">
|
||||
<fa-icon icon="arrow-left" class="m-r-10"></fa-icon>{{ 'labels.buttons.Back' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
@if (!hideOutput) {
|
||||
<div class="back-button">
|
||||
<button type="button" color="primary" mat-raised-button [routerLink]="['../..']">
|
||||
<fa-icon icon="arrow-left" class="m-r-10"></fa-icon>{{ 'labels.buttons.Back' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Angular Imports */
|
||||
import { Component, Input, ViewChild, OnChanges } from '@angular/core';
|
||||
import { Component, Input, ViewChild, OnChanges, inject } from '@angular/core';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import {
|
||||
MatTableDataSource,
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
MatRowDef,
|
||||
MatRow
|
||||
} from '@angular/material/table';
|
||||
import { DecimalPipe, NgIf, NgFor } from '@angular/common';
|
||||
import { DecimalPipe } from '@angular/common';
|
||||
|
||||
/** Custom Servies */
|
||||
import { ReportsService } from '../../reports.service';
|
||||
@@ -54,6 +54,11 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
]
|
||||
})
|
||||
export class TableAndSmsComponent implements OnChanges {
|
||||
private reportsService = inject(ReportsService);
|
||||
dialog = inject(MatDialog);
|
||||
private decimalPipe = inject(DecimalPipe);
|
||||
private progressBarService = inject(ProgressBarService);
|
||||
|
||||
/** Run Report Data */
|
||||
@Input() dataObject: any;
|
||||
|
||||
@@ -73,17 +78,6 @@ export class TableAndSmsComponent implements OnChanges {
|
||||
/** Paginator for run-report table. */
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
|
||||
/**
|
||||
* @param {ReportsService} reportsService Reports Service
|
||||
* @param {DecimalPipe} decimalPipe Decimal Pipe
|
||||
*/
|
||||
constructor(
|
||||
private reportsService: ReportsService,
|
||||
public dialog: MatDialog,
|
||||
private decimalPipe: DecimalPipe,
|
||||
private progressBarService: ProgressBarService
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Fetches run report data post changes in run report form.
|
||||
*/
|
||||
@@ -154,7 +148,6 @@ export class TableAndSmsComponent implements OnChanges {
|
||||
required: true,
|
||||
order: 2
|
||||
})
|
||||
|
||||
];
|
||||
const data = {
|
||||
title: 'Export data to File',
|
||||
|
||||
Reference in New Issue
Block a user