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

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

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.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
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 David Trowbridge
reviewboard/static/rb/js/reviews/models/reviewRequestEditorModel.ts
reviewboard/static/rb/js/reviews/models/unifiedBannerModel.ts
reviewboard/static/rb/js/reviews/views/fileAttachmentThumbnailView.ts
reviewboard/static/rb/js/reviews/views/reviewRequestActions.ts
reviewboard/static/rb/js/reviews/views/reviewRequestEditorView.ts
reviewboard/static/rb/js/reviews/views/reviewRequestFieldViews.ts
reviewboard/static/rb/js/reviews/views/tests/fileAttachmentThumbnailViewTests.ts
reviewboard/static/rb/js/ui/views/inlineEditorView.ts
Loading...