+
{{"JOIN" | translate}}
diff --git a/src/app/pages/session-detail/session-detail.page.scss b/src/app/pages/session-detail/session-detail.page.scss
index 3c00a0ba..97067384 100644
--- a/src/app/pages/session-detail/session-detail.page.scss
+++ b/src/app/pages/session-detail/session-detail.page.scss
@@ -53,4 +53,22 @@ ion-item {
}
.image-container{
height: 200px;
+}
+.person-container{
+ font-size: 20px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ padding-right: 10px;
+}
+
+.manager-text-container{
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ gap: 5px;
+ font-size: 16px;
+ color: rgb(0, 0, 0);
+ margin-left: 6px;
+ margin-bottom: 4px;
}
\ No newline at end of file
diff --git a/src/app/pages/session-detail/session-detail.page.ts b/src/app/pages/session-detail/session-detail.page.ts
index 95f0d06f..d92aba16 100644
--- a/src/app/pages/session-detail/session-detail.page.ts
+++ b/src/app/pages/session-detail/session-detail.page.ts
@@ -6,10 +6,12 @@ import { CommonRoutes } from 'src/global.routes';
import * as moment from 'moment';
import { localKeys } from 'src/app/core/constants/localStorage.keys';
import { Location } from '@angular/common';
-import { ToastController } from '@ionic/angular';
+import { ModalController, ToastController } from '@ionic/angular';
import { TranslateService } from '@ngx-translate/core';
import { App, AppState } from '@capacitor/app';
import { Clipboard } from '@capacitor/clipboard';
+import { MenteeListPopupComponent } from 'src/app/shared/components/mentee-list-popup/mentee-list-popup.component';
+import { EventListenerFocusTrapInertStrategy } from '@angular/cdk/a11y';
@Component({
@@ -20,6 +22,7 @@ import { Clipboard } from '@capacitor/clipboard';
export class SessionDetailPage implements OnInit {
id: any;
showEditButton: any;
+ isConductor:any =false;
isCreator:any = false;
userDetails: any;
isEnabled: boolean;
@@ -33,10 +36,14 @@ export class SessionDetailPage implements OnInit {
isLoaded : boolean = false
public isMobile:any
userCantAccess:any = true;
+ enrolledMenteeList:any;
+ sessionManagerText="";
+ activeUrl:any;
+ isNotInvited: any;
constructor(private localStorage: LocalStorageService, private router: Router,
private activatedRoute: ActivatedRoute, private sessionService: SessionService,
- private utilService: UtilService, private toast: ToastService, private user: UserService ,private toaster: ToastController,private translate : TranslateService,) {
+ private utilService: UtilService, private toast: ToastService, private user: UserService ,private toaster: ToastController,private translate : TranslateService,private modalCtrl: ModalController) {
this.id = this.activatedRoute.snapshot.paramMap.get('id')
this.isMobile = utilService.isMobile()
}
@@ -76,7 +83,8 @@ export class SessionDetailPage implements OnInit {
{
title: 'MEDIUM',
key: 'medium',
- }
+ },
+
],
data: {
id:'',
@@ -129,7 +137,12 @@ export class SessionDetailPage implements OnInit {
is_enrolled:null,
title:"",
start_date:"",
- meeting_info:""
+ meeting_info:"",
+ mentee_count:0,
+ isCreator:false,
+ isConductor:false,
+ manager_name:"",
+ mentor_designation:[]
},
};
@@ -138,24 +151,47 @@ export class SessionDetailPage implements OnInit {
this.sessionDatas = response?.result;
this.isLoaded = true ;
this.userCantAccess = response?.responseCode == 'OK' ? false:true
+ this.isCreator = response.result.created_by == this.userDetails.id ? true:false;
+ this.isConductor = this.userDetails.id == response.result.mentor_id ? true : false;
+ this.sessionManagerText = this.isConductor ? "ASSIGNED_BY":"INVITED_BY";
+ this.isNotInvited = response?.result?.enrolment_type === 'INVITED'? false : true;
if (!this.userCantAccess) {
response = response.result;
this.setPageHeader(response);
let readableStartDate = moment.unix(response.start_date).toLocaleString();
let currentTimeInSeconds=Math.floor(Date.now()/1000);
if(response.is_enrolled){
- this.isEnabled = ((response.start_date - currentTimeInSeconds) < 600 || response.status=='LIVE') ? true : false
+ this.isEnabled = ((response.start_date - currentTimeInSeconds) < 600 || response?.status?.value=='LIVE') ? true : false
} else {
- this.isEnabled = ((response.start_date-currentTimeInSeconds)<600 || response.status=='LIVE')?true:false;
+ this.isEnabled = ((response.start_date-currentTimeInSeconds)<600 || response?.status?.value=='LIVE')?true:false;
}
this.detailData.data = Object.assign({}, response);
this.detailData.data.start_date = readableStartDate;
this.detailData.data.meeting_info = response.meeting_info?.platform;
+ this.detailData.data.mentee_count = response.seats_limit - response.seats_remaining
this.startDate = (response.start_date>0)?moment.unix(response.start_date).toLocaleString():this.startDate;
this.endDate = (response.end_date>0)?moment.unix(response.end_date).toLocaleString():this.endDate;
this.platformOff = (response?.meeting_info?.platform == 'OFF') ? true : false;
+ this.detailData.data.mentor_designation = response.mentor_designation.map(designation => designation.label).join(', ');
+ if((!this.isConductor && !this.detailData.form.some(obj => obj.title === 'MENTOR'))){
+ this.detailData.form.push(
+ {
+ title: 'MENTOR',
+ key: 'mentor_name',
+ },
+ );
+ }
+ if((this.isCreator || this.isConductor) && !this.detailData.form.some(obj => obj.title === 'MENTEE_COUNT')){
+
+ this.detailData.form.push(
+ {
+ title: 'MENTEE_COUNT',
+ key: 'mentee_count',
+ },
+ );
+ }
}
- if((response?.meeting_info?.platform == 'OFF') && this.isCreator && response.status=='PUBLISHED'){
+ if((response?.meeting_info?.platform == 'OFF') && this.isCreator && response?.status?.value=='PUBLISHED'){
this.showToasts('ADD_MEETING_LINK', 0 , [
{
text: 'Add meeting link',
@@ -176,14 +212,14 @@ export class SessionDetailPage implements OnInit {
setPageHeader(response) {
let currentTimeInSeconds=Math.floor(Date.now()/1000);
- this.isEnabled = ((response.start_date-currentTimeInSeconds)<600 || response.status=='LIVE')?true:false;
- this.headerConfig.share = response.status=="COMPLETED"?false:true;
+ this.isEnabled = ((response.start_date-currentTimeInSeconds)<600 || response?.status?.value=='LIVE')?true:false;
+ this.headerConfig.share = (response?.status?.value=="COMPLETED" || response.type.value == "PRIVATE")?false:true;
this.id = response.id;
if(this.userDetails){
- this.isCreator = this.userDetails.id == response.mentor_id ? true : false;
+ this.isConductor = this.userDetails.id == response.mentor_id ? true : false;
}
- this.headerConfig.edit = (this.isCreator && response.status=="PUBLISHED"&& !this.isEnabled)?true:null;
- this.headerConfig.delete = (this.isCreator && response.status=="PUBLISHED" && !this.isEnabled)?true:null;
+ this.headerConfig.edit = (this.isCreator && response?.status?.value !="COMPLETED"&& ((response.end_date>currentTimeInSeconds)))?true:null;
+ this.headerConfig.delete = (this.isCreator && response?.status?.value !="COMPLETED" && response?.status?.value !="LIVE" && ((response.end_date>currentTimeInSeconds)))?true:null;
}
action(event) {
@@ -227,7 +263,12 @@ export class SessionDetailPage implements OnInit {
};
editSession() {
- this.router.navigate([CommonRoutes.CREATE_SESSION], { queryParams: { id: this.id } });
+ this.activeUrl = this.router.url;
+ if(this.activeUrl.includes('/admin/managers-session-details')){
+ this.router.navigate([`${CommonRoutes.ADMIN}/${CommonRoutes.MANAGERS_SESSION}`], { queryParams: { id: this.id }});
+ }else{
+ this.router.navigate([CommonRoutes.CREATE_SESSION], { queryParams: { id: this.id } });
+ }
}
deleteSession() {
@@ -312,4 +353,18 @@ export class SessionDetailPage implements OnInit {
goToHome() {
this.router.navigate([`/${CommonRoutes.TABS}/${CommonRoutes.HOME}`]);
}
+
+ async onViewList($event){
+
+ let modal = await this.modalCtrl.create({
+ component: MenteeListPopupComponent,
+ cssClass: 'search-popover-config',
+ componentProps: { id:this.id }
+ });
+
+ modal.onDidDismiss().then(async (dataReturned) => {
+
+ });
+ modal.present()
+ }
}
diff --git a/src/app/pages/tabs/dashboard/dashboard.page.html b/src/app/pages/tabs/dashboard/dashboard.page.html
index 132afa04..e4c16bf2 100644
--- a/src/app/pages/tabs/dashboard/dashboard.page.html
+++ b/src/app/pages/tabs/dashboard/dashboard.page.html
@@ -31,24 +31,8 @@
-
-
-
- {{'TOTAL_SESSION_CREATED' | translate}}
- {{ chartData?.total_session_created }}
-
-
-
-
-
-
- {{'TOTAL_SESSION_CONDUCTED' | translate}}
- {{ chartData?.total_session_hosted }}
-
-
-
-
+
@@ -68,9 +52,9 @@
-
-
-
+
+
+
diff --git a/src/app/pages/tabs/dashboard/dashboard.page.ts b/src/app/pages/tabs/dashboard/dashboard.page.ts
index 08a39fa9..4cf5f8bd 100644
--- a/src/app/pages/tabs/dashboard/dashboard.page.ts
+++ b/src/app/pages/tabs/dashboard/dashboard.page.ts
@@ -21,15 +21,15 @@ export class DashboardPage implements OnInit {
selectedFilter = "WEEKLY";
filter: any = [
{
- key: 'WEEKLY',
+ label: 'THIS_WEEK',
value: 'WEEKLY'
},
{
- key: 'MONTHLY',
+ label: 'THIS_MONTH',
value: 'MONTHLY'
},
{
- key: 'QUARTERLY',
+ label: 'THIS_QUARTER',
value: 'QUARTERLY'
}
];
@@ -94,24 +94,55 @@ export class DashboardPage implements OnInit {
}
createChart() {
+ const maxDataValue = Math.max(
+ ...(
+ this.segment === 'mentor' ?
+ [this.chartData.total_session_created, this.chartData.total_session_assigned, this.chartData.total_session_hosted] :
+ [this.chartData.total_session_enrolled, this.chartData.total_session_attended]
+ )
+ );
this.chart = new Chart('MyChart', {
- type: 'pie',
+ type: this.segment === 'mentor' ? 'bar': 'pie',
data: {
- labels: this.segment === 'mentor' ? ['Total sessions created', 'Total sessions conducted'] : ['Total sessions enrolled', 'Total sessions attended'],
+ labels: this.segment === 'mentor' ? ['Total sessions created', 'Total sessions assigned', 'Total sessions conducted'] : ['Total sessions enrolled', 'Total sessions attended'],
datasets: [{
- label: 'Total',
- data: this.segment === 'mentor' ? [this.chartData.total_session_created, this.chartData.total_session_hosted] : [this.chartData.total_session_enrolled, this.chartData.total_session_attended],
- backgroundColor: [
- '#ffdf00', '#7b7b7b'
- ],
- hoverOffset: 4
+ label: '',
+ data: this.segment === 'mentor' ? [this.chartData.total_session_created, this.chartData.total_session_assigned, this.chartData.total_session_hosted,] : [this.chartData.total_session_enrolled, this.chartData.total_session_attended],
+ backgroundColor: this.segment === 'mentor' ?['#4e81bd', '#fdc107', '#5ab251']: ['#ffdf00', '#7b7b7b'],
+ borderWidth: 1,
+ barThickness: 50,
}],
},
options: {
- aspectRatio: 1.5,
responsive: true,
+ maintainAspectRatio: false,
+ plugins: {
+ legend: {
+ display: false,
+ }
+ },
+ scales: this.segment === 'mentor' ?{
+ y: {
+ ticks: {
+ stepSize: this.calculateStepSize(maxDataValue),
+ },
+ grid: {
+ display: false,
+ },
+ },
+ x:{
+ grid: {
+ display: false,
+ },
+ }
+ }:{}
}
});
- this.dataAvailable = (this.chartData?.total_session_created == 0 || this.chartData?.total_session_enrolled == 0) ? false : true
+ this.dataAvailable = !!(this.chartData?.total_session_created ||this.chartData?.total_session_enrolled ||this.chartData?.total_session_assigned ||this.chartData?.total_session_hosted);
+ }
+
+ calculateStepSize(maxDataValue) {
+
+ return Math.ceil(maxDataValue / 5);
}
}
\ No newline at end of file
diff --git a/src/app/pages/tabs/home/home.page.html b/src/app/pages/tabs/home/home.page.html
index 13c2cb71..dce3fea1 100644
--- a/src/app/pages/tabs/home/home.page.html
+++ b/src/app/pages/tabs/home/home.page.html
@@ -71,7 +71,7 @@
-
+
+
{{mentor.key}}
@@ -20,6 +21,7 @@
+
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 c7932c87..7f947fe1 100644
--- a/src/app/pages/tabs/mentor-directory/mentor-directory.page.ts
+++ b/src/app/pages/tabs/mentor-directory/mentor-directory.page.ts
@@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
-import { Router } from '@angular/router';
+import { ActivatedRoute, Router } from '@angular/router';
import { IonContent, IonInfiniteScroll } from '@ionic/angular';
import { urlConstants } from 'src/app/core/constants/urlConstants';
import {
@@ -30,14 +30,21 @@ export class MentorDirectoryPage implements OnInit {
mentors = [];
mentorsCount;
- isLoaded : boolean = false
+ isLoaded: boolean = false;
+
constructor(
private router: Router,
private loaderService: LoaderService,
- private httpService: HttpService
- ) { }
+ private httpService: HttpService,
+ private route: ActivatedRoute
+ ) {
+ }
ngOnInit() {
+ this.route.queryParamMap.subscribe((queryParams) => {
+ this.searchText = queryParams.get('search');
+ this.searchText = this.searchText === null ? '' : this.searchText;
+ });
}
ionViewWillEnter() {
@@ -53,19 +60,20 @@ export class MentorDirectoryPage implements OnInit {
}
async getMentors(showLoader = true) {
- showLoader ? await this.loaderService.startLoader(): '';
+ showLoader ? await this.loaderService.startLoader() : '';
const config = {
- url: urlConstants.API_URLS.MENTORS_DIRECTORY_LIST + this.page + '&limit=' + this.limit + '&search=' + btoa(this.searchText),
+ url: urlConstants.API_URLS.MENTORS_DIRECTORY_LIST + this.page + '&limit=' + this.limit + '&search=' + btoa(this.searchText) + '&directory=true',
payload: {}
};
try {
let data: any = await this.httpService.get(config);
this.isLoaded = true
- showLoader ? await this.loaderService.stopLoader(): '';
- if(this.mentors.length && this.mentors[this.mentors.length-1].key==data.result.data[0]?.key){
- this.mentors[this.mentors.length-1].values = this.mentors[this.mentors.length-1].values.concat(data.result.data[0].values)
+ showLoader ? await this.loaderService.stopLoader() : '';
+ if (this.mentors.length && this.mentors[this.mentors.length - 1].key == data.result.data[0]?.key) {
+ this.mentors[this.mentors.length - 1].values = this.mentors[this.mentors.length - 1].values.concat(data.result.data[0].values)
data.result.data.shift();
this.mentors = this.mentors.concat(data.result.data);
+
} else {
this.mentors = this.mentors.concat(data.result.data);
}
@@ -74,14 +82,13 @@ export class MentorDirectoryPage implements OnInit {
}
catch (error) {
this.isLoaded = true
- showLoader ? await this.loaderService.stopLoader(): '';
+ showLoader ? await this.loaderService.stopLoader() : '';
}
}
- eventAction(event) {
- console.log(event, "event");
+ eventAction(event){
switch (event.type) {
case 'cardSelect':
- this.router.navigate([CommonRoutes.MENTOR_DETAILS,event?.data?.id]);
+ this.router.navigate([CommonRoutes.MENTOR_DETAILS, event?.data?.id]);
break;
}
}
@@ -90,9 +97,12 @@ export class MentorDirectoryPage implements OnInit {
await this.getMentors(false);
event.target.complete();
}
- onSearch() {
- this.isLoaded = false
+ 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 = [];
}
diff --git a/src/app/shared/components/dynamic-form/dynamic-form.component.html b/src/app/shared/components/dynamic-form/dynamic-form.component.html
index 45a12496..6935d1cc 100644
--- a/src/app/shared/components/dynamic-form/dynamic-form.component.html
+++ b/src/app/shared/components/dynamic-form/dynamic-form.component.html
@@ -8,11 +8,19 @@
myForm.get(control.name).touched && myForm.get(control.name).invalid
}"
>
-
{{ control.label }} *
+
+
+ {{ control.label }} *
+
+
+
+
+
+ {{info?.message}}
+
+
+
+
+
-
;
name: string;
label: string;
- value: string;
+ value: any;
type: string;
class: string;
position: string;
@@ -63,6 +66,13 @@ interface JsonFormControls {
platformPlaceHolder?:string;
showSelectAll?: boolean;
multiple?:boolean;
+ placeHolder?: string;
+ displayFormat?: string;
+ dependedChild?: string;
+ dependedParent?: string;
+ meta?: any;
+ multiSelect?: boolean;
+ info?: Array