Skip to content

Commit

Permalink
Merge pull request #373 from GSuma21/release-2.6.0-changes
Browse files Browse the repository at this point in the history
Release 2.6.0 changes
  • Loading branch information
kiranharidas187 authored Jan 30, 2024
2 parents 4d7edd7 + fb962f0 commit 75d06d9
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class AdminWorkapceService {
};
try {
let result = await this.httpService.getFile(config);
this.utilService.parseAndDownloadCSV(result.data, "manage_session_list")
this.utilService.parseAndDownloadCSV(result.data, "enrolled_mentee_list")
}
catch (error) {
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/services/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class AuthService {
this.userService.userEvent.next(this.user);
await this.localStorage.setLocalData(localKeys.USER_DETAILS, this.user);
await this.localStorage.setLocalData(localKeys.SELECTED_LANGUAGE, this.user.preferred_language.value);
this.translate.use(this.user.preferred_language)
this.translate.use(this.user.preferred_language.value)
return this.user;
}

Expand Down
4 changes: 4 additions & 0 deletions src/app/modules/admin/admin-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ const routes: Routes = [
forms: { page: MANAGERS_CREATE_SESSION_FORM},
permissions: { module: permissions.MANAGE_SESSION, action: manageSessionAction.SESSION_ACTIONS },
}
},
{
path: CommonRoutes.MANAGERS_SESSION_DETAILS,
loadChildren: () => import('../../pages/session-detail/session-detail.module').then( m => m.SessionDetailPageModule),
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ModalController } from '@ionic/angular';
import { FilterPopupComponent } from 'src/app/shared/components/filter-popup/filter-popup.component';
import { UtilService } from 'src/app/core/services';
import { SessionService } from 'src/app/core/services/session/session.service';
import { MenteeListPopupComponent } from 'src/app/shared/components/mentee-list-popup/mentee-list-popup.component';

@Component({
selector: 'app-manage-session',
Expand Down Expand Up @@ -108,6 +109,19 @@ export class ManageSessionComponent implements OnInit {
case 'mentor_name':
this.router.navigate([CommonRoutes.MENTOR_DETAILS, this.receivedEventData.element.mentor_id]);
break;
case "mentee_count":
let modal = await this.modalCtrl.create({
component: MenteeListPopupComponent,
cssClass: 'search-popover-config',
componentProps: { id:this.receivedEventData.element.id }
});

modal.onDidDismiss().then(async (dataReturned) => {

});
modal.present()
break;

case "EDIT":
this.router.navigate([`${CommonRoutes.ADMIN}/${CommonRoutes.MANAGERS_SESSION}`], { queryParams: { id: this.receivedEventData.element.id }});
break;
Expand All @@ -122,7 +136,7 @@ export class ManageSessionComponent implements OnInit {
});
break;
default:
this.router.navigate([CommonRoutes.SESSIONS_DETAILS, this.receivedEventData.element.id]);
this.router.navigate([`${CommonRoutes.ADMIN}/${CommonRoutes.MANAGERS_SESSION_DETAILS}`, this.receivedEventData.element.id]);
}
}

