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

Lectures: Fix embedding of TUM-Live videos in lecture units #8183

Conversation

JohannesWt
Copy link
Contributor

@JohannesWt JohannesWt commented Mar 12, 2024

Checklist

General

Client

Motivation and Context

This PR resolves an existing issue where a video unit, added to a lecture using a TUM-Live URL without the 'video_only=1' URL parameter, could not be embedded. #8157

Description

  • A TUM Live URL added to the source field of a video unit without the search param 'video_only=1' will not be accepted
  • A TUM Live URL without the search param 'video_only' can be transformed using the 'transform into embeddable format' button to a valid TUM Live URL

Steps for Testing

Prerequisites:

  • 1 Lecture to add (or edit) a video unit
  1. Log in to Artemis
  2. Navigate to Course Administration
  3. Navigate to Lectures
  4. Click on "Units" on a lecture
  5. Click on "Video" in the button bar to add a new video
  6. Insert a name for the video unit
  7. Insert a TUM live link (e.g. https://live.rbg.tum.de/w/AdvProg/35931) into the field "Transform into embeddable format"
  8. Click the arrow button next to the field
  9. Click on "Submit"
  10. Expand the created video unit on the video unit overview page
  11. Play the video

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked







Review Progress

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Screenshots

Summary by CodeRabbit

  • New Features

    • Enhanced video URL validation and transformation for lecture units, including support for TUM-Live URLs.
  • Bug Fixes

    • Fixed an issue with the incorrect identification of invalid video URLs in the form validation.
  • Tests

    • Updated existing tests to align with the new validation logic.
    • Added tests for transforming TUM-Live URLs into embeddable formats.

@JohannesWt JohannesWt self-assigned this Mar 12, 2024
@artemis-bot artemis-bot added this to In progress in Artemis Development Mar 12, 2024
@github-actions github-actions bot added tests client Pull requests that update TypeScript code. (Added Automatically!) labels Mar 12, 2024
@JohannesWt JohannesWt temporarily deployed to artemis-test5.artemis.cit.tum.de March 12, 2024 14:36 — with GitHub Actions Inactive
@JohannesWt JohannesWt linked an issue Mar 12, 2024 that may be closed by this pull request
@MaximilianAnzinger MaximilianAnzinger changed the title Lecture: Embed tum live URLs without 'video_only=1' parameter in url validator Lecture: Fix embedding of TUM-Live videos in lecture units Mar 12, 2024
@JohannesWt JohannesWt marked this pull request as ready for review March 14, 2024 09:23
@JohannesWt JohannesWt requested a review from a team as a code owner March 14, 2024 09:23
Copy link

coderabbitai bot commented Mar 14, 2024

Walkthrough

The update enhances the video unit form's URL validation mechanism in an Angular application. It refines the validation logic for video URLs, introducing new validators for source and transformed URLs, and adapts to handle specific TUM URLs by converting them to an embeddable format. This adjustment ensures more precise validation and user feedback, improving the overall user experience in managing video content within the application.

Changes

File Path Change Summary
.../video-unit-form/video-unit-form.component.html Updated the conditional check for displaying URL validation errors.
.../video-unit-form/video-unit-form.component.ts Imported ValidationErrors, renamed and updated validators, modified form controls to use new validators, and enhanced URL extraction logic for TUM URLs.
.../video-unit/video-unit-form.component.spec.ts Updated method calls in tests to reflect validator name changes and added a test for TUM-Live URL transformation.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@JohannesWt
Copy link
Contributor Author

The failing tests are not related to the changes I did.

@JohannesWt JohannesWt dismissed coderabbitai’s stale review March 18, 2024 11:42

The suggested changes would invert the changes and not work

nityanandaz
nityanandaz previously approved these changes Mar 18, 2024
Copy link
Contributor

@nityanandaz nityanandaz left a comment

Choose a reason for hiding this comment

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

Manual test, locally.
Generates embeddable video URL correctly.

basak-akan
basak-akan previously approved these changes Mar 18, 2024
Copy link
Contributor

@basak-akan basak-akan left a comment

Choose a reason for hiding this comment

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

Besides @rstief 's statements, code looks good 👍

Copy link
Contributor

@milljoniaer milljoniaer left a comment

Choose a reason for hiding this comment

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

Thanks for the improvements, I just have one additional thought.
I dont like the two let statements. Couldnt you move the whole functionality after the try catch inside the try blocks and return the error state inside the catch blocks?

I personally would like that better. What are your thoughts on this?

Copy link
Contributor

@milljoniaer milljoniaer left a comment

Choose a reason for hiding this comment

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

Discussed on slack, I am fine with this solution as well

Copy link
Contributor

@basak-akan basak-akan left a comment

Choose a reason for hiding this comment

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

Code lgtm 👍

Copy link
Contributor

@rstief rstief left a comment

Choose a reason for hiding this comment

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

Code looks good after changes 👍

Copy link
Contributor

@nityanandaz nityanandaz left a comment

Choose a reason for hiding this comment

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

Re-test after code changes, still works

Copy link
Contributor

@MaximilianAnzinger MaximilianAnzinger left a comment

Choose a reason for hiding this comment

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

maintainer approved 👍

@krusche krusche added this to the 6.9.4 milestone Mar 24, 2024
@krusche krusche merged commit 98bae48 into develop Mar 24, 2024
63 of 69 checks passed
@krusche krusche deleted the fix/8157-lecture-tum-live-links-are-not-supported-for-video-units branch March 24, 2024 22:19
@krusche krusche changed the title Lecture: Fix embedding of TUM-Live videos in lecture units Lectures: Fix embedding of TUM-Live videos in lecture units Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix client Pull requests that update TypeScript code. (Added Automatically!) ready to merge small tests
Projects
Archived in project
Artemis Development
  
In progress
Development

Successfully merging this pull request may close these issues.

Lecture: TUM-Live links are not supported for video units
7 participants