diff options
-rw-r--r-- | apps/dav/lib/Upload/AssemblyStream.php | 11 | ||||
-rw-r--r-- | apps/files/js/favoritesfilelist.js | 6 | ||||
-rw-r--r-- | apps/files/js/favoritesplugin.js | 5 | ||||
-rw-r--r-- | apps/files/js/filelist.js | 4 | ||||
-rw-r--r-- | apps/files/js/recentplugin.js | 5 | ||||
-rw-r--r-- | apps/files_sharing/js/app.js | 30 | ||||
-rw-r--r-- | apps/files_sharing/js/sharedfilelist.js | 6 | ||||
-rw-r--r-- | apps/files_trashbin/js/app.js | 6 | ||||
-rw-r--r-- | apps/systemtags/js/app.js | 7 | ||||
-rw-r--r-- | lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php | 2 | ||||
-rw-r--r-- | tests/acceptance/features/app-files.feature | 72 | ||||
-rw-r--r-- | tests/acceptance/features/bootstrap/FileListContext.php | 16 |
12 files changed, 146 insertions, 24 deletions
diff --git a/apps/dav/lib/Upload/AssemblyStream.php b/apps/dav/lib/Upload/AssemblyStream.php index 24417851f2f..95e324f0468 100644 --- a/apps/dav/lib/Upload/AssemblyStream.php +++ b/apps/dav/lib/Upload/AssemblyStream.php @@ -76,9 +76,6 @@ class AssemblyStream implements \Icewind\Streams\File { return strnatcmp($a->getName(), $b->getName()); }); $this->nodes = array_values($nodes); - if (count($this->nodes) > 0) { - $this->currentStream = $this->getStream($this->nodes[0]); - } $this->size = array_reduce($this->nodes, function ($size, IFile $file) { return $size + $file->getSize(); }, 0); @@ -107,7 +104,11 @@ class AssemblyStream implements \Icewind\Streams\File { */ public function stream_read($count) { if (is_null($this->currentStream)) { - return ''; + if ($this->currentNode < count($this->nodes)) { + $this->currentStream = $this->getStream($this->nodes[$this->currentNode]); + } else { + return ''; + } } do { @@ -191,7 +192,7 @@ class AssemblyStream implements \Icewind\Streams\File { * @return bool */ public function stream_eof() { - return $this->pos >= $this->size || $this->currentStream === null; + return $this->pos >= $this->size || ($this->currentNode >= count($this->nodes) && $this->currentNode === null); } /** diff --git a/apps/files/js/favoritesfilelist.js b/apps/files/js/favoritesfilelist.js index 8c9c125d0a1..44adf5d7b5b 100644 --- a/apps/files/js/favoritesfilelist.js +++ b/apps/files/js/favoritesfilelist.js @@ -94,12 +94,6 @@ $(document).ready(function() { return OCA.Files.FileList.prototype.reloadCallback.call(this, status, result); }, - - _onUrlChanged: function (e) { - if (e && _.isString(e.dir)) { - this.changeDirectory(e.dir, false, true); - } - } }); OCA.Files.FavoritesFileList = FavoritesFileList; diff --git a/apps/files/js/favoritesplugin.js b/apps/files/js/favoritesplugin.js index 7294ef9461c..3ceadca826d 100644 --- a/apps/files/js/favoritesplugin.js +++ b/apps/files/js/favoritesplugin.js @@ -67,6 +67,11 @@ return new OCA.Files.FavoritesFileList( $el, { fileActions: fileActions, + // The file list is created when a "show" event is handled, + // so it should be marked as "shown" like it would have been + // done if handling the event with the file list already + // created. + shown: true } ); }, diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 0a6620ab22c..a4d306edc19 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -221,6 +221,10 @@ return; } + if (options.shown) { + this.shown = options.shown; + } + if (options.config) { this._filesConfig = options.config; } else if (!_.isUndefined(OCA.Files) && !_.isUndefined(OCA.Files.App)) { diff --git a/apps/files/js/recentplugin.js b/apps/files/js/recentplugin.js index 524b556a517..c1b013ef1b8 100644 --- a/apps/files/js/recentplugin.js +++ b/apps/files/js/recentplugin.js @@ -67,6 +67,11 @@ return new OCA.Files.RecentFileList( $el, { fileActions: fileActions, + // The file list is created when a "show" event is handled, + // so it should be marked as "shown" like it would have been + // done if handling the event with the file list already + // created. + shown: true } ); }, diff --git a/apps/files_sharing/js/app.js b/apps/files_sharing/js/app.js index 750f66236ae..b6ca71e15d1 100644 --- a/apps/files_sharing/js/app.js +++ b/apps/files_sharing/js/app.js @@ -34,7 +34,11 @@ OCA.Sharing.App = { id: 'shares.self', sharedWithUser: true, fileActions: this._createFileActions(), - config: OCA.Files.App.getFilesConfig() + config: OCA.Files.App.getFilesConfig(), + // The file list is created when a "show" event is handled, so + // it should be marked as "shown" like it would have been done + // if handling the event with the file list already created. + shown: true } ); @@ -56,7 +60,11 @@ OCA.Sharing.App = { id: 'shares.others', sharedWithUser: false, fileActions: this._createFileActions(), - config: OCA.Files.App.getFilesConfig() + config: OCA.Files.App.getFilesConfig(), + // The file list is created when a "show" event is handled, so + // it should be marked as "shown" like it would have been done + // if handling the event with the file list already created. + shown: true } ); @@ -78,7 +86,11 @@ OCA.Sharing.App = { id: 'shares.link', linksOnly: true, fileActions: this._createFileActions(), - config: OCA.Files.App.getFilesConfig() + config: OCA.Files.App.getFilesConfig(), + // The file list is created when a "show" event is handled, so + // it should be marked as "shown" like it would have been done + // if handling the event with the file list already created. + shown: true } ); @@ -101,7 +113,11 @@ OCA.Sharing.App = { showDeleted: true, sharedWithUser: true, fileActions: this._restoreShareAction(), - config: OCA.Files.App.getFilesConfig() + config: OCA.Files.App.getFilesConfig(), + // The file list is created when a "show" event is handled, so + // it should be marked as "shown" like it would have been done + // if handling the event with the file list already created. + shown: true } ); @@ -122,7 +138,11 @@ OCA.Sharing.App = { { id: 'shares.overview', config: OCA.Files.App.getFilesConfig(), - isOverview: true + isOverview: true, + // The file list is created when a "show" event is handled, so + // it should be marked as "shown" like it would have been done + // if handling the event with the file list already created. + shown: true } ); diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js index 1535e744639..7fa38a58c59 100644 --- a/apps/files_sharing/js/sharedfilelist.js +++ b/apps/files_sharing/js/sharedfilelist.js @@ -446,12 +446,6 @@ // Sort by expected sort comparator return files.sort(this._sortComparator); }, - - _onUrlChanged: function(e) { - if (e && _.isString(e.dir)) { - this.changeDirectory(e.dir, false, true); - } - } }); /** diff --git a/apps/files_trashbin/js/app.js b/apps/files_trashbin/js/app.js index 82e47d510bf..199cb7d4f84 100644 --- a/apps/files_trashbin/js/app.js +++ b/apps/files_trashbin/js/app.js @@ -51,7 +51,11 @@ OCA.Trashbin.App = { iconClass: 'icon-delete', } ], - client: this.client + client: this.client, + // The file list is created when a "show" event is handled, so + // it should be marked as "shown" like it would have been done + // if handling the event with the file list already created. + shown: true } ); }, diff --git a/apps/systemtags/js/app.js b/apps/systemtags/js/app.js index 04ac53d3b32..2ef88564528 100644 --- a/apps/systemtags/js/app.js +++ b/apps/systemtags/js/app.js @@ -28,7 +28,12 @@ { id: 'systemtags', fileActions: this._createFileActions(), - config: OCA.Files.App.getFilesConfig() + config: OCA.Files.App.getFilesConfig(), + // The file list is created when a "show" event is handled, + // so it should be marked as "shown" like it would have been + // done if handling the event with the file list already + // created. + shown: true } ); diff --git a/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php b/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php index 088fb2d859d..795d8cc8642 100644 --- a/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php +++ b/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php @@ -74,6 +74,8 @@ class ContentSecurityPolicyNonceManager { Request::USER_AGENT_CHROME, // Firefox 45+ '/^Mozilla\/5\.0 \([^)]+\) Gecko\/[0-9.]+ Firefox\/(4[5-9]|[5-9][0-9])\.[0-9.]+$/', + // Safari 12+ + '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Version\/(1[2-9]|[2-9][0-9])\.[0-9]+ Safari\/[0-9.A-Z]+$/', ]; if($this->request->isUserAgent($browserWhitelist)) { diff --git a/tests/acceptance/features/app-files.feature b/tests/acceptance/features/app-files.feature index 00f09900d3e..3bded3fef11 100644 --- a/tests/acceptance/features/app-files.feature +++ b/tests/acceptance/features/app-files.feature @@ -31,6 +31,78 @@ Feature: app-files When I open the details view for "welcome.txt" Then I see that the details view is open + Scenario: show recent files + Given I am logged in + And I create a new folder named "Folder just created" + When I open the "Recent" section + Then I see that the current section is "Recent" + Then I see that the file list contains a file named "Folder just created" + + Scenario: show recent files for a second time + Given I am logged in + And I open the "Recent" section + And I see that the current section is "Recent" + And I open the "All files" section + And I see that the current section is "All files" + And I create a new folder named "Folder just created" + When I open the "Recent" section + Then I see that the current section is "Recent" + Then I see that the file list contains a file named "Folder just created" + + Scenario: show favorites + Given I am logged in + And I mark "welcome.txt" as favorite + When I open the "Favorites" section + Then I see that the current section is "Favorites" + Then I see that the file list contains a file named "welcome.txt" + + Scenario: show favorites for a second time + Given I am logged in + And I open the "Favorites" section + And I see that the current section is "Favorites" + And I open the "All files" section + And I see that the current section is "All files" + And I mark "welcome.txt" as favorite + When I open the "Favorites" section + Then I see that the current section is "Favorites" + Then I see that the file list contains a file named "welcome.txt" + + Scenario: show shares + Given I am logged in + And I share the link for "welcome.txt" + When I open the "Shares" section + Then I see that the current section is "Shares" + Then I see that the file list contains a file named "welcome.txt" + + Scenario: show shares for a second time + Given I am logged in + And I open the "Shares" section + And I see that the current section is "Shares" + And I open the "All files" section + And I see that the current section is "All files" + And I share the link for "welcome.txt" + When I open the "Shares" section + Then I see that the current section is "Shares" + Then I see that the file list contains a file named "welcome.txt" + + Scenario: show deleted files + Given I am logged in + And I delete "welcome.txt" + When I open the "Deleted files" section + Then I see that the current section is "Deleted files" + Then I see that the file list contains a file named "welcome.txt" + + Scenario: show deleted files for a second time + Given I am logged in + And I open the "Deleted files" section + And I see that the current section is "Deleted files" + And I open the "All files" section + And I see that the current section is "All files" + And I delete "welcome.txt" + When I open the "Deleted files" section + Then I see that the current section is "Deleted files" + Then I see that the file list contains a file named "welcome.txt" + Scenario: rename a file with the details view open Given I am logged in And I open the details view for "welcome.txt" diff --git a/tests/acceptance/features/bootstrap/FileListContext.php b/tests/acceptance/features/bootstrap/FileListContext.php index bc225e3f9b1..6a39d7a999f 100644 --- a/tests/acceptance/features/bootstrap/FileListContext.php +++ b/tests/acceptance/features/bootstrap/FileListContext.php @@ -255,6 +255,13 @@ class FileListContext implements Context, ActorAwareInterface { } /** + * @return Locator + */ + public static function deleteMenuItem() { + return self::fileActionsMenuItemFor("Delete"); + } + + /** * @Given I create a new folder named :folderName */ public function iCreateANewFolderNamed($folderName) { @@ -323,6 +330,15 @@ class FileListContext implements Context, ActorAwareInterface { } /** + * @When I delete :fileName + */ + public function iDelete($fileName) { + $this->actor->find(self::fileActionsMenuButtonForFile($this->fileListAncestor, $fileName), 10)->click(); + + $this->actor->find(self::deleteMenuItem(), 2)->click(); + } + + /** * @Then I see that the file list is eventually loaded */ public function iSeeThatTheFileListIsEventuallyLoaded() { |