fixed worklist issues

sultan-q3
umasoodch 4 years ago
parent 6648091b82
commit 2e84d853de

@ -12,11 +12,9 @@
<span>{{ts.trPK('work-list','open-analysis')}}</span> <span>{{ts.trPK('work-list','open-analysis')}}</span>
</div> </div>
<div class="result-text-container" [ngStyle]="showChart === false || receivedITGCount === false ? {'visibility': 'hidden'} : {}"> <div class="result-text-container" [ngStyle]="showChart === false || receivedITGCount === false ? {'visibility': 'hidden'} : {}">
<!-- <span *ngIf="selectedFilter === 'ALL'">{{newWorkListResponse.length + ITGCount}} {{ts.trPK('work-list','of')}} </span> <h2>{{totalRequestCount}}</h2>
<span *ngIf="showSearchButton && newWorkListResponse.length > 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse.length}} {{ts.trPK('work-list','of')}} </span> --> <!-- <h2 *ngIf="showSearchButton && newWorkListResponse.length > 0 && itemType === ''">{{newWorkListResponse[0].NO_OF_ROWS + ITGCount}}</h2> -->
<h2 *ngIf="!showSearchButton">{{totalRequestCount}}</h2> <!-- <h2 *ngIf="showSearchButton && newWorkListResponse.length > 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse[0].NO_OF_ROWS}}</h2> -->
<h2 *ngIf="showSearchButton && newWorkListResponse.length > 0 && itemType === ''">{{newWorkListResponse[0].NO_OF_ROWS + ITGCount}}</h2>
<h2 *ngIf="showSearchButton && newWorkListResponse.length > 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse[0].NO_OF_ROWS}}</h2>
<span>{{ts.trPK('work-list','total')}} <br> {{ts.trPK('work-list','open-reqest')}}</span> <span>{{ts.trPK('work-list','total')}} <br> {{ts.trPK('work-list','open-reqest')}}</span>
</div> </div>
<div *ngIf="!showChart || !receivedITGCount" class="spinner-custom-class"> <div *ngIf="!showChart || !receivedITGCount" class="spinner-custom-class">
@ -45,7 +43,7 @@
<span style="margin-left: 5px;">{{ts.trPK('work-list','clear-search')}}</span> <span style="margin-left: 5px;">{{ts.trPK('work-list','clear-search')}}</span>
<ion-icon name="close" ></ion-icon> <ion-icon name="close" ></ion-icon>
</ion-col> </ion-col>
<ion-col style="float: right;" size=[6] (click)="openSearchModal()" *ngIf="selectedFilter !== 'ITG'"> <ion-col style="float: right;" size=[6] (click)="openSearchModal()" *ngIf="selectedFilter !== 'ITG' && !showSearchButton">
<ion-icon name="search" ></ion-icon> <ion-icon name="search" ></ion-icon>
<span>{{ts.trPK('work-list','advanced-search')}}</span> <span>{{ts.trPK('work-list','advanced-search')}}</span>
</ion-col> </ion-col>
@ -74,7 +72,6 @@
</div> </div>
</div> </div>
<div [ngClass]="ITGItem.length > 0 ? 'work-list-container' : ''" *ngIf="selectedFilter == 'ITG'" > <div [ngClass]="ITGItem.length > 0 ? 'work-list-container' : ''" *ngIf="selectedFilter == 'ITG'" >
<!-- <div *ngFor='let segmentInfo of ITGItem[0]; let i= index' (click)='openITG(segmentInfo)'> -->
<div *ngFor='let segmentInfo of ITGItem[0]; let i= index' > <div *ngFor='let segmentInfo of ITGItem[0]; let i= index' >
<div *ngIf="activeSegment !== 'All'" (click)='openITG(segmentInfo)'> <div *ngIf="activeSegment !== 'All'" (click)='openITG(segmentInfo)'>
@ -103,7 +100,6 @@
</div> </div>
</div> </div>
</div> </div>
<!-- </div> -->
<ion-infinite-scroll (ionInfinite)="doInfinite($event)" *ngIf="itemType !== ''"> <ion-infinite-scroll (ionInfinite)="doInfinite($event)" *ngIf="itemType !== ''">
<ion-infinite-scroll-content></ion-infinite-scroll-content> <ion-infinite-scroll-content></ion-infinite-scroll-content>

