Skip to content

Commit

Permalink
Merge pull request #400 from Cafnanc/release-2.6.0
Browse files Browse the repository at this point in the history
Release 2.6.0
  • Loading branch information
Cafnanc authored Feb 14, 2024
2 parents d752373 + d7b8736 commit 247e8a6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/app/core/services/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export class AuthService {
};
try {
let data: any = await this.httpService.post(config);
this.setUserInLocal(data);
await this.setUserInLocal(data);
let user = await this.profileService.getProfileDetailsFromAPI();
this.userService.userEvent.next(user);
this.loaderService.stopLoader();
return data.result.user;
}
Expand Down Expand Up @@ -74,8 +76,6 @@ export class AuthService {
await this.localStorage.setLocalData(localKeys.USER_ROLES, this.profileService.getUserRole(this.user))
await this.profileService.getUserRole(this.user);
this.profileService.isMentor = (this.user?.user_roles[0]?.title === 'mentor')
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.value)
return this.user;
Expand Down
7 changes: 4 additions & 3 deletions src/app/pages/auth/login/login.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { MenuController } from '@ionic/angular';
import { TranslateService } from '@ngx-translate/core';
import { AuthService, LocalStorageService, UtilService } from 'src/app/core/services';
import { AuthService, LocalStorageService, UserService, UtilService } from 'src/app/core/services';
import { DynamicFormComponent, JsonFormData } from 'src/app/shared/components/dynamic-form/dynamic-form.component';
import { CommonRoutes } from 'src/global.routes';
import { environment } from 'src/environments/environment';
Expand Down Expand Up @@ -69,7 +69,7 @@ export class LoginPage implements OnInit {
termsOfServiceUrl = environment.termsOfServiceUrl;
constructor(private authService: AuthService, private router: Router,private utilService: UtilService,
private menuCtrl: MenuController, private activatedRoute: ActivatedRoute,private profileService: ProfileService,
private translateService: TranslateService, private localStorage: LocalStorageService) {
private translateService: TranslateService, private localStorage: LocalStorageService, private userService: UserService) {
this.menuCtrl.enable(false);
}

Expand Down Expand Up @@ -104,7 +104,8 @@ export class LoginPage implements OnInit {
this.userDetails = await this.authService.loginAccount(this.form1.myForm.value);
if (this.userDetails !== null) {
this.utilService.ionMenuShow(true)
await this.profileService.getProfileDetailsFromAPI();
let user = await this.profileService.getProfileDetailsFromAPI();
this.userService.userEvent.next(user);
if (this.id) {
this.router.navigate([`/${CommonRoutes.SESSIONS_DETAILS}/${this.id}`], { replaceUrl: true });
this.menuCtrl.enable(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class SearchPopoverComponent implements OnInit {
{ name: 'designation', displayName: 'Designation', type: 'array' },
{ name: 'organization', displayName: 'Organisation', type: 'text' },
{ name: 'email', displayName: 'E-mail ID', type: 'text' },
{ name: 'type', displayName: 'Enrollment Type', type: 'text' },
{ name: 'type', displayName: 'Enrollment type', type: 'text' },
{ name: 'action', displayName: 'Actions', type: 'button' }
]

Expand Down Expand Up @@ -102,8 +102,12 @@ export class SearchPopoverComponent implements OnInit {
const designationQueryParam = this.selectedFilters && this.selectedFilters.designation
? '&designation=' + this.selectedFilters.designation.map(des => des.value).join(',')
: '';
let queryString = organizationsQueryParam + designationQueryParam;
if(this.data.control.id){
queryString = queryString + '&session_id=' + this.data.control.id
}
const sorting = `&order=${this.sortingData?.order || ''}&sort_by=${this.sortingData?.sort_by || ''}`;
const queryString = organizationsQueryParam + designationQueryParam + sorting
queryString = queryString + sorting
const config = {
url: urlConstants.API_URLS[this.data.control.meta.url] + this.page + '&limit=' + this.limit + '&search=' + btoa(this.searchText) + queryString,
payload: {}
Expand All @@ -114,7 +118,8 @@ export class SearchPopoverComponent implements OnInit {
this.noDataMessage = this.searchText ? "SEARCH_RESULT_NOT_FOUND" : "THIS_SPACE_LOOKS_EMPTY"
let selectedIds = _.map(this.selectedList, 'id');
data.result.data.forEach((ele) => {
ele.action = _.includes(selectedIds, ele.id) ? (ele.type === 'ENROLLED' ? [] : this.actionButtons.REMOVE) : this.actionButtons.ADD;
ele.action = _.includes(selectedIds, ele.id) ? (ele.enrolled_type === 'ENROLLED' ? [] : this.actionButtons.REMOVE) : this.actionButtons.ADD;
ele.type = ele?.enrolled_type
ele.organization = ele?.organization?.name;
});
return data.result.data
Expand Down

0 comments on commit 247e8a6

Please sign in to comment.