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.

Changes between revision 6 and 7

orig
1
2
3
4
5
6
7

Commits

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.
f08c75b174780bdf5ffc6448ab021bf5faffdfb1 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.
55ed50f13cbac858a41b81a0a133e1c709a20e89 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.
f84b102fd15a42fdd581740ad1d82c87d7cba094 Daniel
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.
c54c3e15db74152743160aa3f4d81a0d0b6d9aff 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.
63a91f0ce9e59ca0de6f79efa7208c1d4855d767 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.
ab1af0d8e307ff51675cb8cc630171798a7ce2a0 Daniel
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/publishButtonViewTests.ts
Loading...