Allow commenting on draft (unpublished) items.
Review Request #12949 — Created April 12, 2023 and submitted
For as long as Review Board has existed, we've disallowed commenting on
items before they're published. The reasoning here was that if you add a
diff comment, replacing the diff will delete the comment (and similar
for file attachments).This change updates the comment dialog to remove the
hasDraft
checks.
This is replaced with a new mechanism whereby we add apublic
state to
diffs and file attachments, and use that to show a warning to the user
if they're commenting on something which has not yet been published. The
bulk of the code changes here are just plumbing that state all the way
down to the comment block models, which use it to decide what to display
to the user.
- Ran unit tests.
- Created review requests with published and unpublished diffs and file
attachments. Checked that adding a comment to published items worked
as normal, and that the draft warnings were correctly shown for draft
diffs and file attachments, as well as for interdiffs and file
attachment diffs involving an unpublished tip revision.
Summary | ID |
---|---|
5ae837284a1299d99ebcb65ecd4757837c8de21e |
Description | From | Last Updated |
---|---|---|
Do comments get deleted when the draft diff/file is replaced? I think we should update the unit tests to confirm … |
maubin | |
line too long (80 > 79 characters) Column: 80 Error code: E501 |
reviewbot | |
If comments get deleted when a draft diff is replaced, I think we should explicitely say delete here instead of … |
maubin | |
If comments get deleted when the file is replaced, I think we should explicitely say delete here instead of invalidate. |
maubin |
- Commits:
-
Summary ID 26fa6a100ab2e62d3731c18c2642d729bdf3b79c 8ae716c43d8bb0a823b76c91936d6b228d6dcb81 - Diff:
-
Revision 2 (+454 -44)
Checks run (2 succeeded)
-
-
Do comments get deleted when the draft diff/file is replaced? I think we should update the unit tests to confirm what happens after draft diffs/files get deleted while they have comments.
-
If comments get deleted when a draft diff is replaced, I think we should explicitely say
delete
here instead ofinvalidate
. -
If comments get deleted when the file is replaced, I think we should explicitely say
delete
here instead ofinvalidate
.
- Commits:
-
Summary ID 8ae716c43d8bb0a823b76c91936d6b228d6dcb81 5ae837284a1299d99ebcb65ecd4757837c8de21e - Diff:
-
Revision 3 (+538 -48)