Skip to content

Commit

Permalink
Added FEATURE_COPY_NEXBOARD_ENABLED to cenabled nexboard on copy course.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaellinaresxk committed Nov 20, 2023
1 parent 8c51e64 commit 1faba72
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/server/src/modules/lesson/service/lesson-copy.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export class LessonCopyService {
}> {
const etherpadEnabled = Configuration.get('FEATURE_ETHERPAD_ENABLED') as boolean;
const nexboardEnabled = Configuration.get('FEATURE_NEXBOARD_ENABLED') as boolean;
const copyNexboardEnabled = Configuration.get('FEATURE_COPY_NEXBOARD_ENABLED') as boolean;
const copiedContent: IComponentProperties[] = [];
const copiedContentStatus: CopyStatus[] = [];
for (let i = 0; i < content.length; i += 1) {
Expand Down Expand Up @@ -227,7 +228,7 @@ export class LessonCopyService {
copiedContent.push(linkContent);
copiedContentStatus.push(embeddedTaskStatus);
}
if (element.component === ComponentType.NEXBOARD && nexboardEnabled) {
if (element.component === ComponentType.NEXBOARD && nexboardEnabled && copyNexboardEnabled) {
// eslint-disable-next-line no-await-in-loop
const nexboardContent = await this.copyNexboard(element, params);
const nexboardStatus = {
Expand All @@ -236,7 +237,9 @@ export class LessonCopyService {
status: CopyStatusEnum.PARTIAL,
};
if (nexboardContent) {
nexboardStatus.status = CopyStatusEnum.NOT_DOING;
copiedContent.push(nexboardContent);
} else {
nexboardStatus.status = CopyStatusEnum.FAIL;
}
copiedContentStatus.push(nexboardStatus);
}
Expand Down

0 comments on commit 1faba72

Please sign in to comment.