Skip to content

Commit 71ea6db

Browse files
Update angular to 18
1 parent 27e3834 commit 71ea6db

File tree

24 files changed

+527
-1132
lines changed

24 files changed

+527
-1132
lines changed

package-lock.json

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

package.json

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@
1212
"private": true,
1313
"dependencies": {
1414
"@angular/animations": "^18.2.14",
15-
"@angular/cdk": "^17.3.10",
15+
"@angular/cdk": "^18.2.14",
1616
"@angular/common": "^18.2.14",
1717
"@angular/compiler": "^18.2.14",
1818
"@angular/core": "^18.2.14",
1919
"@angular/forms": "^18.2.14",
2020
"@angular/localize": "^18.2.14",
21-
"@angular/material": "^17.3.10",
22-
"@angular/material-moment-adapter": "^17.3.10",
21+
"@angular/material": "^18.2.14",
22+
"@angular/material-moment-adapter": "^18.2.14",
2323
"@angular/platform-browser": "^18.2.14",
2424
"@angular/platform-browser-dynamic": "^18.2.14",
2525
"@angular/router": "^18.2.14",
2626
"@auth0/angular-jwt": "^5.0.1",
27-
"@fortawesome/angular-fontawesome": "^0.14.1",
28-
"@fortawesome/fontawesome-free": "^5.15.4",
27+
"@fortawesome/angular-fontawesome": "^0.15.0",
28+
"@fortawesome/fontawesome-free": "^7.1.0",
2929
"@fortawesome/fontawesome-svg-core": "^1.2.28",
3030
"@fortawesome/free-solid-svg-icons": "^5.13.0",
31-
"@ng-bootstrap/ng-bootstrap": "^16.0.0",
32-
"@ngx-translate/core": "^15.0.0",
33-
"@ngx-translate/http-loader": "^6.0.0",
31+
"@ng-bootstrap/ng-bootstrap": "^17.0.1",
32+
"@ngx-translate/core": "^17.0.0",
33+
"@ngx-translate/http-loader": "^17.0.0",
3434
"@popperjs/core": "^2.11.6",
3535
"all": "0.0.0",
3636
"animate.css": "^4.1.1",
@@ -43,11 +43,11 @@
4343
"leaflet-geosearch": "3.6.1",
4444
"leaflet.fullscreen": "3.0.1",
4545
"moment": "^2.29.4",
46-
"monaco-editor": "^0.44.0",
46+
"monaco-editor": "^0.50.0",
4747
"ng": "0.0.0",
4848
"ng-inline-svg-2": "^15.0.1",
49-
"ngx-cookie-service": "^17.1.0",
50-
"ngx-monaco-editor-v2": "^17.0.1",
49+
"ngx-cookie-service": "^18.0.0",
50+
"ngx-monaco-editor-v2": "^18.1.0",
5151
"ngx-papaparse": "^5.0.0",
5252
"popper.js": "^1.16.1",
5353
"proj4": "2.12.1",
@@ -62,7 +62,7 @@
6262
"@angular-devkit/build-angular": "^18.2.21",
6363
"@angular/cli": "^18.2.21",
6464
"@angular/compiler-cli": "^18.2.14",
65-
"@ngrx/store-devtools": "^17.2.0",
65+
"@ngrx/store-devtools": "^18.1.1",
6666
"@types/jasmine": "~3.6.0",
6767
"@types/jasminewd2": "~2.0.3",
6868
"@types/jest": "^30.0.0",
@@ -88,14 +88,5 @@
8888
"tslint-angular": "^3.0.3",
8989
"tslint-config-prettier": "^1.18.0",
9090
"typescript": "~5.4.5"
91-
},
92-
"overrides": {
93-
"postcss": "^8.4.31",
94-
"tough-cookie": "^4.1.4",
95-
"xml2js": "^0.6.2",
96-
"babel-plugin-polyfill-corejs3": "0.8.6",
97-
"babel-plugin-polyfill-corejs2": "0.4.6",
98-
"babel-plugin-polyfill-regenerator": "0.5.3",
99-
"webpack-dev-middleware": "5.3.4"
10091
}
10192
}

