Skip to content

Commit f1f7af5

Browse files
committed
Angular 18 upgrade
1 parent 6c79b38 commit f1f7af5

95 files changed

Lines changed: 4056 additions & 3146 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

web-app/admin/src/app/admin/admin-authentication/admin-authentication-delete/admin-authentication-delete.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
button {
55
margin-left: 8px;
6-
color: mat.get-color-from-palette($app-primary);
6+
color: mat.m2-get-color-from-palette($app-primary);
77
}
88

99
mat-dialog-actions {

web-app/admin/src/app/admin/admin-breadcrumb/admin-breadcrumb.component.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
box-sizing: border-box;
2525

2626
.admin-breadcrumb {
27-
color: mat.get-color-from-palette($app-primary);
27+
color: mat.m2-get-color-from-palette($app-primary);
2828
cursor: pointer;
2929
display: inline-flex;
3030
align-items: center;
3131
line-height: 1;
3232
}
3333

3434
.admin-breadcrumb:hover {
35-
color: mat.get-color-from-palette($app-primary);
35+
color: mat.m2-get-color-from-palette($app-primary);
3636
opacity: 0.6;
3737
}
3838

@@ -53,7 +53,7 @@
5353

5454
mat-icon,
5555
i {
56-
color: mat.get-color-from-palette($app-primary);
56+
color: mat.m2-get-color-from-palette($app-primary);
5757
margin-right: 7px;
5858
margin-left: 7px;
5959
width: 24px;

web-app/admin/src/app/admin/admin-feeds/admin-feed/admin-feed-delete/admin-feed-delete.component.spec.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { HttpClientTestingModule } from '@angular/common/http/testing'
1+
import { provideHttpClientTesting } from '@angular/common/http/testing'
22
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'
33
import { MatDialogModule as MatDialogModule, MatDialogRef as MatDialogRef, MAT_DIALOG_DATA as MAT_DIALOG_DATA } from '@angular/material/dialog'
44
import { Feed } from '@ngageoint/mage.web-core-lib/feed'
55
import { AdminFeedDeleteComponent } from './admin-feed-delete.component'
6+
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
67

78
describe('AdminFeedDeleteComponent', () => {
89
let component: AdminFeedDeleteComponent
@@ -15,13 +16,15 @@ describe('AdminFeedDeleteComponent', () => {
1516

1617
beforeEach(waitForAsync(() => {
1718
TestBed.configureTestingModule({
18-
imports: [MatDialogModule, HttpClientTestingModule],
19-
providers: [
19+
declarations: [AdminFeedDeleteComponent],
20+
imports: [MatDialogModule],
21+
providers: [
2022
{ provide: MatDialogRef, useValue: {} },
21-
{ provide: MAT_DIALOG_DATA, useValue: feedData }
22-
],
23-
declarations: [AdminFeedDeleteComponent]
24-
})
23+
{ provide: MAT_DIALOG_DATA, useValue: feedData },
24+
provideHttpClient(withInterceptorsFromDi()),
25+
provideHttpClientTesting()
26+
]
27+
})
2528
.compileComponents()
2629
}))
2730

web-app/admin/src/app/admin/admin-feeds/admin-feed/admin-feed-edit/admin-feed-edit-configuration.component.spec.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HttpClientTestingModule } from '@angular/common/http/testing';
1+
import { provideHttpClientTesting } from '@angular/common/http/testing';
22
import { Component } from '@angular/core';
33
import {
44
ComponentFixture,
@@ -28,6 +28,7 @@ import {
2828
feedMetaDataLean,
2929
FeedMetaDataNullable
3030
} from './feed-edit.model';
31+
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
3132

3233
type FeedMetaDataBooleanKeys = 'itemsHaveIdentity' | 'itemsHaveSpatialDimension';
3334

@@ -80,23 +81,21 @@ describe('FeedMetaDataComponent', () => {
8081

8182
beforeEach(waitForAsync(() => {
8283
TestBed.configureTestingModule({
83-
imports: [
84-
FormsModule,
84+
declarations: [
85+
TestFeedMetaDataHostComponent,
86+
AdminFeedEditConfigurationComponent
87+
],
88+
imports: [FormsModule,
8589
MatAutocompleteModule,
8690
MatCheckboxModule,
8791
MatExpansionModule,
8892
MatFormFieldModule,
8993
MatInputModule,
9094
NoopAnimationsModule,
9195
ReactiveFormsModule,
92-
StaticIconModule,
93-
HttpClientTestingModule
94-
],
95-
declarations: [
96-
TestFeedMetaDataHostComponent,
97-
AdminFeedEditConfigurationComponent
98-
]
99-
}).compileComponents();
96+
StaticIconModule],
97+
providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
98+
}).compileComponents();
10099
}));
101100

102101
beforeEach(() => {

web-app/admin/src/app/admin/admin-feeds/admin-feed/admin-feed-edit/admin-feed-edit.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
font-family: inherit;
3333
font-weight: 600;
3434
line-height: 1.15;
35-
color: mat.get-color-from-palette($app-primary);
35+
color: mat.m2-get-color-from-palette($app-primary);
3636
}
3737

3838
.icon {

web-app/admin/src/app/admin/admin-feeds/admin-feed/admin-feed-edit/admin-feed-edit.component.spec.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { JsonSchemaFormModule } from '@ngageoint/vendor-ajsf-core';
2-
import { HttpClientTestingModule } from '@angular/common/http/testing'
2+
import { provideHttpClientTesting } from '@angular/common/http/testing'
33
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
44
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
55
import { MatAutocompleteModule } from '@angular/material/autocomplete';
@@ -32,6 +32,7 @@ import { AdminFeedEditTopicComponent } from './admin-feed-edit-topic/admin-feed-
3232
import { AdminFeedEditComponent } from './admin-feed-edit.component';
3333
import { FeedEditState, freshEditState } from './feed-edit.model'
3434
import { FeedEditService } from './feed-edit.service'
35+
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
3536

3637
type MockFeedEditService = {
3738
state$: BehaviorSubject<FeedEditState>
@@ -98,19 +99,17 @@ describe('FeedEditComponent', () => {
9899
mockFeedService.fetchServices.and.returnValue(of([]))
99100

100101
TestBed.configureTestingModule({
101-
providers: [
102-
{ provide: FeedService, useValue: mockFeedService },
103-
{
104-
provide: ActivatedRoute,
105-
useValue: {
106-
snapshot: {
107-
paramMap: convertToParamMap({})
108-
}
109-
}
110-
}
111-
],
112-
imports: [
113-
MatAutocompleteModule,
102+
declarations: [
103+
AdminFeedEditComponent,
104+
AdminServiceEditComponent,
105+
AdminFeedEditTopicComponent,
106+
AdminFeedEditTopicConfigurationComponent,
107+
AdminFeedEditConfigurationComponent,
108+
AdminFeedEditItemPropertiesComponent,
109+
FeedItemSummaryComponent,
110+
JsonSchemaWidgetAutocompleteComponent
111+
],
112+
imports: [MatAutocompleteModule,
114113
MatDividerModule,
115114
MatExpansionModule,
116115
MatListModule,
@@ -129,20 +128,21 @@ describe('FeedEditComponent', () => {
129128
MomentModule,
130129
MageCommonModule,
131130
StaticIconModule,
132-
AdminBreadcrumbModule,
133-
HttpClientTestingModule,
134-
],
135-
declarations: [
136-
AdminFeedEditComponent,
137-
AdminServiceEditComponent,
138-
AdminFeedEditTopicComponent,
139-
AdminFeedEditTopicConfigurationComponent,
140-
AdminFeedEditConfigurationComponent,
141-
AdminFeedEditItemPropertiesComponent,
142-
FeedItemSummaryComponent,
143-
JsonSchemaWidgetAutocompleteComponent
144-
]
145-
})
131+
AdminBreadcrumbModule],
132+
providers: [
133+
{ provide: FeedService, useValue: mockFeedService },
134+
{
135+
provide: ActivatedRoute,
136+
useValue: {
137+
snapshot: {
138+
paramMap: convertToParamMap({})
139+
}
140+
}
141+
},
142+
provideHttpClient(withInterceptorsFromDi()),
143+
provideHttpClientTesting()
144+
]
145+
})
146146
.overrideComponent(AdminFeedEditComponent, {
147147
set: {
148148
providers: [{ provide: FeedEditService, useValue: mockEditService }]

web-app/admin/src/app/admin/admin-feeds/admin-feed/admin-feed.component.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ $event-add-overlay-height: 72px;
5151
}
5252

5353
.heading__icon {
54-
color: mat.get-color-from-palette($app-primary);
54+
color: mat.m2-get-color-from-palette($app-primary);
5555
margin-right: 16px;
5656
font-size: 40px;
5757
height: 40px;
@@ -116,7 +116,7 @@ $event-add-overlay-height: 72px;
116116

117117
mat-card-header {
118118
color: white;
119-
background-color: mat.get-color-from-palette($app-primary);
119+
background-color: mat.m2-get-color-from-palette($app-primary);
120120
position: relative;
121121
padding: 16px 16px 0;
122122
margin-bottom: 8px;

web-app/admin/src/app/admin/admin-feeds/admin-service/admin-service.component.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
.heading__icon {
3535
flex: 0 0 auto;
36-
color: mat.get-color-from-palette($app-primary);
36+
color: mat.m2-get-color-from-palette($app-primary);
3737
margin-right: 16px;
3838
font-size: 40px;
3939
height: 40px;
@@ -109,7 +109,7 @@
109109
}
110110

111111
.content__card-title {
112-
color: mat.get-color-from-palette($app-primary);
112+
color: mat.m2-get-color-from-palette($app-primary);
113113
font-size: 20px;
114114
font-weight: 500;
115115
line-height: 1.25;
@@ -131,7 +131,7 @@
131131
}
132132

133133
.feed-list__icon {
134-
color: mat.get-color-from-palette($app-primary);
134+
color: mat.m2-get-color-from-palette($app-primary);
135135
margin-right: 16px !important;
136136
margin-top: 27px !important;
137137
}
@@ -163,7 +163,7 @@
163163
}
164164

165165
.primary-color {
166-
color: mat.get-color-from-palette($app-primary);
166+
color: mat.m2-get-color-from-palette($app-primary);
167167
}
168168

169169
:host ::ng-deep mage-json-schema-form {

web-app/admin/src/app/admin/admin-layers/layer-details/layer-details.component.spec.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
tick,
66
discardPeriodicTasks
77
} from '@angular/core/testing';
8-
import { HttpClientTestingModule } from '@angular/common/http/testing';
8+
import { provideHttpClientTesting } from '@angular/common/http/testing';
99
import { MatDialogModule as MatDialogModule } from '@angular/material/dialog';
1010
import { MatSnackBarModule as MatSnackBarModule } from '@angular/material/snack-bar';
1111
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
@@ -22,6 +22,7 @@ import { AdminUserService } from '../../services/admin-user.service';
2222
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2323
import { MatIconModule } from '@angular/material/icon';
2424
import { MatPaginatorModule } from '@angular/material/paginator';
25+
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
2526

2627
describe('LayerDetailsComponent', () => {
2728
let component: LayerDetailsComponent;
@@ -97,25 +98,24 @@ describe('LayerDetailsComponent', () => {
9798
buildMocks();
9899

99100
await TestBed.configureTestingModule({
100-
declarations: [LayerDetailsComponent],
101-
imports: [
102-
HttpClientTestingModule,
103-
MatDialogModule,
101+
declarations: [LayerDetailsComponent],
102+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
103+
imports: [MatDialogModule,
104104
MatSnackBarModule,
105105
NoopAnimationsModule,
106106
RouterTestingModule,
107107
MatIconModule,
108-
MatPaginatorModule
109-
],
110-
providers: [
108+
MatPaginatorModule],
109+
providers: [
111110
{ provide: ActivatedRoute, useValue: makeActivatedRoute(params) },
112111
{ provide: LayersService, useValue: mockLayersService },
113112
{ provide: AdminEventsService, useValue: mockEventsService },
114113
{ provide: LocalStorageService, useValue: mockLocalStorageService },
115-
{ provide: AdminUserService, useValue: mockUserService }
116-
],
117-
schemas: [CUSTOM_ELEMENTS_SCHEMA]
118-
}).compileComponents();
114+
{ provide: AdminUserService, useValue: mockUserService },
115+
provideHttpClient(withInterceptorsFromDi()),
116+
provideHttpClientTesting()
117+
]
118+
}).compileComponents();
119119

120120
fixture = TestBed.createComponent(LayerDetailsComponent);
121121
component = fixture.componentInstance;

web-app/admin/src/app/admin/admin-map/admin-map.component.spec.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
22
import { Component, ViewChild } from '@angular/core';
33
import { MatInputModule as MatInputModule } from '@angular/material/input';
44
import { By } from '@angular/platform-browser';
5-
import { HttpClientTestingModule } from '@angular/common/http/testing';
5+
import { provideHttpClientTesting } from '@angular/common/http/testing';
66
import { MatSnackBarModule as MatSnackBarModule } from '@angular/material/snack-bar';
77
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
88
import { of } from 'rxjs';
@@ -11,6 +11,7 @@ import { FormsModule } from '@angular/forms';
1111

1212
import { AdminMapComponent } from './admin-map.component';
1313
import { MapSettingsService } from '../../../app/map/settings/map.settings.service';
14+
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
1415

1516
@Component({
1617
selector: 'host-component',
@@ -44,19 +45,18 @@ describe('AdminMapComponent', () => {
4445
mockMapSettingsService.updateMapSettings.and.returnValue(of({} as any));
4546

4647
await TestBed.configureTestingModule({
47-
imports: [
48-
MatInputModule,
48+
declarations: [AdminMapComponent, TestHostComponent],
49+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
50+
imports: [MatInputModule,
4951
MatSnackBarModule,
50-
HttpClientTestingModule,
5152
NoopAnimationsModule,
52-
FormsModule
53-
],
54-
declarations: [AdminMapComponent, TestHostComponent],
55-
providers: [
56-
{ provide: MapSettingsService, useValue: mockMapSettingsService }
57-
],
58-
schemas: [CUSTOM_ELEMENTS_SCHEMA]
59-
}).compileComponents();
53+
FormsModule],
54+
providers: [
55+
{ provide: MapSettingsService, useValue: mockMapSettingsService },
56+
provideHttpClient(withInterceptorsFromDi()),
57+
provideHttpClientTesting()
58+
]
59+
}).compileComponents();
6060
});
6161

6262
beforeEach(() => {

0 commit comments

Comments
 (0)