Frontend changes for new `publish_and_archive` profile setting.

Review Request #14053 — Created July 24, 2024 and updated — Latest diff uploaded

Information

Review Board
master

Reviewers

When publishing reviews, we have an option for archiving the review request
after the review gets published.

These changes are part of a new profile setting which will allow user to have
their review requests automatically archived instead of having to click the
“… and archive the review request” button every time.

This means created a new class to standardize the different implementations
of the publish button and connecting it to backend changes to access the
publish_and_archive user setting.

New Jasmine tests were added to test publishButtonView functionality, checkboxes, and click actions.
Whole reviewboard test suite was run successfully.
Manually testing demonstrated that the changes looked and worked as intended.

Diff Revision 3

This is not the most recent revision of the diff. The latest diff is revision 7. See what's changed.

orig
1
2
3
4
5
6
7

Commits

First Last Summary ID Author
Created a new class to standardize the publish buttons across ReviewBoard.
Currently, there are 2 different versions of the publish review button in use. First, there is `UnifiedBannerView`, in which the publish button has its own class and includes dropdown checkboxes for archiving and sending emails. The second, in `ReviewDialogView`, the publish button is an html `MenuButtonView` that has dropdown buttons that are NOT checkboxes, which can publish and archive, or publish and send email, but not both. This new class will standardize the structure of the publish button, make it easily moddable, and make each publish button have checkboxes.
d4a8f4fff3d7df30759c88ffc160590072da2ff6 Daniel
Introduced new publishButton to reviewDialogView to add dropdown checkboxes.
These changes included making a new subclass of `PublishButtonView` called `RDPublishButtonView`, which obtains the reviewRequestEditor differently due to different models being passed into the `ReviewDialogView` and triggers a different function in `_action()` due to the previous publishing structure in `ReviewDialogView`. This new publish button replaces the old publish button, which did not have checkboxes, only action buttons. This change also meant that the arguments passed into `_saveReview()` could no longer be optional when saving and discarding.
638fe6254cc6a658f1e5738a8fd34e71f9dc9476 Daniel
Created Jasmine Tests.
This commit has the new Jasmine Unit Tests for the PublishButtonView. They test each aspect of this new class, from appearance, to checkbox availablility, to actions.
2d9b716bf66aaadf4a6b5843110610d75cd0ba92 Daniel
reviewboard/reviews/context.py
reviewboard/reviews/templatetags/reviewtags.py
reviewboard/static/rb/js/reviews/index.ts
reviewboard/static/rb/js/reviews/models/reviewRequestEditorModel.ts
reviewboard/static/rb/js/reviews/views/publishButton.ts
reviewboard/static/rb/js/reviews/views/reviewDialogView.ts
reviewboard/static/rb/js/reviews/views/unifiedBannerView.ts
reviewboard/static/rb/js/reviews/views/tests/index.ts
reviewboard/static/rb/js/reviews/views/tests/publishButtonViewTests.ts
Loading...