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

Task form: Show text input for files if previously used #1626

Open
MrSerth opened this issue Aug 31, 2024 · 0 comments
Open

Task form: Show text input for files if previously used #1626

MrSerth opened this issue Aug 31, 2024 · 0 comments
Labels

Comments

@MrSerth
Copy link
Member

MrSerth commented Aug 31, 2024

When creating or updating a task, we run several validations before storing the user data. When an error occurs, we don't save the requested changes, but rather render the input form again with an error message clearly showing the issues.

However, when we render this form again, the "alternative input" for files is shown by default, rather than the otherwise usual ACE editor used for textual input. In contrast to the textual input, the "alternative input" shows a file picker, allowing users to select a file from the local file system to upload.

The issue is that the form switches to the alternative input on validation errors, even when the standard textual input was used before. We should improve this behavior and still ensure that uploading a binary file works, even with validation errors.

Steps to reproduce:

  1. Go to https://codeharbor.openhpi.de/tasks/new
  2. Add a new file
  3. Only enter some value in the file content editor
  4. Save the task
  5. See the validation errors as expected. Now, move to the file previously added. You'll notice that the editor is gone and a file picker is present.
  6. Clicking on "Toggle file upload/editor" will show the editor again and also include the string previously entered for the new file.
@MrSerth MrSerth added the bug label Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant