From 5463a475c4bfbf5a95b305ca3311984fbc86c39a Mon Sep 17 00:00:00 2001 From: Henry Taeschner Date: Fri, 25 Oct 2024 09:44:32 +0200 Subject: [PATCH] fix: adjust app setup --- src/{_am_mixins.scss => app/_am-mixins.scss} | 20 ++++---- .../announcement-detail.component.html | 5 +- .../announcement-detail.component.scss | 2 +- .../announcement-criteria.component.scss | 2 +- .../announcement-search.component.html | 12 ++--- .../announcement-search.component.scss | 2 +- src/app/announcement/announcement.module.ts | 14 +++--- src/app/app.module.ts | 30 ++++++------ src/app/onecx-announcement-remote.module.ts | 34 +++++++------- ...announcement-banner.component.bootstrap.ts | 19 ++++++-- .../announcement-banner.component.ts | 46 +++++++++++++------ ...ncement-list-active.component.bootstrap.ts | 9 ++-- src/app/shared/shared.module.ts | 12 +++-- tsconfig.app.json | 2 +- webpack.config.js | 9 ++-- 15 files changed, 125 insertions(+), 93 deletions(-) rename src/{_am_mixins.scss => app/_am-mixins.scss} (96%) diff --git a/src/_am_mixins.scss b/src/app/_am-mixins.scss similarity index 96% rename from src/_am_mixins.scss rename to src/app/_am-mixins.scss index f38067f..bceda47 100644 --- a/src/_am_mixins.scss +++ b/src/app/_am-mixins.scss @@ -160,8 +160,8 @@ .p-autocomplete-panel .p-autocomplete-items .p-autocomplete-item { padding-top: 0.4rem; padding-bottom: 0.4rem; - &:nth-child(odd) { - background-color: #f8f9fa; + &:nth-child(even) { + background-color: var(--table-body-row-even-bg); } } .p-autocomplete-clear-icon { @@ -358,24 +358,24 @@ @mixin dataview-list-zebra-rows { :host ::ng-deep { .p-dataview-list .p-dataview-content .p-grid > div { - &:nth-child(odd) { - background-color: #f8f9fa; + &:nth-child(even) { + background-color: var(--table-body-row-even-bg); } } } } @mixin dropdown-zebra-rows { :host ::ng-deep { - .p-dropdown-panel .p-dropdown-items *:nth-child(odd) .p-dropdown-item { - background-color: #f8f9fa; + .p-dropdown-panel .p-dropdown-items *:nth-child(even) .p-dropdown-item { + background-color: var(--table-body-row-even-bg); } } } @mixin listbox-zebra-rows { :host ::ng-deep { .p-listbox:not(.p-disabled) .p-listbox-item:not(.p-highlight):not(.p-disabled) { - &:nth-child(odd) { - background-color: #f8f9fa; + &:nth-child(even) { + background-color: var(--table-body-row-even-bg); } } } @@ -383,8 +383,8 @@ @mixin picklist-zebra-rows { :host ::ng-deep { .p-picklist-list li { - &:nth-child(odd) { - background-color: #f8f9fa; + &:nth-child(even) { + background-color: var(--table-body-row-even-bg); } } } diff --git a/src/app/announcement/announcement-detail/announcement-detail.component.html b/src/app/announcement/announcement-detail/announcement-detail.component.html index 391b80b..5fb386f 100644 --- a/src/app/announcement/announcement-detail/announcement-detail.component.html +++ b/src/app/announcement/announcement-detail/announcement-detail.component.html @@ -49,6 +49,7 @@ rows="3" [autoResize]="true" appendTo="body" + [ariaLabel]="'ANNOUNCEMENT.TOOLTIPS.CONTENT' | translate" [pTooltip]="'ANNOUNCEMENT.TOOLTIPS.CONTENT' | translate" tooltipPosition="top" tooltipEvent="hover" @@ -67,7 +68,7 @@ [autoDisplayFirst]="true" [appendTo]="'body'" formControlName="workspaceName" - [aria-label]="'ANNOUNCEMENT.WORKSPACE' | translate" + [ariaLabel]="'ANNOUNCEMENT.WORKSPACE' | translate" [pTooltip]="'ANNOUNCEMENT.TOOLTIPS.WORKSPACE' | translate" tooltipPosition="top" tooltipEvent="hover" @@ -87,7 +88,7 @@ [autoDisplayFirst]="true" [appendTo]="'body'" formControlName="productName" - [aria-label]="'ANNOUNCEMENT.APPLICATION' | translate" + [ariaLabel]="'ANNOUNCEMENT.APPLICATION' | translate" [pTooltip]="'ANNOUNCEMENT.TOOLTIPS.APPLICATION' | translate" tooltipPosition="top" tooltipEvent="hover" diff --git a/src/app/announcement/announcement-detail/announcement-detail.component.scss b/src/app/announcement/announcement-detail/announcement-detail.component.scss index 9b6ea23..31da4dd 100644 --- a/src/app/announcement/announcement-detail/announcement-detail.component.scss +++ b/src/app/announcement/announcement-detail/announcement-detail.component.scss @@ -1,4 +1,4 @@ -@import '/src/_am_mixins.scss'; +@import '/src/app/_am-mixins.scss'; @include correct-select-button; @include dialog-footer-buttons; diff --git a/src/app/announcement/announcement-search/announcement-criteria/announcement-criteria.component.scss b/src/app/announcement/announcement-search/announcement-criteria/announcement-criteria.component.scss index fc1d0f0..ea163f8 100644 --- a/src/app/announcement/announcement-search/announcement-criteria/announcement-criteria.component.scss +++ b/src/app/announcement/announcement-search/announcement-criteria/announcement-criteria.component.scss @@ -1,3 +1,3 @@ -@import '/src/_am_mixins.scss'; +@import '/src/app/_am-mixins.scss'; @include correct-search-criteria; diff --git a/src/app/announcement/announcement-search/announcement-search.component.html b/src/app/announcement/announcement-search/announcement-search.component.html index 0e7eb1b..c49cb1e 100644 --- a/src/app/announcement/announcement-search/announcement-search.component.html +++ b/src/app/announcement/announcement-search/announcement-search.component.html @@ -81,7 +81,7 @@ class="p-button-rounded font-medium p-button-text p-button p-component p-button-icon-only" [id]="'am_announcement_search_table_row_' + row + '_view_action'" (click)="onDetail($event, rowData, 'VIEW')" - [aria-label]="'ACTIONS.VIEW' | translate" + [ariaLabel]="'ACTIONS.VIEW' | translate" [pTooltip]="'ACTIONS.VIEW' | translate" tooltipPosition="top" tooltipEvent="hover" @@ -95,7 +95,7 @@ class="p-button-rounded font-medium p-button-text p-button p-component p-button-icon-only" [id]="'am_announcement_search_table_row_' + row + '_edit_action'" (click)="onDetail($event, rowData, 'EDIT')" - [aria-label]="'ACTIONS.EDIT.LABEL' | translate" + [ariaLabel]="'ACTIONS.EDIT.LABEL' | translate" [pTooltip]="'ACTIONS.EDIT.ANNOUNCEMENT.TOOLTIP' | translate" tooltipPosition="top" tooltipEvent="hover" @@ -109,7 +109,7 @@ class="p-button-rounded font-medium p-button-text p-button p-component p-button-icon-only" [id]="'am_announcement_search_table_row_' + row + '_copy_action'" (click)="onCopy($event, rowData)" - [aria-label]="'ACTIONS.COPY.LABEL' | translate" + [ariaLabel]="'ACTIONS.COPY.LABEL' | translate" [pTooltip]="'ACTIONS.COPY.ANNOUNCEMENT.TOOLTIP' | translate" tooltipPosition="top" tooltipEvent="hover" @@ -123,7 +123,7 @@ class="p-button-rounded font-medium p-button-text p-button p-component p-button-icon-only" [id]="'am_announcement_search_table_row_' + row + '_delete_action'" (click)="onDelete($event, rowData)" - [aria-label]="'ACTIONS.DELETE.LABEL' | translate" + [ariaLabel]="'ACTIONS.DELETE.LABEL' | translate" [pTooltip]="'ACTIONS.DELETE.ANNOUNCEMENT.TOOLTIP' | translate" tooltipPosition="top" tooltipEvent="hover" @@ -147,7 +147,7 @@ [class.text-red-600]="rowData['priority'] === 'IMPORTANT'" [class.text-yellow-600]="rowData['priority'] === 'NORMAL'" [class.text-blue-600]="rowData['priority'] === 'LOW'" - [aria-label]="'ENUMS.ANNOUNCEMENT_STATUS.' + rowData[col.field] | translate" + [attr.aria-label]="'ENUMS.ANNOUNCEMENT_STATUS.' + rowData[col.field] | translate" [pTooltip]=" ('ENUMS.ANNOUNCEMENT_STATUS.' + rowData[col.field] | translate) + ' - ' + @@ -163,7 +163,7 @@ [class.pi-info-circle]="rowData[col.field] === 'INFO'" [class.pi-calendar]="rowData[col.field] === 'EVENT'" [class.pi-wrench]="rowData[col.field] === 'SYSTEM_MAINTENANCE'" - [aria-label]="'ENUMS.ANNOUNCEMENT_TYPE.' + rowData[col.field] | translate" + [attr.aria-label]="'ENUMS.ANNOUNCEMENT_TYPE.' + rowData[col.field] | translate" [pTooltip]="'ENUMS.ANNOUNCEMENT_TYPE.' + rowData[col.field] | translate" tooltipPosition="top" tooltipEvent="hover" diff --git a/src/app/announcement/announcement-search/announcement-search.component.scss b/src/app/announcement/announcement-search/announcement-search.component.scss index e883aee..71f8081 100644 --- a/src/app/announcement/announcement-search/announcement-search.component.scss +++ b/src/app/announcement/announcement-search/announcement-search.component.scss @@ -1,4 +1,4 @@ -@import '/src/_am_mixins.scss'; +@import '/src/app/_am-mixins.scss'; @include danger-action; @include table-inline-buttons; diff --git a/src/app/announcement/announcement.module.ts b/src/app/announcement/announcement.module.ts index 35acc3b..d411f6b 100644 --- a/src/app/announcement/announcement.module.ts +++ b/src/app/announcement/announcement.module.ts @@ -1,11 +1,12 @@ -import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, NgModule } from '@angular/core' +import { NgModule } from '@angular/core' import { CommonModule } from '@angular/common' import { FormsModule } from '@angular/forms' import { RouterModule, Routes } from '@angular/router' import { PortalCoreModule } from '@onecx/portal-integration-angular' -import { InitializeModuleGuard, addInitializeModuleGuard } from '@onecx/angular-integration-interface' -import { SharedModule } from '../shared/shared.module' +import { addInitializeModuleGuard, InitializeModuleGuard } from '@onecx/angular-integration-interface' +import { SharedModule } from 'src/app/shared/shared.module' + import { AnnouncementSearchComponent } from './announcement-search/announcement-search.component' import { AnnouncementCriteriaComponent } from './announcement-search/announcement-criteria/announcement-criteria.component' import { AnnouncementDetailComponent } from './announcement-detail/announcement-detail.component' @@ -19,10 +20,10 @@ const routes: Routes = [ }, { path: 'list-active', - component: OneCXAnnouncementListActiveComponent, - pathMatch: 'full' + component: OneCXAnnouncementListActiveComponent } ] + @NgModule({ declarations: [AnnouncementSearchComponent, AnnouncementDetailComponent, AnnouncementCriteriaComponent], imports: [ @@ -32,8 +33,7 @@ const routes: Routes = [ [RouterModule.forChild(addInitializeModuleGuard(routes))], SharedModule ], - providers: [InitializeModuleGuard], - schemas: [NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA] + providers: [InitializeModuleGuard] }) export class AnnouncementModule { constructor() { diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 2f3387b..c7b034a 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,18 +1,15 @@ -import { APP_INITIALIZER, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, NgModule } from '@angular/core' +import { APP_INITIALIZER, NgModule } from '@angular/core' import { CommonModule } from '@angular/common' -import { HttpClient, HttpClientModule } from '@angular/common/http' +import { HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' import { RouterModule, Routes } from '@angular/router' +import { BrowserModule } from '@angular/platform-browser' +import { BrowserAnimationsModule } from '@angular/platform-browser/animations' import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core' -import { - APP_CONFIG, - AppStateService, - createTranslateLoader, - translateServiceInitializer, - PortalCoreModule, - UserService -} from '@onecx/portal-integration-angular' import { KeycloakAuthModule } from '@onecx/keycloak-auth' +import { createTranslateLoader } from '@onecx/angular-accelerator' +import { APP_CONFIG, AppStateService, UserService } from '@onecx/angular-integration-interface' +import { translateServiceInitializer, PortalCoreModule } from '@onecx/portal-integration-angular' import { environment } from 'src/environments/environment' import { AppComponent } from './app.component' @@ -28,13 +25,14 @@ const routes: Routes = [ declarations: [AppComponent], imports: [ CommonModule, + BrowserModule, + BrowserAnimationsModule, KeycloakAuthModule, - HttpClientModule, + PortalCoreModule.forRoot('onecx-announcement-ui'), RouterModule.forRoot(routes, { initialNavigation: 'enabledBlocking', enableTracing: true }), - PortalCoreModule.forRoot('onecx-announcement-ui'), TranslateModule.forRoot({ isolate: true, loader: { @@ -51,12 +49,12 @@ const routes: Routes = [ useFactory: translateServiceInitializer, multi: true, deps: [UserService, TranslateService] - } - ], - schemas: [NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA] + }, + provideHttpClient(withInterceptorsFromDi()) + ] }) export class AppModule { constructor() { - console.info('App Module constructor') + console.info('OneCX Announcement Module constructor') } } diff --git a/src/app/onecx-announcement-remote.module.ts b/src/app/onecx-announcement-remote.module.ts index 9410a04..c5523ae 100644 --- a/src/app/onecx-announcement-remote.module.ts +++ b/src/app/onecx-announcement-remote.module.ts @@ -1,23 +1,23 @@ -import { HttpClient, HttpClientModule } from '@angular/common/http' import { APP_INITIALIZER, DoBootstrap, Injector, NgModule } from '@angular/core' -import { Router, RouterModule, Routes } from '@angular/router' +import { HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' +import { RouterModule, Routes, Router } from '@angular/router' import { BrowserModule } from '@angular/platform-browser' import { BrowserAnimationsModule } from '@angular/platform-browser/animations' -import { MissingTranslationHandler, TranslateLoader, TranslateModule } from '@ngx-translate/core' +import { TranslateLoader, TranslateModule, MissingTranslationHandler } from '@ngx-translate/core' + +import { AngularAuthModule } from '@onecx/angular-auth' +import { createTranslateLoader } from '@onecx/angular-accelerator' +import { createAppEntrypoint, initializeRouter, startsWith } from '@onecx/angular-webcomponents' +import { addInitializeModuleGuard, AppStateService, ConfigurationService } from '@onecx/angular-integration-interface' import { - AppStateService, - ConfigurationService, - createTranslateLoader, PortalApiConfiguration, PortalCoreModule, PortalMissingTranslationHandler } from '@onecx/portal-integration-angular' -import { addInitializeModuleGuard } from '@onecx/angular-integration-interface' -import { createAppEntrypoint, initializeRouter, startsWith } from '@onecx/angular-webcomponents' -import { AngularAuthModule } from '@onecx/angular-auth' -import { AppEntrypointComponent } from './app-entrypoint.component' + import { Configuration } from './shared/generated' import { environment } from 'src/environments/environment' +import { AppEntrypointComponent } from './app-entrypoint.component' function apiConfigProvider(configService: ConfigurationService, appStateService: AppStateService) { return new PortalApiConfiguration(Configuration, environment.apiPrefix, configService, appStateService) @@ -33,11 +33,11 @@ const routes: Routes = [ @NgModule({ declarations: [AppEntrypointComponent], imports: [ + AngularAuthModule, BrowserModule, - HttpClientModule, BrowserAnimationsModule, - RouterModule.forRoot(addInitializeModuleGuard(routes)), PortalCoreModule.forMicroFrontend(), + RouterModule.forRoot(addInitializeModuleGuard(routes)), TranslateModule.forRoot({ isolate: true, loader: { @@ -46,21 +46,19 @@ const routes: Routes = [ deps: [HttpClient, AppStateService] }, missingTranslationHandler: { provide: MissingTranslationHandler, useClass: PortalMissingTranslationHandler } - }), - AngularAuthModule + }) ], - exports: [], providers: [ ConfigurationService, + { provide: Configuration, useFactory: apiConfigProvider, deps: [ConfigurationService, AppStateService] }, { provide: APP_INITIALIZER, useFactory: initializeRouter, multi: true, deps: [Router, AppStateService] }, - { provide: Configuration, useFactory: apiConfigProvider, deps: [ConfigurationService, AppStateService] } - ], - schemas: [] + provideHttpClient(withInterceptorsFromDi()) + ] }) export class OneCXAnnouncementModule implements DoBootstrap { constructor(private readonly injector: Injector) { diff --git a/src/app/remotes/announcement-banner/announcement-banner.component.bootstrap.ts b/src/app/remotes/announcement-banner/announcement-banner.component.bootstrap.ts index 4438eca..3639e5d 100644 --- a/src/app/remotes/announcement-banner/announcement-banner.component.bootstrap.ts +++ b/src/app/remotes/announcement-banner/announcement-banner.component.bootstrap.ts @@ -1,13 +1,24 @@ -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' import { importProvidersFrom } from '@angular/core' -import { OneCXAnnouncementBannerComponent } from './announcement-banner.component' -import { bootstrapRemoteComponent } from '@onecx/angular-webcomponents' +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' +import { BrowserModule } from '@angular/platform-browser' +import { BrowserAnimationsModule } from '@angular/platform-browser/animations' +import { provideRouter } from '@angular/router' + import { AngularAuthModule } from '@onecx/angular-auth' +import { bootstrapRemoteComponent } from '@onecx/angular-webcomponents' + import { environment } from 'src/environments/environment' +import { OneCXAnnouncementBannerComponent } from './announcement-banner.component' bootstrapRemoteComponent( OneCXAnnouncementBannerComponent, 'ocx-announcement-banner-component', environment.production, - [provideHttpClient(withInterceptorsFromDi()), importProvidersFrom(AngularAuthModule)] + [ + provideHttpClient(withInterceptorsFromDi()), + importProvidersFrom(AngularAuthModule), + importProvidersFrom(BrowserModule), + importProvidersFrom(BrowserAnimationsModule), + provideRouter([{ path: '**', children: [] }]) + ] ) diff --git a/src/app/remotes/announcement-banner/announcement-banner.component.ts b/src/app/remotes/announcement-banner/announcement-banner.component.ts index 3216a58..b3c2372 100644 --- a/src/app/remotes/announcement-banner/announcement-banner.component.ts +++ b/src/app/remotes/announcement-banner/announcement-banner.component.ts @@ -11,12 +11,19 @@ import { AppStateService } from '@onecx/angular-integration-interface' import { AngularRemoteComponentsModule, BASE_URL, - RemoteComponentConfig, ocxRemoteComponent, ocxRemoteWebcomponent, - provideTranslateServiceForRoot + provideTranslateServiceForRoot, + RemoteComponentConfig, + SLOT_SERVICE, + SlotService } from '@onecx/angular-remote-components' -import { AppConfigService, UserService, createRemoteComponentTranslateLoader } from '@onecx/portal-integration-angular' +import { + AppConfigService, + PortalCoreModule, + UserService, + createRemoteComponentTranslateLoader +} from '@onecx/portal-integration-angular' import { Announcement, AnnouncementAbstract, @@ -26,17 +33,24 @@ import { import { SharedModule } from 'src/app/shared/shared.module' import { environment } from 'src/environments/environment' +export function slotInitializer(slotService: SlotService) { + return () => slotService.init() +} + @Component({ selector: 'app-announcement-banner', + templateUrl: './announcement-banner.component.html', + styleUrls: ['./announcement-banner.component.scss'], standalone: true, imports: [ AngularRemoteComponentsModule, + CarouselModule, CommonModule, - TranslateModule, + PortalCoreModule, SharedModule, - CarouselModule, TagModule, - TooltipModule + TooltipModule, + TranslateModule ], providers: [ { @@ -50,10 +64,12 @@ import { environment } from 'src/environments/environment' useFactory: createRemoteComponentTranslateLoader, deps: [HttpClient, BASE_URL] } - }) - ], - templateUrl: './announcement-banner.component.html', - styleUrls: ['./announcement-banner.component.scss'] + }), + { + provide: SLOT_SERVICE, + useExisting: SlotService + } + ] }) export class OneCXAnnouncementBannerComponent implements ocxRemoteComponent, ocxRemoteWebcomponent { @Input() set ocxRemoteComponentConfig(config: RemoteComponentConfig) { @@ -66,11 +82,11 @@ export class OneCXAnnouncementBannerComponent implements ocxRemoteComponent, ocx constructor( @Inject(BASE_URL) private readonly baseUrl: ReplaySubject, - private readonly translateService: TranslateService, - private readonly apiV1: AnnouncementInternalAPIService, + private readonly appConfigService: AppConfigService, private readonly appStateService: AppStateService, + private readonly translateService: TranslateService, private readonly userService: UserService, - private readonly appConfigService: AppConfigService + private readonly announcementApi: AnnouncementInternalAPIService ) { this.userService.lang$.subscribe((lang) => this.translateService.use(lang)) combineLatest([ @@ -82,7 +98,7 @@ export class OneCXAnnouncementBannerComponent implements ocxRemoteComponent, ocx mergeMap(([_, currentWorkspace, currentMfe]) => { return currentMfe.productName === 'onecx-welcome' ? of([]) // exclude onecx-welcome - : this.apiV1 + : this.announcementApi .searchAnnouncementBanners({ announcementBannerSearchCriteria: { workspaceName: currentWorkspace.workspaceName, @@ -117,7 +133,7 @@ export class OneCXAnnouncementBannerComponent implements ocxRemoteComponent, ocx } ocxInitRemoteComponent(config: RemoteComponentConfig): void { - this.apiV1.configuration = new Configuration({ + this.announcementApi.configuration = new Configuration({ basePath: Location.joinWithSlash(config.baseUrl, environment.apiPrefix) }) this.baseUrl.next(config.baseUrl) diff --git a/src/app/remotes/announcement-list-active/announcement-list-active.component.bootstrap.ts b/src/app/remotes/announcement-list-active/announcement-list-active.component.bootstrap.ts index 27869b6..a23cf07 100644 --- a/src/app/remotes/announcement-list-active/announcement-list-active.component.bootstrap.ts +++ b/src/app/remotes/announcement-list-active/announcement-list-active.component.bootstrap.ts @@ -1,13 +1,15 @@ import { importProvidersFrom } from '@angular/core' import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' +import { BrowserModule } from '@angular/platform-browser' import { BrowserAnimationsModule } from '@angular/platform-browser/animations' +import { provideRouter } from '@angular/router' -import { bootstrapRemoteComponent } from '@onecx/angular-webcomponents' import { AngularAuthModule } from '@onecx/angular-auth' +import { bootstrapRemoteComponent } from '@onecx/angular-webcomponents' import { environment } from 'src/environments/environment' + import { OneCXAnnouncementListActiveComponent } from './announcement-list-active.component' -import { BrowserModule } from '@angular/platform-browser' bootstrapRemoteComponent( OneCXAnnouncementListActiveComponent, @@ -17,6 +19,7 @@ bootstrapRemoteComponent( provideHttpClient(withInterceptorsFromDi()), importProvidersFrom(AngularAuthModule), importProvidersFrom(BrowserModule), - importProvidersFrom(BrowserAnimationsModule) + importProvidersFrom(BrowserAnimationsModule), + provideRouter([{ path: '**', children: [] }]) ] ) diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 289a8c0..cd1b2c5 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -1,4 +1,4 @@ -import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, NgModule } from '@angular/core' +import { NgModule } from '@angular/core' import { CommonModule } from '@angular/common' import { FormsModule, ReactiveFormsModule } from '@angular/forms' import { TranslateModule, TranslateService } from '@ngx-translate/core' @@ -11,6 +11,7 @@ import { ConfirmPopupModule } from 'primeng/confirmpopup' import { ConfirmationService } from 'primeng/api' import { DataViewModule } from 'primeng/dataview' import { DialogModule } from 'primeng/dialog' +import { DialogService, DynamicDialogModule } from 'primeng/dynamicdialog' import { DropdownModule } from 'primeng/dropdown' import { InputTextModule } from 'primeng/inputtext' import { InputTextareaModule } from 'primeng/inputtextarea' @@ -22,11 +23,14 @@ import { SelectButtonModule } from 'primeng/selectbutton' import { TableModule } from 'primeng/table' import { ToastModule } from 'primeng/toast' +import { PortalCoreModule, PortalDialogService } from '@onecx/portal-integration-angular' + import { LabelResolver } from './label.resolver' @NgModule({ declarations: [], imports: [ + PortalCoreModule.forMicroFrontend(), AutoCompleteModule, CalendarModule, CommonModule, @@ -35,6 +39,7 @@ import { LabelResolver } from './label.resolver' DataViewModule, DialogModule, DropdownModule, + DynamicDialogModule, FormsModule, InputTextModule, InputTextareaModule, @@ -57,6 +62,7 @@ import { LabelResolver } from './label.resolver' DataViewModule, DialogModule, DropdownModule, + DynamicDialogModule, FormsModule, InputTextModule, InputTextareaModule, @@ -74,6 +80,7 @@ import { LabelResolver } from './label.resolver' providers: [ ConfirmationService, LabelResolver, + { provide: DialogService, useClass: PortalDialogService }, provideErrorTailorConfig({ controlErrorsOn: { async: true, blur: true, change: true }, errors: { @@ -96,7 +103,6 @@ import { LabelResolver } from './label.resolver' ) } }) - ], - schemas: [NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA] + ] }) export class SharedModule {} diff --git a/tsconfig.app.json b/tsconfig.app.json index 82d03b9..3db7974 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -15,5 +15,5 @@ "src/app/remotes/announcement-list-active/announcement-list-active.component.main.ts" ], "include": ["src/**/*.ts"], - "exclude": ["src/test.ts", "src/**/*.spec.ts"] + "exclude": ["src/test.ts", "src/**/*.spec.ts", "src/environments/environment.prod.ts"] } diff --git a/webpack.config.js b/webpack.config.js index 9c6d9fe..f2067a7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -12,15 +12,14 @@ const config = withModuleFederationPlugin({ }, shared: share({ '@angular/core': { requiredVersion: 'auto', includeSecondaries: true }, - '@angular/common/http': { requiredVersion: 'auto', includeSecondaries: true }, '@angular/common': { requiredVersion: 'auto', includeSecondaries: { skip: ['@angular/common/http/testing'] } }, - '@angular/elements': { requiredVersion: 'auto', includeSecondaries: true }, + '@angular/common/http': { requiredVersion: 'auto', includeSecondaries: true }, '@angular/forms': { requiredVersion: 'auto', includeSecondaries: true }, - '@angular/router': { requiredVersion: 'auto', includeSecondaries: true }, '@angular/platform-browser': { requiredVersion: 'auto', includeSecondaries: true }, - rxjs: { requiredVersion: 'auto', includeSecondaries: true }, - primeng: { requiredVersion: 'auto', includeSecondaries: true }, + '@angular/router': { requiredVersion: 'auto', includeSecondaries: true }, '@ngx-translate/core': { requiredVersion: 'auto' }, + primeng: { requiredVersion: 'auto', includeSecondaries: true }, + rxjs: { requiredVersion: 'auto', includeSecondaries: true }, '@onecx/accelerator': { requiredVersion: 'auto', includeSecondaries: true }, '@onecx/angular-accelerator': { requiredVersion: 'auto', includeSecondaries: true }, '@onecx/angular-auth': { requiredVersion: 'auto', includeSecondaries: true },