[10.5.0] Add admin settings checkbox to 'Enable manual file locking on the web UI'#37702
[10.5.0] Add admin settings checkbox to 'Enable manual file locking on the web UI'#37702phil-davis wants to merge 1 commit into
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
|
To decide:
|
| $tmpl = new Template('settings', 'panels/admin/persistentlocking'); | ||
| $tmpl->assign('defaultTimeout', $this->config->getAppValue('core', 'lock_timeout_default', LockManager::LOCK_TIMEOUT_DEFAULT)); | ||
| $tmpl->assign('maximumTimeout', $this->config->getAppValue('core', 'lock_timeout_max', LockManager::LOCK_TIMEOUT_MAX)); | ||
| $tmpl->assign('manualFileLockOnWebUIEnabled', $this->config->getAppValue('files', 'enable_lock_file_action', 'no')); |
There was a problem hiding this comment.
This is on a core panel outside of the files app, but references a files app setting.
Is that OK?
I don't know what to do when a settings panel needs to have settings from a mix of core and apps.
| var minRange = currentInput.attr('min'); | ||
| var maxRange = currentInput.attr('max'); | ||
| if (name === 'enable_lock_file_action') { | ||
| app = 'files'; |
There was a problem hiding this comment.
This adds code to core settings panel JS that is aware of and manipulates a files app setting.
Is this OK?
How to do it better?
There was a problem hiding this comment.
Maybe enable_lock_file_action could be moved from files app to core app? Or?
Codecov Report
@@ Coverage Diff @@
## release-10.5.0 #37702 +/- ##
====================================================
- Coverage 64.74% 64.74% -0.01%
Complexity 19363 19363
====================================================
Files 1281 1281
Lines 75628 75630 +2
Branches 1333 1333
====================================================
+ Hits 48966 48967 +1
- Misses 26270 26271 +1
Partials 392 392
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
What happens about code coverage here? Do I need to add PHP unit tests? If so, where? |
7c5517f to
d2d5687
Compare
|
I raised a new PR to master - #37720 |
Description
Adds a checkbox to admin settings "Manual File Locking" to "Enable manual file locking on the web UI"
Checking the checkbox does the same as:
occ config:app:set files enable_lock_file_action --value yesUnchecking does the same as:
occ config:app:set files enable_lock_file_action --value noRelated Issue
This is a follow-on enhancement from all the file locking additions.
How Has This Been Tested?
Manually check the new checkbox, the browse to the Files page and confirm that the "Lock file" action is available for a file.
Manually uncheck the new checkbox, the browse to the Files page and confirm that the "Lock file" action is not available for a file.
Types of changes
Checklist: