toast messages when copied to clipboard and network errors

This commit is contained in:
Baptiste Lemoine 2020-01-16 12:05:54 +01:00
parent 4098f7ec5c
commit b44f2719b4
4 changed files with 12 additions and 5 deletions

View File

@ -52,3 +52,5 @@
<router-outlet></router-outlet> <router-outlet></router-outlet>
</main> </main>
<framadate-debugger></framadate-debugger> <framadate-debugger></framadate-debugger>
<p-toast position="top-right"></p-toast>

View File

@ -89,3 +89,4 @@
</section> </section>
<p-toast position="bottom-right"></p-toast>

View File

@ -24,7 +24,11 @@ export class EndConfirmationComponent extends BaseComponent implements OnInit {
} }
copyLink(str: any) { 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() { sendToEmail() {

View File

@ -163,9 +163,9 @@ export class ConfigService extends PollConfig {
) )
.subscribe(res => { .subscribe(res => {
// message: 'Trouvé! Allez voir votre boite email', // message: 'Trouvé! Allez voir votre boite email',
this.myPolls = res; this.myPolls = res;
console.log('res', res); console.log('res', res);
this.loading = false; this.loading = false;
this.messageService.add({ this.messageService.add({
severity: 'success', severity: 'success',
summary: 'Service Message', summary: 'Service Message',
@ -186,7 +186,7 @@ export class ConfigService extends PollConfig {
// TODO handle a toast message // TODO handle a toast message
console.error('err', err); console.error('err', err);
this.loading = false; 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});
} }