Skip to content

Commit

Permalink
Mark svcs in all constructors as readonly, bump deps (#247)
Browse files Browse the repository at this point in the history
* fix: mark svcs in all constructors as readonly, bump deps

* fix: bump libs

---------

Co-authored-by: Christian Badura <[email protected]>
  • Loading branch information
cbadura and Christian Badura authored Sep 30, 2024
1 parent 49e6cd7 commit 1df8cba
Show file tree
Hide file tree
Showing 15 changed files with 271 additions and 141 deletions.
281 changes: 206 additions & 75 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@
"@ngrx/router-store": "^18.0.1",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"@onecx/accelerator": "^5.12.2",
"@onecx/angular-accelerator": "^5.12.2",
"@onecx/angular-auth": "^5.12.2",
"@onecx/angular-integration-interface": "^5.12.2",
"@onecx/angular-remote-components": "^5.12.2",
"@onecx/angular-testing": "^5.12.2",
"@onecx/angular-webcomponents": "^5.12.2",
"@onecx/integration-interface": "^5.12.2",
"@onecx/keycloak-auth": "^5.12.2",
"@onecx/portal-integration-angular": "^5.12.2",
"@onecx/portal-layout-styles": "^5.12.2",
"@onecx/accelerator": "^5.13.0",
"@onecx/angular-accelerator": "^5.13.0",
"@onecx/angular-auth": "^5.13.0",
"@onecx/angular-integration-interface": "^5.13.0",
"@onecx/angular-remote-components": "^5.13.0",
"@onecx/angular-testing": "^5.13.0",
"@onecx/angular-webcomponents": "^5.13.0",
"@onecx/integration-interface": "^5.13.0",
"@onecx/keycloak-auth": "^5.13.0",
"@onecx/portal-integration-angular": "^5.13.0",
"@onecx/portal-layout-styles": "^5.13.0",
"@webcomponents/webcomponentsjs": "^2.8.0",
"keycloak-angular": "^16.0.1",
"primeflex": "^3.3.1",
"primeicons": "^7.0.0",
"primeng": "^17.18.9",
"primeng": "^17.18.10",
"rxjs": "7.8.1",
"tslib": "^2.7.0"
},
Expand All @@ -88,11 +88,11 @@
"@openapitools/openapi-generator-cli": "^2.13.9",
"@schematics/angular": "18.2.1",
"@types/jasmine": "~5.1.4",
"@types/node": "~22.7.2",
"@types/node": "~22.7.3",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"css-loader": "^7.1.2",
"eslint": "^8.57.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-prettier": "^5.2.1",
Expand All @@ -118,7 +118,7 @@
"ts-node": "10.9.2",
"typescript": "5.5",
"url-loader": "^4.1.1",
"webpack": "^5.93.0",
"webpack": "^5.95.0",
"webpack-merge": "^6.0.1"
}
}
2 changes: 1 addition & 1 deletion src/app/onecx-product-store-remote.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const routes: Routes = [
schemas: []
})
export class OneCXProductStoreModule implements DoBootstrap {
constructor(private injector: Injector) {
constructor(private readonly injector: Injector) {
console.info('OneCX Product Store Module constructor')
}

Expand Down
8 changes: 4 additions & 4 deletions src/app/product-store/app-delete/app-delete.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export class AppDeleteComponent {
@Output() appDeleted = new EventEmitter<boolean>()

constructor(
private msApi: MicroservicesAPIService,
private mfeApi: MicrofrontendsAPIService,
private msgService: PortalMessageService,
private translate: TranslateService
private readonly msApi: MicroservicesAPIService,
private readonly mfeApi: MicrofrontendsAPIService,
private readonly msgService: PortalMessageService,
private readonly translate: TranslateService
) {}

public onDialogHide(): void {
Expand Down
15 changes: 7 additions & 8 deletions src/app/product-store/app-detail/app-detail.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, Renderer2, ViewChild } from '@angular/core'
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core'
import { FormControl, FormGroup, Validators } from '@angular/forms'
import { TranslateService } from '@ngx-translate/core'
import { finalize } from 'rxjs'
Expand Down Expand Up @@ -87,13 +87,12 @@ export class AppDetailComponent implements OnInit, OnChanges {
public convertToUniqueStringArray = convertToUniqueStringArray

constructor(
private user: UserService,
private icon: IconService,
private msApi: MicroservicesAPIService,
private mfeApi: MicrofrontendsAPIService,
private msgService: PortalMessageService,
private translate: TranslateService,
private renderer: Renderer2
private readonly user: UserService,
private readonly icon: IconService,
private readonly msApi: MicroservicesAPIService,
private readonly mfeApi: MicrofrontendsAPIService,
private readonly msgService: PortalMessageService,
private readonly translate: TranslateService
) {
this.hasCreatePermission = this.user.hasPermission('APP#CREATE')
this.hasEditPermission = this.user.hasPermission('APP#EDIT')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class AppInternComponent implements OnChanges {
public operator = false
public deprecated = false

constructor(private translate: TranslateService) {}
constructor(private readonly translate: TranslateService) {}

public ngOnChanges(): void {
this.undeployed = this.app?.undeployed ?? false
Expand Down
12 changes: 6 additions & 6 deletions src/app/product-store/app-search/app-search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ export class AppSearchComponent implements OnInit, OnDestroy {
@ViewChild(DataView) dv: DataView | undefined

constructor(
private route: ActivatedRoute,
private router: Router,
private user: UserService,
private mfeApi: MicrofrontendsAPIService,
private msApi: MicroservicesAPIService,
private translate: TranslateService
private readonly route: ActivatedRoute,
private readonly router: Router,
private readonly user: UserService,
private readonly mfeApi: MicrofrontendsAPIService,
private readonly msApi: MicroservicesAPIService,
private readonly translate: TranslateService
) {
this.hasCreatePermission = this.user.hasPermission('APP#CREATE')
this.hasDeletePermission = this.user.hasPermission('APP#DELETE')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ export class ProductAppsComponent implements OnChanges, OnDestroy {
public hasDeletePermission = false

constructor(
private icon: IconService,
private user: UserService,
private productApi: ProductsAPIService
private readonly icon: IconService,
private readonly user: UserService,
private readonly productApi: ProductsAPIService
) {
this.hasCreatePermission = this.user.hasPermission('APP#CREATE')
this.hasDeletePermission = this.user.hasPermission('APP#DELETE')
Expand Down
16 changes: 8 additions & 8 deletions src/app/product-store/product-detail/product-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ export class ProductDetailComponent implements OnInit {
@ViewChild(ProductPropertyComponent, { static: false }) productPropsComponent!: ProductPropertyComponent

constructor(
private router: Router,
private route: ActivatedRoute,
private user: UserService,
private location: Location,
private productApi: ProductsAPIService,
private imageApi: ImagesInternalAPIService,
private msgService: PortalMessageService,
private translate: TranslateService
private readonly router: Router,
private readonly route: ActivatedRoute,
private readonly user: UserService,
private readonly location: Location,
private readonly productApi: ProductsAPIService,
private readonly imageApi: ImagesInternalAPIService,
private readonly msgService: PortalMessageService,
private readonly translate: TranslateService
) {
this.dateFormat = this.user.lang$.getValue() === 'de' ? 'dd.MM.yyyy HH:mm:ss' : 'medium'
this.productName = this.route.snapshot.paramMap.get('name') || ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class ProductInternComponent implements OnChanges {
public operator = false
public undeployed = false

constructor(private translate: TranslateService) {}
constructor(private readonly translate: TranslateService) {}

public ngOnChanges(): void {
if (this.product) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ export class ProductPropertyComponent implements OnChanges, OnInit {
public convertToUniqueStringArray = convertToUniqueStringArray

constructor(
private icon: IconService,
private elements: ElementRef,
private productApi: ProductsAPIService,
private imageApi: ImagesInternalAPIService,
private msgService: PortalMessageService
private readonly icon: IconService,
private readonly elements: ElementRef,
private readonly productApi: ProductsAPIService,
private readonly imageApi: ImagesInternalAPIService,
private readonly msgService: PortalMessageService
) {
this.formGroup = new FormGroup<ProductDetailForm>({
id: new FormControl(null),
Expand Down
10 changes: 5 additions & 5 deletions src/app/product-store/product-search/product-search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ export class ProductSearchComponent implements OnInit {
@ViewChild(DataView) dv: DataView | undefined

constructor(
private route: ActivatedRoute,
private router: Router,
private productApi: ProductsAPIService,
private translate: TranslateService,
private imageApi: ImagesInternalAPIService
private readonly route: ActivatedRoute,
private readonly router: Router,
private readonly productApi: ProductsAPIService,
private readonly translate: TranslateService,
private readonly imageApi: ImagesInternalAPIService
) {
this.productSearchCriteriaGroup = new FormGroup<ProductSearchCriteria>({
displayName: new FormControl<string | null>(null),
Expand Down
6 changes: 3 additions & 3 deletions src/app/product-store/slot-delete/slot-delete.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export class SlotDeleteComponent {
@Output() slotDeleted = new EventEmitter<boolean>()

constructor(
private slotApi: SlotsAPIService,
private msgService: PortalMessageService,
private translate: TranslateService
private readonly slotApi: SlotsAPIService,
private readonly msgService: PortalMessageService,
private readonly translate: TranslateService
) {}

public onDialogHide(): void {
Expand Down
10 changes: 5 additions & 5 deletions src/app/product-store/slot-search/slot-search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ export class SlotSearchComponent implements OnInit {
@ViewChild(DataView) dv: DataView | undefined

constructor(
private route: ActivatedRoute,
private router: Router,
private user: UserService,
private slotApi: SlotsAPIService,
private translate: TranslateService
private readonly route: ActivatedRoute,
private readonly router: Router,
private readonly user: UserService,
private readonly slotApi: SlotsAPIService,
private readonly translate: TranslateService
) {
this.hasDeletePermission = this.user.hasPermission('SLOT#DELETE')
this.slotSearchCriteriaGroup = new FormGroup<SlotSearchCriteria>({
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function convertToUniqueStringArray(unsorted: string | undefined | null):
unsorted
.toString()
.split(',')
.map((a) => ar?.push(a.trim()))
.forEach((a) => ar?.push(a.trim()))
return ar.sort(sortByLocale)
}

Expand Down

0 comments on commit 1df8cba

Please sign in to comment.