Disable front-end features for read-only mode

Review Request #8810 - Created March 11, 2017 and updated

Kanghee Park
Review Board
master
8657, 8648
8812, 8811
reviewboard, students

Read-only mode is a setting an admin can enable to prevent writes to the database. This can be used when the site is under maintenence or being upgraded. This commit disables most UI features which would normally affect Review Board, but under read-only mode, does not. Disabling some features such as login and redirection when attempting to view a read-only restricted page is contained in the next commit.

This commit contains changes to the datagrid so changes to it does not change profile settings, navbar (hide My Account and New Review Request buttons), ETag, ReviewRequestEditor(including actions, comments, and the editor itself),

Other changes include adding read-only mode setting to the context processor and adding a utility file containing the logic to determine whether a user is in read-only mode or not.

Check that caching of read-only mode is done correctly by changing modes and refreshing pages
Check that profile doesn't save in datagrid when in read-only mode by ensuring code doesn't reach the save method
Check that the review request actions available are appropriately changed when in read-only mode
Check that comments can't be added or replied to in read-only mode
Check that review requests can not be modified in read-only mode
Check that modifying review requests (such as bugs or branch) when in read-only mode while the site in browser is still old displayed an appropriate error message
Check that modifying anything to the webapi doesn't send a request at all when in read-only mode
Check that trying to add a comment through clicking on a line in diff displays appropriate warning about read-only mode
Check that clicking on the Star does nothing in read-only mode
Check that the above does not occur for admins

  • 0
  • 22
  • 12
  • 34
Description From Last Updated
Review Bot
Kanghee Park
Kanghee Park
Review Bot
Simon Zhang
Barret Rennie
Christian Hammond
Kanghee Park
Review Bot
Kanghee Park
Review request changed

Change Summary:

Moved read_only.py and webapi/base.py changes to previous diff, review #8657. Since the review is based on the old 8657 still, it will not show read_only.py and the webapi.py changes on this diff, but once it is applied on 8657 it should show.

Diff:

Revision 4 (+164 -66)

Show changes

Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/models/base_comment.py
        reviewboard/reviews/default_actions.py
        reviewboard/reviews/templatetags/reviewtags.py
        reviewboard/reviews/models/review_request.py
        reviewboard/accounts/models.py
        reviewboard/admin/context_processors.py
        reviewboard/settings.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/dashboardView.js
        reviewboard/static/rb/js/views/starManagerView.js
        reviewboard/templates/reviews/review_reply_section.html
        reviewboard/templates/base/navbar.html
        reviewboard/static/rb/js/utils/apiUtils.es6.js
        reviewboard/templates/base.html
        reviewboard/templates/base/_nav_support_menu.html
        reviewboard/static/rb/js/models/userSessionModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/views/commentDialogView.js
        reviewboard/static/rb/js/models/commentEditorModel.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/models/base_comment.py
        reviewboard/reviews/default_actions.py
        reviewboard/reviews/templatetags/reviewtags.py
        reviewboard/reviews/models/review_request.py
        reviewboard/accounts/models.py
        reviewboard/admin/context_processors.py
        reviewboard/settings.py
    
    Ignored Files:
        reviewboard/static/rb/js/pages/views/dashboardView.js
        reviewboard/static/rb/js/views/starManagerView.js
        reviewboard/templates/reviews/review_reply_section.html
        reviewboard/templates/base/navbar.html
        reviewboard/static/rb/js/utils/apiUtils.es6.js
        reviewboard/templates/base.html
        reviewboard/templates/base/_nav_support_menu.html
        reviewboard/static/rb/js/models/userSessionModel.js
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
        reviewboard/static/rb/js/models/reviewRequestEditorModel.js
        reviewboard/static/rb/js/views/commentDialogView.js
        reviewboard/static/rb/js/models/commentEditorModel.js
    
    
  2. reviewboard/settings.py (Diff revision 4)
     
     
     'django_reset' imported but unused
    
  3. reviewboard/settings.py (Diff revision 4)
     
     
     'from settings_local import *' used; unable to detect undefined names
    
Loading...