-
-
- {{mentor.key}}
+
+
+ {{mentor.key}}
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
diff --git a/src/app/pages/tabs/mentor-directory/mentor-directory.page.ts b/src/app/pages/tabs/mentor-directory/mentor-directory.page.ts
index 7f947fe1..14aa0e62 100644
--- a/src/app/pages/tabs/mentor-directory/mentor-directory.page.ts
+++ b/src/app/pages/tabs/mentor-directory/mentor-directory.page.ts
@@ -1,11 +1,10 @@
import { Component, OnInit, ViewChild } from '@angular/core';
-import { ActivatedRoute, Router } from '@angular/router';
+import { Router } from '@angular/router';
import { IonContent, IonInfiniteScroll } from '@ionic/angular';
import { urlConstants } from 'src/app/core/constants/urlConstants';
import {
HttpService,
- LoaderService,
- ToastService
+ LoaderService
} from 'src/app/core/services';
import { CommonRoutes } from 'src/global.routes';
@@ -23,7 +22,7 @@ export class MentorDirectoryPage implements OnInit {
searchText: string = '';
public headerConfig: any = {
menu: true,
- label: 'MENTORS_DIRECTORY',
+ // label: 'MENTORS_DIRECTORY',
headerColor: 'primary',
notification: false,
};
@@ -31,26 +30,32 @@ export class MentorDirectoryPage implements OnInit {
mentors = [];
mentorsCount;
isLoaded: boolean = false;
+ filterData : any;
+ filteredDatas = []
+ chips =[]
+ setPaginatorToFirstpage: boolean;
+ criteriaData = []
+ isOpen = false;
+ selectedChipLabel: any;
+ overlayChips = [];
+ selectedChipName: any;
+ urlFilterData: string;
+ directory: boolean = true;
+ selectedChips: boolean = false;
+ data: any;
constructor(
private router: Router,
private loaderService: LoaderService,
- private httpService: HttpService,
- private route: ActivatedRoute
+ private httpService: HttpService
) {
}
- ngOnInit() {
- this.route.queryParamMap.subscribe((queryParams) => {
- this.searchText = queryParams.get('search');
- this.searchText = this.searchText === null ? '' : this.searchText;
- });
- }
+ ngOnInit() {}
- ionViewWillEnter() {
+ async ionViewWillEnter() {
this.page = 1;
this.mentors = [];
- this.searchText = '';
this.getMentors();
this.gotToTop();
}
@@ -62,11 +67,12 @@ export class MentorDirectoryPage implements OnInit {
async getMentors(showLoader = true) {
showLoader ? await this.loaderService.startLoader() : '';
const config = {
- url: urlConstants.API_URLS.MENTORS_DIRECTORY_LIST + this.page + '&limit=' + this.limit + '&search=' + btoa(this.searchText) + '&directory=true',
+ url: urlConstants.API_URLS.MENTORS_DIRECTORY_LIST + this.page + '&limit=' + this.limit + '&search=' + btoa(this.searchText) + '&directory=' + this.directory + '&search_on=' + (this.selectedChipName? this.selectedChipName : '') + '&' + (this.urlFilterData ? this.urlFilterData: ''),
payload: {}
};
try {
let data: any = await this.httpService.get(config);
+ this.data = data.result.data;
this.isLoaded = true
showLoader ? await this.loaderService.stopLoader() : '';
if (this.mentors.length && this.mentors[this.mentors.length - 1].key == data.result.data[0]?.key) {
@@ -93,17 +99,14 @@ export class MentorDirectoryPage implements OnInit {
}
}
async loadMore(event) {
- this.page = this.page + 1;
- await this.getMentors(false);
+ if(this.data){
+ this.page = this.directory ? this.page + 1 : this.page;
+ await this.getMentors(false);
+ }
event.target.complete();
}
onSearch(){
- this.isLoaded = false;
- this.page = 1;
- if (this.searchText) {
- this.router.navigate([CommonRoutes.TABS + '/' + CommonRoutes.MENTOR_DIRECTORY], { queryParams: { search: this.searchText } });
- }
- this.getMentors();
- this.mentors = [];
+ this.router.navigate(['/' + CommonRoutes.MENTOR_SEARCH_DIRECTORY], { queryParams: { search: this.searchText } });
}
+
}
diff --git a/src/app/shared/components/filter-popup/filter-popup.component.html b/src/app/shared/components/filter-popup/filter-popup.component.html
index 46ae2409..10c190ae 100644
--- a/src/app/shared/components/filter-popup/filter-popup.component.html
+++ b/src/app/shared/components/filter-popup/filter-popup.component.html
@@ -5,7 +5,7 @@