diff options
-rw-r--r-- | apps/comments/js/commentstabview.js | 2 | ||||
-rw-r--r-- | apps/comments/tests/js/commentstabviewSpec.js | 4 | ||||
-rw-r--r-- | apps/dav/appinfo/info.xml | 5 | ||||
-rw-r--r-- | apps/dav/composer/composer/autoload_classmap.php | 1 | ||||
-rw-r--r-- | apps/dav/composer/composer/autoload_static.php | 1 | ||||
-rw-r--r-- | apps/dav/lib/CardDAV/SyncJob.php | 42 | ||||
-rw-r--r-- | apps/files/js/filelist.js | 3 | ||||
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 24 | ||||
-rw-r--r-- | core/Controller/LoginController.php | 1 | ||||
-rw-r--r-- | core/templates/login.php | 2 | ||||
-rw-r--r-- | lib/private/App/AppStore/Fetcher/Fetcher.php | 2 | ||||
-rw-r--r-- | settings/Activity/SecurityProvider.php | 2 | ||||
-rw-r--r-- | settings/js/apps.js | 12 | ||||
-rw-r--r-- | tests/Core/Controller/LoginControllerTest.php | 33 | ||||
-rw-r--r-- | tests/Settings/Activity/SecurityProviderTest.php | 4 |
15 files changed, 77 insertions, 61 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index 9b75cb4671e..bd89c8bbb49 100644 --- a/apps/comments/js/commentstabview.js +++ b/apps/comments/js/commentstabview.js @@ -512,7 +512,7 @@ _onTypeComment: function(ev) { var $field = $(ev.target); - var len = $field.val().length; + var len = $field.text().length; var $submitButton = $field.data('submitButtonEl'); if (!$submitButton) { $submitButton = $field.closest('form').find('.submit'); diff --git a/apps/comments/tests/js/commentstabviewSpec.js b/apps/comments/tests/js/commentstabviewSpec.js index 813b2a72eae..0131bc7bce3 100644 --- a/apps/comments/tests/js/commentstabviewSpec.js +++ b/apps/comments/tests/js/commentstabviewSpec.js @@ -411,7 +411,7 @@ describe('OCA.Comments.CommentsTabView tests', function() { expect($message.hasClass('error')).toEqual(false); }); it('displays tooltip when limit is almost reached', function() { - $message.val(createMessageWithLength(view._commentMaxLength - 2)); + $message.text(createMessageWithLength(view._commentMaxLength - 2)); $message.trigger('change'); expect(tooltipStub.calledWith('show')).toEqual(true); @@ -419,7 +419,7 @@ describe('OCA.Comments.CommentsTabView tests', function() { expect($message.hasClass('error')).toEqual(false); }); it('displays tooltip and disabled button when limit is exceeded', function() { - $message.val(createMessageWithLength(view._commentMaxLength + 2)); + $message.text(createMessageWithLength(view._commentMaxLength + 2)); $message.trigger('change'); expect(tooltipStub.calledWith('show')).toEqual(true); diff --git a/apps/dav/appinfo/info.xml b/apps/dav/appinfo/info.xml index 0f97289ba37..25a0d542e85 100644 --- a/apps/dav/appinfo/info.xml +++ b/apps/dav/appinfo/info.xml @@ -5,7 +5,7 @@ <description>WebDAV endpoint</description> <licence>AGPL</licence> <author>owncloud.org</author> - <version>1.4.5</version> + <version>1.4.6</version> <default_enable/> <types> <filesystem/> @@ -17,9 +17,6 @@ <dependencies> <nextcloud min-version="13" max-version="13" /> </dependencies> - <background-jobs> - <job>OCA\DAV\CardDAV\SyncJob</job> - </background-jobs> <repair-steps> <post-migration> <step>OCA\DAV\Migration\FixBirthdayCalendarComponent</step> diff --git a/apps/dav/composer/composer/autoload_classmap.php b/apps/dav/composer/composer/autoload_classmap.php index ddb8d7ca8d2..4d2db8e2f5e 100644 --- a/apps/dav/composer/composer/autoload_classmap.php +++ b/apps/dav/composer/composer/autoload_classmap.php @@ -59,7 +59,6 @@ return array( 'OCA\\DAV\\CardDAV\\ImageExportPlugin' => $baseDir . '/../lib/CardDAV/ImageExportPlugin.php', 'OCA\\DAV\\CardDAV\\PhotoCache' => $baseDir . '/../lib/CardDAV/PhotoCache.php', 'OCA\\DAV\\CardDAV\\Plugin' => $baseDir . '/../lib/CardDAV/Plugin.php', - 'OCA\\DAV\\CardDAV\\SyncJob' => $baseDir . '/../lib/CardDAV/SyncJob.php', 'OCA\\DAV\\CardDAV\\SyncService' => $baseDir . '/../lib/CardDAV/SyncService.php', 'OCA\\DAV\\CardDAV\\UserAddressBooks' => $baseDir . '/../lib/CardDAV/UserAddressBooks.php', 'OCA\\DAV\\CardDAV\\Xml\\Groups' => $baseDir . '/../lib/CardDAV/Xml/Groups.php', diff --git a/apps/dav/composer/composer/autoload_static.php b/apps/dav/composer/composer/autoload_static.php index 46707a93912..42f2e6da286 100644 --- a/apps/dav/composer/composer/autoload_static.php +++ b/apps/dav/composer/composer/autoload_static.php @@ -74,7 +74,6 @@ class ComposerStaticInitDAV 'OCA\\DAV\\CardDAV\\ImageExportPlugin' => __DIR__ . '/..' . '/../lib/CardDAV/ImageExportPlugin.php', 'OCA\\DAV\\CardDAV\\PhotoCache' => __DIR__ . '/..' . '/../lib/CardDAV/PhotoCache.php', 'OCA\\DAV\\CardDAV\\Plugin' => __DIR__ . '/..' . '/../lib/CardDAV/Plugin.php', - 'OCA\\DAV\\CardDAV\\SyncJob' => __DIR__ . '/..' . '/../lib/CardDAV/SyncJob.php', 'OCA\\DAV\\CardDAV\\SyncService' => __DIR__ . '/..' . '/../lib/CardDAV/SyncService.php', 'OCA\\DAV\\CardDAV\\UserAddressBooks' => __DIR__ . '/..' . '/../lib/CardDAV/UserAddressBooks.php', 'OCA\\DAV\\CardDAV\\Xml\\Groups' => __DIR__ . '/..' . '/../lib/CardDAV/Xml/Groups.php', diff --git a/apps/dav/lib/CardDAV/SyncJob.php b/apps/dav/lib/CardDAV/SyncJob.php deleted file mode 100644 index f0f8d51c2ca..00000000000 --- a/apps/dav/lib/CardDAV/SyncJob.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Joas Schilling <coding@schilljs.com> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace OCA\DAV\CardDAV; - -use OC\BackgroundJob\TimedJob; -use OCA\DAV\AppInfo\Application; - -class SyncJob extends TimedJob { - - public function __construct() { - // Run once a day - $this->setInterval(24 * 60 * 60); - } - - protected function run($argument) { - $app = new Application(); - /** @var SyncService $ss */ - $ss = $app->getSyncService(); - $ss->syncInstance(); - } -} diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 61e9432dce3..d0c0fc1a7fc 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -683,11 +683,14 @@ // the details to be shown. event.preventDefault(); var filename = $tr.attr('data-file'); + this.fileActions.currentFile = $tr.find('td'); var mime = this.fileActions.getCurrentMimeType(); var type = this.fileActions.getCurrentType(); var permissions = this.fileActions.getCurrentPermissions(); var action = this.fileActions.get(mime, type, permissions)['Details']; if (action) { + // also set on global object for legacy apps + window.FileActions.currentFile = this.fileActions.currentFile; action(filename, { $file: $tr, fileList: this, diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index 83926b24fee..fc5a6c18f95 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -2489,6 +2489,30 @@ describe('OCA.Files.FileList tests', function() { expect(context.fileActions).toBeDefined(); expect(context.dir).toEqual('/subdir'); }); + it('Clicking on an empty space of the file row will trigger the "Details" action', function() { + var detailsActionStub = sinon.stub(); + fileList.setFiles(testFiles); + // Override the "Details" action set internally by the FileList for + // easier testing. + fileList.fileActions.registerAction({ + mime: 'all', + name: 'Details', + permissions: OC.PERMISSION_NONE, + actionHandler: detailsActionStub + }); + // Ensure that the action works even if fileActions.currentFile is + // not set. + fileList.fileActions.currentFile = null; + var $tr = fileList.findFileEl('One.txt'); + $tr.find('td.filename a.name').click(); + expect(detailsActionStub.calledOnce).toEqual(true); + expect(detailsActionStub.getCall(0).args[0]).toEqual('One.txt'); + var context = detailsActionStub.getCall(0).args[1]; + expect(context.$file.is($tr)).toEqual(true); + expect(context.fileList).toBe(fileList); + expect(context.fileActions).toBe(fileList.fileActions); + expect(context.dir).toEqual('/subdir'); + }); it('redisplays actions when new actions have been registered', function() { var actionStub = sinon.stub(); var readyHandler = sinon.stub(); diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php index e87e097e423..e53095a7de7 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php @@ -179,6 +179,7 @@ class LoginController extends Controller { $parameters['alt_login'] = OC_App::getAlternativeLogIns(); $parameters['rememberLoginState'] = !empty($remember_login) ? $remember_login : 0; + $parameters['hideRemeberLoginState'] = !empty($redirect_url) && $this->session->exists('client.flow.state.token'); if (!is_null($user) && $user !== '') { $parameters['loginName'] = $user; diff --git a/core/templates/login.php b/core/templates/login.php index 82827bbef03..d28c92e36ef 100644 --- a/core/templates/login.php +++ b/core/templates/login.php @@ -70,6 +70,7 @@ script('core', 'merged-login'); <?php } ?> <div class="login-additional"> + <?php if (!$_['hideRemeberLoginState']) { ?> <div class="remember-login-container"> <?php if ($_['rememberLoginState'] === 0) { ?> <input type="checkbox" name="remember_login" value="1" id="remember_login" class="checkbox checkbox--white"> @@ -78,6 +79,7 @@ script('core', 'merged-login'); <?php } ?> <label for="remember_login"><?php p($l->t('Stay logged in')); ?></label> </div> + <?php } ?> <?php if (!empty($_['canResetPassword'])) { ?> <div class="lost-password-container"> <a id="lost-password" href="<?php p($_['resetPasswordLink']); ?>"> diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php index 5ce64671ffa..cd33d228c4b 100644 --- a/lib/private/App/AppStore/Fetcher/Fetcher.php +++ b/lib/private/App/AppStore/Fetcher/Fetcher.php @@ -170,7 +170,7 @@ abstract class Fetcher { $file->putContent(json_encode($responseJson)); return json_decode($file->getContent(), true)['data']; } catch (ConnectException $e) { - $this->logger->logException($e, ['app' => 'appstoreFetcher']); + $this->logger->info('Could not connect to appstore', ['app' => 'appstoreFetcher']); return []; } catch (\Exception $e) { return []; diff --git a/settings/Activity/SecurityProvider.php b/settings/Activity/SecurityProvider.php index f0789842e82..680881b6e31 100644 --- a/settings/Activity/SecurityProvider.php +++ b/settings/Activity/SecurityProvider.php @@ -53,7 +53,7 @@ class SecurityProvider implements IProvider { throw new InvalidArgumentException(); } - $l = $this->l10n->get('core', $language); + $l = $this->l10n->get('settings', $language); switch ($event->getSubject()) { case 'twofactor_success': diff --git a/settings/js/apps.js b/settings/js/apps.js index 6406e37cbcb..0a6e86ed701 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -535,20 +535,20 @@ OC.Settings.Apps = OC.Settings.Apps || { showEmptyUpdates: function() { $('#apps-list').addClass('hidden'); - $('#apps-list-empty').removeClass('hidden').find('h2').text(t('settings', 'No app updates available')); + $('#apps-list-empty').removeClass('hidden').find('h2').text(t('settings', 'App up to date')); $('#app-list-empty-icon').removeClass('icon-search').addClass('icon-download'); }, updateApp:function(appId, element) { var oldButtonText = element.val(); - element.val(t('settings','Updating....')); + element.val(t('settings','Upgrading …')); OC.Settings.Apps.hideErrorMessage(appId); $.post(OC.filePath('settings','ajax','updateapp.php'),{appid:appId},function(result) { if(!result || result.status !== 'success') { if (result.data && result.data.message) { OC.Settings.Apps.showErrorMessage(appId, result.data.message); } else { - OC.Settings.Apps.showErrorMessage(appId, t('settings','Error while updating app')); + OC.Settings.Apps.showErrorMessage(appId, t('settings','Could not upgrade app')); } element.val(oldButtonText); } @@ -584,7 +584,7 @@ OC.Settings.Apps = OC.Settings.Apps || { element.val(t('settings','Removing …')); $.post(OC.filePath('settings','ajax','uninstallapp.php'),{appid:appId},function(result) { if(!result || result.status !== 'success') { - OC.Settings.Apps.showErrorMessage(appId, t('settings','Error while removing app')); + OC.Settings.Apps.showErrorMessage(appId, t('settings','Could not remove app')); element.val(t('settings','Remove')); } else { OC.Settings.Apps.rebuildNavigation(); @@ -722,9 +722,9 @@ OC.Settings.Apps = OC.Settings.Apps || { OC.dialogs.info( t( 'settings', - 'The app has been enabled but needs to be updated. You will be redirected to the update page in 5 seconds.' + 'The app has been enabled but needs to be upgraded. You will be redirected to the upgrade page in 5 seconds.' ), - t('settings','App update'), + t('settings','App upgrade'), function () { window.location.reload(); }, diff --git a/tests/Core/Controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php index e02b8403a2a..ddf7a865d66 100644 --- a/tests/Core/Controller/LoginControllerTest.php +++ b/tests/Core/Controller/LoginControllerTest.php @@ -182,12 +182,43 @@ class LoginControllerTest extends TestCase { 'alt_login' => [], 'rememberLoginState' => 0, 'resetPasswordLink' => null, + 'hideRemeberLoginState' => false, ], 'guest' ); $this->assertEquals($expectedResponse, $this->loginController->showLoginForm('', '', '')); } + public function testShowLoginFormForFlowAuth() { + $this->userSession + ->expects($this->once()) + ->method('isLoggedIn') + ->willReturn(false); + $this->session + ->expects($this->once()) + ->method('exists') + ->with('client.flow.state.token') + ->willReturn(true); + + $expectedResponse = new TemplateResponse( + 'core', + 'login', + [ + 'messages' => [], + 'redirect_url' => 'login/flow', + 'loginName' => '', + 'user_autofocus' => true, + 'canResetPassword' => true, + 'alt_login' => [], + 'rememberLoginState' => 0, + 'resetPasswordLink' => null, + 'hideRemeberLoginState' => true, + ], + 'guest' + ); + $this->assertEquals($expectedResponse, $this->loginController->showLoginForm('', 'login/flow', '')); + } + /** * @return array */ @@ -240,6 +271,7 @@ class LoginControllerTest extends TestCase { 'alt_login' => [], 'rememberLoginState' => 0, 'resetPasswordLink' => false, + 'hideRemeberLoginState' => false, ], 'guest' ); @@ -278,6 +310,7 @@ class LoginControllerTest extends TestCase { 'alt_login' => [], 'rememberLoginState' => 0, 'resetPasswordLink' => false, + 'hideRemeberLoginState' => false, ], 'guest' ); diff --git a/tests/Settings/Activity/SecurityProviderTest.php b/tests/Settings/Activity/SecurityProviderTest.php index 21fc28f3c3b..552548984d7 100644 --- a/tests/Settings/Activity/SecurityProviderTest.php +++ b/tests/Settings/Activity/SecurityProviderTest.php @@ -87,7 +87,7 @@ class SecurityProviderTest extends TestCase { ->willReturn('security'); $this->l10n->expects($this->once()) ->method('get') - ->with('core', $lang) + ->with('settings', $lang) ->willReturn($l); $this->urlGenerator->expects($this->once()) ->method('imagePath') @@ -119,7 +119,7 @@ class SecurityProviderTest extends TestCase { ->willReturn('security'); $this->l10n->expects($this->once()) ->method('get') - ->with('core', $lang) + ->with('settings', $lang) ->willReturn($l); $event->expects($this->once()) ->method('getSubject') |