From 6a34981c9bc60b79400f3461b73eb32705121cd7 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Sun, 21 Nov 2021 10:38:11 +0300 Subject: [PATCH] added toast MSG and confirm dialog for update and delete btn in profile family member segment --- .../src/app/profile/home/home.component.html | 8 +++---- Mohem/src/app/profile/home/home.component.ts | 20 +++++++++++++--- Mohem/src/assets/localization/i18n.json | 24 +++++++++++++++++++ 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/Mohem/src/app/profile/home/home.component.html b/Mohem/src/app/profile/home/home.component.html index 907ad3ff..1382e47c 100644 --- a/Mohem/src/app/profile/home/home.component.html +++ b/Mohem/src/app/profile/home/home.component.html @@ -323,9 +323,9 @@

{{data.name}}

-
+
-

update

+

{{ts.trPK('userProfile','update')}}

@@ -334,9 +334,9 @@

{{data.relation}}

-
+
-

Remove

+

{{ts.trPK('userProfile','remove')}}

diff --git a/Mohem/src/app/profile/home/home.component.ts b/Mohem/src/app/profile/home/home.component.ts index 4b624e90..58a4163c 100644 --- a/Mohem/src/app/profile/home/home.component.ts +++ b/Mohem/src/app/profile/home/home.component.ts @@ -22,15 +22,15 @@ export class HomeComponent implements OnInit { public familyMemberData = [ { - name:'Enad', + name:'test', relation:'Father' }, { - name:'Zoz', + name:'test 1', relation:'Son' }, { - name:'Hofi', + name:'test 2', relation:'daughter' }, ] @@ -393,5 +393,19 @@ export class HomeComponent implements OnInit { this.cs.openAddBasicDetails('correct'); } } + + updateFunction(){ + // this.cs.presentAlert(this.ts.trPK('general', 'error-itg')); + this.cs.presentConfirmDialog(this.ts.trPK('userProfile', 'update-msg'), + ()=>{ + this.cs.greenToastPK("userProfile","update-confirm"); + }); + } + RemoveFunction(){ + this.cs.presentConfirmDialog(this.ts.trPK('userProfile', 'remove-msg'), + ()=>{ + this.cs.redToastPK("userProfile","remove-confirm"); + }); + } } diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index c0a4b48f..a690e0fe 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -1450,6 +1450,30 @@ "work":{ "en":"Work", "ar":"العمل" + }, + "update":{ + "en":"Update", + "ar":"تعديل" + }, + "remove":{ + "en":"Remove", + "ar":"حذف" + }, + "update-msg":{ + "en":"Are you sure you want update this member ?", + "ar":"هل انت متاكد من تعديل هذا العضو؟" + }, + "remove-msg":{ + "en":"Are you sure you want rmove this member ?", + "ar":"هل انت متاكد من حذف هذا العضو ؟" + }, + "update-confirm":{ + "en":"member updated successfully", + "ar":"تم تعديل البيانات بنجاح" + }, + "remove-confirm":{ + "en":"member removed successfully", + "ar":"تم حذف البيانات بنجاح" } }, "changePassword": {