Browse Source

feat(theme-shared): add destroy subject to custom error component

#2097
pull/2142/head
mehmet-erim 7 years ago
parent
commit
707c37c04d
  1. 1
      npm/ng-packs/packages/theme-shared/src/lib/components/error/error.component.ts
  2. 6
      npm/ng-packs/packages/theme-shared/src/lib/handlers/error.handler.ts
  3. 1
      npm/ng-packs/packages/theme-shared/src/lib/services/confirmation.service.ts

1
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<any>).rootNodes[0]);
customComponentRef.changeDetectorRef.detectChanges();
}

6
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;

1
npm/ng-packs/packages/theme-shared/src/lib/services/confirmation.service.ts

@ -25,7 +25,6 @@ export class ConfirmationService extends AbstractToaster<Confirmation.Options> {
options?: Confirmation.Options,
): Observable<Toaster.Status> {
this.listenToEscape();
return super.show(message, title, severity, options);
}

Loading…
Cancel
Save