diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-17 14:25:53 +0300 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-17 14:25:53 +0300 |
commit | f46225fa2c42b7472f39dbdd4ea74fb9a43f250a (patch) | |
tree | c3020b2ad1d8556010752b5f85f153e98eb4bd1c | |
parent | f28f6a3001531732ff1fbb7f73af0d388b028281 (diff) | |
parent | 403eb87f4db42c03b3df9103de19df2b4a3fac96 (diff) |
Merge pull request #23335 from owncloud/ext-user-mounting-gui-stable9
[stable9] Display external storage GUI even if user mounting disabled
-rw-r--r-- | apps/files_external/appinfo/application.php | 4 | ||||
-rw-r--r-- | apps/files_external/js/settings.js | 1 | ||||
-rw-r--r-- | apps/files_external/personal.php | 1 | ||||
-rw-r--r-- | apps/files_external/settings.php | 1 | ||||
-rw-r--r-- | apps/files_external/templates/settings.php | 6 | ||||
-rw-r--r-- | apps/files_external/tests/js/settingsSpec.js | 6 |
6 files changed, 14 insertions, 5 deletions
diff --git a/apps/files_external/appinfo/application.php b/apps/files_external/appinfo/application.php index 0f08cc6004f..cdc58aed7e8 100644 --- a/apps/files_external/appinfo/application.php +++ b/apps/files_external/appinfo/application.php @@ -59,9 +59,7 @@ class Application extends App { $backendService = $container->query('OCA\\Files_External\\Service\\BackendService'); \OCP\App::registerAdmin('files_external', 'settings'); - if ($backendService->isUserMountingAllowed()) { - \OCP\App::registerPersonal('files_external', 'personal'); - } + \OCP\App::registerPersonal('files_external', 'personal'); } /** diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index ceacbf4afab..0b33458bec2 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -813,6 +813,7 @@ MountConfigListView.prototype = _.extend({ this.$el.find('tbody').append($tr.clone()); $tr.data('storageConfig', storageConfig); + $tr.show(); $tr.find('td').last().attr('class', 'remove'); $tr.find('td.mountOptionsToggle').removeClass('hidden'); $tr.find('td').last().removeAttr('style'); diff --git a/apps/files_external/personal.php b/apps/files_external/personal.php index 4d8f480ecc0..5c568f45b7d 100644 --- a/apps/files_external/personal.php +++ b/apps/files_external/personal.php @@ -38,4 +38,5 @@ $tmpl->assign('storages', $userStoragesService->getStorages()); $tmpl->assign('dependencies', OC_Mount_Config::dependencyMessage($backendService->getBackends())); $tmpl->assign('backends', $backendService->getAvailableBackends()); $tmpl->assign('authMechanisms', $backendService->getAuthMechanisms()); +$tmpl->assign('allowUserMounting', $backendService->isUserMountingAllowed()); return $tmpl->fetchPage(); diff --git a/apps/files_external/settings.php b/apps/files_external/settings.php index 5bc330ff189..0d83d26ff97 100644 --- a/apps/files_external/settings.php +++ b/apps/files_external/settings.php @@ -44,5 +44,4 @@ $tmpl->assign('backends', $backendService->getAvailableBackends()); $tmpl->assign('authMechanisms', $backendService->getAuthMechanisms()); $tmpl->assign('dependencies', OC_Mount_Config::dependencyMessage($backendService->getBackends())); $tmpl->assign('allowUserMounting', $backendService->isUserMountingAllowed()); -$tmpl->assign('allowUserMounting', $backendService->isUserMountingAllowed()); return $tmpl->fetchPage(); diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index f7caf3d2caa..697a145131c 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -85,7 +85,11 @@ </tr> </thead> <tbody> - <tr id="addMountPoint"> + <tr id="addMountPoint" + <?php if ($_['visibilityType'] === BackendService::VISIBILITY_PERSONAL && $_['allowUserMounting'] === false): ?> + style="display: none;" + <?php endif; ?> + > <td class="status"> <span></span> </td> diff --git a/apps/files_external/tests/js/settingsSpec.js b/apps/files_external/tests/js/settingsSpec.js index 2a7afd6c2fa..462407e9540 100644 --- a/apps/files_external/tests/js/settingsSpec.js +++ b/apps/files_external/tests/js/settingsSpec.js @@ -179,6 +179,12 @@ describe('OCA.External.Settings tests', function() { // TODO: check "remove" button visibility }); + it('shows row even if selection row is hidden', function() { + view.$el.find('tr#addMountPoint').hide(); + selectBackend('\\OC\\TestBackend'); + expect(view.$el.find('tr:first').is(':visible')).toBe(true); + expect(view.$el.find('tr#addMountPoint').is(':visible')).toBe(false); + }); // TODO: test with personal mounts (no applicable fields) // TODO: test suggested mount point logic }); |