src/app/admin/admin.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { AdminRoutingModule } from "./admin-routing.module";
55
import { ApplicationsModule } from "@applications/applications.module";
66
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
77
import { RouterModule } from "@angular/router";
8-
import { TranslateModule } from "@ngx-translate/core";
8+
import { TranslatePipe } from "@ngx-translate/core";
99
import { FormModule } from "@shared/components/forms/form.module";
1010
import { NGMaterialModule } from "@shared/Modules/materiale.module";
1111
import { PipesModule } from "@shared/pipes/pipes.module";
@@ -68,7 +68,7 @@ import { AwaitingUsersTableTabComponent } from "./users/user-list/awaiting-user-
6868
NGMaterialModule,
6969
PipesModule,
7070
CommonModule,
71-
TranslateModule,
71+
TranslatePipe,
7272
FormsModule,
7373
ReactiveFormsModule,
7474
FormModule,

src/app/app.module.ts

Lines changed: 57 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { NgIf } from "@angular/common";
2-
import { HTTP_INTERCEPTORS, HttpClient, provideHttpClient, withInterceptorsFromDi } from "@angular/common/http";
2+
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from "@angular/common/http";
33
import { NgModule } from "@angular/core";
44
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
55
import { MatInputModule } from "@angular/material/input";
@@ -9,15 +9,15 @@ import { BrowserModule, Title } from "@angular/platform-browser";
99
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
1010
import { JwtModule } from "@auth0/angular-jwt";
1111
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
12-
import { TranslateLoader, TranslateModule } from "@ngx-translate/core";
13-
import { TranslateHttpLoader } from "@ngx-translate/http-loader";
12+
import { provideTranslateService, TranslateDirective, TranslateModule, TranslatePipe } from "@ngx-translate/core";
13+
import { provideTranslateHttpLoader } from "@ngx-translate/http-loader";
1414
import { MatSelectSearchModule } from "@shared/components/mat-select-search/mat-select-search.module";
1515
import { WelcomeDialogModule } from "@shared/components/welcome-dialog/welcome-dialog.module";
1616
import { AuthJwtInterceptor } from "@shared/helpers/auth-jwt.interceptor";
1717
import { MatPaginatorIntlDa } from "@shared/helpers/mat-paginator-intl-da";
1818
import { NGMaterialModule } from "@shared/Modules/materiale.module";
1919
import { PipesModule } from "@shared/pipes/pipes.module";
20-
import { SAVER, getSaver } from "@shared/providers/saver.provider";
20+
import { getSaver, SAVER } from "@shared/providers/saver.provider";
2121
import { SharedVariableModule } from "@shared/shared-variable/shared-variable.module";
2222
import { SharedModule } from "@shared/shared.module";
2323
import { CookieService } from "ngx-cookie-service";
@@ -33,60 +33,61 @@ import { NavbarModule } from "./navbar/navbar.module";
3333
import { ProfilesModule } from "./profiles/profiles.module";
3434
import { SearchModule } from "./search/search.module";
3535

36-
export function HttpLoaderFactory(http: HttpClient) {
37-
return new TranslateHttpLoader(http, "./assets/i18n/", ".json");
38-
}
39-
4036
export function tokenGetter() {
4137
return localStorage.getItem("id_token");
4238
}
4339

