Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/js/breadcrumb.js23
-rw-r--r--apps/files/js/filelist.js6
-rw-r--r--apps/files/lib/Activity/Settings/FavoriteAction.php12
-rw-r--r--apps/files/lib/Service/OwnershipTransferService.php6
-rw-r--r--apps/files/tests/js/breadcrumbSpec.js6
5 files changed, 45 insertions, 8 deletions
diff --git a/apps/files/js/breadcrumb.js b/apps/files/js/breadcrumb.js
index 383d3debd09..8a5d42bd975 100644
--- a/apps/files/js/breadcrumb.js
+++ b/apps/files/js/breadcrumb.js
@@ -58,7 +58,9 @@
BreadCrumb.prototype = {
$el: null,
dir: null,
+ maxDepthDir: null,
dirInfo: null,
+ activeItemIndex: 0,
/**
* Total width of all breadcrumbs
@@ -81,6 +83,9 @@
dir = dir.replace(/\\/g, '/');
dir = dir || '/';
if (dir !== this.dir) {
+ if ((this.maxDepthDir || "").search(dir) !== 0) {
+ this.maxDepthDir = dir;
+ }
this.dir = dir;
this.render();
}
@@ -118,7 +123,7 @@
// Menu is destroyed on every change, we need to init it
OC.unregisterMenu($('.crumbmenu > .icon-more'), $('.crumbmenu > .popovermenu'));
- var parts = this._makeCrumbs(this.dir || '/');
+ var parts = this._makeCrumbs(this.maxDepthDir || '/');
var $crumb;
var $menuItem;
this.$el.empty();
@@ -163,7 +168,7 @@
if(menuPart.dir) {
$menuItem = $('<li class="crumblist"><a><span class="icon-folder"></span><span></span></a></li>');
$menuItem.data('dir', menuPart.dir);
- $menuItem.find('a').attr('href', this.getCrumbUrl(part, j));
+ $menuItem.find('a').attr('href', this.getCrumbUrl(menuPart, j));
$menuItem.find('span:eq(1)').text(menuPart.name);
this.$menu.children('ul').append($menuItem);
if (this.onClick) {
@@ -171,11 +176,16 @@
}
}
}
+
_.each(this._detailViews, function(view) {
view.render({
dirInfo: this.dirInfo
});
- $crumb.append(view.$el);
+
+ if (this.breadcrumbs.length > 2) {
+ this.breadcrumbs[this.activeItemIndex + 2].append(view.$el);
+ }
+
$menuItem.append(view.$el.clone(true));
}, this);
@@ -228,8 +238,15 @@
for (var i = 0; i < parts.length; i++) {
var part = parts[i];
pathToHere = pathToHere + '/' + part;
+
+ let classes = "";
+ if (pathToHere === this.dir) {
+ this.activeItemIndex = i;
+ classes = "active";
+ }
crumbs.push({
dir: pathToHere,
+ class: classes,
name: part
});
}
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 33e942bbc72..facbbf09e0e 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -2294,6 +2294,12 @@
this.setFiles(result);
if (this.dirInfo) {
+ // Make sure the currentFileList is the current one
+ // When navigating to the favorite or share with you virtual
+ // folder, this is not correctly set during the initialisation
+ // otherwise.
+ OCA.Files.App && OCA.Files.App.updateCurrentFileList(this);
+
var newFileId = this.dirInfo.id;
// update fileid in URL
var params = {
diff --git a/apps/files/lib/Activity/Settings/FavoriteAction.php b/apps/files/lib/Activity/Settings/FavoriteAction.php
index 8c43b68ef88..3c6ceb23959 100644
--- a/apps/files/lib/Activity/Settings/FavoriteAction.php
+++ b/apps/files/lib/Activity/Settings/FavoriteAction.php
@@ -55,7 +55,7 @@ class FavoriteAction extends FileActivitySettings {
* @since 11.0.0
*/
public function canChangeStream() {
- return true;
+ return false;
}
/**
@@ -71,7 +71,7 @@ class FavoriteAction extends FileActivitySettings {
* @since 11.0.0
*/
public function canChangeMail() {
- return true;
+ return false;
}
/**
@@ -81,4 +81,12 @@ class FavoriteAction extends FileActivitySettings {
public function isDefaultEnabledMail() {
return false;
}
+
+ /**
+ * @return bool True when the option can be changed for the notification
+ * @since 20.0.0
+ */
+ public function canChangeNotification() {
+ return false;
+ }
}
diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php
index ace7215100e..661a7e66e10 100644
--- a/apps/files/lib/Service/OwnershipTransferService.php
+++ b/apps/files/lib/Service/OwnershipTransferService.php
@@ -443,13 +443,17 @@ class OwnershipTransferService {
$output->writeln("Restoring incoming shares ...");
$progress = new ProgressBar($output, count($sourceShares));
$prefix = "$destinationUid/files";
+ $finalShareTarget = '';
if (substr($finalTarget, 0, strlen($prefix)) === $prefix) {
$finalShareTarget = substr($finalTarget, strlen($prefix));
}
foreach ($sourceShares as $share) {
try {
// Only restore if share is in given path.
- $pathToCheck = '/' . trim($path) . '/';
+ $pathToCheck = '/';
+ if (trim($path, '/') !== '') {
+ $pathToCheck = '/' . trim($path) . '/';
+ }
if (substr($share->getTarget(), 0, strlen($pathToCheck)) !== $pathToCheck) {
continue;
}
diff --git a/apps/files/tests/js/breadcrumbSpec.js b/apps/files/tests/js/breadcrumbSpec.js
index 820b0f70569..b83ec78be7b 100644
--- a/apps/files/tests/js/breadcrumbSpec.js
+++ b/apps/files/tests/js/breadcrumbSpec.js
@@ -56,13 +56,15 @@ describe('OCA.Files.BreadCrumb tests', function() {
expect($crumbs.eq(1).find('a').hasClass('icon-home')).toEqual(true);
expect($crumbs.eq(1).data('dir')).toEqual('/');
});
- it('Renders root when switching to root', function() {
+ it('Renders complete directory when switching to root', function() {
var $crumbs;
bc.setDirectory('/somedir');
bc.setDirectory('/');
$crumbs = bc.$el.find('.crumb');
- expect($crumbs.length).toEqual(2);
+ expect($crumbs.length).toEqual(3);
expect($crumbs.eq(1).data('dir')).toEqual('/');
+ expect($crumbs.eq(2).data('dir')).toEqual('/somedir');
+ expect($crumbs.eq(2).attr('class').includes("active")).toEqual(false);
});
it('Renders single path section', function() {
var $crumbs;