@ -186,7 +186,7 @@ export class HomeComponent implements OnInit {
this.WorkListObj.P_SEARCH_SENT_DATE = ''; this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_PAGE_NUM = 0; this.WorkListObj.P_PAGE_NUM = 0;
this.WorkListObj.P_PAGE_LIMIT = 5; this.WorkListObj.P_PAGE_LIMIT = 25;
} }
ngOnInit() { ngOnInit() {
@ -212,7 +212,6 @@ export class HomeComponent implements OnInit {
this.selectedFilter = 'HR'; this.selectedFilter = 'HR';
this.filters[0].active = true; this.filters[0].active = true;
this.isPostNoLoad = true; this.isPostNoLoad = true;
// this.disableFilters();
this.resetData(); this.resetData();
this.direction = TranslatorService.getCurrentLanguageName(); this.direction = TranslatorService.getCurrentLanguageName();
this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false); this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false);
@ -303,11 +302,10 @@ export class HomeComponent implements OnInit {
} }
activeFilter(index: number) { activeFilter(index: number) {
if (index !== 4) { if (index !== this.currentActiveIndex) {
this.common.startLoading(); if (index !== 4) {
} this.common.startLoading();
console.log(this.filters); }
if (this.currentActiveIndex !== index) {
this.previousActiveIndex = this.currentActiveIndex; this.previousActiveIndex = this.currentActiveIndex;
this.currentActiveIndex = index; this.currentActiveIndex = index;
this.filters[this.previousActiveIndex].active = false; this.filters[this.previousActiveIndex].active = false;
@ -315,7 +313,6 @@ export class HomeComponent implements OnInit {
this.selectedFilter = this.filters[this.currentActiveIndex].key; this.selectedFilter = this.filters[this.currentActiveIndex].key;
const filterValue = this.filters[this.currentActiveIndex].value; const filterValue = this.filters[this.currentActiveIndex].value;
if (this.selectedFilter !== 'ITG') { if (this.selectedFilter !== 'ITG') {
// this.getFilteredData(this.selectedFilter);
this.initiateNewWorklistData(this.selectedFilter, filterValue); this.initiateNewWorklistData(this.selectedFilter, filterValue);
} }
} }
@ -325,9 +322,12 @@ export class HomeComponent implements OnInit {
this.common.openProfile('sideMenu'); this.common.openProfile('sideMenu');
} }
disableFilters() { configureFilters() {
for (const filter of this.filters) { for (const filter of this.filters) {
if (filter.key === this.itemType) { 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.disable = false;
filter.active = true; filter.active = true;
this.selectedFilter = filter.name; this.selectedFilter = filter.name;
@ -339,12 +339,26 @@ export class HomeComponent implements OnInit {
filter.active = false; filter.active = false;
} }
} }
if (this.itemType === '') { if (this.itemType === '') {
this.filters[0].active = true; 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() { async openSearchModal() {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: WorklistAdvancedSearchComponent, component: WorklistAdvancedSearchComponent,
@ -369,19 +383,10 @@ export class HomeComponent implements OnInit {
this.newWorkListResponse = []; this.newWorkListResponse = [];
this.showFormattedData = []; this.showFormattedData = [];
this.allFormattedData = []; this.allFormattedData = [];
// this.selectedFilter = 'ALL';
if (this.itemType !== '') { 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.isPostNoLoad = false;
this.getAllPushNotificationFun(); this.getAllPushNotificationFun();
} }
@ -494,7 +499,6 @@ export class HomeComponent implements OnInit {
this.showFormattedData = this.sortArray(categorizedWorkListResponse); this.showFormattedData = this.sortArray(categorizedWorkListResponse);
this.allFormattedData = this.showFormattedData; this.allFormattedData = this.showFormattedData;
this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR); this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR);
// this.assignDataToFilters();
} }
} else { } else {
this.newWorkListResponse = []; this.newWorkListResponse = [];
@ -503,7 +507,6 @@ export class HomeComponent implements OnInit {
} }
this.data.datasets[0].data[4] = this.ITGCount; this.data.datasets[0].data[4] = this.ITGCount;
this.showChart = true; this.showChart = true;
// this.common.stopLoading();
this.isLoading = false; this.isLoading = false;
} }
} }
@ -562,11 +565,11 @@ export class HomeComponent implements OnInit {
clearSearch() { clearSearch() {
this.common.startLoading(); this.common.startLoading();
this.isLoading = true; this.isLoading = false;
this.itemType = ''; this.itemType = 'HRSSA';
this.selectedFilter = 'ALL'; this.selectedFilter = 'HR';
this.isPostNoLoad = true; this.isPostNoLoad = true;
// this.disableFilters(); this.enableFilters();
this.resetData(); this.resetData();
this.getAllPushNotificationFun(); this.getAllPushNotificationFun();
} }

Loading…
Cancel
Save