diff --git a/src/app/client/src/app/modules/learn/components/batch/create-batch/create-batch.component.html b/src/app/client/src/app/modules/learn/components/batch/create-batch/create-batch.component.html index c4540a625c07281e6a7d45e68c4705bcfd58e990..adf543cf36de7ad51e9afee08cf457b2b75b8054 100644 --- a/src/app/client/src/app/modules/learn/components/batch/create-batch/create-batch.component.html +++ b/src/app/client/src/app/modules/learn/components/batch/create-batch/create-batch.component.html @@ -80,7 +80,7 @@ </sui-select-option> </sui-multi-select> </div> --> - <div class="one field " *ngIf="createBatchForm.value.enrollmentType !== 'open'"> + <div class="one field "> <label>{{resourceService?.frmelmnts?.lbl?.batchmentors}}</label> <div class="createbatchdropdown ui fluid multiple search selection dropdown" id="mentors" ng-class="batch.isUserSearch === 1 ? 'loading' : undefined"> <input id="mentorSelList"> diff --git a/src/app/client/src/app/modules/learn/components/batch/create-batch/create-batch.component.ts b/src/app/client/src/app/modules/learn/components/batch/create-batch/create-batch.component.ts index d9a9a6a47681b80c09ba2ca078258f916a415918..c2feee05ac9cccb11745024a497c38c43148520f 100644 --- a/src/app/client/src/app/modules/learn/components/batch/create-batch/create-batch.component.ts +++ b/src/app/client/src/app/modules/learn/components/batch/create-batch/create-batch.component.ts @@ -202,9 +202,9 @@ export class CreateBatchComponent implements OnInit, OnDestroy { this.disableSubmitBtn = true; let participants = []; let mentors = []; + mentors = $('#mentors').dropdown('get value') ? $('#mentors').dropdown('get value').split(',') : []; if (this.createBatchForm.value.enrollmentType !== 'open') { participants = $('#participants').dropdown('get value') ? $('#participants').dropdown('get value').split(',') : []; - mentors = $('#mentors').dropdown('get value') ? $('#mentors').dropdown('get value').split(',') : []; } const startDate = moment(this.createBatchForm.value.startDate).format('YYYY-MM-DD'); const endDate = this.createBatchForm.value.endDate && moment(this.createBatchForm.value.endDate).format('YYYY-MM-DD'); diff --git a/src/app/client/src/app/modules/learn/components/batch/update-course-batch/update-course-batch.component.html b/src/app/client/src/app/modules/learn/components/batch/update-course-batch/update-course-batch.component.html index 11274c4b3a2f40573027b9450204598af90755fd..b5a18d8b126b1fafc617d2ebf79bb41de7c32253 100644 --- a/src/app/client/src/app/modules/learn/components/batch/update-course-batch/update-course-batch.component.html +++ b/src/app/client/src/app/modules/learn/components/batch/update-course-batch/update-course-batch.component.html @@ -83,7 +83,7 @@ </sui-select-option> </sui-multi-select> </div> --> - <div class="one field " *ngIf="batchUpdateForm.value.enrollmentType !== 'open'"> + <div class="one field "> <label>{{resourceService?.frmelmnts?.lbl?.batchmentors}}</label> <div class="createbatchdropdown ui fluid multiple search selection dropdown" id="mentors" [ngClass]="{ 'disabled' : showFormInViewMode }"> @@ -97,7 +97,7 @@ </div> </div> </div> - <div class="one field" *ngIf="batchUpdateForm.value.enrollmentType !== 'open' && selectedMentors.length > 0"> + <div class="one field" *ngIf="selectedMentors.length > 0"> <label>{{resourceService?.frmelmnts?.lbl?.batchselmentors}}</label> <a class="ui label mt-5" *ngFor="let selectmentor of selectedMentors"> <img class="ui right spaced avatar image" src="{{selectmentor.avatar || 'assets/images/user_logo.png' | cdnprefixurl}}"> {{selectmentor.name}}{{selectmentor.otherDetail}} diff --git a/src/app/client/src/app/modules/learn/components/batch/update-course-batch/update-course-batch.component.ts b/src/app/client/src/app/modules/learn/components/batch/update-course-batch/update-course-batch.component.ts index b6ab40dc66cd7116147d9f5db9c6cc1f61c80c87..02f4f12a714e7152527092d444f5d3fc1bdd6cde 100644 --- a/src/app/client/src/app/modules/learn/components/batch/update-course-batch/update-course-batch.component.ts +++ b/src/app/client/src/app/modules/learn/components/batch/update-course-batch/update-course-batch.component.ts @@ -319,9 +319,9 @@ export class UpdateCourseBatchComponent implements OnInit, OnDestroy { this.disableSubmitBtn = true; let participants = []; let mentors = []; + mentors = $('#mentors').dropdown('get value') ? $('#mentors').dropdown('get value').split(',') : []; if (this.batchUpdateForm.value.enrollmentType !== 'open') { participants = $('#participant').dropdown('get value') ? $('#participant').dropdown('get value').split(',') : []; - mentors = $('#mentors').dropdown('get value') ? $('#mentors').dropdown('get value').split(',') : []; } const startDate = moment(this.batchUpdateForm.value.startDate).format('YYYY-MM-DD'); const endDate = this.batchUpdateForm.value.endDate && moment(this.batchUpdateForm.value.endDate).format('YYYY-MM-DD'); @@ -335,13 +335,11 @@ export class UpdateCourseBatchComponent implements OnInit, OnDestroy { createdFor: this.userService.userProfile.organisationIds, mentors: _.compact(mentors) }; - if (this.batchUpdateForm.value.enrollmentType !== 'open') { - const selected = []; - _.forEach(this.selectedMentors, (value) => { - selected.push(value.id); - }); - requestBody['mentors'] = _.concat(_.compact(requestBody['mentors']), selected); - } + const selected = []; + _.forEach(this.selectedMentors, (value) => { + selected.push(value.id); + }); + requestBody['mentors'] = _.concat(_.compact(requestBody['mentors']), selected); this.courseBatchService.updateBatch(requestBody).pipe(takeUntil(this.unsubscribe)) .subscribe((response) => { if (participants && participants.length > 0) { diff --git a/src/app/client/src/app/modules/workspace/components/update-batch/update-batch.component.html b/src/app/client/src/app/modules/workspace/components/update-batch/update-batch.component.html index 3bef7be1d7cbf3d993ae269dd6b53e0feb70914d..11f52fabdec88df119d2f4d9b8b6d79e655e2a34 100644 --- a/src/app/client/src/app/modules/workspace/components/update-batch/update-batch.component.html +++ b/src/app/client/src/app/modules/workspace/components/update-batch/update-batch.component.html @@ -67,7 +67,7 @@ </div> </div> </div> - <div class="one field " *ngIf="batchUpdateForm.value.enrollmentType !== 'open'"> + <div class="one field "> <label>{{resourceService?.frmelmnts?.lbl?.batchmentors}}</label> <div class="createbatchdropdown ui fluid multiple search selection dropdown" id="mentors" [ngClass]="{ 'disabled': batchDetails.status === 2 }"> <input id="mentorSelList"> @@ -81,7 +81,7 @@ </div> </div> </div> - <div class="one field" *ngIf="batchUpdateForm.value.enrollmentType !== 'open' && selectedMentors.length > 0"> + <div class="one field" *ngIf="selectedMentors.length > 0"> <label>{{resourceService?.frmelmnts?.lbl?.batchselmentors}}</label> <a class="ui label mt-5" *ngFor="let selectmentor of selectedMentors"> <img class="ui right spaced avatar image" src="{{selectmentor.avatar || 'assets/images/user_logo.png' | cdnprefixurl}}"> diff --git a/src/app/client/src/app/modules/workspace/components/update-batch/update-batch.component.ts b/src/app/client/src/app/modules/workspace/components/update-batch/update-batch.component.ts index 4e0ee7ca3cad3268fca7f07bc1c7d80a9c0c741f..8b5bfc83c3e4bb02a1917f83ebbb50e3310d5eb6 100644 --- a/src/app/client/src/app/modules/workspace/components/update-batch/update-batch.component.ts +++ b/src/app/client/src/app/modules/workspace/components/update-batch/update-batch.component.ts @@ -306,9 +306,9 @@ export class UpdateBatchComponent implements OnInit, OnDestroy { this.disableSubmitBtn = true; let participants = []; let mentors = []; + mentors = $('#mentors').dropdown('get value') ? $('#mentors').dropdown('get value').split(',') : []; if (this.batchUpdateForm.value.enrollmentType !== 'open') { participants = $('#participant').dropdown('get value') ? $('#participant').dropdown('get value').split(',') : []; - mentors = $('#mentors').dropdown('get value') ? $('#mentors').dropdown('get value').split(',') : []; } const startDate = moment(this.batchUpdateForm.value.startDate).format('YYYY-MM-DD'); const endDate = this.batchUpdateForm.value.endDate && moment(this.batchUpdateForm.value.endDate).format('YYYY-MM-DD'); @@ -322,13 +322,11 @@ export class UpdateBatchComponent implements OnInit, OnDestroy { createdFor: this.userService.userProfile.organisationIds, mentors: _.compact(mentors) }; - if (this.batchUpdateForm.value.enrollmentType !== 'open') { - const selected = []; - _.forEach(this.selectedMentors, (value) => { - selected.push(value.id); - }); - requestBody['mentors'] = _.concat(_.compact(requestBody['mentors']), selected); - } + const selected = []; + _.forEach(this.selectedMentors, (value) => { + selected.push(value.id); + }); + requestBody['mentors'] = _.concat(_.compact(requestBody['mentors']), selected); this.batchService.updateBatch(requestBody).pipe(takeUntil(this.unsubscribe)) .subscribe((response) => { if (participants && participants.length > 0) {