Add RepositoryForm for tracking repository config options and state.

Review Request #12754 — Created Dec. 9, 2022 and updated — Latest diff uploaded

Information

Review Board
release-6.x

Reviewers

This introduces RepositoryForm, which is now created when
instantiating the repository configuration page. This parses model state
from the server-side form, creating collections of SCMTool, hosting
service, and account options for configuration.

This will soon contain logic and additional configuration state, for the
purpose of creating a more dynamic client-side-driven repository
configuration experience.

For now, little has changed, except some global variables
(HOSTING_SERVICES and TOOLS_INFO) and some stored state from the DOM
(the list of original SCMTools) have been updated to use the new form
model capabilities.

There's also some code removed for disabling form inputs when showing a
SSL cert or SSH key confirmation. This hasn't worked since Review Board
3, and this will all be replaced in time anyway. This code existed in a
file that's now being removed, so for now, it's just going away.

Repository form code now lives in the main "admin" bundle, and unit
tests have been added for the form model.

Unit tests passed.

Tested that repository form loading worked, and that all operations that
query hosting service information or tools and update configuration all
behave as normal.

Diff Revision 2

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

orig
1
2
3
4
5
6

Commits

First Last Summary ID Author
Add RepositoryForm for tracking repository config options and state.
This introduces `RepositoryForm`, which is now created when instantiating the repository configuration page. This parses model state from the server-side form, creating collections of SCMTool, hosting service, and account options for configuration. This will soon contain logic and additional configuration state, for the purpose of creating a more dynamic client-side-driven repository configuration experience. For now, little has changed, except some global variables (`HOSTING_SERVICES` and `TOOLS_INFO`) and some stored state from the DOM (the list of original SCMTools) have been updated to use the new form model capabilities. There's also some code removed for disabling form inputs when showing a SSL cert or SSH key confirmation. This hasn't worked since Review Board 3, and this will all be replaced in time anyway. This code existed in a file that's now being removed, so for now, it's just going away. Repository form code now lives in the main "admin" bundle, and unit tests have been added for the form model.
d871c607f4953b1b28057b83629d07e44c463de5 Christian Hammond
reviewboard/staticbundles.py
reviewboard/scmtools/forms.py
reviewboard/static/rb/js/admin/models/repositoryFormModel.es6.js
reviewboard/static/rb/js/admin/models/tests/repositoryFormModelTests.es6.js
reviewboard/static/rb/js/admin/views/repositoryFormView.es6.js
reviewboard/templates/admin/scmtools/repository/change_form.html
Loading...