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>
</div>
<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>
<span *ngIf="showSearchButton && newWorkListResponse.length > 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse.length}} {{ts.trPK('work-list','of')}} </span> -->
<h2 *ngIf="!showSearchButton">{{totalRequestCount}}</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>
<h2>{{totalRequestCount}}</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>
</div>
<div *ngIf="!showChart || !receivedITGCount" class="spinner-custom-class">
@ -45,7 +43,7 @@
<span style="margin-left: 5px;">{{ts.trPK('work-list','clear-search')}}</span>
<ion-icon name="close" ></ion-icon>
</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>
<span>{{ts.trPK('work-list','advanced-search')}}</span>
</ion-col>
@ -74,7 +72,6 @@
</div>
</div>
<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 *ngIf="activeSegment !== 'All'" (click)='openITG(segmentInfo)'>
@ -103,7 +100,6 @@
</div>
</div>
</div>
<!-- </div> -->
<ion-infinite-scroll (ionInfinite)="doInfinite($event)" *ngIf="itemType !== ''">
<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_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();
}

Loading…
Cancel
Save