Skip to content

Commit

Permalink
Bump libs, fix code smells (#392)
Browse files Browse the repository at this point in the history
* fix: bump libs, fix rc app config test issue

* fix: mark svcs in constructors as readonly

* fix: other code smells

---------

Co-authored-by: Christian Badura <[email protected]>
  • Loading branch information
cbadura and Christian Badura authored Oct 18, 2024
1 parent f8aa4e8 commit b1c6e1f
Show file tree
Hide file tree
Showing 24 changed files with 197 additions and 192 deletions.
90 changes: 45 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@
"@ngrx/router-store": "^18.0.1",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"@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",
"@onecx/accelerator": "5.19.2",
"@onecx/angular-accelerator": "5.19.2",
"@onecx/angular-auth": "5.19.2",
"@onecx/angular-integration-interface": "5.19.2",
"@onecx/angular-remote-components": "5.19.2",
"@onecx/angular-testing": "5.19.2",
"@onecx/angular-webcomponents": "5.19.2",
"@onecx/integration-interface": "5.19.2",
"@onecx/keycloak-auth": "5.19.2",
"@onecx/portal-integration-angular": "5.19.2",
"@onecx/portal-layout-styles": "5.19.2",
"@webcomponents/webcomponentsjs": "^2.8.0",
"file-saver": "^2.0.5",
"keycloak-angular": "^16.0.1",
Expand Down
12 changes: 6 additions & 6 deletions src/app/remotes/footer-menu/footer-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ export class OneCXFooterMenuComponent implements OnInit, ocxRemoteComponent, ocx
menuItems$: Observable<MenuItem[]> | undefined

constructor(
@Inject(BASE_URL) private baseUrl: ReplaySubject<string>,
private userService: UserService,
private translateService: TranslateService,
private appStateService: AppStateService,
private menuItemApiService: MenuItemAPIService,
private menuItemService: MenuItemService
@Inject(BASE_URL) private readonly baseUrl: ReplaySubject<string>,
private readonly userService: UserService,
private readonly translateService: TranslateService,
private readonly appStateService: AppStateService,
private readonly menuItemApiService: MenuItemAPIService,
private readonly menuItemService: MenuItemService
) {
this.userService.lang$.subscribe((lang) => this.translateService.use(lang))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ export class OneCXHorizontalMainMenuComponent implements OnInit, ocxRemoteCompon
menuItems$: Observable<MenuItem[]> | undefined

constructor(
@Inject(BASE_URL) private baseUrl: ReplaySubject<string>,
private userService: UserService,
private translateService: TranslateService,
private appStateService: AppStateService,
private menuItemApiService: MenuItemAPIService,
private menuItemService: MenuItemService
@Inject(BASE_URL) private readonly baseUrl: ReplaySubject<string>,
private readonly userService: UserService,
private readonly translateService: TranslateService,
private readonly appStateService: AppStateService,
private readonly menuItemApiService: MenuItemAPIService,
private readonly menuItemService: MenuItemService
) {
this.userService.lang$.subscribe((lang) => this.translateService.use(lang))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ import { NgModule, Renderer2 } from '@angular/core'
import { CommonModule } from '@angular/common'
import { provideRouter, Router, RouterModule } from '@angular/router'
import { NoopAnimationsModule } from '@angular/platform-browser/animations'
import { BASE_URL, RemoteComponentConfig, SlotService } from '@onecx/angular-remote-components'
import { AppStateService, UserService } from '@onecx/angular-integration-interface'
import { AppConfigService, IfPermissionDirective } from '@onecx/angular-accelerator'
import { TranslateTestingModule } from 'ngx-translate-testing'
import { ReplaySubject, of, throwError } from 'rxjs'
import { MenuModule } from 'primeng/menu'
import { AvatarModule } from 'primeng/avatar'
import { RippleModule } from 'primeng/ripple'
import { TooltipModule } from 'primeng/tooltip'
import { PrimeIcons } from 'primeng/api'

import { BASE_URL, RemoteComponentConfig, SlotService } from '@onecx/angular-remote-components'
import { AppStateService, UserService } from '@onecx/angular-integration-interface'
import { IfPermissionDirective } from '@onecx/angular-accelerator'
import { AppConfigService } from '@onecx/portal-integration-angular'
import { MenuItemAPIService } from 'src/app/shared/generated'
import { OneCXUserAvatarMenuComponent, slotInitializer } from './user-avatar-menu.component'
import { OneCXUserAvatarMenuHarness } from './user-avatar-menu.harness'
Expand Down
16 changes: 8 additions & 8 deletions src/app/remotes/user-avatar-menu/user-avatar-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ export class OneCXUserAvatarMenuComponent
menuAnchorPosition: MenuAnchorPositionConfig = 'right'

constructor(
private renderer: Renderer2,
private userService: UserService,
private menuItemApiService: MenuItemAPIService,
private appStateService: AppStateService,
private appConfigService: AppConfigService,
@Inject(BASE_URL) private baseUrl: ReplaySubject<string>,
private translateService: TranslateService,
private menuItemService: MenuItemService
private readonly renderer: Renderer2,
private readonly userService: UserService,
private readonly menuItemApiService: MenuItemAPIService,
private readonly appStateService: AppStateService,
private readonly appConfigService: AppConfigService,
@Inject(BASE_URL) private readonly baseUrl: ReplaySubject<string>,
private readonly translateService: TranslateService,
private readonly menuItemService: MenuItemService
) {
this.userService.lang$.subscribe((lang) => this.translateService.use(lang))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { NO_ERRORS_SCHEMA } from '@angular/core'
import { TestBed } from '@angular/core/testing'
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'
import { provideHttpClient } from '@angular/common/http'
Expand All @@ -6,19 +7,19 @@ import { CommonModule } from '@angular/common'
import { provideRouter, Router, RouterModule } from '@angular/router'
import { NoopAnimationsModule } from '@angular/platform-browser/animations'
import { TranslateService } from '@ngx-translate/core'
import { BASE_URL, RemoteComponentConfig, SlotService } from '@onecx/angular-remote-components'
import { AppStateService, UserService } from '@onecx/angular-integration-interface'
import { TranslateTestingModule } from 'ngx-translate-testing'
import { ReplaySubject, of, throwError } from 'rxjs'
import { PanelMenuModule } from 'primeng/panelmenu'
import { AccordionModule } from 'primeng/accordion'
import { PrimeIcons } from 'primeng/api'

import { MenuItemAPIService } from 'src/app/shared/generated'
import { BASE_URL, RemoteComponentConfig, SlotService } from '@onecx/angular-remote-components'
import { AppStateService, UserService } from '@onecx/angular-integration-interface'
import { OneCXUserSidebarMenuComponent, slotInitializer } from './user-sidebar-menu.component'
import { OneCXUserSidebarMenuHarness } from './user-sidebar-menu.harness'
import { NO_ERRORS_SCHEMA } from '@angular/core'
import { UserProfile } from '@onecx/integration-interface'
import { AppConfigService } from '@onecx/angular-accelerator'
import { AppConfigService } from '@onecx/portal-integration-angular'

describe('OneCXUserSidebarMenuComponent', () => {
const menuItemApiSpy = jasmine.createSpyObj<MenuItemAPIService>('MenuItemAPIService', ['getMenuItems'])
Expand Down
14 changes: 7 additions & 7 deletions src/app/remotes/user-sidebar-menu/user-sidebar-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ export class OneCXUserSidebarMenuComponent implements ocxRemoteComponent, ocxRem
inlineProfileActive = false

constructor(
@Inject(BASE_URL) private baseUrl: ReplaySubject<string>,
private translateService: TranslateService,
private appConfigService: AppConfigService,
private appStateService: AppStateService,
private menuItemApiService: MenuItemAPIService,
private userService: UserService,
private menuItemService: MenuItemService
@Inject(BASE_URL) private readonly baseUrl: ReplaySubject<string>,
private readonly translateService: TranslateService,
private readonly appConfigService: AppConfigService,
private readonly appStateService: AppStateService,
private readonly menuItemApiService: MenuItemAPIService,
private readonly userService: UserService,
private readonly menuItemService: MenuItemService
) {
this.userService.lang$.subscribe((lang) => this.translateService.use(lang))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ export class OneCXVerticalMainMenuComponent implements ocxRemoteComponent, ocxRe
menuItems$: Observable<MenuItem[]> | undefined

constructor(
@Inject(BASE_URL) private baseUrl: ReplaySubject<string>,
private userService: UserService,
private translateService: TranslateService,
private appStateService: AppStateService,
private menuItemApiService: MenuItemAPIService,
private menuItemService: MenuItemService
@Inject(BASE_URL) private readonly baseUrl: ReplaySubject<string>,
private readonly userService: UserService,
private readonly translateService: TranslateService,
private readonly appStateService: AppStateService,
private readonly menuItemApiService: MenuItemAPIService,
private readonly menuItemService: MenuItemService
) {
this.userService.lang$.subscribe((lang) => this.translateService.use(lang))
}
Expand Down
12 changes: 6 additions & 6 deletions src/app/workspace/workspace-create/workspace-create.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export class WorkspaceCreateComponent implements OnInit {
public mfeRList: string[] = []

constructor(
private router: Router,
private route: ActivatedRoute,
private workspaceApi: WorkspaceAPIService,
private message: PortalMessageService,
private translate: TranslateService,
private productApi: ProductAPIService
private readonly router: Router,
private readonly route: ActivatedRoute,
private readonly workspaceApi: WorkspaceAPIService,
private readonly message: PortalMessageService,
private readonly translate: TranslateService,
private readonly productApi: ProductAPIService
) {
this.formGroup = new FormGroup({
name: new FormControl(null, [Validators.required, Validators.minLength(2), Validators.maxLength(50)]),
Expand Down
Loading

0 comments on commit b1c6e1f

Please sign in to comment.