Display external storage GUI even if user mounting disabled

This commit is contained in:
Robin McCorkell 2016-03-16 22:06:49 +00:00
parent 08b9193919
commit 403eb87f4d
6 changed files with 14 additions and 5 deletions

View File

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

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