44-
@NgModule({ declarations: [AppComponent, ErrorPageComponent, NewUserComponent, UserPageComponent],
45-
bootstrap: [AppComponent],
46-
exports: [TranslateModule], imports: [SharedVariableModule.forRoot(),
47-
AuthModule,
48-
BrowserModule,
49-
BrowserAnimationsModule,
50-
HttpClientModule,
51-
AppRoutingModule,
52-
NavbarModule,
53-
ProfilesModule,
54-
TranslateModule.forRoot({
55-
defaultLanguage: "da",
56-
loader: {
57-
provide: TranslateLoader,
58-
useFactory: HttpLoaderFactory,
59-
deps: [HttpClient],
60-
},
61-
}),
62-
NgbModule,
63-
NgIf,
64-
FormsModule,
65-
ReactiveFormsModule,
66-
BrowserAnimationsModule,
67-
NGMaterialModule,
68-
GatewayModule,
69-
MatSelectSearchModule,
70-
SearchModule,
71-
SharedModule,
72-
MatInputModule,
73-
MatTooltipModule,
74-
JwtModule.forRoot({
75-
config: {
76-
tokenGetter,
77-
},
78-
}),
79-
MonacoEditorModule.forRoot(),
80-
WelcomeDialogModule,
81-
PipesModule], providers: [
82-
// use these two providers only in dev environment
83-
//{ provide: ErrorHandler, useClass: GlobalErrorHandler },
84-
//{ provide: HTTP_INTERCEPTORS, useClass: ServerErrorInterceptor, multi: true },
85-
Title,
86-
{ provide: HTTP_INTERCEPTORS, useClass: AuthJwtInterceptor, multi: true },
87-
{ provide: SAVER, useFactory: getSaver },
88-
{ provide: MatPaginatorIntl, useClass: MatPaginatorIntlDa },
89-
{ provide: CookieService },
90-
provideHttpClient(withInterceptorsFromDi()),
91-
] })
40+
@NgModule({
41+
declarations: [AppComponent, ErrorPageComponent, NewUserComponent, UserPageComponent],
42+
bootstrap: [AppComponent],
43+
exports: [TranslatePipe, TranslateDirective],
44+
imports: [
45+
SharedVariableModule.forRoot(),
46+
AuthModule,
47+
BrowserModule,
48+
BrowserAnimationsModule,
49+
AppRoutingModule,
50+
NavbarModule,
51+
ProfilesModule,
52+
TranslateModule.forRoot({
53+
fallbackLang: "da",
54+
loader: provideTranslateHttpLoader({prefix:"./assets/i18n/", suffix:".json"}),
55+
}),
56+
NgbModule,
57+
NgIf,
58+
FormsModule,
59+
ReactiveFormsModule,
60+
BrowserAnimationsModule,
61+
NGMaterialModule,
62+
GatewayModule,
63+
MatSelectSearchModule,
64+
SearchModule,
65+
SharedModule,
66+
MatInputModule,
67+
MatTooltipModule,
68+
JwtModule.forRoot({
69+
config: {
70+
tokenGetter,
71+
},
72+
}),
73+
MonacoEditorModule.forRoot(),
74+
WelcomeDialogModule,
75+
PipesModule,
76+
],
77+
providers: [
78+
// use these two providers only in dev environment
79+
//{ provide: ErrorHandler, useClass: GlobalErrorHandler },
80+
//{ provide: HTTP_INTERCEPTORS, useClass: ServerErrorInterceptor, multi: true },
81+
Title,
82+
{ provide: HTTP_INTERCEPTORS, useClass: AuthJwtInterceptor, multi: true },
83+
{ provide: SAVER, useFactory: getSaver },
84+
{ provide: MatPaginatorIntl, useClass: MatPaginatorIntlDa },
85+
{ provide: CookieService },
86+
provideHttpClient(withInterceptorsFromDi()),
87+
provideTranslateService({
88+
fallbackLang: "da",
89+
loader: provideTranslateHttpLoader({prefix:"./assets/i18n/", suffix:".json"}),
90+
}),
91+
],
92+
})
9293
export class AppModule {}

src/app/applications/applications-list/application-filter/application-filter.component.ts

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { ApplicationService } from "@applications/application.service";
99
import { ApplicationStatus, ApplicationStatusCheck } from "@applications/enums/status.enum";
1010
import { ChirpstackGatewayService } from "./../../../shared/services/chirpstack-gateway.service";
1111

12-
import { TranslateModule, TranslateService } from "@ngx-translate/core";
12+
import { TranslatePipe, TranslateService } from "@ngx-translate/core";
1313
import { SharedVariableService } from "@shared/shared-variable/shared-variable.service";
1414
import { ApplicationsFilterService } from "./applications-filter.service";
1515

