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

EW-1090: Fix for componentLernStoreImpl implemented #5474

Open
wants to merge 62 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
6399552
EW-1090: added an object model for resources of lesson
HKayed Jan 15, 2025
0d12c91
EW-1090: Modifying the swagger definitions of resources model
HKayed Jan 22, 2025
38e25a5
EW-1090: initial bug fix commit
HKayed Jan 29, 2025
8af4a55
EW-1090: modified tests to suit the new structure of LessonResources
HKayed Jan 30, 2025
02f4e93
EW-1090: fix for a failing test
HKayed Jan 30, 2025
dbc1f5b
EW-1019: Improve TSP Sync performance after testing. (#5375)
mkreuzkam-cap Jan 7, 2025
130a7e8
BC-8635 - fix task permission (#5417)
virgilchiriac Jan 7, 2025
fef9ed9
BC-8609 - fix tools in rooms (#5416)
hoeppner-dataport Jan 8, 2025
03ec9ea
N21-2270 Change group visibility for teachers that can see students (…
MarvinOehlerkingCap Jan 13, 2025
50cd047
EW-1021: Change TSP test2 to test url (#5362)
mkreuzkam-cap Jan 13, 2025
19c29ea
N21-2103 update media activations (#5364)
mrikallab Jan 13, 2025
60ab9f2
BC-7871 - Test authentication in api tests by removing guard override…
bischofmax Jan 13, 2025
3aa3a51
N21-1990 Add preferred name option to migration wizard (#5409)
MarvinOehlerkingCap Jan 13, 2025
72eef52
BC-8680 - Unpaginated Endpoint of School Teachers for Room Members (#…
muratmerdoglu-dp Jan 14, 2025
fb8b02e
cleanup dependencies (#5426)
Loki-Afro Jan 14, 2025
ca5c342
BC-8468 - Remove additional self build modules from api-tests (BoardC…
SevenWaysDP Jan 14, 2025
90e7831
BC-8526 - Move testing folder from src/shared to src/ (#5431)
bischofmax Jan 15, 2025
6eaf713
BC-8480 Dissolve console and config folder (#5428)
bischofmax Jan 16, 2025
ff27198
BC-8509 change linter rule (#5432)
CeEv Jan 16, 2025
fd1b095
BC-8373 - Naming <name>.app.module.ts (#5427)
bergatco Jan 17, 2025
9f0491d
BC-8168 - Implementing video conferences in FE and remaining issues (…
uidp Jan 17, 2025
6b7a703
BC-8440 Remove devDependencies from docker image (#5419)
dyedwiper Jan 17, 2025
eccc932
BC-8746 - fix add members (#5443)
hoeppner-dataport Jan 17, 2025
3770b42
BC-8113 update gh-actions (#5434)
Loki-Afro Jan 17, 2025
8b64f4f
Revert "BC-8440 Remove devDependencies from docker image (#5419)" (#5…
mamutmk5 Jan 17, 2025
b67598a
BC-8545 - add school role to RoomMemberList (#5441)
NFriedo Jan 20, 2025
689bc0b
BC-8763 workaround for actions/build-push-action@v6 (#5452)
Loki-Afro Jan 20, 2025
24aa094
N21-2242 Course sync add handling for substitute teachers (#5352)
sdinkov Jan 21, 2025
2e2f459
EW-777 working on review account module Refactoring part (#5406)
MajedAlaitwniCap Jan 21, 2025
e5444e7
BC-8479 - Remove @src (#5437)
bergatco Jan 21, 2025
b32ade2
BC-8650 - Add feature flag for changing permissions in rooms (#5447)
NFriedo Jan 21, 2025
8ba8f51
BC-8693 - Dependency updates (#5430)
SevenWaysDP Jan 21, 2025
c78171e
BC-8777 Bump undici from 6.21.0 to 6.21.1 (#5456)
dependabot[bot] Jan 22, 2025
cff0ebf
N21-2190 add ctl media metadata sync cronjob (#5439)
GordonNicholasCap Jan 22, 2025
82137a5
N21-2319 Change board type (#5442)
MarvinOehlerkingCap Jan 22, 2025
71816ec
BC-8809 update sonartype gh-action (#5457)
Loki-Afro Jan 22, 2025
223fdde
BC-8737 - Add missing things to video conference feature (#5445)
uidp Jan 23, 2025
69ab7d6
BC-8508 - Remove exports from shared/*/index.ts (#5454)
bergatco Jan 23, 2025
8718e92
BC-8681 - replace nbc mail addresses (#5438)
hoeppner-dataport Jan 23, 2025
abe63e2
N21-2285 Media Activations Extension (#5433)
sdinkov Jan 23, 2025
0752b1d
BC-8738 - Remove imports from modules in testing (#5440)
bischofmax Jan 23, 2025
b9f41c6
EW-1061 Course file export with Common Cartridge (#5330)
psachmann Jan 24, 2025
11d75f4
BC-8547 - change room roles (#5450)
Metauriel Jan 24, 2025
45bb43a
N21-2368 Fix unmarking outdated users after restarting a migration (#…
MarvinOehlerkingCap Jan 27, 2025
7d84128
N21-2358 Link elements display card title for board card links (#5467)
MarvinOehlerkingCap Jan 27, 2025
cc4a9f9
N21-2190 fix missing strategy register (#5470)
GordonNicholasCap Jan 27, 2025
0998919
N21-2347 Switch vidis sync configuration from envs to db (#5458)
MarvinOehlerkingCap Jan 27, 2025
55b1cbd
BC-8440 Remove dev dependencies from docker image (#5460)
dyedwiper Jan 27, 2025
dac5432
BC-8794 - Escaping for special Char '&' in room names is not correct …
uidp Jan 27, 2025
6ee1545
BC-1591 - Add password_1 and password_2 params to params that don't g…
bischofmax Jan 28, 2025
b0447b8
N21-2292 adjust ctl tool seed data (#5462)
MBergCap Jan 28, 2025
b6d5840
EW-1126 Improving performance for tsp sync (#5469)
SimoneRadtke-Cap Jan 28, 2025
818d167
BC-8861 Revert upgrade of aws dependencies (#5472)
dyedwiper Jan 29, 2025
452345f
Merge branch 'main' into EW-1090
HKayed Jan 30, 2025
511e8bc
EW-1090: fix import for unit tests
HKayed Jan 30, 2025
d6a3b46
EW-1090: using Dto for the mapping of the contents of the lesson comp…
HKayed Feb 3, 2025
eac48f7
EW-1090: spaces added for linter
HKayed Feb 3, 2025
254dd47
EW-1090: Array is now mapped to each corresponding element
HKayed Feb 3, 2025
5ead8a4
EW-1090: Modified a flawed naming for lernstore
HKayed Feb 6, 2025
7554d68
Merge branch 'main' into EW-1090
HKayed Feb 6, 2025
029991c
EW-1090: modifying the test to suit the change in lesson.entity
HKayed Feb 6, 2025
d0097e3
EW-1090: Changing test
HKayed Feb 6, 2025
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
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { ComponentLernstorePropsImpl } from '../lessons-api-client';
import { LessonResourcesDto } from './lesson-resources.dto';

export class ComponentLernstorePropsDto {
public resources: string[];
public resources: LessonResourcesDto[];

constructor(lernstoreContent: ComponentLernstorePropsImpl) {
this.resources = lernstoreContent.resources;
this.resources = [];
for (const resource of lernstoreContent.resources) {
this.resources.push(new LessonResourcesDto(resource));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { LessonResources } from '../lessons-api-client';

export class LessonResourcesDto {
client: string;

description: string;

merlinReference: string;

title: string;

url: string;

constructor(lessonResources: LessonResources) {
this.client = lessonResources.client;
this.description = lessonResources.description;
this.merlinReference = lessonResources.merlinReference;
this.title = lessonResources.title;
this.url = lessonResources.url;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.gitignore
.npmignore
.openapi-generator-ignore
api.ts
api/lesson-api.ts
base.ts
Expand All @@ -15,10 +14,8 @@ models/component-lernstore-props-impl.ts
models/component-nexboard-props-impl.ts
models/component-text-props-impl.ts
models/index.ts
models/lesson-content-response-content.ts
models/lesson-content-response.ts
models/lesson-linked-task-response.ts
models/lesson-metadata-list-response.ts
models/lesson-metadata-response.ts
models/lesson-resources.ts
models/lesson-response.ts
models/material-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,39 +170,13 @@ export const LessonApiFactory = function (configuration?: Configuration, basePat
};
};

/**
* LessonApi - interface
* @export
* @interface LessonApi
*/
export interface LessonApiInterface {
/**
*
* @param {string} lessonId The id of the lesson.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof LessonApiInterface
*/
lessonControllerGetLesson(lessonId: string, options?: RawAxiosRequestConfig): AxiosPromise<LessonResponse>;

/**
*
* @param {string} lessonId The id of the lesson.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof LessonApiInterface
*/
lessonControllerGetLessonTasks(lessonId: string, options?: RawAxiosRequestConfig): AxiosPromise<Array<LessonLinkedTaskResponse>>;

}

/**
* LessonApi - object-oriented interface
* @export
* @class LessonApi
* @extends {BaseAPI}
*/
export class LessonApi extends BaseAPI implements LessonApiInterface {
export class LessonApi extends BaseAPI {
/**
*
* @param {string} lessonId The id of the lesson.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type { Configuration } from './configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';

export const BASE_PATH = "http://localhost/api/v3".replace(/\/+$/, "");
export const BASE_PATH = "http://localhost:3030/api/v3".replace(/\/+$/, "");

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
*/


// May contain unused imports in some cases
// @ts-ignore
import type { LessonResources } from './lesson-resources';

/**
*
Expand All @@ -22,9 +25,9 @@
export interface ComponentLernstorePropsImpl {
/**
* resources of a Lernstore component
* @type {Array<string>}
* @type {Array<LessonResources>}
* @memberof ComponentLernstorePropsImpl
*/
'resources': Array<string>;
'resources': Array<LessonResources>;
}

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ export * from './component-lernstore-props-impl';
export * from './component-nexboard-props-impl';
export * from './component-text-props-impl';
export * from './lesson-content-response';
export * from './lesson-content-response-content';
export * from './lesson-linked-task-response';
export * from './lesson-metadata-list-response';
export * from './lesson-metadata-response';
export * from './lesson-resources';
export * from './lesson-response';
export * from './material-response';
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface LessonContentResponse {
* @type {string}
* @memberof LessonContentResponse
*/
'component': LessonContentResponseComponent;
'component': LessonContentResponseComponentEnum;
/**
*
* @type {boolean}
Expand All @@ -62,15 +62,15 @@ export interface LessonContentResponse {
'hidden': boolean;
}

export const LessonContentResponseComponent = {
ETHERPAD: 'Etherpad',
GEO_GEBRA: 'geoGebra',
INTERNAL: 'internal',
RESOURCES: 'resources',
TEXT: 'text',
NEX_BOARD: 'neXboard'
export const LessonContentResponseComponentEnum = {
Etherpad: 'Etherpad',
GeoGebra: 'geoGebra',
Internal: 'internal',
Lernstore: 'lernstore',
Text: 'text',
NeXboard: 'neXboard'
} as const;

export type LessonContentResponseComponent = typeof LessonContentResponseComponent[keyof typeof LessonContentResponseComponent];
export type LessonContentResponseComponentEnum = typeof LessonContentResponseComponentEnum[keyof typeof LessonContentResponseComponentEnum];


Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface LessonLinkedTaskResponse {
* @type {string}
* @memberof LessonLinkedTaskResponse
*/
'descriptionInputFormat': LessonLinkedTaskResponseDescriptionInputFormat;
'descriptionInputFormat': LessonLinkedTaskResponseDescriptionInputFormatEnum;
/**
*
* @type {string}
Expand Down Expand Up @@ -94,13 +94,13 @@ export interface LessonLinkedTaskResponse {
'finishedIds': Array<string>;
}

export const LessonLinkedTaskResponseDescriptionInputFormat = {
PLAIN_TEXT: 'plainText',
RICH_TEXT_CK5_SIMPLE: 'richTextCk5Simple',
RICH_TEXT_CK4: 'richTextCk4',
RICH_TEXT_CK5: 'richTextCk5'
export const LessonLinkedTaskResponseDescriptionInputFormatEnum = {
PlainText: 'plainText',
RichTextCk5Simple: 'richTextCk5Simple',
RichTextCk4: 'richTextCk4',
RichTextCk5: 'richTextCk5'
} as const;

export type LessonLinkedTaskResponseDescriptionInputFormat = typeof LessonLinkedTaskResponseDescriptionInputFormat[keyof typeof LessonLinkedTaskResponseDescriptionInputFormat];
export type LessonLinkedTaskResponseDescriptionInputFormatEnum = typeof LessonLinkedTaskResponseDescriptionInputFormatEnum[keyof typeof LessonLinkedTaskResponseDescriptionInputFormatEnum];


Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/* tslint:disable */
/* eslint-disable */
/**
* Schulcloud-Verbund-Software Server API
* This is v3 of Schulcloud-Verbund-Software Server. Checkout /docs for v1.
*
* The version of the OpenAPI document: 3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/



/**
*
* @export
* @interface LessonResources
*/
export interface LessonResources {
/**
* client
* @type {string}
* @memberof LessonResources
*/
'client': string;
/**
* description
* @type {string}
* @memberof LessonResources
*/
'description': string;
/**
* merlinReference
* @type {string}
* @memberof LessonResources
*/
'merlinReference': string;
/**
* title
* @type {string}
* @memberof LessonResources
*/
'title': string;
/**
* url
* @type {string}
* @memberof LessonResources
*/
'url': string;
}

Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import {
LessonContentResponse,
LessonResponse,
LessonLinkedTaskResponse,
LessonLinkedTaskResponseDescriptionInputFormat,
LessonLinkedTaskResponseDescriptionInputFormatEnum,
ComponentEtherpadPropsImpl,
ComponentGeogebraPropsImpl,
ComponentInternalPropsImpl,
ComponentTextPropsImpl,
ComponentLernstorePropsImpl,
ComponentNexboardPropsImpl,
LessonContentResponseComponent,
LessonContentResponseComponentEnum,
} from '../lessons-api-client';
import { LessonDtoMapper } from './lesson-dto.mapper';
import { LessonDto } from '../dto';
Expand Down Expand Up @@ -183,11 +183,11 @@ describe('LessonDtoMapper', () => {
describe('when mapping LessonResponse to lesson DTO with lernstore content', () => {
const setup = () => {
const lessonContentResponse: LessonContentResponse = {
content: { resources: [faker.internet.url(), faker.lorem.text()] } as ComponentLernstorePropsImpl,
content: { resources: [faker.internet.url(), faker.lorem.text()] } as unknown as ComponentLernstorePropsImpl,
_id: faker.string.uuid(),
id: faker.string.uuid(),
title: faker.lorem.sentence(),
component: faker.helpers.arrayElement(['resources']),
component: faker.helpers.arrayElement(['lernstore']),
hidden: faker.datatype.boolean(),
};

Expand All @@ -212,7 +212,7 @@ describe('LessonDtoMapper', () => {
const result = LessonDtoMapper.mapToLessonDto(lessonResponse);

expect(result).toBeInstanceOf(LessonDto);
expect(result.contents[0].component).toEqual('resources');
expect(result.contents[0].component).toEqual('lernstore');
expect(result.contents[0].content).toBeInstanceOf(ComponentLernstorePropsDto);
});
});
Expand Down Expand Up @@ -271,7 +271,7 @@ describe('LessonDtoMapper', () => {
_id: faker.string.uuid(),
id: faker.string.uuid(),
title: faker.lorem.sentence(),
component: faker.helpers.arrayElement(['unknown']) as unknown as LessonContentResponseComponent,
component: faker.helpers.arrayElement(['unknown']) as unknown as LessonContentResponseComponentEnum,
hidden: faker.datatype.boolean(),
};

Expand Down Expand Up @@ -306,7 +306,7 @@ describe('LessonDtoMapper', () => {
const lessonLinkedTaskResponse: LessonLinkedTaskResponse = {
name: faker.lorem.sentence(),
description: faker.lorem.sentence(),
descriptionInputFormat: LessonLinkedTaskResponseDescriptionInputFormat.PLAIN_TEXT,
descriptionInputFormat: LessonLinkedTaskResponseDescriptionInputFormatEnum.PlainText,
availableDate: faker.date.recent().toString(),
dueDate: faker.date.future().toString(),
private: faker.datatype.boolean(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
ComponentNexboardPropsImpl,
ComponentTextPropsImpl,
LessonContentResponse,
LessonContentResponseComponent,
LessonContentResponseComponentEnum,
LessonLinkedTaskResponse,
LessonResponse,
MaterialResponse,
Expand Down Expand Up @@ -73,47 +73,47 @@ export class LessonDtoMapper {

private static mapToLessenContentDto(lessonContentResponse: LessonContentResponse): LessonContentDto | null {
switch (lessonContentResponse.component) {
case LessonContentResponseComponent.TEXT:
case LessonContentResponseComponentEnum.Text:
return new LessonContentDto({
id: lessonContentResponse.id,
title: lessonContentResponse.title,
component: lessonContentResponse.component,
hidden: lessonContentResponse.hidden,
content: new ComponentTextPropsDto(lessonContentResponse.content as ComponentTextPropsImpl),
});
case LessonContentResponseComponent.ETHERPAD:
case LessonContentResponseComponentEnum.Etherpad:
return new LessonContentDto({
id: lessonContentResponse.id,
title: lessonContentResponse.title,
component: lessonContentResponse.component,
hidden: lessonContentResponse.hidden,
content: new ComponentEtherpadPropsDto(lessonContentResponse.content as ComponentEtherpadPropsImpl),
});
case LessonContentResponseComponent.GEO_GEBRA:
case LessonContentResponseComponentEnum.GeoGebra:
return new LessonContentDto({
id: lessonContentResponse.id,
title: lessonContentResponse.title,
component: lessonContentResponse.component,
hidden: lessonContentResponse.hidden,
content: new ComponentGeogebraPropsDto(lessonContentResponse.content as ComponentGeogebraPropsImpl),
});
case LessonContentResponseComponent.INTERNAL:
case LessonContentResponseComponentEnum.Internal:
return new LessonContentDto({
id: lessonContentResponse.id,
title: lessonContentResponse.title,
component: lessonContentResponse.component,
hidden: lessonContentResponse.hidden,
content: new ComponentInternalPropsDto(lessonContentResponse.content as ComponentInternalPropsImpl),
});
case LessonContentResponseComponent.RESOURCES:
case LessonContentResponseComponentEnum.Lernstore:
return new LessonContentDto({
id: lessonContentResponse.id,
title: lessonContentResponse.title,
component: lessonContentResponse.component,
hidden: lessonContentResponse.hidden,
content: new ComponentLernstorePropsDto(lessonContentResponse.content as ComponentLernstorePropsImpl),
});
case LessonContentResponseComponent.NEX_BOARD:
case LessonContentResponseComponentEnum.NeXboard:
return new LessonContentDto({
id: lessonContentResponse.id,
title: lessonContentResponse.title,
Expand Down
Loading
Loading