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

Communication: Allow file uploads in messages #9580

Merged
merged 31 commits into from
Oct 26, 2024

Conversation

pzdr7
Copy link
Contributor

@pzdr7 pzdr7 commented Oct 24, 2024

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) and too complex database calls.
  • I strictly followed the principle of data economy for all database calls.
  • I strictly followed the server coding and design guidelines.
  • I documented the Java code using JavaDoc style.

Client

  • Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data (e.g. using paging).
  • I documented the TypeScript code using JSDoc style.
  • I added multiple screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

Motivation and Context

In the communication feature, it's currently not possible to upload files or link images, as the message will just remain blank.

Description

  • Added the file upload to the markdown editor in the communication view
  • Added endpoints for storing and retrieving markdown files in communication
  • Allows users to embed images in their messages

Steps for Testing

Prerequisites:

  • 1 Student
  • 1 Course with communication enabled
  1. Navigate to a channel, private message, or group chat.
  2. Upload files into the editor:
  • Click the file upload footer and select an image file. Verify that a link gets inserted and that when you send the message, the image is embedded. When you click on the image, it should expand.
  • Select a file that is larger than 5 MiB, but smaller than 20 MiB. There should be an error message.
  1. Check that the other reference types (e.g. user, channel) are still displayed correctly.
  2. Check that you can link to external images, e.g. by inserting ![ase](https://avatars.githubusercontent.com/u/11064260?s=200&v=4)

Testserver States

Note

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







Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Screenshots

Screencast.from.24.10.2024.20.23.45.webm

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced constants for file size and submission limits to enhance configuration consistency.
    • Added methods for managing markdown file uploads and retrievals specific to course conversations.
    • Enhanced the markdown editor to support file uploads for both images and PDFs.
    • Implemented new error messages for missing image references in the markdown editor.
    • Updated the component to utilize reactive state management for posting content parts.
    • Improved file upload functionality with dynamic file type acceptance based on allowed extensions.
  • Bug Fixes

    • Improved error handling for oversized file uploads in the file resource.
  • Documentation

    • Updated internationalization files to include new messages for image reference errors.
  • Tests

    • Expanded test coverage for file upload scenarios and component behavior adjustments.

@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) core Pull requests that affect the corresponding module labels Oct 24, 2024
@krusche krusche added this to the 7.6.4 milestone Oct 25, 2024
Copy link
Contributor

@dmytropolityka dmytropolityka 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 on ts1, also code

@krusche krusche merged commit f684600 into develop Oct 26, 2024
67 of 74 checks passed
@krusche krusche deleted the feature/communication/file-upload branch October 26, 2024 11:43
Copy link

⚠️ Unable to deploy to test servers ⚠️

Testserver "artemis-test5.artemis.cit.tum.de" is already in use by PR #9611.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Oct 27, 2024
@github-actions github-actions bot removed the deployment-error Added by deployment workflows if an error occured label Oct 27, 2024
Copy link

⚠️ Unable to deploy to test servers ⚠️

Testserver "artemis-test1.artemis.cit.tum.de" is already in use by PR #9395.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Oct 27, 2024
@github-actions github-actions bot removed the deployment-error Added by deployment workflows if an error occured label Oct 27, 2024
@github-actions github-actions bot added deployment-error Added by deployment workflows if an error occured and removed deploy:artemis-test2 labels Oct 27, 2024
@github-actions github-actions bot removed the deployment-error Added by deployment workflows if an error occured label Oct 27, 2024
@github-actions github-actions bot added deployment-error Added by deployment workflows if an error occured and removed deploy:artemis-test2 labels Oct 27, 2024
@Fallthunderclap
Copy link

Tested on test-server-2
Followed steps for testing and haven't encountered any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) core Pull requests that affect the corresponding module deployment-error Added by deployment workflows if an error occured playwright priority:high ready for review server Pull requests that update Java code. (Added Automatically!) tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.