summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-09 13:31:00 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-09 13:31:00 +0100
commita6ade67dfbbae562634e9cce47d53f1aa78ad7e4 (patch)
tree4ccbbc41b87d13e9cd44f9cbc01c0506534348d3 /apps/files
parent9639981041ba5d430b055eb1f4806c203ed2f7b7 (diff)
parent847a2426b8614b8fd5f7d05175dc4885a8a45e9c (diff)
downloadnextcloud-server-a6ade67dfbbae562634e9cce47d53f1aa78ad7e4.tar.gz
nextcloud-server-a6ade67dfbbae562634e9cce47d53f1aa78ad7e4.zip
Merge pull request #22197 from owncloud/files-filterbysystemtags
Add file list filter to filter by system tags
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/js/filelist.js4
-rw-r--r--apps/files/tests/controller/ViewControllerTest.php25
-rw-r--r--apps/files/tests/js/filelistSpec.js6
3 files changed, 29 insertions, 6 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 35999b5d0ee..1a6f38d3d7c 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -815,6 +815,10 @@
if (mountType) {
data.mountType = mountType;
}
+ var path = $el.attr('data-path');
+ if (path) {
+ data.path = path;
+ }
return data;
},
diff --git a/apps/files/tests/controller/ViewControllerTest.php b/apps/files/tests/controller/ViewControllerTest.php
index b5df3cfc904..28e2f0c2c9a 100644
--- a/apps/files/tests/controller/ViewControllerTest.php
+++ b/apps/files/tests/controller/ViewControllerTest.php
@@ -168,6 +168,15 @@ class ViewControllerTest extends TestCase {
'icon' => '',
],
2 => [
+ 'id' => 'systemtagsfilter',
+ 'appname' => 'systemtags',
+ 'script' => 'list.php',
+ 'order' => 9,
+ 'name' => new \OC_L10N_String(new \OC_L10N('systemtags'), 'Tags', []),
+ 'active' => false,
+ 'icon' => '',
+ ],
+ 3 => [
'id' => 'sharingin',
'appname' => 'files_sharing',
'script' => 'list.php',
@@ -176,7 +185,7 @@ class ViewControllerTest extends TestCase {
'active' => false,
'icon' => '',
],
- 3 => [
+ 4 => [
'id' => 'sharingout',
'appname' => 'files_sharing',
'script' => 'list.php',
@@ -185,7 +194,7 @@ class ViewControllerTest extends TestCase {
'active' => false,
'icon' => '',
],
- 4 => [
+ 5 => [
'id' => 'sharinglinks',
'appname' => 'files_sharing',
'script' => 'list.php',
@@ -194,7 +203,7 @@ class ViewControllerTest extends TestCase {
'active' => false,
'icon' => '',
],
- 5 => [
+ 6 => [
'id' => 'trashbin',
'appname' => 'files_trashbin',
'script' => 'list.php',
@@ -227,18 +236,22 @@ class ViewControllerTest extends TestCase {
'content' => null,
],
2 => [
- 'id' => 'sharingin',
+ 'id' => 'systemtagsfilter',
'content' => null,
],
3 => [
- 'id' => 'sharingout',
+ 'id' => 'sharingin',
'content' => null,
],
4 => [
- 'id' => 'sharinglinks',
+ 'id' => 'sharingout',
'content' => null,
],
5 => [
+ 'id' => 'sharinglinks',
+ 'content' => null,
+ ],
+ 6 => [
'id' => 'trashbin',
'content' => null,
],
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index 1b2dd12213b..0091a9ee6e4 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -2521,6 +2521,12 @@ describe('OCA.Files.FileList tests', function() {
expect(fileInfo.size).toEqual(12);
expect(fileInfo.mimetype).toEqual('text/plain');
expect(fileInfo.type).toEqual('file');
+ expect(fileInfo.path).not.toBeDefined();
+ });
+ it('adds path attribute if available', function() {
+ $tr.attr('data-path', '/subdir');
+ var fileInfo = fileList.elementToFile($tr);
+ expect(fileInfo.path).toEqual('/subdir');
});
});
describe('new file menu', function() {