@@ -24,25 +24,13 @@ import { ApplicationsFilterService } from "./applications-filter.service";
2424
MatSelectModule,
2525
MatOptionModule,
2626
MatButtonModule,
27-
TranslateModule,
27+
TranslatePipe,
2828
],
2929
templateUrl: "./application-filter.component.html",
3030
styleUrl: "./application-filter.component.scss",
3131
encapsulation: ViewEncapsulation.ShadowDom,
3232
})
3333
export class ApplicationFilterComponent implements OnInit {
34-
constructor(
35-
private applicationService: ApplicationService,
36-
private filterService: ApplicationsFilterService,
37-
private sharedVariableService: SharedVariableService,
38-
public translate: TranslateService,
39-
public ChirpstackGatewayService: ChirpstackGatewayService
40-
) {}
41-
ngOnInit(): void {
42-
this.loadOwnerOptions();
43-
this.ChirpstackGatewayService.getMultiple().subscribe(data => data);
44-
}
45-
4634
stateOptions: { label: string; value: ApplicationStatus | "All" }[] = [
4735
{ label: "APPLICATION-FILTER.ALL", value: "All" },
4836
{ label: "APPLICATION-FILTER.NONE", value: ApplicationStatus["NONE"] },
@@ -51,14 +39,28 @@ export class ApplicationFilterComponent implements OnInit {
5139
{ label: "APPLICATION-FILTER.PROTOTYPE", value: ApplicationStatus["PROTOTYPE"] },
5240
{ label: "APPLICATION-FILTER.OTHER", value: ApplicationStatus["OTHER"] },
5341
];
54-
5542
statusOptions: { label: string; value: ApplicationStatusCheck | "All" }[] = [
5643
{ label: "APPLICATION-FILTER.ALL", value: "All" },
5744
{ label: "APPLICATION-FILTER.ALERT", value: "alert" },
5845
{ label: "APPLICATION-FILTER.STABLE", value: "stable" },
5946
];
60-
6147
ownerOptions: { label: string; value: string | "All" }[] = [];
48+
state: string = "All";
49+
status: string = "All";
50+
owner: string = "All";
51+
52+
constructor(
53+
private applicationService: ApplicationService,
54+
private filterService: ApplicationsFilterService,
55+
private sharedVariableService: SharedVariableService,
56+
public translate: TranslateService,
57+
public ChirpstackGatewayService: ChirpstackGatewayService
58+
) {}
59+
60+
ngOnInit(): void {
61+
this.loadOwnerOptions();
62+
this.ChirpstackGatewayService.getMultiple().subscribe(data => data);
63+
}
6264

6365
loadOwnerOptions(): void {
6466
this.applicationService
@@ -70,10 +72,6 @@ export class ApplicationFilterComponent implements OnInit {
7072
});
7173
}
7274

73-
state: string = "All";
74-
status: string = "All";
75-
owner: string = "All";
76-
7775
onStatusCheck(event: any): void {
7876
this.filterService.updateStatusCheck(event.value);
7977
}

src/app/applications/applications-list/applications-list-dashboard/applications-list-dashboard.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import { Component, OnInit } from "@angular/core";
22
import { MatIconRegistry } from "@angular/material/icon";
33
import { DomSanitizer } from "@angular/platform-browser";
44
import { ApplicationService } from "@applications/application.service";
5-
import { TranslateModule, TranslateService } from "@ngx-translate/core";
5+
import { TranslatePipe, TranslateService } from "@ngx-translate/core";
66
import { ChirpstackGatewayService } from "@shared/services/chirpstack-gateway.service";
77
import { SharedVariableService } from "@shared/shared-variable/shared-variable.service";
88
import { BasicInformationBoxComponent } from "../../../shared/components/basic-information-box/basic-information-box.component";
99

1010
@Component({
1111
selector: "app-applications-list-dashboard",
1212
standalone: true,
13-
imports: [BasicInformationBoxComponent, TranslateModule],
13+
imports: [BasicInformationBoxComponent, TranslatePipe],
1414
templateUrl: "./applications-list-dashboard.component.html",
1515
styleUrl: "./applications-list-dashboard.component.scss",
1616
})

src/app/applications/applications.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { NgModule } from "@angular/core";
33
import { ReactiveFormsModule } from "@angular/forms";
44
import { RouterModule } from "@angular/router";
55
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
6-
import { TranslateModule } from "@ngx-translate/core";
6+
import { TranslatePipe } from "@ngx-translate/core";
77
import { BasicInformationBoxComponent } from "@shared/components/basic-information-box/basic-information-box.component";
88
import { FormModule } from "@shared/components/forms/form.module";
99
import { OptionFieldComponent } from "@shared/components/option-field/option-field.component";
@@ -44,7 +44,7 @@ import { BasicTabSwitchComponent } from "@shared/components/basic-tab-switch/bas
4444
imports: [
4545
CommonModule,
4646
RouterModule,
47-
TranslateModule,
47+
TranslatePipe,
4848
IotDevicesModule,
4949
DatatargetModule,
5050
DirectivesModule,

src/app/applications/datatarget/datatarget.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { NgModule } from "@angular/core";
33
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
44
import { RouterModule } from "@angular/router";
55
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
6-
import { TranslateModule } from "@ngx-translate/core";
6+
import { TranslatePipe } from "@ngx-translate/core";
77
import { NGMaterialModule } from "@shared/Modules/materiale.module";
88
import { FormModule } from "@shared/components/forms/form.module";
99
import { PipesModule } from "@shared/pipes/pipes.module";
@@ -60,7 +60,7 @@ import { MonacoEditorModule } from "ngx-monaco-editor-v2";
6060
imports: [
6161
CommonModule,
6262
RouterModule,
63-
TranslateModule,
63+
TranslatePipe,
6464
FormModule,
6565
NGMaterialModule,
6666
FontAwesomeModule,

src/app/applications/iot-devices/iot-devices.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { GraphModule } from "@app/graph/graph.module";
77
import { IotDeviceDetailsMqttExternalBrokerComponent } from "@applications/iot-devices/iot-device-detail/iot-device-details-mqtt-external-broker/iot-device-details-mqtt-external-broker.component";
88
import { IotDeviceDetailsMqttInternalBrokerComponent } from "@applications/iot-devices/iot-device-detail/iot-device-details-mqtt-internal-broker/iot-device-details-mqtt-internal-broker.component";
99
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
10-
import { TranslateModule } from "@ngx-translate/core";
10+
import { TranslatePipe } from "@ngx-translate/core";
1111
import { FormModule } from "@shared/components/forms/form.module";
1212
import { TableSortIconComponent } from "@shared/components/table-sort-icon/table-sort-icon.component";
1313
import { NGMaterialModule } from "@shared/Modules/materiale.module";
@@ -71,7 +71,7 @@ import { IotDeviceCopyComponent } from "./iot-device-copy/iot-device-copy.compon
7171
SharedModule,
7272
CommonModule,
7373
RouterModule,
74-
TranslateModule,
74+
TranslatePipe,
7575
FormModule,
7676
NGMaterialModule,
7777
FormsModule,

src/app/applications/multicast/multicast.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { MulticastDetailComponent } from "./multicast-detail/multicast-detail.co
55
import { MulticastEditComponent } from "./multicast-edit/multicast-edit.component";
66
import { MulticastTableComponent } from "./multicast-table/multicast-table.component";
77
import { RouterModule } from "@angular/router";
8-
import { TranslateModule } from "@ngx-translate/core";
8+
import { TranslatePipe } from "@ngx-translate/core";
99
import { NGMaterialModule } from "@shared/Modules/materiale.module";
1010
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
1111
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
@@ -18,7 +18,7 @@ import { MulticastTabComponent } from "./multicast-tab/multicast-tab.component";
1818
imports: [
1919
CommonModule,
2020
RouterModule,
21-
TranslateModule,
21+
TranslatePipe,
2222
NGMaterialModule,
2323
FontAwesomeModule,
2424
ReactiveFormsModule,

0 commit comments

Comments
 (0)