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

BC-7162 Include within the imported course results that whiteboard content is not incorporated in the import. #4983

Merged
merged 6 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 0 additions & 7 deletions apps/server/src/modules/copy-helper/dto/copy.response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,4 @@ export class CopyApiResponse {
description: 'List of included sub elements with recursive type structure',
})
elements?: CopyApiResponse[];

@ApiPropertyOptional({
isArray: true,
enum: CopyElementType,
description: 'Array with listed types of all sub elements',
})
elementsTypes?: CopyElementType[];
}
17 changes: 1 addition & 16 deletions apps/server/src/modules/copy-helper/mapper/copy.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { TaskCopyParentParams } from '@modules/task/types';
import { LessonEntity, Task } from '@shared/domain/entity';
import { EntityId } from '@shared/domain/types';
import { CopyApiResponse } from '../dto/copy.response';
import { CopyElementType, CopyStatus, CopyStatusEnum } from '../types/copy.types';
import { CopyStatus, CopyStatusEnum } from '../types/copy.types';

export class CopyMapper {
static mapToResponse(copyStatus: CopyStatus): CopyApiResponse {
Expand Down Expand Up @@ -46,19 +46,4 @@ export class CopyMapper {

return dto;
}

static mapElementsToTypes(element: CopyStatus, types: CopyElementType[] = []): CopyElementType[] {
const indexOfFound = types.indexOf(element.type);
if (indexOfFound === -1) {
types.push(element.type);
}

if (element.elements) {
element.elements.forEach((child) => {
this.mapElementsToTypes(child, types);
});
}

return types;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ describe('copy helper service', () => {

expect(derivedStatus).toEqual(CopyStatusEnum.FAIL);
});

it('should return fail if the last and only nested child is FAIL ', () => {
const element = createNestedStates([
CopyStatusEnum.SUCCESS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export class RoomsController {
): Promise<CopyApiResponse> {
const copyStatus = await this.courseCopyUc.copyCourse(currentUser.userId, urlParams.roomId);
const dto = CopyMapper.mapToResponse(copyStatus);
dto.elementsTypes = CopyMapper.mapElementsToTypes(copyStatus);
return dto;
}

Expand Down
Loading