fixing workflow list and fixing search in offer page

enad-Q1
enadhilal 5 years ago
parent b146c90abf
commit bc3b3616a7

@ -74,8 +74,10 @@
<ion-textarea [(ngModel)]="userNote"></ion-textarea> <ion-textarea [(ngModel)]="userNote"></ion-textarea>
</ion-item> </ion-item>
</div> </div>
<div [hidden]="isAnswer==true" <!-- <div [hidden]="isAnswer==true"
*ngIf="actionHistory.length >0 && !userSelected && ReplacementList.length==0 && searchBy === '1'"> *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"> <div class="uk-margin">
{{'replacementRoll, related' | translate}} {{'replacementRoll, related' | translate}}
</div> </div>
@ -127,6 +129,13 @@
</div> </div>
</div> </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"> <div [hidden]="isAnswer==true" *ngIf="ReplacementList.length>0 && !userSelected" class="uk-margin">
{{'replacementRoll, search-result' | translate}} {{'replacementRoll, search-result' | translate}}
</div> </div>

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

@ -13,10 +13,11 @@
<ion-row> <ion-row>
<ion-col size="12"> <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" <ion-input [placeholder]="'itemforsale,search-items'| translate" [(ngModel)]="searchText"
(ionInput)="search($event.target.value)"></ion-input> (ionInput)="search($event.target.value)"></ion-input>
</ion-item> </ion-item> -->
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>

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

Loading…
Cancel
Save