Skip to content

Commit

Permalink
Merge pull request #505 from rahulramakrishnan3/release-3.0.0
Browse files Browse the repository at this point in the history
story 905
  • Loading branch information
Cafnanc authored Jun 25, 2024
2 parents c4611e5 + bf5e7e4 commit e305e1e
Show file tree
Hide file tree
Showing 32 changed files with 1,152 additions and 200 deletions.
14 changes: 14 additions & 0 deletions src/app/core/services/form/form.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,18 @@ export class FormService {
})
return existingData
}

async filterList(obj){
const config = {
url: urlConstants.API_URLS.FILTER_LIST + '&type=' + obj,
payload: {},
};
try {
const data: any = await this.http.get(config);
return data.result
}
catch (error) {
return null;
}
}
}
1 change: 1 addition & 0 deletions src/app/core/services/permission/permission.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export class PermissionService {
try {
const data: any = await this.httpService.get(config);
this.setConfigInLocal(data.result)
return data
}
catch (error) {
return null;
Expand Down
16 changes: 16 additions & 0 deletions src/app/core/services/profile/profile.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,20 @@ export class ProfileService {
modal.present();
}

async getMentors(showLoader = true, obj){
showLoader ? await this.loaderService.startLoader() : '';
const config = {
url: urlConstants.API_URLS.MENTORS_DIRECTORY_LIST + obj?.page + '&limit=' + obj.pageSize + '&search=' + btoa(obj.searchText) + '&directory=false'+ '&search_on=' + (obj?.selectedChip? obj?.selectedChip : '') + '&' + (obj?.urlQueryData ? obj?.urlQueryData: ''),
payload: {}
};
try {
let data: any = await this.httpService.get(config);
showLoader ? await this.loaderService.stopLoader() : '';
return data;
}
catch (error) {
showLoader ? await this.loaderService.stopLoader() : '';
}
}

}
14 changes: 13 additions & 1 deletion src/app/core/services/session/session.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class SessionService {

async getSessionsList(obj) {
const config = {
url: urlConstants.API_URLS.GET_SESSIONS_LIST + obj?.type + '&page=' + obj?.page + '&limit=' + obj?.limit + '&search=' + btoa(obj?.searchText),
url: urlConstants.API_URLS.GET_SESSIONS_LIST + obj?.page + '&limit=' + obj?.limit + '&search=' + btoa(obj?.searchText) + '&search_on=' + (obj?.selectedChip ? obj?.selectedChip : '') + '&' + obj?.filterData,
};
try {
let data: any = await this.httpService.get(config);
Expand Down Expand Up @@ -252,4 +252,16 @@ export class SessionService {
catch (error) {
}
}

async getSessions(obj) {
const config = {
url: urlConstants.API_URLS.HOME_SESSION + obj.page + '&limit=' + obj.limit,
};
try {
let data: any = await this.httpService.get(config);
return data
}
catch (error) {
}
}
}
5 changes: 5 additions & 0 deletions src/app/modules/private/private-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ const routes: Routes = [
loadChildren: () => import('../../pages/login-activity/login-activity.module').then(m => m.LoginActivityPageModule),
canActivate: [PrivateGuard]
},
{
path: CommonRoutes.MENTOR_SEARCH_DIRECTORY,
loadChildren: () => import('../../pages/mentor-search-directory/mentor-search-directory.module').then(m => m.MentorSearchDirectoryPageModule),
canActivate: [PrivateGuard]
},
{
path: '',
redirectTo: '',
Expand Down
6 changes: 5 additions & 1 deletion src/app/pages/home-search/home-search.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { HomeSearchPageRoutingModule } from './home-search-routing.module';
import { HomeSearchPage } from './home-search.page';
import { CoreModule } from 'src/app/core/core.module';
import { SharedModule } from 'src/app/shared/shared.module';
import { MatPaginatorModule } from '@angular/material/paginator';
import { OverlayModule } from '@angular/cdk/overlay';

@NgModule({
imports: [
Expand All @@ -17,7 +19,9 @@ import { SharedModule } from 'src/app/shared/shared.module';
CoreModule,
SharedModule,
IonicModule,
HomeSearchPageRoutingModule
HomeSearchPageRoutingModule,
MatPaginatorModule,
OverlayModule
],
declarations: [HomeSearchPage]
})
Expand Down
115 changes: 67 additions & 48 deletions src/app/pages/home-search/home-search.page.html
Original file line number Diff line number Diff line change
@@ -1,51 +1,70 @@
<app-page-header [config]="headerConfig"></app-page-header>
<ion-content class="ion-padding">
<ion-toolbar>
<ion-searchbar (ionClear)="cancelSearch($event)" class="top-padding" [(ngModel)]="searchText" placeholder="" (keypress)="checkInput($event)" debounce="100"></ion-searchbar>
</ion-toolbar>
<ion-segment (ionChange)="segmentChanged($event)" [value]="type">
<ion-segment-button value="all-sessions">
<ion-label class="segment-label">{{ "SESSIONS" | translate }}</ion-label>
</ion-segment-button>
<ion-segment-button value="mentor-profile">
<ion-label class="segment-label">{{ "MENTORS" | translate }}</ion-label>
</ion-segment-button>
</ion-segment>
<div *ngIf="results">
<div [ngSwitch]="type">
<ion-list *ngSwitchCase="'all-sessions'">
<ion-grid>
<ion-row class="d-flex ">
<ion-col *ngFor="let result of results" padding size-xs="12" size-sm="12" size-md="6" size-lg="6"
align-self-stretch>
<div class="my-10" >
<app-session-card [data]="result" (onClickEvent)="onSessionAction($event)">
</app-session-card>
</div>
</ion-col>
</ion-row>
</ion-grid>
</ion-list>
<ion-list *ngSwitchCase="'mentor-profile'">
<div *ngFor="let result of results">
<ion-grid >
<ion-row class="d-flex ">
<ion-col *ngFor="let value of result.values" padding size-xs="12" size-sm="12" size-md="6" size-lg="4" align-self-stretch>
<app-mentor-card class="mentor-card" [data]="value" (onClickEvent)="eventAction($event)">
</app-mentor-card>
</ion-col>
<app-page-header [config]="headerConfig">
<div class="d-flex flex-justify-center my-8">
<ion-searchbar class="search-bar" [debounce]="1000" placeholder="{{'HOME_SEARCH_PLACEHOLDER' | translate}}" #event [(ngModel)]="searchText" (keyup.enter)="search(event.value)"
cdkOverlayOrigin #trigger="cdkOverlayOrigin" (click)="isOpen = !isOpen">
</ion-searchbar>
</div>
</app-page-header>
<ion-toolbar class="padding-top-10">
<ng-template
cdkConnectedOverlay
[cdkConnectedOverlayOrigin]="trigger"
[cdkConnectedOverlayOpen]="isOpen"
(overlayOutsideClick)="isOpen = false"
[cdkConnectedOverlayOffsetY]="10"
[cdkConnectedOverlayWidth]="trigger.elementRef.nativeElement.offsetWidth"
>
<ion-grid>
<div class="overlay-container">
<ion-row>
<ion-chip
class="overlay-chip"
*ngFor="let chip of overlayChips; let i = index"
(click)="selectChip(chip)"
[ngClass]="{'selected-chip': criteriaChip === chip.label}">
<ion-icon name="close-circle" color="white"></ion-icon>
<ion-label class="chip-label">{{ chip.label }}</ion-label>
</ion-chip>
</ion-row>
</ion-grid>
</div>
</ion-list>
</div>
</div>
<div *ngIf="noResults && !searching">
<app-no-data-found [messageHeader]="'SORRY_NO_RESULTS'"> </app-no-data-found>
</div>
</ion-grid>
</ng-template>
<ion-grid>
<ion-row>
<ion-col *ngIf="criteriaChip" 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-chip>
</div>
</ion-col>
<ion-col size="auto">
<div *ngIf="chips.length && criteriaChip" class="verticalLine"><hr></div>
</ion-col>
<ion-col class="chip-container">
<ion-row>
<div>
<ion-chip class="chip" *ngFor="let chip of chips ; let i = index">
<ion-icon name="close-circle" (click)="removeChip(chip.value, i)" color="white"></ion-icon>
<ion-label class="chip-label">{{ chip.label }}</ion-label>
</ion-chip>
</div>
</ion-row>
</ion-col>
<ion-col size="auto" style="display: flex;align-items: center;">
<div style="width: 5em">
<div class="filter">
<p style="margin: unset;">{{"FILTER" | translate}}</p>
<div class="circle-container" (click)="onClickFilter()">
<ion-icon class="ion-funnel-icon" name="funnel"></ion-icon>
</div>
</div>
</div>
</ion-col>
</ion-row>
</ion-grid>
</ion-toolbar>
<ion-content>
<app-generic-search [results]="results" [totalCount]="totalCount" [searchValue]="searchText" (onClickEvent)="eventAction($event)" (onPageChangeEvent)="onPageChange($event)"></app-generic-search>
</ion-content>
<ion-footer class="ion-no-border">
<ion-button [disabled]="trimLeft(searchText)?.length < 3" expand="full" (click)="search()">
<ion-icon name="search" class="ion-margin-right"></ion-icon> {{"SEARCH" | translate}}
</ion-button>
</ion-footer>
97 changes: 96 additions & 1 deletion src/app/pages/home-search/home-search.page.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,98 @@
.segment-label{
text-transform: none;
}
}
.search-bar{
--border-radius:25px;
--icon-color:var(--ion-color-primary);
font-size:16px;
height: 36px;
max-width: 600px;
min-width: 350px;
}
ion-content {
--padding: 0;
}

.ion-funnel-icon {
font-size: 12px;
color: var(--white);
}

.search-navigation{
display: flex;
justify-content: space-between;
}

.search-result-label{
display: flex;
align-items: center;
}

.verticalLine {
border-left: thin solid #807e7e;
height: 32px;
}
.search-result-count{
display: flex;
padding-left: 24%;
}

.selected-chip{
--background:var(--ion-color-primary);
--color:var(--white);
}
.filter{
display: flex;
flex-direction: row;
gap: 5px;
justify-content: end;
padding: 0 2%;
}
.chip {
background-color: var(--ion-color-primary);
font-size: 14px;
color: var(--white);
align-items: center;
display: inline-block;
text-decoration: none;
}
.circle-container {
width: 20px;
height: 20px;
border-radius: 50%;
background-color: #832215;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--white);
}
.chip-container {
display: flex;
white-space: nowrap;
width: calc(100% - 100px);
overflow-y: auto;
scrollbar-width: none;
}

.overlay-container {
background-color: white;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
border-radius: 4px;
padding: 16px;
max-width: 100%;
z-index: 1000;
}
.overlay-chip {
font-size: 14px;
align-items: center;
display: inline-block;
text-decoration: none;
ion-icon {
color: white;
}
&.selected-chip {
background-color: var(--ion-color-primary);
color: white;
}
}
Loading

0 comments on commit e305e1e

Please sign in to comment.