Chore: update to Angular v18 (#7106)

This commit is contained in:
shamoon
2024-06-26 20:57:39 -07:00
committed by GitHub
parent 4f1185c65d
commit 3435ffd00c
93 changed files with 3461 additions and 2829 deletions

View File

@@ -1,6 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { CorrespondentListComponent } from './correspondent-list.component'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { DatePipe } from '@angular/common'
import { SortableDirective } from 'src/app/directives/sortable.directive'
import { NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap'
@@ -10,6 +10,7 @@ import { IfPermissionsDirective } from 'src/app/directives/if-permissions.direct
import { CorrespondentService } from 'src/app/services/rest/correspondent.service'
import { of } from 'rxjs'
import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons'
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
describe('CorrespondentListComponent', () => {
let component: CorrespondentListComponent
@@ -24,14 +25,17 @@ describe('CorrespondentListComponent', () => {
PageHeaderComponent,
IfPermissionsDirective,
],
providers: [DatePipe],
imports: [
HttpClientTestingModule,
NgbPaginationModule,
FormsModule,
ReactiveFormsModule,
NgxBootstrapIconsModule.pick(allIcons),
],
providers: [
DatePipe,
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
}).compileComponents()
correspondentsService = TestBed.inject(CorrespondentService)
})

View File

@@ -3,7 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'
import { CustomFieldsComponent } from './custom-fields.component'
import { CustomField, CustomFieldDataType } from 'src/app/data/custom-field'
import { CustomFieldsService } from 'src/app/services/rest/custom-fields.service'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { By } from '@angular/platform-browser'
import {
@@ -21,6 +21,7 @@ import { ConfirmDialogComponent } from '../../common/confirm-dialog/confirm-dial
import { PageHeaderComponent } from '../../common/page-header/page-header.component'
import { CustomFieldEditDialogComponent } from '../../common/edit-dialog/custom-field-edit-dialog/custom-field-edit-dialog.component'
import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons'
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
const fields: CustomField[] = [
{
@@ -50,6 +51,14 @@ describe('CustomFieldsComponent', () => {
PageHeaderComponent,
ConfirmDialogComponent,
],
imports: [
NgbPaginationModule,
FormsModule,
ReactiveFormsModule,
NgbModalModule,
NgbPopoverModule,
NgxBootstrapIconsModule.pick(allIcons),
],
providers: [
{
provide: PermissionsService,
@@ -59,15 +68,8 @@ describe('CustomFieldsComponent', () => {
currentUserOwnsObject: () => true,
},
},
],
imports: [
HttpClientTestingModule,
NgbPaginationModule,
FormsModule,
ReactiveFormsModule,
NgbModalModule,
NgbPopoverModule,
NgxBootstrapIconsModule.pick(allIcons),
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
})

View File

@@ -1,5 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { DatePipe } from '@angular/common'
import { SortableDirective } from 'src/app/directives/sortable.directive'
import { NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap'
@@ -10,6 +10,7 @@ import { of } from 'rxjs'
import { DocumentTypeListComponent } from './document-type-list.component'
import { DocumentTypeService } from 'src/app/services/rest/document-type.service'
import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons'
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
describe('DocumentTypeListComponent', () => {
let component: DocumentTypeListComponent
@@ -24,14 +25,17 @@ describe('DocumentTypeListComponent', () => {
PageHeaderComponent,
IfPermissionsDirective,
],
providers: [DatePipe],
imports: [
HttpClientTestingModule,
NgbPaginationModule,
FormsModule,
ReactiveFormsModule,
NgxBootstrapIconsModule.pick(allIcons),
],
providers: [
DatePipe,
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
}).compileComponents()
documentTypeService = TestBed.inject(DocumentTypeService)

View File

@@ -2,7 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'
import { MailComponent } from './mail.component'
import { DatePipe } from '@angular/common'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { RouterTestingModule } from '@angular/router/testing'
import {
NgbModule,
@@ -42,6 +42,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { EditDialogMode } from '../../common/edit-dialog/edit-dialog.component'
import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons'
import { SwitchComponent } from '../../common/input/switch/switch.component'
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
const mailAccounts = [
{ id: 1, name: 'account1' },
@@ -85,10 +86,8 @@ describe('MailComponent', () => {
PermissionsFormComponent,
SwitchComponent,
],
providers: [CustomDatePipe, DatePipe, PermissionsGuard],
imports: [
NgbModule,
HttpClientTestingModule,
RouterTestingModule.withRoutes(routes),
FormsModule,
ReactiveFormsModule,
@@ -96,6 +95,13 @@ describe('MailComponent', () => {
NgSelectModule,
NgxBootstrapIconsModule.pick(allIcons),
],
providers: [
CustomDatePipe,
DatePipe,
PermissionsGuard,
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
}).compileComponents()
mailAccountService = TestBed.inject(MailAccountService)

View File

@@ -1,5 +1,5 @@
import { DatePipe } from '@angular/common'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import {
ComponentFixture,
TestBed,
@@ -41,6 +41,7 @@ import { MATCH_LITERAL } from 'src/app/data/matching-model'
import { PermissionsDialogComponent } from '../../common/permissions-dialog/permissions-dialog.component'
import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons'
import { BulkEditObjectOperation } from 'src/app/services/rest/abstract-name-filter-service'
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
const tags: Tag[] = [
{
@@ -81,9 +82,7 @@ describe('ManagementListComponent', () => {
ConfirmDialogComponent,
PermissionsDialogComponent,
],
providers: [DatePipe, PermissionsGuard],
imports: [
HttpClientTestingModule,
NgbPaginationModule,
FormsModule,
ReactiveFormsModule,
@@ -91,6 +90,12 @@ describe('ManagementListComponent', () => {
RouterTestingModule.withRoutes(routes),
NgxBootstrapIconsModule.pick(allIcons),
],
providers: [
DatePipe,
PermissionsGuard,
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
}).compileComponents()
tagService = TestBed.inject(TagService)

View File

@@ -1,5 +1,5 @@
import { DatePipe } from '@angular/common'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap'
@@ -10,6 +10,7 @@ import { StoragePathService } from 'src/app/services/rest/storage-path.service'
import { PageHeaderComponent } from '../../common/page-header/page-header.component'
import { StoragePathListComponent } from './storage-path-list.component'
import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons'
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
describe('StoragePathListComponent', () => {
let component: StoragePathListComponent
@@ -24,14 +25,17 @@ describe('StoragePathListComponent', () => {
PageHeaderComponent,
IfPermissionsDirective,
],
providers: [DatePipe],
imports: [
HttpClientTestingModule,
NgbPaginationModule,
FormsModule,
ReactiveFormsModule,
NgxBootstrapIconsModule.pick(allIcons),
],
providers: [
DatePipe,
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
}).compileComponents()
storagePathService = TestBed.inject(StoragePathService)

View File

@@ -1,5 +1,5 @@
import { DatePipe } from '@angular/common'
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap'
@@ -11,6 +11,7 @@ import { PageHeaderComponent } from '../../common/page-header/page-header.compon
import { TagListComponent } from './tag-list.component'
import { SafeHtmlPipe } from 'src/app/pipes/safehtml.pipe'
import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons'
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
describe('TagListComponent', () => {
let component: TagListComponent
@@ -26,14 +27,17 @@ describe('TagListComponent', () => {
IfPermissionsDirective,
SafeHtmlPipe,
],
providers: [DatePipe],
imports: [
HttpClientTestingModule,
NgbPaginationModule,
FormsModule,
ReactiveFormsModule,
NgxBootstrapIconsModule.pick(allIcons),
],
providers: [
DatePipe,
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
}).compileComponents()
tagService = TestBed.inject(TagService)

View File

@@ -1,4 +1,4 @@
import { HttpClientTestingModule } from '@angular/common/http/testing'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { By } from '@angular/platform-browser'
@@ -25,6 +25,7 @@ import {
} from 'src/app/data/workflow-trigger'
import { WorkflowActionType } from 'src/app/data/workflow-action'
import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons'
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
const workflows: Workflow[] = [
{
@@ -85,6 +86,14 @@ describe('WorkflowsComponent', () => {
PageHeaderComponent,
ConfirmDialogComponent,
],
imports: [
NgbPaginationModule,
FormsModule,
ReactiveFormsModule,
NgbModalModule,
NgbPopoverModule,
NgxBootstrapIconsModule.pick(allIcons),
],
providers: [
{
provide: PermissionsService,
@@ -94,15 +103,8 @@ describe('WorkflowsComponent', () => {
currentUserOwnsObject: () => true,
},
},
],
imports: [
HttpClientTestingModule,
NgbPaginationModule,
FormsModule,
ReactiveFormsModule,
NgbModalModule,
NgbPopoverModule,
NgxBootstrapIconsModule.pick(allIcons),
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting(),
],
})