diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html index 326c7d16..45af49e2 100644 --- a/Mohem/src/app/notification/home/home.component.html +++ b/Mohem/src/app/notification/home/home.component.html @@ -12,11 +12,9 @@ {{ts.trPK('work-list','open-analysis')}}
- -

{{totalRequestCount}}

-

{{newWorkListResponse[0].NO_OF_ROWS + ITGCount}}

-

{{newWorkListResponse[0].NO_OF_ROWS}}

+

{{totalRequestCount}}

+ + {{ts.trPK('work-list','total')}}
{{ts.trPK('work-list','open-reqest')}}
@@ -45,7 +43,7 @@ {{ts.trPK('work-list','clear-search')}} - + {{ts.trPK('work-list','advanced-search')}} @@ -74,7 +72,6 @@
-
@@ -103,7 +100,6 @@
- diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index 7b47aad2..ce8635c3 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -186,7 +186,7 @@ export class HomeComponent implements OnInit { this.WorkListObj.P_SEARCH_SENT_DATE = ''; this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; this.WorkListObj.P_PAGE_NUM = 0; - this.WorkListObj.P_PAGE_LIMIT = 5; + this.WorkListObj.P_PAGE_LIMIT = 25; } ngOnInit() { @@ -212,7 +212,6 @@ export class HomeComponent implements OnInit { this.selectedFilter = 'HR'; this.filters[0].active = true; this.isPostNoLoad = true; - // this.disableFilters(); this.resetData(); this.direction = TranslatorService.getCurrentLanguageName(); this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false); @@ -303,11 +302,10 @@ export class HomeComponent implements OnInit { } activeFilter(index: number) { - if (index !== 4) { - this.common.startLoading(); - } - console.log(this.filters); - if (this.currentActiveIndex !== index) { + if (index !== this.currentActiveIndex) { + if (index !== 4) { + this.common.startLoading(); + } this.previousActiveIndex = this.currentActiveIndex; this.currentActiveIndex = index; this.filters[this.previousActiveIndex].active = false; @@ -315,7 +313,6 @@ export class HomeComponent implements OnInit { this.selectedFilter = this.filters[this.currentActiveIndex].key; const filterValue = this.filters[this.currentActiveIndex].value; if (this.selectedFilter !== 'ITG') { - // this.getFilteredData(this.selectedFilter); this.initiateNewWorklistData(this.selectedFilter, filterValue); } } @@ -325,9 +322,12 @@ export class HomeComponent implements OnInit { this.common.openProfile('sideMenu'); } - disableFilters() { + configureFilters() { for (const filter of this.filters) { if (filter.key === this.itemType) { + const index = this.filters.map(function(e) { return e.key; }).indexOf(this.itemType); + this.currentActiveIndex = index; + this.previousActiveIndex = 0; filter.disable = false; filter.active = true; this.selectedFilter = filter.name; @@ -339,12 +339,26 @@ export class HomeComponent implements OnInit { filter.active = false; } } + if (this.itemType === '') { this.filters[0].active = true; } } + enableFilters() { + this.currentActiveIndex = 0; + this.previousActiveIndex = 0; + for (const filter of this.filters) { + filter.disable = false; + if (filter.key === this.itemType) { + filter.active = true; + } else { + filter.active = false; + } + } + } + async openSearchModal() { const modal = await this.modalController.create({ component: WorklistAdvancedSearchComponent, @@ -369,19 +383,10 @@ export class HomeComponent implements OnInit { this.newWorkListResponse = []; this.showFormattedData = []; this.allFormattedData = []; - // this.selectedFilter = 'ALL'; if (this.itemType !== '') { - this.disableFilters(); + this.configureFilters(); } - - this.filters[this.currentActiveIndex].active = false; - this.currentActiveIndex = 0; - this.previousActiveIndex = 0; - this.filters[this.currentActiveIndex].active = true; - // if (this.itemType !== '') { - // this.disableFilters(); - // } this.isPostNoLoad = false; this.getAllPushNotificationFun(); } @@ -494,7 +499,6 @@ export class HomeComponent implements OnInit { this.showFormattedData = this.sortArray(categorizedWorkListResponse); this.allFormattedData = this.showFormattedData; this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR); - // this.assignDataToFilters(); } } else { this.newWorkListResponse = []; @@ -503,7 +507,6 @@ export class HomeComponent implements OnInit { } this.data.datasets[0].data[4] = this.ITGCount; this.showChart = true; - // this.common.stopLoading(); this.isLoading = false; } } @@ -562,11 +565,11 @@ export class HomeComponent implements OnInit { clearSearch() { this.common.startLoading(); - this.isLoading = true; - this.itemType = ''; - this.selectedFilter = 'ALL'; + this.isLoading = false; + this.itemType = 'HRSSA'; + this.selectedFilter = 'HR'; this.isPostNoLoad = true; - // this.disableFilters(); + this.enableFilters(); this.resetData(); this.getAllPushNotificationFun(); }