Chore: Check for deprecations using eslint plugin
Chore: environment file replacement stopped. Chore: All components are now standalone and removed all modules Chore: App routing is now in app.routes and similarly for all submodules Chore: Http interceptors are now functional and split refresh interceptor into a separate one.
This commit is contained in:
1 parent
b6bb3dbcfd
commit
4571b31fc0
309 files changed
+3897
-5222
No files matched your search
+4
-9
@@ -1,6 +1,4 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CostCentreDetailComponent } from './cost-centre-detail.component';
|
||||
|
||||
@@ -8,14 +6,11 @@ describe('CostCentreDetailComponent', () => {
|
||||
let component: CostCentreDetailComponent;
|
||||
let fixture: ComponentFixture<CostCentreDetailComponent>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ReactiveFormsModule, RouterTestingModule],
|
||||
declarations: [CostCentreDetailComponent],
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [CostCentreDetailComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CostCentreDetailComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButton } from '@angular/material/button';
|
||||
import { MatCard, MatCardHeader, MatCardTitle, MatCardContent, MatCardActions } from '@angular/material/card';
|
||||
import { MatFormField, MatLabel } from '@angular/material/form-field';
|
||||
import { MatInput } from '@angular/material/input';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
import { CostCentre } from '../../core/cost-centre';
|
||||
@@ -10,6 +14,19 @@ import { CostCentreService } from '../cost-centre.service';
|
||||
selector: 'app-cost-centre-detail',
|
||||
templateUrl: './cost-centre-detail.component.html',
|
||||
styleUrls: ['./cost-centre-detail.component.css'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatCard,
|
||||
MatCardHeader,
|
||||
MatCardTitle,
|
||||
MatCardContent,
|
||||
ReactiveFormsModule,
|
||||
MatFormField,
|
||||
MatLabel,
|
||||
MatInput,
|
||||
MatCardActions,
|
||||
MatButton,
|
||||
],
|
||||
})
|
||||
export class CostCentreDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
@@ -54,15 +71,15 @@ export class CostCentreDetailComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
save() {
|
||||
this.ser.saveOrUpdate(this.getItem()).subscribe(
|
||||
() => {
|
||||
this.ser.saveOrUpdate(this.getItem()).subscribe({
|
||||
next: () => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/cost-centres');
|
||||
},
|
||||
(error) => {
|
||||
error: (error) => {
|
||||
this.toaster.show('Danger', error);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
getItem(): CostCentre {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
|
||||
import { CostCentreListComponent } from './cost-centre-list.component';
|
||||
|
||||
@@ -9,8 +8,7 @@ describe('CostCentreListComponent', () => {
|
||||
|
||||
beforeEach(fakeAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [RouterTestingModule],
|
||||
declarations: [CostCentreListComponent],
|
||||
imports: [RouterTestingModule, CostCentreListComponent],
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(CostCentreListComponent);
|
||||
|
||||
@@ -1,7 +1,22 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatAnchor } from '@angular/material/button';
|
||||
import { MatCard, MatCardHeader, MatCardTitleGroup, MatCardTitle, MatCardContent } from '@angular/material/card';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { MatSort, MatSortHeader } from '@angular/material/sort';
|
||||
import {
|
||||
MatTable,
|
||||
MatColumnDef,
|
||||
MatHeaderCellDef,
|
||||
MatHeaderCell,
|
||||
MatCellDef,
|
||||
MatCell,
|
||||
MatHeaderRowDef,
|
||||
MatHeaderRow,
|
||||
MatRowDef,
|
||||
MatRow,
|
||||
} from '@angular/material/table';
|
||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||
|
||||
import { CostCentre } from '../../core/cost-centre';
|
||||
|
||||
@@ -11,6 +26,30 @@ import { CostCentreListDataSource } from './cost-centre-list-datasource';
|
||||
selector: 'app-cost-centre-list',
|
||||
templateUrl: './cost-centre-list.component.html',
|
||||
styleUrls: ['./cost-centre-list.component.css'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatCard,
|
||||
MatCardHeader,
|
||||
MatCardTitleGroup,
|
||||
MatCardTitle,
|
||||
MatAnchor,
|
||||
RouterLink,
|
||||
MatIcon,
|
||||
MatCardContent,
|
||||
MatTable,
|
||||
MatSort,
|
||||
MatColumnDef,
|
||||
MatHeaderCellDef,
|
||||
MatHeaderCell,
|
||||
MatSortHeader,
|
||||
MatCellDef,
|
||||
MatCell,
|
||||
MatHeaderRowDef,
|
||||
MatHeaderRow,
|
||||
MatRowDef,
|
||||
MatRow,
|
||||
MatPaginator,
|
||||
],
|
||||
})
|
||||
export class CostCentreListComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator?: MatPaginator;
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import { CostCentreRoutingModule } from './cost-centre-routing.module';
|
||||
|
||||
describe('CostCentreRoutingModule', () => {
|
||||
let costCentreRoutingModule: CostCentreRoutingModule;
|
||||
|
||||
beforeEach(() => {
|
||||
costCentreRoutingModule = new CostCentreRoutingModule();
|
||||
});
|
||||
|
||||
it('should create an instance', () => {
|
||||
expect(costCentreRoutingModule).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,13 +0,0 @@
|
||||
import { CostCentreModule } from './cost-centre.module';
|
||||
|
||||
describe('CostCentreModule', () => {
|
||||
let costCentreModule: CostCentreModule;
|
||||
|
||||
beforeEach(() => {
|
||||
costCentreModule = new CostCentreModule();
|
||||
});
|
||||
|
||||
it('should create an instance', () => {
|
||||
expect(costCentreModule).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,35 +0,0 @@
|
||||
import { CdkTableModule } from '@angular/cdk/table';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatPaginatorModule } from '@angular/material/paginator';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { MatSortModule } from '@angular/material/sort';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
|
||||
import { CostCentreDetailComponent } from './cost-centre-detail/cost-centre-detail.component';
|
||||
import { CostCentreListComponent } from './cost-centre-list/cost-centre-list.component';
|
||||
import { CostCentreRoutingModule } from './cost-centre-routing.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
CdkTableModule,
|
||||
MatButtonModule,
|
||||
MatCardModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatPaginatorModule,
|
||||
MatProgressSpinnerModule,
|
||||
MatSortModule,
|
||||
MatTableModule,
|
||||
ReactiveFormsModule,
|
||||
CostCentreRoutingModule,
|
||||
],
|
||||
declarations: [CostCentreListComponent, CostCentreDetailComponent],
|
||||
})
|
||||
export class CostCentreModule {}
|
||||
+2
-10
@@ -1,6 +1,4 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { Routes } from '@angular/router';
|
||||
|
||||
import { authGuard } from '../auth/auth-guard.service';
|
||||
|
||||
@@ -9,7 +7,7 @@ import { CostCentreListComponent } from './cost-centre-list/cost-centre-list.com
|
||||
import { costCentreListResolver } from './cost-centre-list.resolver';
|
||||
import { costCentreResolver } from './cost-centre.resolver';
|
||||
|
||||
const costCentreRoutes: Routes = [
|
||||
export const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: CostCentreListComponent,
|
||||
@@ -44,9 +42,3 @@ const costCentreRoutes: Routes = [
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule, RouterModule.forChild(costCentreRoutes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class CostCentreRoutingModule {}
|
||||
Reference in new issue
Block a user