fixing workflow list and fixing search in offer page

MOHEMM-Q3-DEV-LATEST
enadhilal 4 years ago
parent b146c90abf
commit bc3b3616a7

@ -74,8 +74,10 @@
<ion-textarea [(ngModel)]="userNote"></ion-textarea>
</ion-item>
</div>
<div [hidden]="isAnswer==true"
*ngIf="actionHistory.length >0 && !userSelected && ReplacementList.length==0 && searchBy === '1'">
<!-- <div [hidden]="isAnswer==true"
*ngIf="actionHistory.length >0 && !userSelected && ReplacementList.length==0 && searchBy === '1'"> -->
<div [hidden]="isAnswer==true"
*ngIf="actionHistory.length >0 && !userSelected && searchBy === '1'">
<div class="uk-margin">
{{'replacementRoll, related' | translate}}
</div>
@ -127,6 +129,13 @@
</div>
</div>
</div>
<div *ngIf="favoriteUserList.length === 0 && searchBy == '4'">
<ion-label>
<p style="text-align: center;">
Sorry there is no data
</p>
</ion-label>
</div>
<div [hidden]="isAnswer==true" *ngIf="ReplacementList.length>0 && !userSelected" class="uk-margin">
{{'replacementRoll, search-result' | translate}}
</div>

@ -45,7 +45,8 @@ export class WorkListReplacementRollComponent implements OnInit {
P_RESPOND_ATTRIBUTES_TBL: any[];
typingTimer: any;
userSelected: boolean;
actionHistory: [] = [];
actionHistory = [];
arr = [];
favoriteUserList: [] = [];
isFilter = true;
constructor(public worklistService: WorklistService, private cs: CommonService, public ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) {
@ -59,8 +60,21 @@ export class WorkListReplacementRollComponent implements OnInit {
console.log(this.getpassResAttr);
this.pQuestion = this.cs.sharedService.getSharedData('pQuestion', false);
this.actionHistory = this.cs.sharedService.getSharedData('actionHistoryData', false) ? this.cs.sharedService.getSharedData('actionHistoryData', false) : [];
if (this.getPassActionMode == "ANSWER_INFO") {
// tslint:disable-next-line: max-line-length
this.arr = this.cs.sharedService.getSharedData('actionHistoryData', false) ? this.cs.sharedService.getSharedData('actionHistoryData', false) : [];
var lookupObject = {};
for(var i in this.arr) {
lookupObject[this.arr[i]['USER_NAME']] = this.arr[i];
}
for(i in lookupObject) {
this.actionHistory.push(lookupObject[i]);
}
console.log(this.actionHistory);
if (this.getPassActionMode === 'ANSWER_INFO') {
this.isAnswer = true;
}
@ -285,15 +299,17 @@ export class WorkListReplacementRollComponent implements OnInit {
});
} else {
let msg: string = this.ts.trPK("replacementRoll", "enterNote");
this.cs.showErrorMessageDialog(() => {
}, this.ts.trPK('general', 'ok'), msg);
this.cs.toastPK("replacementRoll", "enterNote");
// let msg: string = this.ts.trPK("replacementRoll", "enterNote");
// this.cs.showErrorMessageDialog(() => {
// }, this.ts.trPK('general', 'ok'), msg);
}
} else {
let msg: string = this.ts.trPK("replacementRoll", "msg");
this.cs.showErrorMessageDialog(() => {
}, this.ts.trPK('general', 'ok'), msg);
this.cs.toastPK("replacementRoll", "msg");
// let msg: string = this.ts.trPK("replacementRoll", "msg");
// this.cs.showErrorMessageDialog(() => {
// }, this.ts.trPK('general', 'ok'), msg);
}
} else if (this.isAnswer == true) {
if (this.userNote) {
@ -308,14 +324,16 @@ export class WorkListReplacementRollComponent implements OnInit {
this.handleApplayActionResult(result);
});
} else {
let msg: string = this.ts.trPK("replacementRoll", "enterNote");
this.cs.showErrorMessageDialog(() => {
}, this.ts.trPK('general', 'ok'), msg);
this.cs.toastPK("replacementRoll", "enterNote");
// let msg: string = this.ts.trPK("replacementRoll", "enterNote");
// this.cs.showErrorMessageDialog(() => {
// }, this.ts.trPK('general', 'ok'), msg);
}
} else {
let msg: string = this.ts.trPK("replacementRoll", "msg");
this.cs.showErrorMessageDialog(() => {
}, this.ts.trPK('general', 'ok'), msg);
this.cs.toastPK("replacementRoll", "msg");
// let msg: string = this.ts.trPK("replacementRoll", "msg");
// this.cs.showErrorMessageDialog(() => {
// }, this.ts.trPK('general', 'ok'), msg);
}
}
@ -430,8 +448,9 @@ export class WorkListReplacementRollComponent implements OnInit {
this.listOfRealted = this.actionHistory;
} else if(selectValue === '4'){
console.log(this.listOfFav.length)
if(this.favoriteUserList.length === 0 || this.favoriteUserList === undefined )
if(this.favoriteUserList.length === 0 || this.favoriteUserList === undefined ) {
this.getFavruite();
}
this.isFilter = true;
this.selectedType = 4;
} else if( selectValue === '2' || selectValue === '3' || selectValue === '5'){

@ -13,10 +13,11 @@
<ion-row>
<ion-col size="12">
<ion-item lines="none" class="SearchtextBox">
<ion-searchbar mode='md' (ionInput)="search($event.target.value)" style="--background: white; margin-top: 10px; padding-bottom: 20px;"></ion-searchbar>
<!-- <ion-item lines="none" class="SearchtextBox">
<ion-input [placeholder]="'itemforsale,search-items'| translate" [(ngModel)]="searchText"
(ionInput)="search($event.target.value)"></ion-input>
</ion-item>
</ion-item> -->
</ion-col>
</ion-row>
<ion-row>

@ -107,6 +107,7 @@ export class HomeComponent implements AfterViewInit {
var parseJSON = data['data'];
var offers = JSON.parse(parseJSON);
this.offersData = offers;
this.tempSearch = this.offersData;
}
}
@ -137,11 +138,16 @@ export class HomeComponent implements AfterViewInit {
return temporalDivElement.textContent || temporalDivElement.innerText || "";
}
search(t) {
this.offersData = this.tempSearch.filter((post, index) => {
if (post.Title.toLowerCase().indexOf(t.toLowerCase()) > -1)
return true;
});
console.log(this.tempSearch);
if(t === ''){
this.offersData = this.tempSearch;
} else{
this.offersData = this.tempSearch.filter((post) => {
return (post.Title.toLowerCase().indexOf(t.toLowerCase()) > -1);
});
}
}

Loading…
Cancel
Save