Block commenting on deleted file attachments.

Review Request #13329 — Created Oct. 11, 2023 and submitted

Information

Review Board
release-6.x

Reviewers

Our current UI allows users to comment on deleted file attachments, but these
comments cannot actually be saved for the deleted files. It also doesn't make
sense to allow commenting on deleted files. To address this, this change blocks
commenting on deleted files. When attempting to comment on one, we display a
warning message in the comment dialog and block the ability to edit the file,
similar to what we display when unauthenticated users try to create comments.
We update the FileAttachmentCommentBlock and FileAttachmentReviewable
models to make use of the file attachment states concept that were recently
introduced.

This also hides the Markdown docs link for comment dialogs that cannot be
edited. This makes more sense than hiding it only for unauthenticated
users, which is what we were doing before.

  • Ran unit tests and JS tests.
  • Tested commenting on a deleted file, saw the warning and inability to
    edit/save the comment.
  • Tested commenting on a non-deleted file.
  • Tested commenting on a draft file.
  • Tested the above cases while logged in and while not logged in.
Summary ID
Block commenting on deleted file attachments.
b81b87818168fbbcc542351d6a90fa8590bdf8b1
Description From Last Updated

'reviewboard.reviews.models.review_request.FileAttachmentState' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

Can you add a Version Added?

chipx86chipx86

Can you add a Version Added?

chipx86chipx86

Can you add a Version Added?

chipx86chipx86

Can you add a Version Added?

chipx86chipx86
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

maubin
chipx86
  1. Code looks good! Just want to get some version info in the docs.

  2. Show all issues

    Can you add a Version Added?

  3. Show all issues

    Can you add a Version Added?

  4. Show all issues

    Can you add a Version Added?

  5. Show all issues

    Can you add a Version Added?

  6. 
      
maubin
chipx86
  1. Ship It!
  2. 
      
maubin
Review request changed
Status:
Completed
Change Summary:
Pushed to release-6.x (6f1c7cb)