Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue #feat prod issues resolved and delete functionality done in man… #361

Merged
merged 3 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/app/core/services/admin-workspace/admin-workapce.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ import { Injectable } from '@angular/core';
import { HttpService } from '../http/http.service';
import { urlConstants } from '../../constants/urlConstants';
import * as _ from 'lodash-es';
import { UtilService } from '../util/util.service';
import { CommonRoutes } from 'src/global.routes';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this import

import { SessionService } from '../session/session.service';
import { ToastService } from '../toast.service';
import { Router } from '@angular/router';

@Injectable({
providedIn: 'root'
})
export class AdminWorkapceService {
constructor(private httpService: HttpService) { }
constructor(private httpService: HttpService,private utilService:UtilService, private sessionService:SessionService,private toast:ToastService, private router:Router) { }

async createdSessionBySessionManager(obj:any) {
const config = {
Expand All @@ -22,6 +27,24 @@ export class AdminWorkapceService {
return false
}
}
deleteSession(id) {
let msg = {
header: 'DELETE_SESSION',
message: 'DELETE_CONFIRM_MSG',
cancel: "DON'T_DELETE",
submit: 'YES_DELETE'
}
this.utilService.alertPopup(msg).then(async data => {
if (data) {
let result = await this.sessionService.deleteSession(id);
if (result.responseCode == "OK") {
this.toast.showToast(result.message, "success");
this.router.navigate([`/${CommonRoutes.TABS}/${CommonRoutes.MANAGE_SESSION}`], { replaceUrl: true });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to use relapceUrl true??

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than redirecting, cant we reload the list only?

}
}
}).catch(error => { })
}


// async downloadcreatedSessionsBySessionManager(obj:any){
// const config = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { AdminWorkapceService } from 'src/app/core/services/admin-workspace/admi
import { CommonRoutes } from 'src/global.routes';
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';

@Component({
selector: 'app-manage-session',
Expand All @@ -20,7 +22,7 @@ export class ManageSessionComponent implements OnInit {
// label: 'MANAGE_SESSION'
};
receivedEventData: any;
constructor(private adminWorkapceService: AdminWorkapceService, private router: Router, private modalCtrl: ModalController) { }
constructor(private adminWorkapceService: AdminWorkapceService, private router: Router, private modalCtrl: ModalController,private utilService:UtilService, private sessionService:SessionService) { }
headingText = "SESSION_LIST"
download = "DOWNLOAD";
page = 1;
Expand Down Expand Up @@ -100,7 +102,7 @@ export class ManageSessionComponent implements OnInit {
this.fetchSessionList()
}

onCLickEvent(data: any) {
async onCLickEvent(data: any) {
this.receivedEventData = data;
switch (this.receivedEventData.action) {
case 'mentor_name':
Expand All @@ -110,7 +112,8 @@ export class ManageSessionComponent implements OnInit {
this.router.navigate([`${CommonRoutes.ADMIN}/${CommonRoutes.MANAGERS_SESSION}`], { queryParams: { id: this.receivedEventData.element.id }});
break;
case 'DELETE':

await this.adminWorkapceService.deleteSession(this.receivedEventData.element.id);
break;
default:
this.router.navigate([CommonRoutes.SESSIONS_DETAILS, this.receivedEventData.element.id]);
}
Expand Down Expand Up @@ -176,4 +179,6 @@ export class ManageSessionComponent implements OnInit {
this.router.navigate([`${CommonRoutes.ADMIN}/${CommonRoutes.MANAGERS_SESSION}`]);
}



}
2 changes: 1 addition & 1 deletion src/app/pages/language/language.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class LanguagePage implements OnInit {

ngOnInit() {
this.localStorage.getLocalData(localKeys.SELECTED_LANGUAGE).then(data =>{
this.selectedLanguage = data;
this.selectedLanguage = data.value;
})
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ import { FilterPopupComponent } from './components/filter-popup/filter-popup.com
FormsModule,
ReactiveFormsModule,
MatButtonModule,
NgxMatMomentModule
NgxMatMomentModule,
MatTableModule,
MatPaginatorModule
],
exports: [
DynamicFormComponent,
Expand All @@ -106,8 +108,6 @@ import { FilterPopupComponent } from './components/filter-popup/filter-popup.com
MentorCardComponent,
JoinDialogBoxComponent,
GenericTableComponent,
MatTableModule,
MatPaginatorModule,
SearchAndSelectComponent,
SearchPopoverComponent,
HasPermissionDirective,
Expand Down
2 changes: 1 addition & 1 deletion src/deployment/ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
- name: Remove www folder
shell: rm -rf www
- name: Build pwa app
shell: cd {{project_path}} && ionic build
shell: cd {{project_path}} && ionic build --prod
- name: Start pm2
shell: cd {{project_path}} && pm2 start pm2.config.json