From 707c37c04d602d743289724198a4ffbffde8fc29 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 11 Nov 2019 10:24:16 +0300 Subject: [PATCH] feat(theme-shared): add destroy subject to custom error component #2097 --- .../src/lib/components/error/error.component.ts | 1 + .../packages/theme-shared/src/lib/handlers/error.handler.ts | 6 +++--- .../theme-shared/src/lib/services/confirmation.service.ts | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) 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 7ccc5c97bd..b06475ac7a 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 @@ -41,6 +41,7 @@ export class ErrorComponent implements AfterViewInit, OnDestroy { if (this.customComponent) { const customComponentRef = this.cfRes.resolveComponentFactory(this.customComponent).create(null); customComponentRef.instance.errorStatus = this.status; + customComponentRef.instance.destroy$ = this.destroy$; this.containerRef.nativeElement.appendChild((customComponentRef.hostView as EmbeddedViewRef).rootNodes[0]); customComponentRef.changeDetectorRef.detectChanges(); } 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 5f75b2ecd5..ced1980067 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 @@ -39,7 +39,7 @@ export const DEFAULT_ERROR_MESSAGES = { details: 'The resource requested could not found on the server.', }, defaultError500: { - title: '500', + title: 'Internal server error', details: 'Error detail not sent by server.', }, }; @@ -106,11 +106,11 @@ export class ErrorHandler { : this.showError( { key: 'AbpAccount::DefaultErrorMessage404', - defaultValue: DEFAULT_ERROR_MESSAGES.defaultError404.title, + defaultValue: DEFAULT_ERROR_MESSAGES.defaultError404.details, }, { key: 'AbpAccount::DefaultErrorMessage404Detail', - defaultValue: DEFAULT_ERROR_MESSAGES.defaultError404.details, + defaultValue: DEFAULT_ERROR_MESSAGES.defaultError404.title, }, ); break; diff --git a/npm/ng-packs/packages/theme-shared/src/lib/services/confirmation.service.ts b/npm/ng-packs/packages/theme-shared/src/lib/services/confirmation.service.ts index 6aa592767d..cceedc22cb 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/services/confirmation.service.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/services/confirmation.service.ts @@ -25,7 +25,6 @@ export class ConfirmationService extends AbstractToaster { options?: Confirmation.Options, ): Observable { this.listenToEscape(); - return super.show(message, title, severity, options); }