Skip to content

Commit

Permalink
Merge pull request #23335 from owncloud/ext-user-mounting-gui-stable9
Browse files Browse the repository at this point in the history
[stable9] Display external storage GUI even if user mounting disabled
  • Loading branch information
DeepDiver1975 committed Mar 17, 2016
2 parents f28f6a3 + 403eb87 commit f46225f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
4 changes: 1 addition & 3 deletions apps/files_external/appinfo/application.php
Expand Up @@ -59,9 +59,7 @@ public function registerSettings() {
$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');
}

/**
Expand Down
1 change: 1 addition & 0 deletions apps/files_external/js/settings.js
Expand Up @@ -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');
Expand Down
1 change: 1 addition & 0 deletions apps/files_external/personal.php
Expand Up @@ -38,4 +38,5 @@
$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();
1 change: 0 additions & 1 deletion apps/files_external/settings.php
Expand Up @@ -44,5 +44,4 @@
$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();
6 changes: 5 additions & 1 deletion apps/files_external/templates/settings.php
Expand Up @@ -85,7 +85,11 @@ function writeParameterInput($parameter, $options, $classes = []) {
</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>
Expand Down
6 changes: 6 additions & 0 deletions apps/files_external/tests/js/settingsSpec.js
Expand Up @@ -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
});
Expand Down

0 comments on commit f46225f

Please sign in to comment.