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-8168 - Implementing video conferences in FE and remaining issues #5420

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

uidp
Copy link
Contributor

@uidp uidp commented Jan 9, 2025

Description

Implementing video conferences in FE and remaining issues

Links to Tickets or other pull requests

BC-8168

hpi-schul-cloud/nuxt-client#3480

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.

}

/* istanbul ignore next */
throw new Error(`Unsupported board reference type ${context.type as string}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe throwing a BadRequestException?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

return features;
}

if (context.type === BoardExternalReferenceType.Room) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering what BoardExternalReferenceType.User is.

Will that case ever happen?

Copy link
Contributor Author

@uidp uidp Jan 15, 2025

Choose a reason for hiding this comment

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

BoardExternalReferenceType.User is for the MediaBoard which exists in the context of a user. So that is theoretically possible i think.

@@ -52,7 +52,7 @@ export class BoardNodeAuthorizableService implements AuthorizationLoaderService
const rootIds = boardNodes.map((node) => node.rootId);
const parentIds = boardNodes.map((node) => node.parentId).filter((defined) => defined) as EntityId[];
const boardNodeMap = await this.getBoardNodeMap([...rootIds, ...parentIds]);
const promises = boardNodes.map((boardNode) => {
const promises = boardNodes.map(async (boardNode) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

you only need async when using await. a normal fn can happily return a promise

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well that was a fix for a linter warning. But yes, I agree. Doesn't have to be awaited.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But we can re-write the function using async / await when we eliminate the then. Maybe that's more readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the code accordingly.


return board;
return { board, features };
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems to be the simplest solution to just add the features in the initial response.

we should not really follow strict rest as we are building an interactive web app and not a static directory

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean adding it to ColumnBoard? That would mean altering the domain object.


if (
this.isVideoConferenceEnabledForCourse(course.features) ||
(await this.isVideoConferenceEnabledForSchool(course.school.id)) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

you will get the feature pushed into the array, even if only the school has VC activated, but the course has not, did I see that right? That would not be correct, as we could have the case, that VC are activated for the whole school, but not for the specific course. Could you validate my thought?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. See also test.

if (context.type === BoardExternalReferenceType.Room) {
const room = await this.roomService.getSingleRoom(context.id);

if ((await this.isVideoConferenceEnabledForSchool(room.schoolId)) || this.isVideoConferenceEnabledForConfig()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

also here we get the feature in both cases, even if its only activated for the instance, but not for the school, that does not sound right

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, we should be able to deactivate the feature for the school even if it's enabled on the instance right?

Copy link
Contributor

@MartinSchuhmacher MartinSchuhmacher Jan 15, 2025

Choose a reason for hiding this comment

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

correct, and it should (for the example above) be able to be deactivated on course level, even if its activated on a school (and therefore on the instance)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

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.

3 participants