Skip to content

Commit 065689c

Browse files
authored
Merge pull request #1082 from griffithlab/upgrade-to-v18-2
upgrade angular core & all major libraries
2 parents 878e82e + 9989ee8 commit 065689c

File tree

39 files changed

+4259
-3947
lines changed

39 files changed

+4259
-3947
lines changed

.github/workflows/build_frontend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup node
2727
uses: actions/setup-node@v4
2828
with:
29-
node-version: 20
29+
node-version: 22
3030

3131
- run: npm install -g yarn
3232
working-directory: ./client

client/package.json

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@
2323
"error-stack-parser": "2.0.6"
2424
},
2525
"dependencies": {
26-
"@angular-devkit/schematics": "17.0.10",
27-
"@angular/animations": "^17.0.9",
28-
"@angular/common": "^17.0.9",
29-
"@angular/compiler": "^17.0.9",
30-
"@angular/core": "^17.0.9",
31-
"@angular/forms": "^17.0.9",
32-
"@angular/platform-browser": "^17.0.9",
33-
"@angular/platform-browser-dynamic": "^17.0.9",
34-
"@angular/router": "^17.0.9",
35-
"@apollo/client": "^3.7.17",
36-
"@ngneat/until-destroy": "^9.1.2",
37-
"@ngrx/component": "^17.0.1",
38-
"@ngx-formly/core": "^6.2.2",
39-
"@ngx-formly/ng-zorro-antd": "^6.2.2",
40-
"apollo-angular": "^5.0.0",
41-
"ng-zorro-antd": "17.0.0",
42-
"ngx-cookie-service": "^16.0.0",
26+
"@angular-devkit/schematics": "18.1.2",
27+
"@angular/animations": "^18.1.2",
28+
"@angular/common": "^18.1.2",
29+
"@angular/compiler": "^18.1.2",
30+
"@angular/core": "^18.1.2",
31+
"@angular/forms": "^18.1.2",
32+
"@angular/platform-browser": "^18.1.2",
33+
"@angular/platform-browser-dynamic": "^18.1.2",
34+
"@angular/router": "^18.1.2",
35+
"@apollo/client": "^3.11.1",
36+
"@ngneat/until-destroy": "^10.0.0",
37+
"@ngrx/component": "^18.0.1",
38+
"@ngx-formly/core": "^6.3.6",
39+
"@ngx-formly/ng-zorro-antd": "^6.3.6",
40+
"apollo-angular": "^7.0.2",
41+
"ng-zorro-antd": "18.0.1",
42+
"ngx-cookie-service": "^18.0.0",
4343
"rxjs": "^7.8.1",
4444
"rxjs-etc": "^10.6.2",
4545
"rxjs-spy": "^8.0.2",
@@ -48,30 +48,34 @@
4848
"zone.js": "0.14.3"
4949
},
5050
"devDependencies": {
51-
"@angular-devkit/build-angular": "^17.0.10",
52-
"@angular-eslint/schematics": "^16.1.2",
53-
"@angular/cli": "^17.0.10",
54-
"@angular/compiler-cli": "17.0.9",
55-
"@graphql-codegen/add": "^3.2.3",
56-
"@graphql-codegen/cli": "^2.16.4",
57-
"@graphql-codegen/fragment-matcher": "^3.3.3",
58-
"@graphql-codegen/introspection": "^2.2.3",
59-
"@graphql-codegen/typescript": "^2.8.7",
60-
"@graphql-codegen/typescript-apollo-angular": "^3.5.6",
61-
"@graphql-codegen/typescript-apollo-client-helpers": "^2.2.6",
62-
"@graphql-codegen/typescript-operations": "^2.5.12",
63-
"@types/node": "^12.11.1",
51+
"@angular-devkit/build-angular": "^18.1.2",
52+
"@angular-devkit/core": "^18.1.2",
53+
"@angular-eslint/schematics": "^18.1.0",
54+
"@angular/cli": "^18.1.2",
55+
"@angular/compiler-cli": "18.1.2",
56+
"@graphql-codegen/add": "^5.0.3",
57+
"@graphql-codegen/cli": "^5.0.2",
58+
"@graphql-codegen/fragment-matcher": "^5.0.2",
59+
"@graphql-codegen/introspection": "^4.0.3",
60+
"@graphql-codegen/typescript": "^4.0.9",
61+
"@graphql-codegen/typescript-apollo-angular": "^4.0.0",
62+
"@graphql-codegen/typescript-apollo-client-helpers": "^3.0.0",
63+
"@graphql-codegen/typescript-operations": "^4.2.3",
64+
"@parcel/watcher": "^2.4.1",
65+
"@types/node": "^20.14.12",
66+
"@typescript-eslint/utils": "^7.17.0",
6467
"directory-tree": "^3.5.1",
68+
"eslint": "^8.56.0",
6569
"graphql": "^16.8.1",
6670
"mustache": "^4.2.0",
6771
"ngx-json-viewer": "^3.0.2",
6872
"prettier": "^3.2.4",
69-
"svg-to-ts": "^9.0.0",
73+
"svg-to-ts": "^12.0.0",
7074
"svgo": "^3.0.2",
7175
"ts-node": "~10.9.1",
7276
"tslib": "^2.3.1",
7377
"tslint": "~6.1.0",
74-
"typescript": "5.2.2",
78+
"typescript": "5.5.4",
7579
"webpack-bundle-analyzer": "^4.5.0"
7680
},
7781
"overrides": {

client/src/app/app.module.ts

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import { APP_INITIALIZER, ErrorHandler, NgModule } from '@angular/core'
33
import { registerLocaleData } from '@angular/common'
44
import en from '@angular/common/locales/en'
55
import {
6-
HttpClientModule,
7-
HttpClientXsrfModule,
8-
HttpClientJsonpModule,
96
HttpClient,
7+
provideHttpClient,
8+
withInterceptorsFromDi,
9+
withJsonpSupport,
10+
withXsrfConfiguration,
1011
} from '@angular/common/http'
1112
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
1213
import { LetDirective, PushPipe } from '@ngrx/component'
@@ -32,22 +33,12 @@ function initializeApiFactory(httpClient: HttpClient): () => Observable<any> {
3233

3334
@NgModule({
3435
declarations: [AppComponent],
36+
bootstrap: [AppComponent],
3537
imports: [
3638
AppRoutingModule,
3739
BrowserAnimationsModule,
3840
BrowserModule,
3941
GraphQLModule,
40-
HttpClientModule,
41-
HttpClientXsrfModule,
42-
HttpClientJsonpModule,
43-
// LoggerModule.forRoot({
44-
// timestampFormat: 'mediumTime',
45-
// level: !environment.production
46-
// ? NgxLoggerLevel.TRACE
47-
// : NgxLoggerLevel.OFF,
48-
// enableSourceMaps: true,
49-
// serverLogLevel: NgxLoggerLevel.ERROR,
50-
// }),
5142
NgxJsonViewerModule,
5243
NzIconModule.forRoot(civicIcons),
5344
CvcForms2Module,
@@ -56,7 +47,6 @@ function initializeApiFactory(httpClient: HttpClient): () => Observable<any> {
5647
CvcNetworkErrorAlertModule,
5748
],
5849
providers: [
59-
CookieService,
6050
{
6151
provide: ErrorHandler,
6252
useClass: AppErrorHandler,
@@ -68,7 +58,11 @@ function initializeApiFactory(httpClient: HttpClient): () => Observable<any> {
6858
deps: [HttpClient],
6959
multi: true,
7060
},
61+
provideHttpClient(
62+
withInterceptorsFromDi(),
63+
withJsonpSupport(),
64+
withXsrfConfiguration({ cookieName: 'XSRF-TOKEN' })
65+
),
7166
],
72-
bootstrap: [AppComponent],
7367
})
7468
export class AppModule {}

client/src/app/components/activities/activity-feed/activity-feed.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</ng-template>
1515
<nz-collapse
1616
[nzBordered]="false"
17-
nzExpandIconPosition="right">
17+
nzExpandIconPosition="end">
1818
<cvc-collapsible-card
1919
[header]="activityHeaderTemplate"
2020
[contents]="activityContentTemplate"></cvc-collapsible-card>

client/src/app/components/features/features-table/features-table.component.html

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,8 @@
6060
[nzSortFn]="true">
6161
Full Name
6262
</th>
63-
<th
64-
nzLeft
65-
nzWidth="70px">
66-
Type
67-
</th>
68-
<th
69-
nzLeft
70-
nzWidth="200px">
71-
Aliases
72-
</th>
63+
<th nzWidth="70px">Type</th>
64+
<th nzWidth="200px">Aliases</th>
7365
<th nzWidth="250px">Diseases</th>
7466
<th nzWidth="225px">Therapies</th>
7567
<th
@@ -144,7 +136,7 @@
144136
filterChange$.next()
145137
"></cvc-clearable-input-filter>
146138
</th>
147-
<th nzLeft>
139+
<th>
148140
<nz-select
149141
nzAllowClear
150142
nzSize="small"
@@ -162,7 +154,7 @@
162154
</nz-option>
163155
</nz-select>
164156
</th>
165-
<th nzLeft>
157+
<th>
166158
<cvc-clearable-input-filter
167159
[(inputModel)]="aliasInput"
168160
(inputModelChange)="
@@ -196,7 +188,7 @@
196188
let-index="index">
197189
<tr class="data-row">
198190
<td nzLeft>
199-
<cvc-feature-tag [feature]="feature"></cvc-feature-tag>
191+
<cvc-feature-tag [feature]="feature!"></cvc-feature-tag>
200192
</td>
201193
<td>
202194
<span
@@ -214,7 +206,7 @@
214206
{{ feature.featureInstanceType | titlecase }}
215207
</span>
216208
</td>
217-
<td nzLeft>
209+
<td>
218210
<cvc-plain-tag-overflow
219211
[tags]="feature.featureAliases"
220212
[matchingText]="aliasInput"></cvc-plain-tag-overflow>
@@ -264,7 +256,7 @@
264256
<!-- card's title template -->
265257
<ng-template #titleTemplate>
266258
<ng-container *ngIf="this.cvcTitleTemplate">
267-
<ng-template [ngTemplateOutlet]="cvcTitleTemplate"></ng-template>
259+
<ng-template [ngTemplateOutlet]="cvcTitleTemplate!"></ng-template>
268260
</ng-container>
269261
<ng-container *ngIf="this.cvcTitle">
270262
{{ this.cvcTitle }}

client/src/app/components/layout/viewer-button/viewer-button.component.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ import { Viewer, ViewerService } from '@app/core/services/viewer/viewer.service'
88
import { ViewerNotificationCountGQL } from '@app/generated/civic.apollo'
99
import { Apollo, gql } from 'apollo-angular'
1010
import { environment } from 'environments/environment'
11-
import { BehaviorSubject, Observable, Subject } from 'rxjs'
11+
import { BehaviorSubject, filter, Observable, Subject } from 'rxjs'
1212
import { tag } from 'rxjs-spy/operators'
1313
import { map, startWith, withLatestFrom } from 'rxjs/operators'
14+
import { pluck } from 'rxjs-etc/operators'
15+
import { isNonNulled } from 'rxjs-etc'
1416

1517
@Component({
1618
selector: 'cvc-viewer-button',
@@ -39,14 +41,16 @@ export class CvcViewerButtonComponent implements OnInit {
3941
this.unreadCount$ = this.unreadCountGql
4042
.watch(undefined, { pollInterval: 5000 })
4143
.valueChanges.pipe(
42-
map(({ data }) => data.notifications.unreadCount),
44+
pluck('data', 'notifications', 'unreadCount'),
45+
filter(isNonNulled),
4346
startWith(0)
4447
)
4548
} else {
4649
this.unreadCount$ = this.unreadCountGql
4750
.watch(undefined)
4851
.valueChanges.pipe(
49-
map(({ data }) => data.notifications.unreadCount),
52+
pluck('data', 'notifications', 'unreadCount'),
53+
filter(isNonNulled),
5054
startWith(0)
5155
)
5256
}

client/src/app/components/revisions/revision-list/revision-list.component.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
ValidateRevisionsForAcceptanceQueryVariables,
2424
ValidationErrorFragment,
2525
} from '@app/generated/civic.apollo'
26-
import { Observable, Subject } from 'rxjs'
26+
import { filter, Observable, Subject, combineLatest } from 'rxjs'
2727
import { Viewer, ViewerService } from '@app/core/services/viewer/viewer.service'
2828
import {
2929
MutationState,
@@ -33,6 +33,8 @@ import { NetworkErrorsService } from '@app/core/services/network-errors.service'
3333
import { map, startWith, takeUntil } from 'rxjs/operators'
3434
import { QueryRef } from 'apollo-angular'
3535
import { InternalRefetchQueryDescriptor } from '@apollo/client/core/types'
36+
import { pluck } from 'rxjs-etc/operators'
37+
import { isNonNulled } from 'rxjs-etc'
3638

3739
type SuccessType = false | 'accepted' | 'rejected'
3840

@@ -120,24 +122,22 @@ export class RevisionListComponent implements OnInit, OnChanges, OnDestroy {
120122
})
121123

122124
this.genericErrors$ = this.queryRef.valueChanges.pipe(
123-
map(({ data }) => {
124-
return data.validateRevisionsForAcceptance.genericErrors
125-
})
125+
pluck('data', 'validateRevisionsForAcceptance', 'genericErrors'),
126+
filter(isNonNulled),
127+
startWith([])
126128
)
127129

128130
this.validationErrors$ = this.queryRef.valueChanges.pipe(
129-
map(({ data }) => {
130-
return data.validateRevisionsForAcceptance.validationErrors
131-
})
131+
pluck('data', 'validateRevisionsForAcceptance', 'validationErrors'),
132+
filter(isNonNulled),
133+
startWith([])
132134
)
133135

134-
this.totalErrorCount$ = this.queryRef.valueChanges.pipe(
135-
map(({ data }) => {
136-
return (
137-
data.validateRevisionsForAcceptance.genericErrors.length +
138-
data.validateRevisionsForAcceptance.validationErrors.length
139-
)
140-
}),
136+
this.totalErrorCount$ = combineLatest([
137+
this.genericErrors$,
138+
this.validationErrors$,
139+
]).pipe(
140+
map(([generic, validation]) => generic.length + validation.length),
141141
startWith(0)
142142
)
143143

client/src/app/components/shared/empty-value/empty-value.component.html

Lines changed: 0 additions & 38 deletions
This file was deleted.

client/src/app/components/shared/empty-value/empty-value.component.less

Lines changed: 0 additions & 20 deletions
This file was deleted.

client/src/app/components/shared/empty-value/empty-value.component.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)