Skip to content

Commit 68b6da7

Browse files
refactor: use angular 20 (#794)
* angular 20 * update first set of dependencies * second set of dependencies * update vega * update visjs * fix lints * if i had a hammerjs * fix gfbio dialog * more hammerjs * hammerjs in tests * override piscina * . instead of .?
1 parent d17f96a commit 68b6da7

File tree

146 files changed

+8456
-6079
lines changed

Some content is hidden

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

146 files changed

+8456
-6079
lines changed

angular.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,5 +1124,31 @@
11241124
},
11251125
"cli": {
11261126
"analytics": false
1127+
},
1128+
"schematics": {
1129+
"@schematics/angular:component": {
1130+
"type": "component"
1131+
},
1132+
"@schematics/angular:directive": {
1133+
"type": "directive"
1134+
},
1135+
"@schematics/angular:service": {
1136+
"type": "service"
1137+
},
1138+
"@schematics/angular:guard": {
1139+
"typeSeparator": "."
1140+
},
1141+
"@schematics/angular:interceptor": {
1142+
"typeSeparator": "."
1143+
},
1144+
"@schematics/angular:module": {
1145+
"typeSeparator": "."
1146+
},
1147+
"@schematics/angular:pipe": {
1148+
"typeSeparator": "."
1149+
},
1150+
"@schematics/angular:resolver": {
1151+
"typeSeparator": "."
1152+
}
11271153
}
11281154
}

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export default defineConfig([
150150
'@typescript-eslint/unbound-method': ['error', {ignoreStatic: true}],
151151
'@typescript-eslint/no-floating-promises': 'warn', // TODO: fix promises
152152
'@typescript-eslint/no-inferrable-types': ['error', {ignoreParameters: true, ignoreProperties: true}],
153+
'@angular-eslint/prefer-inject': 'warn', // TODO: use @inject()
153154

154155
'prefer-arrow/prefer-arrow-functions': [
155156
'error',

package-lock.json

Lines changed: 5339 additions & 3469 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 55 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -49,77 +49,82 @@
4949
},
5050
"private": true,
5151
"dependencies": {
52-
"@angular/animations": "^19.2.10",
53-
"@angular/cdk": "^19.2.15",
54-
"@angular/common": "^19.2.10",
55-
"@angular/compiler": "^19.2.10",
56-
"@angular/core": "^19.2.10",
57-
"@angular/forms": "^19.2.10",
58-
"@angular/material": "^19.2.15",
59-
"@angular/platform-browser": "^19.2.10",
60-
"@angular/platform-browser-dynamic": "^19.2.10",
61-
"@angular/router": "^19.2.10",
52+
"@angular/animations": "^20.1.3",
53+
"@angular/cdk": "^20.1.3",
54+
"@angular/common": "^20.1.3",
55+
"@angular/compiler": "^20.1.3",
56+
"@angular/core": "^20.1.3",
57+
"@angular/forms": "^20.1.3",
58+
"@angular/material": "^20.1.3",
59+
"@angular/platform-browser": "^20.1.3",
60+
"@angular/platform-browser-dynamic": "^20.1.3",
61+
"@angular/router": "^20.1.3",
6262
"@egjs/hammerjs": "^2.0.17",
63-
"@geoengine/openapi-client": "0.0.23",
64-
"codemirror": "~5.65.18",
63+
"@geoengine/openapi-client": "0.0.26",
64+
"codemirror": "~5.65.19",
6565
"d3": "~7.9.0",
6666
"dagre": "~0.8.5",
6767
"dagre-d3": "~0.6.4",
68-
"flatgeobuf": "4.0.1",
69-
"immutable": "~5.1.2",
68+
"flatgeobuf": "4.1.1",
69+
"immutable": "~5.1.3",
7070
"keycharm": "0.4.0",
7171
"moment": "~2.30.1",
72-
"ngx-color-picker": "~19.0.0",
73-
"ngx-mat-select-search": "~8.0.1",
74-
"ol": "~10.5.0",
75-
"ol-mapbox-style": "~12.6.0",
76-
"proj4": "~2.15.0",
77-
"propagating-hammerjs": "^2.0.1",
78-
"rxjs": "^7.4.0",
79-
"uuid": "9.0.1",
80-
"vega": "~5.31.0",
81-
"vega-embed": "~6.27.1",
82-
"vega-lite": "~5.23.0",
83-
"vis-data": "7.1.9",
84-
"vis-timeline": "7.7.3",
85-
"vis-util": "5.0.7",
72+
"ngx-color-picker": "~20.0.0",
73+
"ngx-mat-select-search": "~8.0.2",
74+
"ol": "~10.6.1",
75+
"ol-mapbox-style": "~13.0.1",
76+
"proj4": "~2.19.7",
77+
"propagating-hammerjs": "^3.0.0",
78+
"rxjs": "^7.8.2",
79+
"uuid": "11.1.0",
80+
"vega": "~6.1.2",
81+
"vega-embed": "~7.0.2",
82+
"vega-lite": "~6.2.0",
83+
"vis-data": "8.0.1",
84+
"vis-timeline": "8.1.2",
85+
"vis-util": "6.0.0",
8686
"xss": "1.0.15",
87-
"zone.js": "~0.15.0"
87+
"zone.js": "~0.15.1"
8888
},
8989
"devDependencies": {
90-
"@angular-devkit/architect": "^0.1902.11",
91-
"@angular-devkit/build-angular": "^19.2.11",
92-
"angular-eslint": "^19.7.1",
93-
"@angular/cli": "^19.2.11",
94-
"@angular/compiler-cli": "^19.2.10",
95-
"@angular/language-service": "^19.2.10",
90+
"@angular-devkit/architect": "^0.2001.2",
91+
"@angular-devkit/build-angular": "^20.1.2",
92+
"@angular/cli": "^20.1.2",
93+
"@angular/compiler-cli": "^20.1.3",
94+
"@angular/language-service": "^20.1.3",
9695
"@types/arcgis-rest-api": "^10.4.8",
97-
"@types/codemirror": "~5.60.15",
96+
"@types/codemirror": "~5.60.16",
9897
"@types/d3": "~7.4.3",
99-
"@types/dagre": "^0.7.52",
98+
"@types/dagre": "^0.7.53",
10099
"@types/dagre-d3": "^0.6.6",
100+
"@types/hammerjs": "^2.0.46",
101101
"@types/jasmine": "~5.1.8",
102102
"@types/jasminewd2": "~2.0.13",
103-
"@types/node": "^22.15.16",
104-
"@types/proj4": "^2.5.6",
103+
"@types/node": "^24.1.0",
105104
"@types/topojson-specification": "^1.0.5",
106-
"typescript-eslint": "^8.32.0",
107-
"eslint": "^9.28.0",
108-
"eslint-config-prettier": "^10.1.5",
109-
"eslint-plugin-import": "2.31.0",
110-
"eslint-plugin-jsdoc": "50.7.1",
105+
"angular-eslint": "^20.1.1",
106+
"eslint": "^9.31.0",
107+
"eslint-config-prettier": "^10.1.8",
108+
"eslint-plugin-import": "2.32.0",
109+
"eslint-plugin-jsdoc": "51.4.1",
111110
"eslint-plugin-prefer-arrow": "1.2.3",
112-
"eslint-plugin-prettier": "^5.4.1",
113-
"jasmine-core": "~5.7.1",
111+
"eslint-plugin-prettier": "^5.5.3",
112+
"jasmine-core": "~5.9.0",
114113
"karma": "~6.4.4",
115114
"karma-chrome-launcher": "~3.2.0",
116115
"karma-coverage": "~2.2.1",
117116
"karma-jasmine": "~5.1.0",
118117
"karma-jasmine-html-reporter": "~2.1.0",
119-
"ng-packagr": "^19.2.2",
120-
"prettier": "3.5.3",
121-
"puppeteer": "~24.8.2",
118+
"ng-packagr": "^20.1.0",
119+
"prettier": "3.6.2",
120+
"puppeteer": "~24.15.0",
122121
"ts-node": "~10.9.2",
123-
"typescript": "5.8.3"
122+
"typescript": "5.8.3",
123+
"typescript-eslint": "^8.38.0"
124+
},
125+
"overrides": {
126+
"@angular-devkit/build-angular": {
127+
"piscina": "5.1.3"
128+
}
124129
}
125130
}

projects/common/src/lib/colors/color-attribute-input/color-attribute-input.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
(blur)="propagateChange()"
1111
(keydown.enter)="propagateChange()"
1212
/>
13-
<mat-hint *ngIf="hasColorHint()" align="start">{{ colorHint(input?.key) }}</mat-hint>
13+
@if (hasColorHint()) {
14+
<mat-hint align="start">{{ colorHint(input?.key) }}</mat-hint>
15+
}
1416
</mat-form-field>
1517

1618
<mat-form-field fxFlex>

projects/common/src/lib/colors/color-map-selector/color-map-selector.component.html

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,36 @@
1111
<mat-form-field class="flex-item" fxFlex>
1212
<mat-label>Min</mat-label>
1313
<input matInput type="number" step="any" placeholder="Min" formControlName="min" />
14-
<mat-hint [ngClass]="{'mat-error': true, 'mat-hint': false}" *ngIf="form.controls.bounds.errors?.noFilter">
15-
Specify a minimum and a maximum.
16-
</mat-hint>
17-
<mat-hint
18-
[ngClass]="{'mat-error': true, 'mat-hint': false}"
19-
*ngIf="$any(form.controls.bounds).controls.min.errors?.valueNotLarger"
20-
>
21-
Must be positive for logarithmic gradient.
22-
</mat-hint>
14+
@if (form.controls.bounds.errors?.noFilter) {
15+
<mat-hint [ngClass]="{'mat-error': true, 'mat-hint': false}"> Specify a minimum and a maximum. </mat-hint>
16+
}
17+
@if ($any(form.controls.bounds).controls.min.errors?.valueNotLarger) {
18+
<mat-hint [ngClass]="{'mat-error': true, 'mat-hint': false}"> Must be positive for logarithmic gradient. </mat-hint>
19+
}
2320
</mat-form-field>
2421
<mat-form-field class="flex-item" fxFlex>
2522
<mat-label>Max</mat-label>
2623
<input matInput type="number" step="any" placeholder="Max" formControlName="max" />
27-
<mat-hint [ngClass]="{'mat-error': true, 'mat-hint': false}" *ngIf="form.controls.bounds.errors?.minOverMax">
28-
The maximum must be greater or equal to the minimum.
29-
</mat-hint>
24+
@if (form.controls.bounds.errors?.minOverMax) {
25+
<mat-hint [ngClass]="{'mat-error': true, 'mat-hint': false}">
26+
The maximum must be greater or equal to the minimum.
27+
</mat-hint>
28+
}
3029
</mat-form-field>
3130
</div>
3231

3332
<mat-form-field>
3433
<mat-label>Colormap name</mat-label>
3534
<mat-select formControlName="colorMap">
36-
<mat-option class="options" *ngFor="let colorMap of colorMaps | keyvalue" [value]="colorMap.value">
37-
<div class="colorizer_option_preview" [style.background]="colorMap.value | geoengineRgbaTuplesCssGradient: 90"></div>
38-
{{ colorMap.key }}
39-
</mat-option>
35+
@for (colorMap of colorMaps | keyvalue; track colorMap) {
36+
<mat-option class="options" [value]="colorMap.value">
37+
<div
38+
class="colorizer_option_preview"
39+
[style.background]="colorMap.value | geoengineRgbaTuplesCssGradient: 90"
40+
></div>
41+
{{ colorMap.key }}
42+
</mat-option>
43+
}
4044
</mat-select>
4145
</mat-form-field>
4246

@@ -56,20 +60,23 @@
5660
<tr>
5761
<td><span>Preview</span></td>
5862
<td class="fill_width">
59-
<span *ngIf="!breakpoints"> invalid configuration </span>
60-
<div
61-
*ngIf="!!breakpoints"
62-
class="colorizer_preview fill_width"
63-
[style.background]="breakpoints | geoengineColorBreakpointsCssGradient: 90"
64-
></div>
63+
@if (!breakpoints) {
64+
<span> invalid configuration </span>
65+
}
66+
@if (!!breakpoints) {
67+
<div
68+
class="colorizer_preview fill_width"
69+
[style.background]="breakpoints | geoengineColorBreakpointsCssGradient: 90"
70+
></div>
71+
}
6572
</td>
6673
</tr>
6774
</table>
6875
</div>
6976

7077
<!-- TODO: This will be instantiated to populate the color table -->
7178
<!-- <mat-action-row>
72-
<button type="submit" mat-raised-button color="primary" [disabled]="form.invalid">Create color table</button>
73-
</mat-action-row> -->
79+
<button type="submit" mat-raised-button color="primary" [disabled]="form.invalid">Create color table</button>
80+
</mat-action-row> -->
7481
</form>
7582
</div>

projects/common/src/lib/colors/color-table-editor/color-table-editor.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
[colorAttributeHinter]="colorHints"
88
></geoengine-color-attribute-input>
99
<button mat-icon-button (click)="removeColorAt(i)" class="grid-removebutton"><mat-icon>remove</mat-icon></button>
10-
<div class="grid-errormsg" *ngIf="isNoNumber(i)">Value must be a number!</div>
10+
@if (isNoNumber(i)) {
11+
<div class="grid-errormsg">Value must be a number!</div>
12+
}
1113
</div>
1214
</cdk-virtual-scroll-viewport>
1315
<br />

projects/common/src/lib/colors/percentile-breakpoint-selector/percentile-breakpoint-selector.component.html

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
<mat-label>MIN</mat-label>
1919
<input matInput type="text" disabled="true" value="0.0" />
2020
</mat-form-field>
21-
<div *ngFor="let control of percentiles.controls; let i = index">
22-
<mat-form-field>
23-
<mat-label>Percentile #{{ i + 1 }}</mat-label>
24-
<input matInput type="number" [formControlName]="i" />
25-
</mat-form-field>
26-
</div>
21+
@for (control of percentiles.controls; track control; let i = $index) {
22+
<div>
23+
<mat-form-field>
24+
<mat-label>Percentile #{{ i + 1 }}</mat-label>
25+
<input matInput type="number" [formControlName]="i" />
26+
</mat-form-field>
27+
</div>
28+
}
2729
<mat-form-field>
2830
<mat-label>MAX</mat-label>
2931
<input matInput type="text" disabled="true" value="1.0" />
@@ -33,15 +35,22 @@
3335
<mat-form-field>
3436
<mat-label>Colormap name</mat-label>
3537
<mat-select formControlName="colorMap">
36-
<mat-option class="options" *ngFor="let colorMap of colorMaps | keyvalue" [value]="colorMap.value">
37-
<div class="colorizer_option_preview" [style.background]="colorMap.value | geoengineRgbaTuplesCssGradient: 90"></div>
38-
{{ colorMap.key }}
39-
</mat-option>
38+
@for (colorMap of colorMaps | keyvalue; track colorMap) {
39+
<mat-option class="options" [value]="colorMap.value">
40+
<div
41+
class="colorizer_option_preview"
42+
[style.background]="colorMap.value | geoengineRgbaTuplesCssGradient: 90"
43+
></div>
44+
{{ colorMap.key }}
45+
</mat-option>
46+
}
4047
</mat-select>
4148
</mat-form-field>
4249

4350
<mat-checkbox formControlName="colorMapReverseColors">Reverse colormap</mat-checkbox>
4451

45-
<mat-progress-bar mode="indeterminate" *ngIf="statisticsLoading$ | async"></mat-progress-bar>
52+
@if (statisticsLoading$ | async) {
53+
<mat-progress-bar mode="indeterminate"></mat-progress-bar>
54+
}
4655
</form>
4756
</div>

projects/common/src/lib/common.module.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,16 @@ const COMMON_PIPES = [
140140
AsyncStringSanitizer,
141141
AsyncValueDefault,
142142
BreakpointToCssStringPipe,
143-
BreakpointToCssStringPipe,
144143
ColorBreakpointsCssGradientPipe,
145144
ColorizerCssGradientPipe,
146-
ColorizerCssGradientPipe,
147145
RasterColorizerCssGradientPipe,
148146
RgbaArrayCssGradientPipe,
149147
];
150148

151149
const FXFLEX_LEGACY_DIRECTIVES = [FxFlexDirective, FxLayoutDirective, FxLayoutGapDirective, FxLayoutAlignDirective];
152150

153151
@NgModule({
154-
declarations: [...COMMON_COMPONENTS, ...COMMON_PIPES],
152+
declarations: [...COMMON_COMPONENTS],
155153
imports: [
156154
...MATERIAL_MODULES,
157155
ColorPickerComponent,
@@ -170,6 +168,7 @@ const FXFLEX_LEGACY_DIRECTIVES = [FxFlexDirective, FxLayoutDirective, FxLayoutGa
170168
PointIconComponent,
171169
RasterIconComponent,
172170
...FXFLEX_LEGACY_DIRECTIVES,
171+
...COMMON_PIPES,
173172
],
174173
exports: [
175174
...COMMON_COMPONENTS,

0 commit comments

Comments
 (0)