Block commenting on deleted file attachments.
Review Request #13329 — Created Oct. 11, 2023 and submitted
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 theFileAttachmentCommentBlock
andFileAttachmentReviewable
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 |
---|---|
b81b87818168fbbcc542351d6a90fa8590bdf8b1 |
- Change Summary:
-
Removed unused import.
- Commits:
-
Summary ID 69ea827e50bb44e1b91ff1bea96e4a7d3a2b2c18 9cb0b8048cd9863503cd813ba97345a2a565e7b3 - Diff:
-
Revision 2 (+320 -112)
Checks run (2 succeeded)
- Commits:
-
Summary ID 9cb0b8048cd9863503cd813ba97345a2a565e7b3 b81b87818168fbbcc542351d6a90fa8590bdf8b1 - Diff:
-
Revision 3 (+344 -112)