Allow deletion of entire forum threads #111

Open
ansv7779 wants to merge 10 commits from remove-forum-post into develop
Owner

Only forum replies are allowed to be deleted. Entire threads (and the initial post) can not be deleted.

Fixes

How to test

  1. Log in as eric@example.com (supervisor) or as sture@example.com (author)
  2. Open the forum in project "Putting the it in supervising"
  3. Create a new thread
  4. Delete the thread
  5. Create a second thread
  6. Post some replies as the different users
  7. See that the thread (initial post) can't be deleted
  8. Delete the replies
  9. Delete the thread
Only forum replies are allowed to be deleted. Entire threads (and the initial post) can not be deleted. Fixes #139 ## How to test 1. Log in as `eric@example.com` (supervisor) or as `sture@example.com` (author) 2. Open the forum in project "Putting the it in supervising" 3. Create a new thread 4. Delete the thread 5. Create a second thread 6. Post some replies as the different users 7. See that the thread (initial post) can't be deleted 8. Delete the replies 9. Delete the thread
ansv7779 added 2 commits 2025-02-17 13:59:26 +01:00
ansv7779 added 1 commit 2025-02-17 14:02:18 +01:00
ansv7779 changed title from Allow deletion of forum replies to WIP: Allow deletion of forum replies 2025-02-17 14:03:18 +01:00
First-time contributor
Deployed to https://scipro-remove-forum-post.branch.dsv.su.se
ansv7779 added 1 commit 2025-02-17 14:17:45 +01:00
ansv7779 changed title from WIP: Allow deletion of forum replies to Allow deletion of forum replies 2025-02-17 14:39:27 +01:00
ansv7779 added 1 commit 2025-02-17 14:39:35 +01:00
ansv7779 added the
po
needed
label 2025-02-17 16:03:26 +01:00
niat8586 approved these changes 2025-02-20 14:22:30 +01:00
niat8586 left a comment
Owner

👍
Code looks good.
Really like that you moved some of the logic happening in panels to BasicForumService

👍 Code looks good. Really like that you moved some of the logic happening in panels to BasicForumService
ansv7779 added 1 commit 2025-03-04 12:35:08 +01:00
Owner

I like the solution and the "delete" button. The only thing I would like to add is the possibility to delete a thread, as author/creator of the thread, if there are no replies from other users.

I like the solution and the "delete" button. The only thing I would like to add is the possibility to delete a thread, as author/creator of the thread, if there are no replies from other users.
andan added
po
changes
and removed
po
needed
labels 2025-03-04 14:06:23 +01:00
niat8586 changed title from Allow deletion of forum replies to WIP: Allow deletion of forum replies 2025-03-05 11:52:29 +01:00
ansv7779 added 1 commit 2025-03-05 12:36:57 +01:00
# Conflicts:
#	core/src/test/java/se/su/dsv/scipro/test/SpringTest.java
ansv7779 added 1 commit 2025-03-11 15:02:36 +01:00
ansv7779 added 1 commit 2025-03-17 10:42:08 +01:00
ansv7779 added 2 commits 2025-03-17 10:52:15 +01:00
ansv7779 added 1 commit 2025-03-17 12:46:46 +01:00
ansv7779 changed title from WIP: Allow deletion of forum replies to WIP: Allow deletion of entire forum threads 2025-03-17 13:46:59 +01:00
Author
Owner

Due to technical difficulties in getting thread deletion done has been split off at the point of product owner approval so that deletion of forum replies can be released.

Due to technical difficulties in getting thread deletion done #137 has been split off at the point of product owner approval so that deletion of forum replies can be released.
ansv7779 force-pushed remove-forum-post from b821c16e48 to 819d5c7935 2025-03-18 10:05:46 +01:00 Compare
ansv7779 added 1 commit 2025-03-18 15:58:34 +01:00
The end purpose is to enable removal of entire threads. Previous attempts have failed, all because of something JPA/Hibernate related such as not-null constraint, transient/detached entities, or something else.

 The approach is to get rid of @Entitys throughout the system and use data transfer objects (DTOs) and to make the thread more of a central concept rather than an empty container with an "initial" post. This should allow a more dedicated "delete thread" method that can take care of all the issues instead of "is this the last post then do extra steps" which is causing the problems.

 Changing to DTOs will also align better with the technical future that the current developers want and have decided on "Never return @Entity classes from services" (https://gitea.dsv.su.se/DMC/scipro/wiki/Technical-future).
ansv7779 force-pushed remove-forum-post from 27204cba5e to 2983e13af6 2025-04-08 13:46:29 +02:00 Compare
ansv7779 added 1 commit 2025-04-08 14:40:39 +02:00
ansv7779 added
po
needed
and removed
po
changes
labels 2025-04-08 15:57:11 +02:00
ansv7779 changed title from WIP: Allow deletion of entire forum threads to Allow deletion of entire forum threads 2025-04-08 15:57:15 +02:00
Owner

If an author (or supervisor) creates a thread (or reply) and then deletes it right away, then the supervisor (or author) still gets a red flag notification that the forum is updated. Can be do something about it?

If an author (or supervisor) creates a thread (or reply) and then deletes it right away, then the supervisor (or author) still gets a red flag notification that the forum is updated. Can be do something about it?
Author
Owner

If an author (or supervisor) creates a thread (or reply) and then deletes it right away, then the supervisor (or author) still gets a red flag notification that the forum is updated. Can be do something about it?

Yes that is possible but an e-mail will already be sent out regardless.

> If an author (or supervisor) creates a thread (or reply) and then deletes it right away, then the supervisor (or author) still gets a red flag notification that the forum is updated. Can be do something about it? Yes that is possible but an e-mail will already be sent out regardless.
Owner

We solve it in the following way: in case of deletion, a deletion notification is sent to the receiving part as well.

We solve it in the following way: in case of deletion, a deletion notification is sent to the receiving part as well.
andan added
po
changes
and removed
po
needed
labels 2025-04-10 13:51:30 +02:00
All checks were successful
Deploy to branch.dsv.su.se / deploy (pull_request) Successful in 3m9s
Build and test / build-and-test (push) Successful in 16m24s
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin remove-forum-post:remove-forum-post
git checkout remove-forum-post
Sign in to join this conversation.
No description provided.