diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/error/error.component.html b/npm/ng-packs/packages/theme-shared/src/lib/components/error/error.component.html index 7121f06c7b..8801240bbf 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/error/error.component.html +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/error/error.component.html @@ -1,5 +1,5 @@
- diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/error/error.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/error/error.component.ts index cc64e5445b..70ddce726e 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/error/error.component.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/error/error.component.ts @@ -36,6 +36,8 @@ export class ErrorComponent implements AfterViewInit, OnDestroy { destroy$: Subject; + hideCloseIcon = false; + @ViewChild('container', { static: false }) containerRef: ElementRef; diff --git a/npm/ng-packs/packages/theme-shared/src/lib/handlers/error.handler.ts b/npm/ng-packs/packages/theme-shared/src/lib/handlers/error.handler.ts index ecf82cc9e1..0aa9956aa5 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/handlers/error.handler.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/handlers/error.handler.ts @@ -19,7 +19,6 @@ import { ErrorComponent } from '../components/error/error.component'; import { HttpErrorConfig, ErrorScreenErrorCodes } from '../models/common'; import { Toaster } from '../models/toaster'; import { ConfirmationService } from '../services/confirmation.service'; -import { HTTP_ERROR_CONFIG } from '../tokens/error-pages.token'; export const DEFAULT_ERROR_MESSAGES = { defaultError: { @@ -56,7 +55,7 @@ export class ErrorHandler { private cfRes: ComponentFactoryResolver, private rendererFactory: RendererFactory2, private injector: Injector, - @Inject(HTTP_ERROR_CONFIG) private httpErrorConfig: HttpErrorConfig, + @Inject('HTTP_ERROR_CONFIG') private httpErrorConfig: HttpErrorConfig, ) { this.actions.pipe(ofActionSuccessful(RestOccurError, RouterError, RouterDataResolved)).subscribe(res => { if (res instanceof RestOccurError) { @@ -209,7 +208,8 @@ export class ErrorHandler { this.componentRef.instance[key] = instance[key]; } } - + console.warn(this.httpErrorConfig.errorScreen); + this.componentRef.instance.hideCloseIcon = this.httpErrorConfig.errorScreen.hideCloseIcon; if (this.canCreateCustomError(instance.status as ErrorScreenErrorCodes)) { this.componentRef.instance.cfRes = this.cfRes; this.componentRef.instance.appRef = this.appRef; diff --git a/npm/ng-packs/packages/theme-shared/src/lib/models/common.ts b/npm/ng-packs/packages/theme-shared/src/lib/models/common.ts index f0cd03d6e7..2bca410f5e 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/models/common.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/models/common.ts @@ -14,5 +14,6 @@ export interface HttpErrorConfig { | [ErrorScreenErrorCodes, ErrorScreenErrorCodes] | [ErrorScreenErrorCodes, ErrorScreenErrorCodes, ErrorScreenErrorCodes] | [ErrorScreenErrorCodes, ErrorScreenErrorCodes, ErrorScreenErrorCodes, ErrorScreenErrorCodes]; + hideCloseIcon?: boolean; }; } diff --git a/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts b/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts index 28c3926367..3c7ba9f866 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/theme-shared.module.ts @@ -19,7 +19,7 @@ import { TableSortDirective } from './directives/table-sort.directive'; import { ErrorHandler } from './handlers/error.handler'; import { chartJsLoaded$ } from './utils/widget-utils'; import { RootParams } from './models/common'; -import { HTTP_ERROR_CONFIG, httpErrorConfigFactory } from './tokens/error-pages.token'; +import { HTTP_ERROR_CONFIG, httpErrorConfigFactory } from './tokens/http-error.token'; export function appendScript(injector: Injector) { const fn = () => { diff --git a/npm/ng-packs/packages/theme-shared/src/lib/tokens/error-pages.token.ts b/npm/ng-packs/packages/theme-shared/src/lib/tokens/http-error.token.ts similarity index 100% rename from npm/ng-packs/packages/theme-shared/src/lib/tokens/error-pages.token.ts rename to npm/ng-packs/packages/theme-shared/src/lib/tokens/http-error.token.ts