From b44f2719b44e4aba7476dc7952b4cc739b9d1d39 Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Thu, 16 Jan 2020 12:05:54 +0100 Subject: [PATCH] :zap: toast messages when copied to clipboard and network errors --- src/app/app.component.html | 2 ++ .../end-confirmation/end-confirmation.component.html | 1 + .../pages/end-confirmation/end-confirmation.component.ts | 6 +++++- src/app/services/config.service.ts | 8 ++++---- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index f0e044df..ab58b404 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -52,3 +52,5 @@ + + diff --git a/src/app/pages/end-confirmation/end-confirmation.component.html b/src/app/pages/end-confirmation/end-confirmation.component.html index 35eff720..9bf23ebe 100644 --- a/src/app/pages/end-confirmation/end-confirmation.component.html +++ b/src/app/pages/end-confirmation/end-confirmation.component.html @@ -89,3 +89,4 @@ + diff --git a/src/app/pages/end-confirmation/end-confirmation.component.ts b/src/app/pages/end-confirmation/end-confirmation.component.ts index b75eeb9d..effc1d9b 100644 --- a/src/app/pages/end-confirmation/end-confirmation.component.ts +++ b/src/app/pages/end-confirmation/end-confirmation.component.ts @@ -24,7 +24,11 @@ export class EndConfirmationComponent extends BaseComponent implements OnInit { } copyLink(str: any) { - this.messageService.add({severity: 'success', summary: 'Service Message', detail: 'Via MessageService'}); + this.messageService.add({ + severity: 'success', + summary: 'Lien copié', + detail: str + }); } sendToEmail() { diff --git a/src/app/services/config.service.ts b/src/app/services/config.service.ts index c7958a49..9670d760 100644 --- a/src/app/services/config.service.ts +++ b/src/app/services/config.service.ts @@ -163,9 +163,9 @@ export class ConfigService extends PollConfig { ) .subscribe(res => { // message: 'Trouvé! Allez voir votre boite email', - this.myPolls = res; - console.log('res', res); - this.loading = false; + this.myPolls = res; + console.log('res', res); + this.loading = false; this.messageService.add({ severity: 'success', summary: 'Service Message', @@ -186,7 +186,7 @@ export class ConfigService extends PollConfig { // TODO handle a toast message console.error('err', err); this.loading = false; - this.messageService.add({severity: 'warning', summary: "Erreur lors de l'appel "}); + this.messageService.add({severity: 'warning', summary: "Erreur lors de l'appel ", detail: err.message}); }