From f8b2c1b4f509c037b9650cca2c5befd21f056df3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 19 Dec 2018 16:04:34 +0100 Subject: Refractor notification service Shorter name and use primeng component --- .../verify-account-ask-send-email.component.ts | 11 +++++------ .../verify-account-email/verify-account-email.component.ts | 8 ++++---- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'client/src/app/+verify-account') diff --git a/client/src/app/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts b/client/src/app/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts index 995f42ffc..cfd471fa4 100644 --- a/client/src/app/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts +++ b/client/src/app/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts @@ -1,9 +1,8 @@ import { Component, OnInit } from '@angular/core' import { I18n } from '@ngx-translate/i18n-polyfill' -import { NotificationsService } from 'angular2-notifications' +import { Notifier, RedirectService } from '@app/core' import { ServerService } from '@app/core/server' -import { RedirectService } from '@app/core' -import { UserService, FormReactive } from '@app/shared' +import { FormReactive, UserService } from '@app/shared' import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' @@ -20,7 +19,7 @@ export class VerifyAccountAskSendEmailComponent extends FormReactive implements private userValidatorsService: UserValidatorsService, private userService: UserService, private serverService: ServerService, - private notificationsService: NotificationsService, + private notifier: Notifier, private redirectService: RedirectService, private i18n: I18n ) { @@ -46,12 +45,12 @@ export class VerifyAccountAskSendEmailComponent extends FormReactive implements 'An email with verification link will be sent to {{email}}.', { email } ) - this.notificationsService.success(this.i18n('Success'), message) + this.notifier.success(message) this.redirectService.redirectToHomepage() }, err => { - this.notificationsService.error(this.i18n('Error'), err.message) + this.notifier.error(err.message) } ) } diff --git a/client/src/app/+verify-account/verify-account-email/verify-account-email.component.ts b/client/src/app/+verify-account/verify-account-email/verify-account-email.component.ts index e4a5522c8..f9ecf664b 100644 --- a/client/src/app/+verify-account/verify-account-email/verify-account-email.component.ts +++ b/client/src/app/+verify-account/verify-account-email/verify-account-email.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' import { I18n } from '@ngx-translate/i18n-polyfill' -import { NotificationsService } from 'angular2-notifications' +import { Notifier } from '@app/core' import { UserService } from '@app/shared' @Component({ @@ -17,7 +17,7 @@ export class VerifyAccountEmailComponent implements OnInit { constructor ( private userService: UserService, - private notificationsService: NotificationsService, + private notifier: Notifier, private router: Router, private route: ActivatedRoute, private i18n: I18n @@ -29,7 +29,7 @@ export class VerifyAccountEmailComponent implements OnInit { this.verificationString = this.route.snapshot.queryParams['verificationString'] if (!this.userId || !this.verificationString) { - this.notificationsService.error(this.i18n('Error'), this.i18n('Unable to find user id or verification string.')) + this.notifier.error(this.i18n('Unable to find user id or verification string.')) } else { this.verifyEmail() } @@ -46,7 +46,7 @@ export class VerifyAccountEmailComponent implements OnInit { }, err => { - this.notificationsService.error(this.i18n('Error'), err.message) + this.notifier.error(err.message) } ) } -- cgit v1.2.3