From 483ad8a5d70633e8193e44702caa408d1451cc0b Mon Sep 17 00:00:00 2001 From: enadhilal Date: Fri, 10 Apr 2020 19:57:18 +0300 Subject: [PATCH 1/2] add latest update under Enad branch --- .../device-permissions.service.ts | 2 +- .../app/notification/home/home.component.scss | 4 +-- .../app/notification/home/home.component.ts | 18 ++++++++++ .../work-list-main-itg.component.html | 33 ++++++++++++++++--- .../work-list-main-itg.component.ts | 22 +++++++++---- Mohem/src/assets/localization/i18n.json | 4 +++ 6 files changed, 69 insertions(+), 14 deletions(-) diff --git a/Mohem/src/app/hmg-common/services/device-permissions/device-permissions.service.ts b/Mohem/src/app/hmg-common/services/device-permissions/device-permissions.service.ts index 7859895f..01f7a2b9 100644 --- a/Mohem/src/app/hmg-common/services/device-permissions/device-permissions.service.ts +++ b/Mohem/src/app/hmg-common/services/device-permissions/device-permissions.service.ts @@ -132,7 +132,7 @@ export class DevicePermissionsService { return new Promise((resolve, reject) => { this.cs.confirmAlertDialogPrimarySecondary(() => { resolve(true); - }, this.ts.trPK('general', 'confirm'), + }, this.ts.trPK('general', 'accept'), () => { resolve(false); }, this.ts.trPK('general', 'not-now'), this.ts.trPK('general', 'confirm'), message diff --git a/Mohem/src/app/notification/home/home.component.scss b/Mohem/src/app/notification/home/home.component.scss index a5eb0061..36116457 100644 --- a/Mohem/src/app/notification/home/home.component.scss +++ b/Mohem/src/app/notification/home/home.component.scss @@ -436,7 +436,7 @@ color: #888; font-size: 15px; } .text-span{ -font-size: 14px; +font-size: 12px; color: #888; background-color: white; width: 93%; @@ -446,7 +446,7 @@ border-radius: 15px; } .text-span-active{ -font-size: 14px; +font-size: 12px; color: #888; background-color:#22c6b3; width: 93%; diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index c21a2830..694d0da2 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -523,11 +523,29 @@ export class HomeComponent implements OnInit { names[i] = result.RequestType[i].RequestTypeCode; count++; } + //this.sortArrayOfAll(this.ITGSegment[0].data) console.log(this.ITGSegment); }); } +// return arrayToSort.sort((a: any, b: any) => +// new Date(b.date).getTime() - new Date(a.date).getTime() +// ); + +sortArrayOfAll(arrayOfAll){ + let date1; + let date2; + for(let i=0; i< arrayOfAll.length; i++){ + // for(const filter of arrayOfAll[i]){ + console.log(arrayOfAll); + arrayOfAll.sort((a,b)=>(this.common.getDateTimeISOFromString(a.ModifiedDate), this.common.getDateTimeISOFromString(b.ModifiedDate))?1:-1); + console.log(arrayOfAll); + // console.log(this.common.getDateTimeISOFromString(filter.ModifiedDate)); + // } + } + } + Details() { this.workListService.getITGDetails('', '', this.isPostNoLoad) .subscribe((result: any) => { diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html index 554d5407..a28c4608 100644 --- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html @@ -22,10 +22,32 @@
- -
- + +
+
+
+
+ +
+ +
+
+
+
+
+ + +
+
+
+
+
+
+
@@ -74,12 +96,13 @@ +
-

{{approvalInfo.Action}}

+

{{approvalInfo.Action}}

{{approvalInfo.Name}}

diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts index eeb5f349..c531062f 100644 --- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts @@ -34,6 +34,7 @@ export class WorkListMainItgComponent implements OnInit { public segmentsArray: { name: string, number: number }[] = []; public segmentData: { name: string, data: any }[] = []; public requestDetailsData: { name: string, data: any }[] = []; + public dataLabelAndValue =[]; public header: any = []; public rows: any = []; public workList: any; @@ -89,16 +90,22 @@ export class WorkListMainItgComponent implements OnInit { for (let i = 0; i < result.ITGRequest.FieldGoups.length; i++) { this.segmentsArray[i] = { name: result.ITGRequest.FieldGoups[i].Title, number: i }; this.segmentData[i] = { name: result.ITGRequest.FieldGoups[i].Title, data: result.ITGRequest.FieldGoups[i].Fields } - for (let j = 0; j < this.segmentData[i].data.length; j++) { - if (this.segmentData[i].data[j].TableValue){ - this.requestDetailsData[count] ={ name:this.segmentData[i].data[j].TableValue.Header, - data: this.segmentData[i].data[j].TableValue.Rows} - count++; + // console.log(this.segmentData[i].data[j]) + if(this.segmentData[i].data[j].Type ==="table"){ + // console.log(JSON.parse(this.segmentData[i].data[j].Value)); + this.dataLabelAndValue.push(JSON.parse(this.segmentData[i].data[j].Value)) + console.log(this.dataLabelAndValue); } + // if (this.segmentData[i].data[j].TableValue){ + // this.requestDetailsData[count] ={ name:this.segmentData[i].data[j].TableValue.Header, + // data: this.segmentData[i].data[j].TableValue.Rows} + // count++; + // } } } - console.log(this.requestDetailsData) + console.log(this.dataLabelAndValue) + //console.log(this.requestDetailsData) this.segmentsArray[this.segmentsArray.length] = { name: 'Approval Level', number: this.segmentsArray.length } this.workList = this.request_details.WFHistory; this.options = this.request_details.AllowedActions; @@ -147,6 +154,9 @@ export class WorkListMainItgComponent implements OnInit { if (actionName == "Delegate") { return "../assets/imgs/action-info.png" } + if (actionName == "Answer") { + return "../assets/imgs/action-info.png" + } } public segmentChangedClick(event: any) { diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 08576fb4..251fd893 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -202,6 +202,10 @@ } }, "general": { + "not-now":{ + "en":"not now", + "ar":"لاحقاً" + }, "birth_date": { "en": "Birth Date", "ar": "تاريخ الميلاد" From e421e0b8c3b5e06715adb7f3433906adb6c78f16 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Sat, 11 Apr 2020 14:57:03 +0300 Subject: [PATCH 2/2] fix multi value in ITG --- .../work-list-main-itg/work-list-main-itg.component.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html index a28c4608..9edbbf00 100644 --- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html @@ -23,6 +23,11 @@
+ +
+ +
+