diff --git a/apps/files_trashbin/js/files_trashbin.js b/apps/files_trashbin/js/files_trashbin.js index d381919b0aa071fe032be05991bccb775a3405c5..c9fd1c55ddad1a62b541f06cd6c2cf09911043b6 100644 Binary files a/apps/files_trashbin/js/files_trashbin.js and b/apps/files_trashbin/js/files_trashbin.js differ diff --git a/apps/files_trashbin/js/files_trashbin.js.map b/apps/files_trashbin/js/files_trashbin.js.map index 1def7411fb04853da3c5a41ce9fb83bd54addc67..7d338f0ea71b3d2661654d0d35ab174cfdeda688 100644 Binary files a/apps/files_trashbin/js/files_trashbin.js.map and b/apps/files_trashbin/js/files_trashbin.js.map differ diff --git a/apps/files_trashbin/lib/Sabre/AbstractTrash.php b/apps/files_trashbin/lib/Sabre/AbstractTrash.php index b4d13a41e38a1a492a5d105e8943e7f18306e863..90f14fddd589c11c53bd71509aa67986327a349e 100644 --- a/apps/files_trashbin/lib/Sabre/AbstractTrash.php +++ b/apps/files_trashbin/lib/Sabre/AbstractTrash.php @@ -79,6 +79,10 @@ abstract class AbstractTrash implements ITrash { return $this->data->getOriginalLocation(); } + public function getTitle(): string { + return $this->data->getTitle(); + } + public function delete() { $this->trashManager->removeItem($this->data); } diff --git a/apps/files_trashbin/lib/Sabre/ITrash.php b/apps/files_trashbin/lib/Sabre/ITrash.php index 49c600c3f18a45b13a165164bf0db0a550207ada..7a05fbe9507790f323f222c211cd5a0f20b985d6 100644 --- a/apps/files_trashbin/lib/Sabre/ITrash.php +++ b/apps/files_trashbin/lib/Sabre/ITrash.php @@ -32,6 +32,8 @@ interface ITrash { public function getOriginalLocation(): string; + public function getTitle(): string; + public function getDeletionTime(): int; public function getSize(); diff --git a/apps/files_trashbin/lib/Sabre/PropfindPlugin.php b/apps/files_trashbin/lib/Sabre/PropfindPlugin.php index 19da79fd2a34d0c3340ea0720135f99f6cdc9462..81fed3eba2bda6664036b92654d5c0396f67e021 100644 --- a/apps/files_trashbin/lib/Sabre/PropfindPlugin.php +++ b/apps/files_trashbin/lib/Sabre/PropfindPlugin.php @@ -37,6 +37,7 @@ class PropfindPlugin extends ServerPlugin { const TRASHBIN_FILENAME = '{http://nextcloud.org/ns}trashbin-filename'; const TRASHBIN_ORIGINAL_LOCATION = '{http://nextcloud.org/ns}trashbin-original-location'; const TRASHBIN_DELETION_TIME = '{http://nextcloud.org/ns}trashbin-deletion-time'; + const TRASHBIN_TITLE = '{http://nextcloud.org/ns}trashbin-title'; /** @var Server */ private $server; @@ -70,6 +71,10 @@ class PropfindPlugin extends ServerPlugin { return $node->getOriginalLocation(); }); + $propFind->handle(self::TRASHBIN_TITLE, function () use ($node) { + return $node->getTitle(); + }); + $propFind->handle(self::TRASHBIN_DELETION_TIME, function () use ($node) { return $node->getDeletionTime(); }); diff --git a/apps/files_trashbin/lib/Trash/ITrashItem.php b/apps/files_trashbin/lib/Trash/ITrashItem.php index 74348cf18176977875e918663dbcaab91b799052..bd241c89a34839d187e2d0a63df6a2a7a505ddcd 100644 --- a/apps/files_trashbin/lib/Trash/ITrashItem.php +++ b/apps/files_trashbin/lib/Trash/ITrashItem.php @@ -75,4 +75,6 @@ interface ITrashItem extends FileInfo { * @since 15.0.0 */ public function getUser(): IUser; + + public function getTitle(): string; } diff --git a/apps/files_trashbin/lib/Trash/TrashItem.php b/apps/files_trashbin/lib/Trash/TrashItem.php index a0a0e1f67cea1d031d84d21bdf6f819ba42c4766..0112b6dbc8e93a06ae33977301fd488320135421 100644 --- a/apps/files_trashbin/lib/Trash/TrashItem.php +++ b/apps/files_trashbin/lib/Trash/TrashItem.php @@ -173,4 +173,8 @@ class TrashItem implements ITrashItem { public function getExtension(): string { return $this->fileInfo->getExtension(); } + + public function getTitle(): string { + return $this->getOriginalLocation(); + } } diff --git a/apps/files_trashbin/src/filelist.js b/apps/files_trashbin/src/filelist.js index 661b2f012f4d7a88fd62bb02f4ae19cf172306a3..60b44ea7541e9c9beaab47bf81076aa305d433ad 100644 --- a/apps/files_trashbin/src/filelist.js +++ b/apps/files_trashbin/src/filelist.js @@ -13,6 +13,7 @@ var FILENAME_PROP = '{http://nextcloud.org/ns}trashbin-filename' var DELETION_TIME_PROP = '{http://nextcloud.org/ns}trashbin-deletion-time' var TRASHBIN_ORIGINAL_LOCATION = '{http://nextcloud.org/ns}trashbin-original-location' + var TRASHBIN_TITLE = '{http://nextcloud.org/ns}trashbin-title' /** * Convert a file name in the format filename.d12345 to the real file name. @@ -45,32 +46,33 @@ } FileList.prototype = _.extend({}, OCA.Files.FileList.prototype, /** @lends OCA.Trashbin.FileList.prototype */ { - id: 'trashbin', - appName: t('files_trashbin', 'Deleted files'), - /** @type {OC.Files.Client} */ - client: null, + id: 'trashbin', + appName: t('files_trashbin', 'Deleted files'), + /** @type {OC.Files.Client} */ + client: null, - /** + /** * @private */ - initialize: function() { - this.client.addFileInfoParser(function(response, data) { - var props = response.propStat[0].properties - var path = props[TRASHBIN_ORIGINAL_LOCATION] - return { - displayName: props[FILENAME_PROP], - mtime: parseInt(props[DELETION_TIME_PROP], 10) * 1000, - hasPreview: true, - path: path, - extraData: path - } - }) + initialize: function() { + this.client.addFileInfoParser(function(response, data) { + var props = response.propStat[0].properties + var path = props[TRASHBIN_ORIGINAL_LOCATION] + var title = props[TRASHBIN_TITLE] + return { + displayName: props[FILENAME_PROP], + mtime: parseInt(props[DELETION_TIME_PROP], 10) * 1000, + hasPreview: true, + path: path, + extraData: title + } + }) - var result = OCA.Files.FileList.prototype.initialize.apply(this, arguments) - this.$el.find('.undelete').click('click', _.bind(this._onClickRestoreSelected, this)) + var result = OCA.Files.FileList.prototype.initialize.apply(this, arguments) + this.$el.find('.undelete').click('click', _.bind(this._onClickRestoreSelected, this)) - this.setSort('mtime', 'desc') - /** + this.setSort('mtime', 'desc') + /** * Override crumb making to add "Deleted Files" entry * and convert files with ".d" extensions to a more * user friendly name. @@ -252,7 +254,7 @@ * Returns list of webdav properties to request */ _getWebdavProperties: function() { - return [FILENAME_PROP, DELETION_TIME_PROP, TRASHBIN_ORIGINAL_LOCATION].concat(this.filesClient.getPropfindProperties()) + return [FILENAME_PROP, DELETION_TIME_PROP, TRASHBIN_ORIGINAL_LOCATION, TRASHBIN_TITLE].concat(this.filesClient.getPropfindProperties()) }, /**