From 13a9e0aeba0db5f6a4c972248a6af9460d0db347 Mon Sep 17 00:00:00 2001 From: Rahul K R Date: Fri, 19 Jul 2024 15:32:33 +0530 Subject: [PATCH 1/6] BUG fix : 1407,1401 --- .../components/filter-tree/filter-tree.component.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/app/shared/components/filter-tree/filter-tree.component.ts b/src/app/shared/components/filter-tree/filter-tree.component.ts index 7c9ad2a8..8afde640 100644 --- a/src/app/shared/components/filter-tree/filter-tree.component.ts +++ b/src/app/shared/components/filter-tree/filter-tree.component.ts @@ -11,17 +11,18 @@ export class FilterTreeComponent implements OnInit { @Input() filterData: any; @Output() filtersChanged = new EventEmitter(); - ogArrObj: any; constructor() { } - ngOnInit() { - this.ogArrObj = _.cloneDeep(this.filterData); - } + ngOnInit() { } clearAll() { - this.filterData = _.cloneDeep(this.ogArrObj) + if (this.filterData) { + this.filterData.forEach(filter => + filter.options = filter.options.map(option => ({ ...option, selected: false })) + ); + } this.filtersChanged.emit([]) } From c4740aa7e41748942b2cd7d4f2841014b5fe6701 Mon Sep 17 00:00:00 2001 From: Rahul K R Date: Fri, 19 Jul 2024 17:57:02 +0530 Subject: [PATCH 2/6] BUG fix 1334 --- src/app/pages/tabs/dashboard/dashboard.page.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/pages/tabs/dashboard/dashboard.page.ts b/src/app/pages/tabs/dashboard/dashboard.page.ts index 4cf5f8bd..e78aaca1 100644 --- a/src/app/pages/tabs/dashboard/dashboard.page.ts +++ b/src/app/pages/tabs/dashboard/dashboard.page.ts @@ -41,14 +41,13 @@ export class DashboardPage implements OnInit { private profile: ProfileService, private apiService: HttpService) { } - ngOnInit() { + ngOnInit() { } + + ionViewWillEnter() { this.isMentor = this.profile.isMentor; this.segment = this.isMentor ? "mentor" : "mentee"; this.dataAvailable = true; this.getReports(); - } - - ionViewWillEnter() { this.gotToTop(); } From f7098772a6182a3e7a16c7167146eed0c11fac39 Mon Sep 17 00:00:00 2001 From: Rahul K R Date: Fri, 19 Jul 2024 17:57:34 +0530 Subject: [PATCH 3/6] console error fix --- .../admin/components/manage-session/manage-session.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/modules/admin/components/manage-session/manage-session.component.ts b/src/app/modules/admin/components/manage-session/manage-session.component.ts index e63b97d0..da7344c7 100644 --- a/src/app/modules/admin/components/manage-session/manage-session.component.ts +++ b/src/app/modules/admin/components/manage-session/manage-session.component.ts @@ -171,7 +171,7 @@ export class ManageSessionComponent implements OnInit { modal.onDidDismiss().then(async (dataReturned) => { this.filteredDatas = [] - if (dataReturned !== null) { + if (dataReturned.data && dataReturned.data.data) { if (dataReturned.data.data.selectedFilters) { for (let key in dataReturned.data.data.selectedFilters) { this.filteredDatas[key] = dataReturned.data.data.selectedFilters[key].slice(0, dataReturned.data.data.selectedFilters[key].length).map(obj => obj.value).join(',').toString() From 95da12f484b927fbc27c5eacf02464bf82a838d6 Mon Sep 17 00:00:00 2001 From: Rahul K R Date: Fri, 19 Jul 2024 17:59:03 +0530 Subject: [PATCH 4/6] bug fix : 1403 --- src/app/pages/home-search/home-search.page.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/pages/home-search/home-search.page.ts b/src/app/pages/home-search/home-search.page.ts index 9158cb39..c2349ddd 100644 --- a/src/app/pages/home-search/home-search.page.ts +++ b/src/app/pages/home-search/home-search.page.ts @@ -66,7 +66,7 @@ export class HomeSearchPage implements OnInit { this.searchText = searchText; }); this.criteriaChipSubscription = this.utilService.currentCriteriaChip.subscribe(selectedCriteria => { - this.criteriaChip = JSON.parse(selectedCriteria); + this.criteriaChip = selectedCriteria ? JSON.parse(selectedCriteria) : ""; }); this.user = this.localStorage.getLocalData(localKeys.USER_DETAILS) this.fetchSessionList() @@ -227,6 +227,12 @@ export class HomeSearchPage implements OnInit { } } } + + ionViewWillLeave(){ + this.searchText = ""; + this.criteriaChip = ""; + this.chips = []; + } ngOnDestroy() { this.searchTextSubscription.unsubscribe(); From 0f90889b2ddaf43d1a7050a98950567d0dbb9c42 Mon Sep 17 00:00:00 2001 From: Rahul K R Date: Sat, 20 Jul 2024 20:47:58 +0530 Subject: [PATCH 5/6] mentor search fix --- .../mentor-search-directory.page.html | 8 +++---- .../mentor-search-directory.page.ts | 23 ++++++++++++------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/app/pages/mentor-search-directory/mentor-search-directory.page.html b/src/app/pages/mentor-search-directory/mentor-search-directory.page.html index 4fcc4caf..1f98b2a2 100644 --- a/src/app/pages/mentor-search-directory/mentor-search-directory.page.html +++ b/src/app/pages/mentor-search-directory/mentor-search-directory.page.html @@ -22,7 +22,7 @@ *ngFor="let chip of overlayChips; let i = index" (click)="selectChip(chip)" [ngClass]="{'selected-chip': selectedChipLabel === chip.label}"> - + {{ chip.label }} @@ -32,16 +32,16 @@ - +
- {{selectedChipLabel}} + {{showSelectedCriteria}}
-

+

diff --git a/src/app/pages/mentor-search-directory/mentor-search-directory.page.ts b/src/app/pages/mentor-search-directory/mentor-search-directory.page.ts index 4ad92968..8476e4f6 100644 --- a/src/app/pages/mentor-search-directory/mentor-search-directory.page.ts +++ b/src/app/pages/mentor-search-directory/mentor-search-directory.page.ts @@ -42,6 +42,7 @@ export class MentorSearchDirectoryPage implements OnInit { totalCount: any; limit: any; chips = []; + showSelectedCriteria: any; constructor( private router: Router, @@ -66,6 +67,7 @@ export class MentorSearchDirectoryPage implements OnInit { onSearch(event){ if (event.length >= 3) { this.searchText = event; + this.showSelectedCriteria = this.selectedChipLabel; this.getMentors(); } else { this.toast.showToast("ENTER_MIN_CHARACTER","danger"); @@ -73,23 +75,25 @@ export class MentorSearchDirectoryPage implements OnInit { } selectChip(chip) { - this.selectedChipLabel = chip.label; - this.selectedChipName = chip.name; - this.isOpen = false; - this.getMentors() + if (this.selectedChipLabel === chip.label) { + this.selectedChipLabel = null; + this.selectedChipName = null; + } else { + this.selectedChipLabel = chip.label; + this.selectedChipName = chip.name; + } } closeCriteriaChip(){ this.selectedChipLabel = ""; this.selectedChipName = ""; - this.getMentors() + this.showSelectedCriteria = ""; } removeChip(chip: string,index: number) { this.chips.splice(index, 1); this.removeFilteredData(chip) this.getUrlQueryData(); - this.getMentors() } async onClickFilter() { @@ -175,8 +179,11 @@ export class MentorSearchDirectoryPage implements OnInit { async getMentors(){ var obj = {page: this.page, pageSize: this.pageSize, searchText: this.searchText.trim(), selectedChip: this.selectedChipName, urlQueryData: this.urlQueryData}; let data = await this.profileService.getMentors(true,obj); - this.data = data.result.data; - this.totalCount = data.result.count; + if(data && data.result){ + this.isOpen = false; + this.data = data.result.data; + this.totalCount = data.result.count; + } } } From 8738de8b14d67aa02296e31dd49c847118ba6c36 Mon Sep 17 00:00:00 2001 From: Rahul K R Date: Sat, 20 Jul 2024 21:29:03 +0530 Subject: [PATCH 6/6] session search fix --- src/app/pages/home-search/home-search.page.html | 8 ++++---- src/app/pages/home-search/home-search.page.ts | 13 +++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/app/pages/home-search/home-search.page.html b/src/app/pages/home-search/home-search.page.html index b0c05cd8..f1758332 100644 --- a/src/app/pages/home-search/home-search.page.html +++ b/src/app/pages/home-search/home-search.page.html @@ -24,7 +24,7 @@ *ngFor="let chip of overlayChips; let i = index" (click)="selectChip(chip)" [ngClass]="{'selected-chip': criteriaChip?.label === chip.label}"> - + {{ chip.label }} @@ -33,16 +33,16 @@ - +
- {{criteriaChip?.label}} + {{showSelectedCriteria?.label}}
-

+

diff --git a/src/app/pages/home-search/home-search.page.ts b/src/app/pages/home-search/home-search.page.ts index c2349ddd..5dfbc71f 100644 --- a/src/app/pages/home-search/home-search.page.ts +++ b/src/app/pages/home-search/home-search.page.ts @@ -50,6 +50,7 @@ export class HomeSearchPage implements OnInit { pageSize: any; searchTextSubscription: Subscription; criteriaChipSubscription: Subscription; + showSelectedCriteria: any; constructor(private modalCtrl: ModalController, private router: Router, private toast: ToastService, private sessionService: SessionService, @@ -76,6 +77,7 @@ export class HomeSearchPage implements OnInit { } async ionViewWillEnter() { + this.showSelectedCriteria = this.criteriaChip? this.criteriaChip : ""; const obj = {filterType: 'session', org: false}; let data = await this.formService.filterList(obj); this.filterData = await this.utilService.transformToFilterData(data, obj); @@ -84,6 +86,7 @@ export class HomeSearchPage implements OnInit { search(event) { if (event.length >= 3) { this.searchText = event; + this.showSelectedCriteria = this.criteriaChip; this.isOpen = false; this.fetchSessionList() } else { @@ -187,14 +190,16 @@ export class HomeSearchPage implements OnInit { closeCriteriaChip(){ this.criteriaChip = null; + this.showSelectedCriteria = null; this.router.navigate(['/' + CommonRoutes.HOME_SEARCH], { queryParams: {searchString : this.searchText} }); - this.fetchSessionList() } selectChip(chip) { - this.criteriaChip = chip; - this.fetchSessionList() - this.isOpen = false; + if (this.criteriaChip === chip) { + this.criteriaChip = null; + } else { + this.criteriaChip = chip; + } } getUrlQueryData() {