From 874b9cdf16322c81bde4ea056d2a9af6302af9ff Mon Sep 17 00:00:00 2001
From: tykayn <15d65f2f-0b14-4f70-bf34-e130180ed62b@users.tedomum.net>
Date: Thu, 10 Mar 2022 10:38:49 +0100
Subject: [PATCH] toast on day deletion, icon trash 2 replacement
Signed-off-by: tykayn <15d65f2f-0b14-4f70-bf34-e130180ed62b@users.tedomum.net>
---
.../form/date/list/day/day-list.component.html | 4 ++--
.../form/date/list/day/day-list.component.ts | 8 ++++++++
.../form/option-link/option-link.component.html | 2 +-
src/assets/i18n/en.json | 2 ++
src/assets/i18n/fr.json | 4 +++-
5 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/app/features/administration/form/date/list/day/day-list.component.html b/src/app/features/administration/form/date/list/day/day-list.component.html
index 34a5929b..e2ede449 100644
--- a/src/app/features/administration/form/date/list/day/day-list.component.html
+++ b/src/app/features/administration/form/date/list/day/day-list.component.html
@@ -31,7 +31,7 @@
class="has-no-outline has-no-background has-text-primary has-text-left"
(click)="deleteChoiceField(id)"
>
-
+
{{ 'dates.remove' | translate }} {{ id + 1 }}
@@ -39,7 +39,7 @@
-
diff --git a/src/app/features/administration/form/date/list/day/day-list.component.ts b/src/app/features/administration/form/date/list/day/day-list.component.ts
index 2647dd25..980fac21 100644
--- a/src/app/features/administration/form/date/list/day/day-list.component.ts
+++ b/src/app/features/administration/form/date/list/day/day-list.component.ts
@@ -10,6 +10,8 @@ import { DateChoice } from '../../../../../../core/models/dateChoice.model';
import { PollService } from '../../../../../../core/services/poll.service';
import { DateUtilitiesService } from '../../../../../../core/services/date.utilities.service';
import { environment } from 'src/environments/environment';
+import { TranslateService } from '@ngx-translate/core';
+
@Component({
selector: 'app-day-list',
templateUrl: './day-list.component.html',
@@ -30,6 +32,7 @@ export class DayListComponent {
public dialog: MatDialog,
private toastService: ToastService,
private pollService: PollService,
+ private translate: TranslateService,
private dateUtilitiesService: DateUtilitiesService,
private cd: ChangeDetectorRef,
@Inject(DOCUMENT) private document: any,
@@ -166,6 +169,11 @@ export class DayListComponent {
this.dateChoices.splice(index, 1);
this.cd.detectChanges();
this.focusOnChoice(index - 1 < 0 ? 0 : index - 1);
+
+ this.translate.get('success.deleted_day').subscribe((resp) => {
+ console.log('resp', resp);
+ this.toastService.display(`${resp}`);
+ });
}
isWeekendDay(date_input: string) {
diff --git a/src/app/features/administration/form/option-link/option-link.component.html b/src/app/features/administration/form/option-link/option-link.component.html
index 2433f341..d889dddd 100644
--- a/src/app/features/administration/form/option-link/option-link.component.html
+++ b/src/app/features/administration/form/option-link/option-link.component.html
@@ -22,7 +22,7 @@
-
+
{{ 'choices.delete' | translate }}
diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json
index ecb84f1d..82d9f941 100644
--- a/src/assets/i18n/en.json
+++ b/src/assets/i18n/en.json
@@ -183,6 +183,8 @@
"link": "Public link to share",
"label": "Check your poll",
"action": "See my poll",
+ "deleted_option": "Option removed",
+ "deleted_day": "Date removed",
"admins": "Admin side",
"users": "Respondent side",
"links_mail": "Receive links by email",
diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json
index 86690f51..2ceb7d7e 100644
--- a/src/assets/i18n/fr.json
+++ b/src/assets/i18n/fr.json
@@ -89,7 +89,7 @@
"add": "Ajouter date",
"element": "Date",
"format_helper": "JJ/MM/AAAA",
- "remove": "Supprimer la date",
+ "remove": "Supprimer date",
"add_time": "Ajouter une plage horaire",
"empty": "Vider",
"count_dates": "choix de dates",
@@ -190,6 +190,8 @@
"network_error": "erreur de réseau",
"go_back": "Revenir en arrière",
"copy": "Copier",
+ "deleted_option": "Option supprimée",
+ "deleted_day": "Date supprimée",
"copy_message": "Texte copié :"
},
"visibility": {