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-8193 - Expanding and registering BBB #5354

Merged
merged 32 commits into from
Dec 16, 2024
Merged

Conversation

MartinSchuhmacher
Copy link
Contributor

@MartinSchuhmacher MartinSchuhmacher commented Nov 25, 2024

Description

Start implementing BBB on boards.

Links to Tickets or other pull requests

BC-8193
hpi-schul-cloud/nuxt-client#3469
hpi-schul-cloud/dof_app_deploy#1061

Changes

  • scope for VC service
  • api tests for new VC scopes
  • VC element on board
  • target models for VC

Approval for review

  • DEV: If api was changed - generate-client:server was executed in vue frontend and changes were tested and put in a PR with the same branch name.
  • QA: In addition to review, the code has been manually tested (if manual testing is possible)
  • All points were discussed with the ticket creator, support-team or product owner. The code upholds all quality guidelines from the PR-template.

Notice: Please remove the WIP label if the PR is ready to review, otherwise nobody will review it.

@MartinSchuhmacher MartinSchuhmacher self-assigned this Nov 25, 2024
@Loki-Afro
Copy link
Member

keep code and pr in english

@MartinSchuhmacher MartinSchuhmacher changed the title BC-8193 - Erweiterung und Registrierung BBB BC-8193 - Expanding and registering BBB Dec 2, 2024
@@ -65,6 +67,14 @@ describe(ContentElementResponseFactory.name, () => {
expect(result).toBeInstanceOf(DeletedElementResponse);
});

it('should return instance of DeletedElementResponse', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VideoConferenceElementResponse?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, will fix that

@@ -93,4 +97,8 @@ export class BoardNodeDeleteHooksService {
await this.contextExternalToolService.deleteContextExternalTool(linkedTool);
}
}

async afterDeleteVideoConferenceElement(videoConferenceElement: VideoConferenceElement): Promise<void> {
await this.filesStorageClientAdapterService.deleteFilesOfParent(videoConferenceElement.id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there files associated with video conference elements?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

during implementation I somewhen had the thought that they would have...now I can not explain how that could be xD
so will remove that, you're right 👍

title: `video conference element #${sequence}`,
position: 0,
children: [],
url: `url #${sequence}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we maybe write a proper URL format, like e.g. https://example.org/#{sequence}?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, that is not very quality like, will change that


return {
scopeId: element.id,
scopeName: 'video-conference-element',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use an enum or union type for this? Or is type safety not relevant here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not too sure about it tbh, will investigate on that

Copy link
Contributor Author

@MartinSchuhmacher MartinSchuhmacher Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be fine with the values from VideoConferenceScope enum, so I will use that for the VC scopeName also in course context

};
}
case VideoConferenceScope.VIDEO_CONFERENCE_ELEMENT: {
const element = (await this.boardNodeService.findById(scopeId)) as VideoConferenceElement;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use findByClassAndId(VideoConferenceElement, scopId) to avoid the cast and have the type checked.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for the hint 👍

@@ -4,6 +4,8 @@ import { BaseEntityWithTimestamps } from './base.entity';
export enum TargetModels {
COURSES = 'courses',
EVENTS = 'events',
ROOMS = 'rooms',
VIDEO_CONFERENCE_ELEMENTS = 'video-conference-elements',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quiet long name. Although precise. Maybe we can come up with something shorter. On the other hand we don't know if there will be other elements using VC. An what if we have to implement other VC services other than BBB? 😵‍💫

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also found myself in that rabbit hole when I thought about the naming. I thought about BBB_ELEMENTS but that was little to precise and not fitting with the rest of the services for VC. Otherwise something like BOARD_ELEMENTS could fit, but that would maybe be little too general. Whats your opinion on that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we should stick to 'video-conference-elements'. Otherwise it would be too unspecific.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

Copy link
Contributor

@EzzatOmar EzzatOmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The video-conference.controller.ts apis could have better status codes.

Start Conference (PUT :scope/:scopeId/start):
Current: HttpStatus.OK
Better: HttpStatus.CREATED (201) if conference created, HttpStatus.NO_CONTENT (204) if already running.

Join Conference (GET :scope/:scopeId/join):
Current: HttpStatus.OK
Better: HttpStatus.OK (200) is good, but use HttpStatus.NOT_FOUND (404) if conference not running.

Get Conference Info (GET :scope/:scopeId/info):
Current: HttpStatus.OK
Better: HttpStatus.OK (200) is good, but use HttpStatus.NOT_FOUND (404) if no info available.

End Conference (GET :scope/:scopeId/end):
Current: HttpStatus.OK
Better: HttpStatus.NO_CONTENT (204) if successfully ended, HttpStatus.NOT_FOUND (404) if conference not found.


Good PR. Nothing drastic.

General thoughts...
The video conference module is doing too much. It's too big for doing so little. It should not have so much knowledge about the other modules. In essence, what we actually are doing in this module is managing the big blue button server. We are creating instances and returning links. I'm not even sure if it makes sense to know for which context it is used or not. I mean what kind of difference does it make if the conference is used for a room versus for a board? All we need to do is to check if the person is able to create or if the person can join/delete. So basically only the authorization is needed. I think the title does not even need to be pulled from the scoped resource. It can just be an api argument. Whoever is able to create a conference should also be able to set the title and this can be delegated to the front end.

The authorization on the other hand needs to be done. In case we separate the authorization part like in rooms, where we introduce a roomMembership module, we could delete complexity.

return result;
}

canMap(element: VideoConferenceElement): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use type unknown as you want to check the element type

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point 👍 maybe I change that for all the other types as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is another example of our inconsistency of enum value naming. (camel case, kebab case, ...)

We might want to address that in the future @CeEv

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need a fallback for url and title ... ?? ''.

Is there a reason not to trust the type system?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, agree, if we use types we should trust on that

EXTERNAL_TOOL: 'externalTool',
COLLABORATIVE_TEXT_EDITOR: 'collaborativeTextEditor',
DELETED: 'deleted'
FILE: 'file',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to have this list sorted A->Z

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure how this is sorted by openapi to be honest, would not like to handle that file manually

@MartinSchuhmacher MartinSchuhmacher merged commit 0b4dacc into main Dec 16, 2024
76 checks passed
@MartinSchuhmacher MartinSchuhmacher deleted the BC-8193-start-bbb branch December 16, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants