Skip to content

Commit

Permalink
feat: adjust to new translations and bootstraping (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
markuczy authored Jul 17, 2024
1 parent b275d55 commit b3b0ec3
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 80 deletions.
88 changes: 44 additions & 44 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": "^15.4.0",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"@onecx/accelerator": "^4.41.0",
"@onecx/angular-accelerator": "^4.41.0",
"@onecx/angular-integration-interface": "^4.41.0",
"@onecx/angular-remote-components": "^4.41.0",
"@onecx/angular-webcomponents": "^4.41.0",
"@onecx/angular-testing": "^4.41.0",
"@onecx/integration-interface": "^4.41.0",
"@onecx/keycloak-auth": "^4.41.0",
"@onecx/portal-integration-angular": "^4.41.0",
"@onecx/portal-layout-styles": "^4.41.0",
"@onecx/angular-auth": "^4.41.0",
"@onecx/accelerator": "^4.42.0",
"@onecx/angular-accelerator": "^4.42.0",
"@onecx/angular-integration-interface": "^4.42.0",
"@onecx/angular-remote-components": "^4.42.0",
"@onecx/angular-webcomponents": "^4.42.0",
"@onecx/angular-testing": "^4.42.0",
"@onecx/integration-interface": "^4.42.0",
"@onecx/keycloak-auth": "^4.42.0",
"@onecx/portal-integration-angular": "^4.42.0",
"@onecx/portal-layout-styles": "^4.42.0",
"@onecx/angular-auth": "^4.42.0",
"keycloak-angular": "^13.1.0",
"@webcomponents/webcomponentsjs": "^2.8.0",
"ngx-color": "^8.0.3",
Expand Down
17 changes: 4 additions & 13 deletions src/app/onecx-help-remote.module.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import { HttpClient, HttpClientModule } from '@angular/common/http'
import { BrowserModule } from '@angular/platform-browser'
import { APP_INITIALIZER, DoBootstrap, Injector, NgModule } from '@angular/core'
import { createCustomElement } from '@angular/elements'
import { Router, RouterModule, Routes } from '@angular/router'
import { MissingTranslationHandler, TranslateLoader, TranslateModule } from '@ngx-translate/core'

import {
AppStateService,
ConfigurationService,
createTranslateLoader,
MFE_ID,
PortalApiConfiguration,
PortalCoreModule,
PortalMissingTranslationHandler
} from '@onecx/portal-integration-angular'
import { addInitializeModuleGuard } from '@onecx/angular-integration-interface'
import { initializeRouter, startsWith } from '@onecx/angular-webcomponents'
import { createAppEntrypoint, initializeRouter, startsWith } from '@onecx/angular-webcomponents'
import { AppEntrypointComponent } from './app-entrypoint.component'
import { AngularAuthModule } from '@onecx/angular-auth'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
Expand Down Expand Up @@ -46,7 +44,7 @@ const routes: Routes = [
loader: {
provide: TranslateLoader,
useFactory: createTranslateLoader,
deps: [HttpClient, AppStateService, MFE_ID]
deps: [HttpClient, AppStateService]
},
missingTranslationHandler: { provide: MissingTranslationHandler, useClass: PortalMissingTranslationHandler }
})
Expand All @@ -60,11 +58,7 @@ const routes: Routes = [
multi: true,
deps: [Router, AppStateService]
},
{ provide: Configuration, useFactory: apiConfigProvider, deps: [ConfigurationService, AppStateService] },
{
provide: MFE_ID,
useValue: 'onecx-help'
}
{ provide: Configuration, useFactory: apiConfigProvider, deps: [ConfigurationService, AppStateService] }
],
schemas: []
})
Expand All @@ -74,9 +68,6 @@ export class OneCXHelpModule implements DoBootstrap {
}

ngDoBootstrap(): void {
const appEntrypoint = createCustomElement(AppEntrypointComponent, {
injector: this.injector
})
customElements.define('ocx-help-component', appEntrypoint)
createAppEntrypoint(AppEntrypointComponent, 'ocx-help-component', this.injector)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
PortalCoreModule,
PortalDialogService,
PortalMessageService,
REMOTE_COMPONENT_ID,
UserService,
createRemoteComponentTranslateLoader,
providePortalDialogService
Expand Down Expand Up @@ -58,16 +57,12 @@ import { HelpItemEditorDialogComponent } from './help-item-editor-dialog/help-it
provide: BASE_URL,
useValue: new ReplaySubject<string>(1)
},
{
provide: REMOTE_COMPONENT_ID,
useValue: 'ocx-help-item-editor-component'
},
provideTranslateServiceForRoot({
isolate: true,
loader: {
provide: TranslateLoader,
useFactory: createRemoteComponentTranslateLoader,
deps: [HttpClient, BASE_URL, REMOTE_COMPONENT_ID]
deps: [HttpClient, BASE_URL]
}
})
]
Expand Down
8 changes: 2 additions & 6 deletions src/app/remotes/show-help/show-help.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
ocxRemoteWebcomponent
} from '@onecx/angular-remote-components'
import { UserService, AppStateService } from '@onecx/angular-integration-interface'
import { REMOTE_COMPONENT_ID, createRemoteComponentTranslateLoader } from '@onecx/angular-accelerator'
import { createRemoteComponentTranslateLoader } from '@onecx/angular-accelerator'
import { PortalMessageService, PortalCoreModule } from '@onecx/portal-integration-angular'

import { Configuration, Help, HelpsInternalAPIService } from 'src/app/shared/generated'
Expand Down Expand Up @@ -53,16 +53,12 @@ import { NoHelpItemComponent } from './no-help-item/no-help-item.component'
provide: BASE_URL,
useValue: new ReplaySubject<string>(1)
},
{
provide: REMOTE_COMPONENT_ID,
useValue: 'ocx-show-help-component'
},
provideTranslateServiceForRoot({
isolate: true,
loader: {
provide: TranslateLoader,
useFactory: createRemoteComponentTranslateLoader,
deps: [HttpClient, BASE_URL, REMOTE_COMPONENT_ID]
deps: [HttpClient, BASE_URL]
}
})
]
Expand Down

0 comments on commit b3b0ec3

Please sign in to comment.