From 684e6ea58e720355d7b22de657d1d0f55cfeef3c Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Mon, 6 Nov 2023 14:07:20 +0100 Subject: [PATCH 01/21] Implement basic ui filter construct --- .../src/components/Search/List.vue | 68 ++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/packages/web-app-files/src/components/Search/List.vue b/packages/web-app-files/src/components/Search/List.vue index 026469247f5..90967bcaf86 100644 --- a/packages/web-app-files/src/components/Search/List.vue +++ b/packages/web-app-files/src/components/Search/List.vue @@ -7,6 +7,26 @@ + + + => [ + { + id: 'document', + label: 'Document' + }, + { + id: 'spreadsheet', + label: 'Spreadsheet' + }, + { + id: 'spreadsheet', + label: 'Spreadsheet' + }, + { + id: 'presentation', + label: 'Presentation' + }, + { + id: 'pdf', + label: 'PDF' + }, + { + id: 'image', + label: 'Image' + }, + { + id: 'video', + label: 'Video' + }, + { + id: 'audio', + label: 'Audio' + }, + { + id: 'archive', + label: 'Archive' + } + ] + ) + const searchTerm = computed(() => { return queryItemAsString(unref(searchTermQuery)) }) @@ -416,7 +481,8 @@ export default defineComponent({ breadcrumbs, displayFilter, availableLastModifiedValues, - lastModifiedFilter + lastModifiedFilter, + availableFileTypes } }, computed: { From 6fa3d04837541da87310783edb1c5448c75bd3e9 Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Mon, 6 Nov 2023 14:46:23 +0100 Subject: [PATCH 02/21] Implement doctype icons --- .../src/components/Search/List.vue | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/packages/web-app-files/src/components/Search/List.vue b/packages/web-app-files/src/components/Search/List.vue index 90967bcaf86..e350911ca04 100644 --- a/packages/web-app-files/src/components/Search/List.vue +++ b/packages/web-app-files/src/components/Search/List.vue @@ -22,7 +22,7 @@ > @@ -204,6 +204,7 @@ const visibilityObserver = new VisibilityObserver() type FileType = { id: string label: string + icon: string } type Tag = { id: string @@ -268,39 +269,43 @@ export default defineComponent({ (): Array => [ { id: 'document', - label: 'Document' - }, - { - id: 'spreadsheet', - label: 'Spreadsheet' + label: 'Document', + icon: 'doc' }, { id: 'spreadsheet', - label: 'Spreadsheet' + label: 'Spreadsheet', + icon: 'xls' }, { id: 'presentation', - label: 'Presentation' + label: 'Presentation', + icon: 'ppt' }, { id: 'pdf', - label: 'PDF' + label: 'PDF', + icon: 'pdf' }, { id: 'image', - label: 'Image' + label: 'Image', + icon: 'jpg' }, { id: 'video', - label: 'Video' + label: 'Video', + icon: 'mp4' }, { id: 'audio', - label: 'Audio' + label: 'Audio', + icon: 'mp3' }, { id: 'archive', - label: 'Archive' + label: 'Archive', + icon: 'zip' } ] ) From 8a0e8f79cf1219754a50d7dcd1dcbd8c6b918f0c Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Mon, 6 Nov 2023 14:47:40 +0100 Subject: [PATCH 03/21] Add changelog --- changelog/unreleased/enhancement-add-file-type-filter-chip | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelog/unreleased/enhancement-add-file-type-filter-chip diff --git a/changelog/unreleased/enhancement-add-file-type-filter-chip b/changelog/unreleased/enhancement-add-file-type-filter-chip new file mode 100644 index 00000000000..bad9b4c985a --- /dev/null +++ b/changelog/unreleased/enhancement-add-file-type-filter-chip @@ -0,0 +1,5 @@ +Enhancement: Add file type filter chip + +We've added a new filter option in the search list to filter by file type. + +https://github.com/owncloud/ocis/issues/7432 From a4efe491c75a010584fffb9b494dee438e691949 Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Wed, 8 Nov 2023 15:32:08 +0100 Subject: [PATCH 04/21] Refactor using capabilities for filetypes --- .../src/components/Search/List.vue | 115 ++++++++++-------- packages/web-client/src/ocs/capabilities.ts | 7 ++ .../composables/capability/useCapability.ts | 6 + 3 files changed, 74 insertions(+), 54 deletions(-) diff --git a/packages/web-app-files/src/components/Search/List.vue b/packages/web-app-files/src/components/Search/List.vue index e350911ca04..2e1b2e9603e 100644 --- a/packages/web-app-files/src/components/Search/List.vue +++ b/packages/web-app-files/src/components/Search/List.vue @@ -8,12 +8,12 @@ @@ -146,7 +149,11 @@