Prevent admins from editing fields when there's an un-viewed draft.

Review Request #14037 — Created July 13, 2024 and submitted

Information

Review Board
release-7.x

Reviewers

Now that admins can make a choice about whether they want to view an
unpublished draft or not, we need to be more careful about when they
make edits. This change makes it so if the admin attempts to make a
change to the review request when a user draft exists, we'll block the
edit and prompt them to load the draft first.

  • Attempted to edit review request fields, file attachment
    captions/state, and add new attachments/diffs as an admin while
    viewing a review request with an unpublished draft, but not viewing
    the draft. Saw the expected prompt.
  • Edited review request fields, file attachment captions/state, and
    added new attachments/diffs as both the owner and an admin while
    viewing the current draft.
Summary ID
Prevent admins from editing fields when there's an un-viewed draft.
Now that admins can make a choice about whether they want to view an unpublished draft or not, we need to be more careful about when they make edits. This change makes it so if the admin attempts to make a change to the review request when a user draft exists, we'll block the edit and prompt them to load the draft first. Testing Done: - Attempted to edit review request fields, file attachment captions/state, and add new attachments/diffs as an admin while viewing a review request with an unpublished draft, but not viewing the draft. Saw the expected prompt. - Edited review request fields, file attachment captions/state, and added new attachments/diffs as both the owner and an admin while viewing the current draft.
8509c9d396f82378c4700605595a24dc19c39b1d
Description From Last Updated

We should add a Version Added here too.

chipx86chipx86

Most conditionals are this combination of checks. I wonder if we should just have a function that covers it?

chipx86chipx86

Looks like this should be deleted.

maubinmaubin

Missing a Version Added.

chipx86chipx86
maubin
  1. 
      
  2. reviewboard/static/rb/js/reviews/views/reviewRequestFieldViews.ts (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
    Show all issues

    Looks like this should be deleted.

  3. 
      
chipx86
  1. 
      
  2. Show all issues

    We should add a Version Added here too.

  3. Show all issues

    Most conditionals are this combination of checks. I wonder if we should just have a function that covers it?

  4. 
      
david
chipx86
  1. 
      
  2. Show all issues

    Missing a Version Added.

  3. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-7.x (c5eefb7)