add filter and change icon in replacement modal

enad-Q1
enadhilal 4 years ago
parent 56aeec21d2
commit 1644a903d0

@ -159,7 +159,7 @@ export class WorkListMainItgComponent implements OnInit {
return '../assets/imgs/mohemm-action/info.png';
}
if (actionName === 'ReportGenerated') {
return '../assets/imgs/mohemm-action/info.png';
return '../assets/imgs/mohemm-action/ReportGenerated.png';
}
if (actionName === 'Doable') {
return '../assets/imgs/mohemm-action/info.png';

@ -22,21 +22,20 @@
<ion-row class="top-radio-row">
<ion-col class="center">
<ion-radio mode="md" value="1" checked></ion-radio>
<ion-label class="radio-label">{{'addAttach, name' | translate}}</ion-label>
<ion-label class="radio-label">{{'replacementRoll, workflow' | translate}}</ion-label>
</ion-col>
<ion-col>
<ion-radio mode="md" value="2" ></ion-radio>
<ion-label class="radio-label">{{'login, username' | translate}}</ion-label>
<ion-radio mode="md" value="4" ></ion-radio>
<ion-label class="radio-label">{{'replacementRoll, favorite' | translate}}</ion-label>
</ion-col>
<ion-col>
<ion-radio mode="md" value="3" ></ion-radio>
<ion-label class="radio-label">{{'general, email' | translate}}</ion-label>
<ion-radio mode="md" value="2" ></ion-radio>
<ion-label class="radio-label">{{'replacementRoll, employee-id' | translate}}</ion-label>
</ion-col>
<ion-col>
<ion-radio mode="md" value="4" ></ion-radio>
<ion-label class="radio-label">{{'replacementRoll, favorite' | translate}}</ion-label>
<ion-radio mode="md" value="3" ></ion-radio>
<ion-label class="radio-label">{{'replacementRoll, employee-email' | translate}}</ion-label>
</ion-col>
</ion-row>
@ -45,11 +44,16 @@
<ion-item lines="none" class="search-box">
<div style="padding: 5px;" *ngIf="!isFilter">
<ion-input (ionInput)="onChangeInput()" [ngClass]="direction == 'en'? 'filterInput':'filterInput-ar'" [(ngModel)]="inputSearch" [placeholder]='getPlaceHolder()' clearInput="true"></ion-input>
<!-- <ion-input (ionInput)="onChangeInput()" [ngClass]="direction == 'en'? 'filterInput':'filterInput-ar'" [(ngModel)]="inputSearch" [placeholder]='getPlaceHolder()' clearInput="true"></ion-input> -->
<ion-input class='replacmentSearchBar' (ionInput)="onChangeInput()" style="height: 45px;" class="searchbar-input sc-ion-searchbar-md" [(ngModel)]="inputSearch" [placeholder]= '"replacementRoll, searchbyname" | translate' clearInput="true"></ion-input>
</ion-item>
</div>
<div *ngIf="isFilter">
<ion-searchbar class="filterClass" mode='md' (ionInput)="filterList($event)" placeholder="Filter"></ion-searchbar>
</div>
</ion-list>

@ -200,4 +200,8 @@ ion-radio{
}
.top-radio-row{
font-size: 12px;
}
display: block;
padding-bottom: 25px;
padding-top: 15px;
}

@ -47,6 +47,7 @@ export class WorkListReplacementRollComponent implements OnInit {
userSelected: boolean;
actionHistory: [] = [];
favoriteUserList: [] = [];
isFilter = true;
constructor(public worklistService: WorklistService, private cs: CommonService, public ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) {
this.P_PAGE_NUM = 1;
this.P_PAGE_LIMIT = 50;
@ -408,16 +409,29 @@ export class WorkListReplacementRollComponent implements OnInit {
closeModal() {
this.modalCtrl.dismiss();
}
selectedType;
onChangeSelect(select) {
console.log(select.detail.value);
let selectValue = select.detail.value;
if (selectValue == "1" || selectValue == "2" || selectValue == "3") {
if (selectValue == '1') {
this.isSelect = true;
this.isFilter = true;
this.selectedType = 1;
this.listOfRealted = this.actionHistory;
} else if(selectValue === '4'){
this.getFavruite();
this.isFilter = true;
this.selectedType = 4;
} else if( selectValue === '2' || selectValue === '3'){
this.isSelect = true;
} if(selectValue === '4'){this.getFavruite();}
this.isFilter = false;
this.selectedType = 0;
}
else {
this.isSelect = false;
this.selectedType = 0;
}
}
@ -450,6 +464,7 @@ export class WorkListReplacementRollComponent implements OnInit {
if (this.cs.validResponse(result)) {
this.cs.stopLoading();
this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
this.listOfFav = this.favoriteUserList;
}
})
}
@ -518,4 +533,30 @@ export class WorkListReplacementRollComponent implements OnInit {
// }
// }
listOfRealted: any = [];
listOfFav: any = [];
filterList(event){
const val = event.target.value;
if(this.selectedType === 1){
if(val === '') {
this.actionHistory = this.listOfRealted;
} else {
this.actionHistory = this.listOfRealted.filter((item) => {
return (item.NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
});
}
} else if(this.selectedType === 4) {
if(val === '') {
this.favoriteUserList = this.listOfFav;
} else {
this.favoriteUserList = this.listOfFav.filter((item) => {
return (item.EMPLOYEE_DISPLAY_NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
});
}
}else{
return;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -2194,8 +2194,8 @@
"ar": "البحث باسم المستخدم"
},
"searchbyname": {
"en": "Search by name",
"ar": "البحث عن طريق الإسم"
"en": " Search by name",
"ar": "البحث عن طريق الإسم "
},
"searchbyemail": {
"en": "Search by email",
@ -2212,7 +2212,24 @@
"favorite": {
"en": "Favorite",
"ar": "مفضل"
},
"workflow":{
"en":"WorkFlow",
"ar":"سير العمل"
},
"employee-id":{
"en":"Employee ID",
"ar":"هوية الموظف"
},
"employee-email":{
"en":"Employee Email",
"ar":"البريد الإلكتروني للموظف"
},
"employee-name":{
"en":"Employee Name",
"ar":"اسم الموظف"
}
},
"worklist": {
"view": {

@ -1605,3 +1605,10 @@ ion-segment-button {
.searchbar-input.sc-ion-searchbar-md {
border-radius: 25px;
}
.replacmentSearchBar{
}
.replacmentSearchBar input{
padding-left: 17px;
}
Loading…
Cancel
Save