Merge pull request #23335 from owncloud/ext-user-mounting-gui-stable9

[stable9] Display external storage GUI even if user mounting disabled
This commit is contained in:
Thomas Müller 2016-03-17 12:25:53 +01:00
commit f46225fa2c
6 changed files with 14 additions and 5 deletions

View File

@ -59,10 +59,8 @@ 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');
}
}
/**
* Load storage backends provided by this app

View File

@ -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');

View File

@ -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();

View File

@ -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();

View File

@ -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>

View File

@ -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
});