From cf52d46d47c17a89b2991d0517afc36fca811c43 Mon Sep 17 00:00:00 2001 From: umasoodch Date: Thu, 2 Sep 2021 14:46:54 +0300 Subject: [PATCH] fixed feedback issues --- .../announcement/announcement.component.scss | 1 + .../announcement/announcement.component.ts | 13 ++++---- .../announcement.service.ts | 2 +- .../services-button.component.scss | 2 +- .../app/notification/home/home.component.ts | 32 +++++++++++-------- 5 files changed, 28 insertions(+), 22 deletions(-) diff --git a/Mohem/src/app/backend-integrations/announcement/announcement.component.scss b/Mohem/src/app/backend-integrations/announcement/announcement.component.scss index ddd668b3..6e104364 100644 --- a/Mohem/src/app/backend-integrations/announcement/announcement.component.scss +++ b/Mohem/src/app/backend-integrations/announcement/announcement.component.scss @@ -40,6 +40,7 @@ border-radius: 11px; border-left: 0px; border-right: 0px; + object-fit: cover; } .image-item-ar { padding-right: 5px; diff --git a/Mohem/src/app/backend-integrations/announcement/announcement.component.ts b/Mohem/src/app/backend-integrations/announcement/announcement.component.ts index aab4b825..464b73af 100644 --- a/Mohem/src/app/backend-integrations/announcement/announcement.component.ts +++ b/Mohem/src/app/backend-integrations/announcement/announcement.component.ts @@ -38,6 +38,7 @@ export class AnnouncementComponent implements OnInit { ) { } ngOnInit() { + this.common.startLoading(); this.direction = TranslatorService.getCurrentLanguageName(); this.getAnnouncementListService(); } @@ -59,6 +60,7 @@ export class AnnouncementComponent implements OnInit { this.announcementList.forEach(element => { if (element.id === item.id) { this.announcementService.getAnnouncementListService(this.pageSize, item.id).subscribe((result: any) => { + this.common.stopLoading(); if (this.common.validResponse(result)) { holdData = JSON.parse(result.Mohemm_ITG_ResponseItem); data = JSON.parse(holdData.result.data)[0]; @@ -73,7 +75,7 @@ export class AnnouncementComponent implements OnInit { img: data.Banner_Image }; element.isOpen = !element.isOpen; - this.common.stopLoading(); + // this.common.stopLoading(); } console.log(this.detialData); }); @@ -89,22 +91,19 @@ export class AnnouncementComponent implements OnInit { } getAnnouncementListService() { - this.common.startLoading(); + // this.common.startLoading(); let holdData; this.announcementService.getAnnouncementListService(this.pageSize).subscribe((result: any) => { + this.common.stopLoading(); if (this.common.validResponse(result)) { holdData = JSON.parse(result.Mohemm_ITG_ResponseItem); this.listOfAnnouncement = JSON.parse(holdData.result.data); this.pageLength = this.listOfAnnouncement[0].TotalItems; for (let i = 0; i < this.listOfAnnouncement.length; i++) { this.listOfAnnouncement[i].Title_EN = this.listOfAnnouncement[i].Title_EN; - // this.listOfAnnouncement[i].Title_EN = this.listOfAnnouncement[i].Title_EN.replace(/\ /g, ''); this.listOfAnnouncement[i].Title_AR = this.listOfAnnouncement[i].Title_AR; - // this.listOfAnnouncement[i].Title_AR = this.listOfAnnouncement[i].Title_AR.replace(/\ /g, ''); this.listOfAnnouncement[i].EmailBody_EN = this.listOfAnnouncement[i].EmailBody_EN; - // this.listOfAnnouncement[i].EmailBody_EN = this.listOfAnnouncement[i].EmailBody_EN.replace(/\ /g, ''); this.listOfAnnouncement[i].EmailBody_AR = this.listOfAnnouncement[i].EmailBody_AR; - // this.listOfAnnouncement[i].EmailBody_AR = this.listOfAnnouncement[i].EmailBody_AR.replace(/\ /g, ''); this.arr[i] = { id: this.listOfAnnouncement[i].rowID, title_EN: this.listOfAnnouncement[i].Title_EN, @@ -121,7 +120,7 @@ export class AnnouncementComponent implements OnInit { this.arrList.push(this.arr[i]); } } - this.common.stopLoading(); + // this.common.stopLoading(); }); } diff --git a/Mohem/src/app/hmg-common/services/announcement-services/announcement.service.ts b/Mohem/src/app/hmg-common/services/announcement-services/announcement.service.ts index 1a3c9bac..b2515518 100644 --- a/Mohem/src/app/hmg-common/services/announcement-services/announcement.service.ts +++ b/Mohem/src/app/hmg-common/services/announcement-services/announcement.service.ts @@ -25,7 +25,7 @@ export class AnnouncementService { request.ItgPageSize = 5; request.ItgAwarenessID = 0; request.ItgRowID = (id) ? Number(id) : 0; - return this.con.post( + return this.con.postNoLoad( AnnouncementService.getAnnouncemntList, request, onError, diff --git a/Mohem/src/app/hmg-common/ui/services-button/services-button.component.scss b/Mohem/src/app/hmg-common/ui/services-button/services-button.component.scss index ff7c3d40..ac71c624 100644 --- a/Mohem/src/app/hmg-common/ui/services-button/services-button.component.scss +++ b/Mohem/src/app/hmg-common/ui/services-button/services-button.component.scss @@ -26,7 +26,7 @@ } .pClass { - font-size: 12PX; + font-size: 10px; text-align: center; margin-top: 10px; color: black; diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index ff783369..91a9d1a9 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; +import { Component, OnInit, ViewChild, NgZone } from '@angular/core'; import { ModalController } from '@ionic/angular'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; @@ -173,7 +173,8 @@ export class HomeComponent implements OnInit { public WorklistService: WorklistService, public workListService: WorklistMainService, public modalController: ModalController, - public DS: DashboredService + public DS: DashboredService, + public ngZone: NgZone ) { this.WorkListObj = new WorkListRequest(); this.WorkListObj.P_NOTIFICATION_TYPE = '1'; @@ -232,12 +233,15 @@ export class HomeComponent implements OnInit { } assignDataToFilters() { - this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER; - this.filters[1].value = this.totalHR; - this.filters[2].value = this.totalPO; - this.filters[3].value = this.totalPR; - this.filters[4].value = this.totalMR; - this.filters[5].value = this.totalIC; + this.ngZone.run(() => { + this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER; + this.filters[1].value = this.totalHR; + this.filters[2].value = this.totalPO; + this.filters[3].value = this.totalPR; + this.filters[4].value = this.totalMR; + this.filters[5].value = this.totalIC; + }); + if (this.totalHR === 0) { this.data.datasets[0].data[0] = 0; @@ -439,11 +443,13 @@ export class HomeComponent implements OnInit { } categorizeData(arrayToCategorize: any) { - this.totalHR = 0; - this.totalPO = 0; - this.totalPR = 0; - this.totalMR = 0; - this.totalIC = 0; + this.ngZone.run(() => { + this.totalHR = 0; + this.totalPO = 0; + this.totalPR = 0; + this.totalMR = 0; + this.totalIC = 0; + }) const datePipe = new DatePipe('en-US'); const formattedData = [];