Merge pull request #10509 from nextcloud/bugfix/10398/acceptance-files-changedir

Always replace the app sidebar view when switching from a different file list
This commit is contained in:
Roeland Jago Douma 2018-08-03 15:10:53 +02:00 committed by GitHub
commit c623345027
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 7 deletions

View File

@ -118,10 +118,13 @@
*/
render: function() {
// remove old instances
if ($('#app-sidebar').length === 0) {
var $appSidebar = $('#app-sidebar');
if ($appSidebar.length === 0) {
this.$el.insertAfter($('#app-content'));
} else {
$('#app-sidebar').replaceWith(this.$el)
if ($appSidebar[0] !== this.el) {
$appSidebar.replaceWith(this.$el)
}
}
var templateVars = {

View File

@ -564,7 +564,7 @@
}
this._currentFileModel = model;
this._detailsView.render();
this._detailsView.setFileInfo(model);
this._detailsView.$el.scrollTop(0);
},
@ -1623,7 +1623,7 @@
// discard finished uploads list, we'll get it through a regular reload
this._uploads = {};
this.reload().then(function(success){
return this.reload().then(function(success){
if (!success) {
self.changeDirectory(currentDir, true);
}

View File

@ -1,15 +1,23 @@
Feature: app-files
Scenario: viewing a favorite file in its folder closes the details view
Scenario: viewing a favorite file in its folder shows the correct sidebar view
Given I am logged in
And I create a new folder named "other"
And I mark "other" as favorite
And I mark "welcome.txt" as favorite
And I see that "other" is marked as favorite
And I see that "welcome.txt" is marked as favorite
And I open the "Favorites" section
And I open the details view for "welcome.txt"
And I open the details view for "other"
And I see that the details view is open
And I see that the file name shown in the details view is "other"
When I view "welcome.txt" in folder
Then I see that the current section is "All files"
And I see that the details view is closed
And I see that the details view is open
And I see that the file name shown in the details view is "welcome.txt"
When I open the details view for "other"
And I see that the file name shown in the details view is "other"
Scenario: viewing a favorite file in its folder does not prevent opening the details view in "All files" section
Given I am logged in