Expand Down Expand Up @@ -176,6 +190,7 @@ export class ManageSessionComponent implements OnInit {
ele.action = this.actionButtons[ele?.status?.value]
ele.status = ele?.status?.label;
ele.type = ele?.type?.label;
ele.duration_in_minutes =Math.round(ele?.duration_in_minutes)
});
}
this.tableData = data;
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/session-detail/session-detail.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h6 class="title-font">{{detailData?.data?.title}}</h6>
<ion-label *ngIf="startDate && detailData?.data?.status?.value=='LIVE'" class="date-label">{{"STARTED_ON"|translate}} {{startDate|date:'dd/MM/yyyy'}} {{"AT"|translate}} {{startDate|date:'shortTime'}}</ion-label>
<ion-label *ngIf="endDate && detailData?.data?.status?.value=='COMPLETED'" class="date-label">{{"COMPLETED_ON"|translate}} {{endDate|date:'dd/MM/yyyy'}} {{"AT"|translate}} {{endDate|date:'shortTime'}}</ion-label>
</ion-item>
<div class="d-flex ion-no-padding" *ngIf="sessionManagerText">
<div class="d-flex ion-no-padding" *ngIf="sessionManagerText && detailData.data.manager_name">
<ion-icon class="person-container" name="person"></ion-icon>
<p class="manager-text-container">{{ sessionManagerText | translate}} <span>{{detailData.data.manager_name}}</span></p>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/app/pages/session-detail/session-detail.page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ ion-item {
display: flex;
justify-content: center;
align-items: center;
gap: 5px;
font-size: 16px;
color: rgb(0, 0, 0);
margin-left: 6px;
Expand Down
19 changes: 13 additions & 6 deletions src/app/pages/session-detail/session-detail.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ 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({
Expand All @@ -37,6 +38,7 @@ export class SessionDetailPage implements OnInit {
userCantAccess:any = true;
enrolledMenteeList:any;
sessionManagerText="";
activeUrl:any;

constructor(private localStorage: LocalStorageService, private router: Router,
private activatedRoute: ActivatedRoute, private sessionService: SessionService,
Expand Down Expand Up @@ -171,15 +173,15 @@ export class SessionDetailPage implements OnInit {
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;
if(this.isCreator){
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.isConductor && response?.status?.value=='PUBLISHED'){
this.showToasts('ADD_MEETING_LINK', 0 , [
Expand All @@ -203,7 +205,7 @@ export class SessionDetailPage implements OnInit {
setPageHeader(response) {
let currentTimeInSeconds=Math.floor(Date.now()/1000);
this.isEnabled = ((response.start_date-currentTimeInSeconds)<600 || response?.status?.value=='LIVE')?true:false;
this.headerConfig.share = response?.status?.value=="COMPLETED"?false:true;
this.headerConfig.share = (response?.status?.value=="COMPLETED" || response.type.value == "PRIVATE")?false:true;
this.id = response.id;
if(this.userDetails){
this.isConductor = this.userDetails.id == response.mentor_id ? true : false;
Expand Down Expand Up @@ -253,7 +255,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() {
Expand Down Expand Up @@ -342,7 +349,7 @@ export class SessionDetailPage implements OnInit {
async onViewList($event){

let modal = await this.modalCtrl.create({
component: MenteeListPopupComponent,
component: MenteeListPopupComponent,
cssClass: 'search-popover-config',
componentProps: { id:this.id }
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<ng-container>
<div *ngIf="column.type == 'text'">
<td mat-cell (click)="onCellClick(column.name,element[column.name],element)" *matCellDef="let element">{{
element[column.name] }}</td>
element[column.name] | translate }}</td>
</div>
<div *ngIf="column.type == 'array'">
<td mat-cell (click)="onCellClick(column.name,element)" *matCellDef="let element">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class MenteeListPopupComponent implements OnInit {
let data = await this.sessionService.getEnrolledMenteeList(this.id)
if (data) {
data.forEach((ele) => {
ele.organization = ele?.organization?.label;
ele.organization = ele?.organization?.name;
});
}
this.enrolledMenteeList = data;
Expand Down
8 changes: 5 additions & 3 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,10 @@
"APPLY":"Apply",
"VIEW":"View",
"MENTEE_COUNT":"Mentee count",
"ASSIGNED_BY":"Assigned by",
"INVITED_BY" : "Invited by",
"ASSIGNED_BY":"Assigned by ",
"INVITED_BY" : "Invited by ",
"MENTEE_LIST":"Mentee list",
"ASSIGNED": "Assigned"
"ASSIGNED": "Assigned",
"INVITED":"Invited",
"ENROLLED":"Enrolled"
}
3 changes: 2 additions & 1 deletion src/global.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class CommonRoutes {
public static MANAGE_USER= 'manage-user';
public static BULK_UPLOAD= 'bulk-upload';
public static MANAGE_SESSION= 'manage-session';
public static MANAGERS_SESSION = 'managers-create-session'
public static MANAGERS_SESSION = 'managers-create-session';
public static MANAGERS_SESSION_DETAILS = 'managers-session-details'

}

0 comments on commit 75d06d9

Please sign in to comment.