-
- {{"START_CREATE_SESSION"|translate}}
+
+
+
+
+ {{ "CREATE_SESSIONS" | translate }}
+
+
+ {{ "MANAGE_SESSION" | translate }}
+
+
+
+
+
+
+
+
+
+
+ {{"START_CREATE_SESSION"|translate}}
+
+
+
+
+
+ {{"CREATE_SESSION" | translate }}
+
+
+
+
+
+
+
+
{{"FILTER"|translate}}
+
+
-
-
-
-
- {{'CREATE_SESSION' | translate}}
-
-
-
-
-
-
-
-
-
{{"FILTER"|translate}}
-
-
+
+
+
+ {{ download | translate}}
+
+
+
+
+
-
-
-
- {{ download | translate}}
-
-
\ No newline at end of file
diff --git a/src/app/modules/admin/components/manage-session/manage-session.component.scss b/src/app/modules/admin/components/manage-session/manage-session.component.scss
index 1f0d037c..0832a2d0 100644
--- a/src/app/modules/admin/components/manage-session/manage-session.component.scss
+++ b/src/app/modules/admin/components/manage-session/manage-session.component.scss
@@ -61,4 +61,7 @@
color: #6da6f2;
text-decoration: underline;
cursor: pointer;
+}
+.normal-case {
+ text-transform: none;
}
\ No newline at end of file
diff --git a/src/app/modules/admin/components/manage-session/manage-session.component.ts b/src/app/modules/admin/components/manage-session/manage-session.component.ts
index f572a5d3..59f7531c 100644
--- a/src/app/modules/admin/components/manage-session/manage-session.component.ts
+++ b/src/app/modules/admin/components/manage-session/manage-session.component.ts
@@ -1,15 +1,12 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
-import { LineElement } from 'chart.js/dist';
-import { urlConstants } from 'src/app/core/constants/urlConstants';
import { AdminWorkapceService } from 'src/app/core/services/admin-workspace/admin-workapce.service';
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';
import { MenteeListPopupComponent } from 'src/app/shared/components/mentee-list-popup/mentee-list-popup.component';
import * as moment from 'moment';
+import { urlConstants } from 'src/app/core/constants/urlConstants';
@Component({
selector: 'app-manage-session',
@@ -24,7 +21,13 @@ export class ManageSessionComponent implements OnInit {
// label: 'MANAGE_SESSION'
};
receivedEventData: any;
- constructor(private adminWorkapceService: AdminWorkapceService, private router: Router, private modalCtrl: ModalController,private utilService:UtilService, private sessionService:SessionService) { }
+
+ public manageSessionUrls: any = {
+ downloadCsvApiUrl: urlConstants.API_URLS.SESSION_DOWNLOAD_CSV,
+ uploadCsvApiUrl: urlConstants.API_URLS.SESSION_BULK_UPLOAD
+ }
+
+ constructor(private adminWorkapceService: AdminWorkapceService, private router: Router, private modalCtrl: ModalController) { }
headingText = "SESSION_LIST"
download = "DOWNLOAD";
page = 1;
@@ -85,6 +88,7 @@ export class ManageSessionComponent implements OnInit {
tableData: any;
dummyTableData: any = false;
noDataMessage: any;
+ segmentType = 'manage-session';
filteredDatas = []
actionButtons = {
'UPCOMING': [{ icon: 'eye', cssColor: 'white-color' , action:'VIEW'}, { icon: 'create', cssColor: 'white-color' ,action:'EDIT'}, { icon: 'trash', cssColor: 'white-color',action:'DELETE' }],
@@ -208,5 +212,7 @@ export class ManageSessionComponent implements OnInit {
createSession(){
this.router.navigate([`${CommonRoutes.CREATE_SESSION}`]);
}
-
+ segmentChanged(event){
+ this.segmentType = event.target.value;
+ }
}
diff --git a/src/app/shared/components/bulk-upload/bulk-upload.component.html b/src/app/shared/components/bulk-upload/bulk-upload.component.html
new file mode 100644
index 00000000..3e597e3b
--- /dev/null
+++ b/src/app/shared/components/bulk-upload/bulk-upload.component.html
@@ -0,0 +1,13 @@
+
+
+
+ {{"DOWNLOAD_SAMPLE_CSV"|translate}}
+
+
+ {{"UPLOAD_CSV"|translate}}
+
+
+
+
\ No newline at end of file
diff --git a/src/app/shared/components/bulk-upload/bulk-upload.component.scss b/src/app/shared/components/bulk-upload/bulk-upload.component.scss
new file mode 100644
index 00000000..e69de29b
diff --git a/src/app/shared/components/bulk-upload/bulk-upload.component.spec.ts b/src/app/shared/components/bulk-upload/bulk-upload.component.spec.ts
new file mode 100644
index 00000000..68915e66
--- /dev/null
+++ b/src/app/shared/components/bulk-upload/bulk-upload.component.spec.ts
@@ -0,0 +1,24 @@
+import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
+import { IonicModule } from '@ionic/angular';
+
+import { BulkUploadComponent } from './bulk-upload.component';
+
+describe('BulkUploadComponent', () => {
+ let component: BulkUploadComponent;
+ let fixture: ComponentFixture
;
+
+ beforeEach(waitForAsync(() => {
+ TestBed.configureTestingModule({
+ declarations: [ BulkUploadComponent ],
+ imports: [IonicModule.forRoot()]
+ }).compileComponents();
+
+ fixture = TestBed.createComponent(BulkUploadComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ }));
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/shared/components/bulk-upload/bulk-upload.component.ts b/src/app/shared/components/bulk-upload/bulk-upload.component.ts
new file mode 100644
index 00000000..42eb062f
--- /dev/null
+++ b/src/app/shared/components/bulk-upload/bulk-upload.component.ts
@@ -0,0 +1,49 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { ToastService } from 'src/app/core/services';
+import { OrganisationService } from 'src/app/core/services/organisation/organisation.service';
+import { SessionService } from 'src/app/core/services/session/session.service';
+
+@Component({
+ selector: 'app-bulk-upload',
+ templateUrl: './bulk-upload.component.html',
+ styleUrls: ['./bulk-upload.component.scss'],
+})
+export class BulkUploadComponent implements OnInit {
+
+ @Input() data: any;
+ uploadData: any;
+
+ constructor(
+ private toast: ToastService,
+ private organisation: OrganisationService,
+ private sessionService:SessionService
+ ) { }
+
+ ngOnInit() {}
+
+async downloadCSV(){
+ if(this.data){
+ let response = await this.organisation.downloadCsv(this.data?.downloadCsvApiUrl);
+ if(response){this.sessionService.openBrowser(response,"_blank")}
+ }
+ }
+
+async uploadCSV(event){
+ let file= event.target.files[0];
+ if(file.type != 'text/csv'){
+ this.toast.showToast('PLEASE_UPLOAD_CSV_FILE', 'danger')
+ event.target.value='';
+ }else{
+ let signedUrl = await this.organisation.getSignedUrl(event.target.files[0].name);
+ this.organisation.upload(event.target.files[0], signedUrl).subscribe(async () => {
+ let data = await this.organisation.bulkUpload(signedUrl.filePath,this.data?.uploadCsvApiUrl);
+ if(data){
+ this.toast.showToast(data.message, 'success');
+ event.target.value='';
+ }
+ (error) => event.target.value='';
+ })
+ }
+ }
+
+}
diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts
index fdcc3c36..0bf8668c 100644
--- a/src/app/shared/shared.module.ts
+++ b/src/app/shared/shared.module.ts
@@ -40,6 +40,7 @@ import { HasPermissionDirective } from './directive/permission.directive';
import { FilterTreeComponent } from './components/filter-tree/filter-tree.component';
import { FilterPopupComponent } from './components/filter-popup/filter-popup.component';
import { MenteeListPopupComponent } from './components/mentee-list-popup/mentee-list-popup.component';
+import { BulkUploadComponent } from './components/bulk-upload/bulk-upload.component';
import { UserListModalComponent } from './components/user-list-modal/user-list-modal.component';
import { snakeCaseToUpperCasePipe } from '../core/pipes/snake-case-to-normal-case.pipe';
@@ -73,6 +74,7 @@ import { snakeCaseToUpperCasePipe } from '../core/pipes/snake-case-to-normal-cas
FilterTreeComponent,
FilterPopupComponent,
MenteeListPopupComponent,
+ BulkUploadComponent,
UserListModalComponent,
snakeCaseToUpperCasePipe
],
@@ -120,6 +122,7 @@ import { snakeCaseToUpperCasePipe } from '../core/pipes/snake-case-to-normal-cas
FilterTreeComponent,
FilterPopupComponent,
MenteeListPopupComponent,
+ BulkUploadComponent,
UserListModalComponent,
snakeCaseToUpperCasePipe
],