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: Add undo button when deleting posts #9624

Merged
merged 10 commits into from
Nov 3, 2024

Conversation

PaRangger
Copy link
Contributor

@PaRangger PaRangger commented Oct 28, 2024

Checklist

General

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 strictly followed the client coding and design guidelines.
  • Following the theming guidelines, I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
  • I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • I added multiple screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

Motivation and Context

Currently, messages are deleted by selecting the trash icon on a post and then confirming the action by clicking the checkmark in the same location. While this confirmation step helps prevent accidental deletions, the double-clicking action commonly used in user interfaces may still lead to unintended deletions. To address this, an additional mechanism should be introduced, allowing users to undo a delete action for a brief period, similar to e.g. the "undo send" functionality in the Mac OS Mail app.

Description

A brief delay has been added before permanently deleting a message, allowing users an opportunity to undo their delete command. This delay is accompanied by user interface elements designed to clearly indicate the status and timing of the deletion process.

Steps for Testing

Prerequisites:

  • 1 Instructor/Student/Tutor
  • 1 Course with communication enabled
  1. Log in to Artemis
  2. Navigate to course
  3. Navigate to the communication tab and select a channel
  4. Write a message or locate an existing message of the current user
  5. Delete the message
  6. Undo the delete command
  7. Delete the message again
  8. Check if message is deleted after the delay

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

Client

Class/File Line Coverage Confirmation (assert/expect)
answer-post.component.ts 100%
post.component.ts 94.82%
answer-post-header.component.ts 96.87%
post-header.component.ts 96.66%
posting-header.directive.ts 100%
posting.directive.ts 82.75%
profile-picture.component.ts 100%

Screenshots

Bildschirmaufnahme 2024-10-29 um 00 38 44

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced handling of deleted posts with new UI elements for undoing deletions.
    • Conditional rendering for editing options based on post deletion status.
    • Added animations for improved visual feedback when posts are deleted or restored.
  • Bug Fixes

    • Improved performance in rendering lists of posts by optimizing tracking mechanisms.
  • Localization

    • Added new German and English keys for user feedback on post deletion and undo actions.
  • Tests

    • Expanded test coverage for deletion functionality and UI responses to deletion state changes.

@PaRangger PaRangger added client Pull requests that update TypeScript code. (Added Automatically!) communication Pull requests that affect the corresponding module labels Oct 28, 2024
@github-actions github-actions bot added tests and removed communication Pull requests that affect the corresponding module labels Oct 28, 2024
@PaRangger PaRangger changed the title Communication: Add undo delete button Communication: Add undo button when deleting posts Oct 28, 2024
@PaRangger PaRangger added deploy:artemis-test5 communication Pull requests that affect the corresponding module and removed tests labels Oct 28, 2024
@PaRangger PaRangger temporarily deployed to artemis-test5.artemis.cit.tum.de October 28, 2024 23:57 — with GitHub Actions Inactive
@github-actions github-actions bot added tests and removed communication Pull requests that affect the corresponding module labels Oct 29, 2024
Copy link

⚠️ Unable to deploy to test servers ⚠️

The docker build needs to run through before deploying.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Oct 29, 2024
@PaRangger PaRangger added deploy:artemis-test5 and removed deployment-error Added by deployment workflows if an error occured labels Oct 29, 2024
@PaRangger PaRangger temporarily deployed to artemis-test5.artemis.cit.tum.de October 29, 2024 00:52 — with GitHub Actions Inactive
Copy link

@Malekos74 Malekos74 left a comment

Choose a reason for hiding this comment

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

Server tested on: Server 01

Works as expected. I think the error that you talked about earlier in the conversation is now fixed. Or at least, I couldn't reproduce it.

Copy link

@sawys777 sawys777 left a comment

Choose a reason for hiding this comment

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

Tested on TS2, everything worked as expected from the description. However, I have also tried switching to another channel while waiting for the timer to countdown, when I am back to the previous channel, the message did not get deleted and remain there. Not sure if this is the intended behaviour.

Copy link

@JanaNF JanaNF left a comment

Choose a reason for hiding this comment

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

Manual tested on TS2. It worked as expected, and I tested it in threads, too. It also worked when you delete the main question ->, and then the threads get deleted, too.

Copy link

@zagemello zagemello left a comment

Choose a reason for hiding this comment

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

Works as expected, tested on TS2

@krusche krusche added this to the 7.6.5 milestone Nov 3, 2024
@krusche krusche merged commit b63ac73 into develop Nov 3, 2024
13 of 16 checks passed
@krusche krusche deleted the feature/communication/add-undo-delete-button branch November 3, 2024 19:11
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!) ready for review tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.