Merge pull request #11998 from nextcloud/stable12-11967-fix-opening-a-section-again-in-the-files-app

[stable12] Fix opening a section again in the Files app
This commit is contained in:
Morris Jobke 2018-10-25 14:12:29 +02:00 committed by GitHub
commit 24b688de52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 130 additions and 19 deletions

View File

@ -95,12 +95,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;

View File

@ -67,7 +67,12 @@
return new OCA.Files.FavoritesFileList(
$el, {
fileActions: fileActions,
scrollContainer: $('#app-content')
scrollContainer: $('#app-content'),
// 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
}
);
},

View File

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

View File

@ -67,7 +67,12 @@
return new OCA.Files.RecentFileList(
$el, {
fileActions: fileActions,
scrollContainer: $('#app-content')
scrollContainer: $('#app-content'),
// 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
}
);
},

View File

@ -34,7 +34,11 @@ OCA.Sharing.App = {
scrollContainer: $('#app-content'),
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
}
);
@ -57,7 +61,11 @@ OCA.Sharing.App = {
scrollContainer: $('#app-content'),
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
}
);
@ -80,7 +88,11 @@ OCA.Sharing.App = {
scrollContainer: $('#app-content'),
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
}
);

View File

@ -386,12 +386,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);
}
}
});
/**

View File

@ -30,7 +30,11 @@ OCA.Trashbin.App = {
fileActions: this._createFileActions(),
detailsViewEnabled: false,
scrollTo: urlParams.scrollto,
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
}
);
},

View File

@ -29,7 +29,12 @@
id: 'systemtags',
scrollContainer: $('#app-content'),
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
}
);

View File

@ -23,6 +23,78 @@ Feature: app-files
When I open the details view for "welcome.txt"
Then I see that the details view for "All files" section 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 "Shared by link" section
Then I see that the current section is "Shared by link"
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 "Shared by link" section
And I see that the current section is "Shared by link"
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 "Shared by link" section
Then I see that the current section is "Shared by link"
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"

View File

@ -222,6 +222,13 @@ class FileListContext implements Context, ActorAwareInterface {
return self::fileActionsMenuItemFor("View in folder");
}
/**
* @return Locator
*/
public static function deleteMenuItem() {
return self::fileActionsMenuItemFor("Delete");
}
/**
* @Given I create a new folder named :folderName
*/
@ -275,6 +282,15 @@ class FileListContext implements Context, ActorAwareInterface {
$this->actor->find(self::viewFileInFolderMenuItem(), 2)->click();
}
/**
* @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
*/