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,71 +1,68 @@
|
||||
<div class="container">
|
||||
<mat-card class="layout-column gap-2percent" *ngIf="hasResults">
|
||||
<mat-error *ngIf="overload">{{ 'error.Searched query resulted more than 200 records' | translate }}</mat-error>
|
||||
@if (hasResults) {
|
||||
<mat-card class="layout-column gap-2percent">
|
||||
@if (overload) {
|
||||
<mat-error>{{ 'error.Searched query resulted more than 200 records' | translate }}</mat-error>
|
||||
}
|
||||
<table mat-table [dataSource]="dataSource">
|
||||
<ng-container matColumnDef="entityType">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Entity Type' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let entity" class="view-details">{{ entity.entityType }}</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="entityName">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Entity Name' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let entity" class="view-details">{{ entity.entityName }}</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="entityAccount">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Account No' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let entity" class="view-details">
|
||||
<mifosx-account-number display="left" accountNo="{{ entity.entityAccountNo }}"></mifosx-account-number>
|
||||
</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="externalId">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.External Id' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let entity" class="view-details">
|
||||
<mifosx-external-identifier externalId="{{ entity.entityExternalId }}"></mifosx-external-identifier>
|
||||
</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="parentType">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Parent Type' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let entity" class="view-details">
|
||||
{{ ['CLIENT', 'GROUP', 'CENTER'].includes(entity.entityType) ? 'Office' : 'Client' }}
|
||||
</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="parentName">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Parent Name' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let entity" class="view-details">{{ entity.parentName }}</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="details">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Details' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let entity" class="view-details">
|
||||
<button
|
||||
mat-icon-button
|
||||
matTooltip="{{ 'tooltips.View Entity' | translate }}"
|
||||
(click)="navigate(entity)"
|
||||
matTooltipPosition="right"
|
||||
>
|
||||
<fa-icon icon="eye" size="lg"></fa-icon>
|
||||
</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let entity; columns: displayedColumns"></tr>
|
||||
</table>
|
||||
<mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||
</mat-card>
|
||||
}
|
||||
|
||||
<table mat-table [dataSource]="dataSource">
|
||||
<ng-container matColumnDef="entityType">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Entity Type' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let entity" class="view-details">{{ entity.entityType }}</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="entityName">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Entity Name' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let entity" class="view-details">{{ entity.entityName }}</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="entityAccount">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Account No' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let entity" class="view-details">
|
||||
<mifosx-account-number display="left" accountNo="{{ entity.entityAccountNo }}"></mifosx-account-number>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="externalId">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.External Id' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let entity" class="view-details">
|
||||
<mifosx-external-identifier externalId="{{ entity.entityExternalId }}"></mifosx-external-identifier>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="parentType">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Parent Type' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let entity" class="view-details">
|
||||
{{ ['CLIENT', 'GROUP', 'CENTER'].includes(entity.entityType) ? 'Office' : 'Client' }}
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="parentName">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Parent Name' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let entity" class="view-details">{{ entity.parentName }}</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="details">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Details' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let entity" class="view-details">
|
||||
<button
|
||||
mat-icon-button
|
||||
matTooltip="{{ 'tooltips.View Entity' | translate }}"
|
||||
(click)="navigate(entity)"
|
||||
matTooltipPosition="right"
|
||||
>
|
||||
<fa-icon icon="eye" size="lg"></fa-icon>
|
||||
</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let entity; columns: displayedColumns"></tr>
|
||||
</table>
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||
</mat-card>
|
||||
|
||||
<mat-card class="layout-column gap-2percent" *ngIf="!hasResults">
|
||||
<div class="alert">
|
||||
<div class="message">
|
||||
<i class="fa fa-exclamation-circle alert-check"></i>
|
||||
{{ 'labels.text.No data found' | translate }}
|
||||
@if (!hasResults) {
|
||||
<mat-card class="layout-column gap-2percent">
|
||||
<div class="alert">
|
||||
<div class="message">
|
||||
<i class="fa fa-exclamation-circle alert-check"></i>
|
||||
{{ 'labels.text.No data found' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>
|
||||
</mat-card>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Angular Imports */
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { Component, ViewChild, inject } from '@angular/core';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import {
|
||||
MatTableDataSource,
|
||||
@@ -51,6 +51,9 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
]
|
||||
})
|
||||
export class SearchPageComponent {
|
||||
private route = inject(ActivatedRoute);
|
||||
private router = inject(Router);
|
||||
|
||||
/** Flags if number of search results exceed 200 */
|
||||
overload: boolean;
|
||||
/** Datasource for loans disbursal table */
|
||||
@@ -74,10 +77,7 @@ export class SearchPageComponent {
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
*/
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router
|
||||
) {
|
||||
constructor() {
|
||||
this.route.data.subscribe((data: { searchResults: any }) => {
|
||||
this.dataSource = new MatTableDataSource(data.searchResults);
|
||||
this.dataSource.paginator = this.paginator;
|
||||
|
||||
@@ -24,7 +24,6 @@ const routes: Routes = [
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
||||
@@ -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 { SearchService } from './search.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class SearchResolver {
|
||||
/**
|
||||
* @param {SearchService} searchService Notifications service.
|
||||
*/
|
||||
constructor(private searchService: SearchService) {}
|
||||
private searchService = inject(SearchService);
|
||||
|
||||
/**
|
||||
* Returns the Search Resultsdata.
|
||||
|
||||
@@ -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 */
|
||||
@@ -12,10 +12,7 @@ import { Observable } from 'rxjs';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SearchService {
|
||||
/**
|
||||
* @param {HttpClient} http Http Client to send requests.
|
||||
*/
|
||||
constructor(private http: HttpClient) {}
|
||||
private http = inject(HttpClient);
|
||||
|
||||
/**
|
||||
* @param {string} query Query String
|
||||
|
||||
Reference in New Issue
Block a user