Skip to content

Commit

Permalink
Merge pull request #525 from rahulramakrishnan3/release-3.0.0
Browse files Browse the repository at this point in the history
Release 3.0.0
  • Loading branch information
Cafnanc committed Jul 22, 2024
2 parents f43f837 + 8738de8 commit 8a03ff9
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions src/app/pages/home-search/home-search.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*ngFor="let chip of overlayChips; let i = index"
(click)="selectChip(chip)"
[ngClass]="{'selected-chip': criteriaChip?.label === chip.label}">
<ion-icon name="close-circle" color="white"></ion-icon>
<ion-icon name="close-circle" style="pointer-events: none;" color="white"></ion-icon>
<ion-label class="chip-label">{{ chip.label }}</ion-label>
</ion-chip>
</ion-row>
Expand All @@ -33,16 +33,16 @@
</ng-template>
<ion-grid>
<ion-row>
<ion-col *ngIf="criteriaChip" size="auto">
<ion-col *ngIf="showSelectedCriteria" size="auto">
<div style="width: auto">
<ion-chip class="chip">
<ion-icon name="close-circle" color="white" (click)="closeCriteriaChip()"></ion-icon>
<ion-label class="chip-label">{{criteriaChip?.label}}</ion-label>
<ion-label class="chip-label">{{showSelectedCriteria?.label}}</ion-label>
</ion-chip>
</div>
</ion-col>
<ion-col size="auto">
<div *ngIf="chips.length && criteriaChip" class="verticalLine"><hr></div>
<div *ngIf="chips.length && showSelectedCriteria" class="verticalLine"><hr></div>
</ion-col>
<ion-col class="chip-container">
<ion-row>
Expand Down
21 changes: 16 additions & 5 deletions src/app/pages/home-search/home-search.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -66,7 +67,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()
Expand All @@ -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);
Expand All @@ -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 {
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -227,6 +232,12 @@ export class HomeSearchPage implements OnInit {
}
}
}

ionViewWillLeave(){
this.searchText = "";
this.criteriaChip = "";
this.chips = [];
}

ngOnDestroy() {
this.searchTextSubscription.unsubscribe();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*ngFor="let chip of overlayChips; let i = index"
(click)="selectChip(chip)"
[ngClass]="{'selected-chip': selectedChipLabel === chip.label}">
<ion-icon name="close-circle" color="white"></ion-icon>
<ion-icon name="close-circle" style="pointer-events: none;" color="white"></ion-icon>
<ion-label class="chip-label">{{ chip.label }}</ion-label>
</ion-chip>
</ion-row>
Expand All @@ -32,16 +32,16 @@
<ion-toolbar class="padding-top-10">
<ion-grid>
<ion-row>
<ion-col size="auto" *ngIf="selectedChipLabel">
<ion-col size="auto" *ngIf="showSelectedCriteria">
<div style="width: auto">
<ion-chip class="chip">
<ion-icon name="close-circle" color="white" (click)="closeCriteriaChip()"></ion-icon>
<ion-label class="chip-label">{{selectedChipLabel}}</ion-label>
<ion-label class="chip-label">{{showSelectedCriteria}}</ion-label>
</ion-chip>
</div>
</ion-col>
<ion-col size="auto">
<div *ngIf="chips.length && selectedChipLabel" class="verticalLine"><hr></div>
<div *ngIf="chips.length && showSelectedCriteria" class="verticalLine"><hr></div>
</ion-col>
<ion-col class="chip-container">
<ion-row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class MentorSearchDirectoryPage implements OnInit {
totalCount: any;
limit: any;
chips = [];
showSelectedCriteria: any;

constructor(
private router: Router,
Expand All @@ -66,30 +67,33 @@ 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");
}
}

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() {
Expand Down Expand Up @@ -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;
}
}

}
7 changes: 3 additions & 4 deletions src/app/pages/tabs/dashboard/dashboard.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
11 changes: 6 additions & 5 deletions src/app/shared/components/filter-tree/filter-tree.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ export class FilterTreeComponent implements OnInit {
@Input() filterData: any;
@Output() filtersChanged = new EventEmitter<any>();

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([])
}

Expand Down

0 comments on commit 8a03ff9

Please sign in to comment.