Chore: Upgrade to Angular v14

This commit is contained in:
2022-07-11 20:12:38 +05:30
parent a4c3ae1035
commit b1c003a935
54 changed files with 355 additions and 325 deletions
@@ -1,7 +1,6 @@
import { DataSource } from '@angular/cdk/collections';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { SortDirection } from '@angular/material/sort/sort-direction';
import { MatSort, SortDirection } from '@angular/material/sort';
import { Observable, of as observableOf } from 'rxjs';
import { Entries } from './entries';
@@ -1,9 +1,8 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { MatPaginator } from '@angular/material/paginator';
import { MatRadioChange } from '@angular/material/radio';
import { MatSort } from '@angular/material/sort';
import { SortDirection } from '@angular/material/sort/sort-direction';
import { MatSort, SortDirection } from '@angular/material/sort';
import { ActivatedRoute, Router } from '@angular/router';
import * as moment from 'moment';
@@ -20,7 +19,7 @@ export class EntriesComponent implements OnInit {
@ViewChild(MatSort, { static: true }) sort?: MatSort;
info: Report = new Report();
dataSource: EntriesDatasource = new EntriesDatasource(this.info.report, 0);
form: FormGroup;
form: UntypedFormGroup;
displayedColumns = [
'date',
'voucherType',
@@ -33,7 +32,7 @@ export class EntriesComponent implements OnInit {
posted: boolean | null = null;
issue: boolean = false;
constructor(private route: ActivatedRoute, private router: Router, private fb: FormBuilder) {
constructor(private route: ActivatedRoute, private router: Router, private fb: UntypedFormBuilder) {
this.form = this.fb.group({
startDate: '',
finishDate: '',
@@ -70,9 +69,9 @@ export class EntriesComponent implements OnInit {
issue: this.issue,
});
if (this.posted === null || this.posted) {
(this.form.get('issue') as FormControl).enable();
(this.form.get('issue') as UntypedFormControl).enable();
} else {
(this.form.get('issue') as FormControl).disable();
(this.form.get('issue') as UntypedFormControl).disable();
}
this.dataSource = new EntriesDatasource(
this.info.report,