From 216d25e2bfbba1a05fa0b359e10ccb49c4104cec Mon Sep 17 00:00:00 2001 From: Benjamin Mestrallet Date: Tue, 21 Jul 2026 20:53:31 +0100 Subject: [PATCH 1/6] feat: filter templates by category + top-bar search in the Add-a-document drawer - EXO-88766 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a filter row to the drawer's Templates section, reusing the shared chip bar (the same flat component the activity stream + Docs app use, from categoryVueComponents; object-type=document, space-id=drive owner, hide-on-empty so it only shows when templates are actually categorized). Free-text search follows the standard drawer pattern — a filter icon in the title bar opens a full-width search field with a back arrow. Both filters apply client-side over the already-loaded templates (category via item.categoryIds compared as strings so number/string ids match; search via name); no extra backend. Filters only surface once there are enough templates (>3). Wiring: AttachmentApp gatein module now depends on categoryVueComponents so the chip component resolves in the bundle. Live-verified: chips render + filter, top-bar search filters + back-arrow restores. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../locale/portlet/attachments_en.properties | 2 + .../main/webapp/WEB-INF/gatein-resources.xml | 3 + .../main/webapp/skin/less/attachmentsApp.less | 7 + .../AttachmentCreateDocumentDrawer.vue | 176 ++++++++++++++---- 4 files changed, 152 insertions(+), 36 deletions(-) diff --git a/documents-webapp/src/main/resources/locale/portlet/attachments_en.properties b/documents-webapp/src/main/resources/locale/portlet/attachments_en.properties index 9d6bdcc40..b2f6e9b9c 100644 --- a/documents-webapp/src/main/resources/locale/portlet/attachments_en.properties +++ b/documents-webapp/src/main/resources/locale/portlet/attachments_en.properties @@ -160,6 +160,8 @@ attachments.drawer.templates.empty.canCreate=No templates yet. Create a Template attachments.drawer.templates.createFolder=Create a Templates folder attachments.drawer.templates.createFolder.success=Templates folder created. Add documents to it to offer them as templates. attachments.drawer.templates.createFolder.error=Couldn’t create the Templates folder. +attachments.drawer.templates.search=Search templates +attachments.drawer.templates.noMatch=No template matches your filter documents.attach.image.alt=Preview of {0} attachments.drawer.done=Done attachments.drawer.removeAll=Remove all diff --git a/documents-webapp/src/main/webapp/WEB-INF/gatein-resources.xml b/documents-webapp/src/main/webapp/WEB-INF/gatein-resources.xml index 3de1df863..c026e81c1 100644 --- a/documents-webapp/src/main/webapp/WEB-INF/gatein-resources.xml +++ b/documents-webapp/src/main/webapp/WEB-INF/gatein-resources.xml @@ -290,6 +290,9 @@ documentsPreviewExtension + + categoryVueComponents + diff --git a/documents-webapp/src/main/webapp/skin/less/attachmentsApp.less b/documents-webapp/src/main/webapp/skin/less/attachmentsApp.less index b5a0600e6..8a3e6601c 100644 --- a/documents-webapp/src/main/webapp/skin/less/attachmentsApp.less +++ b/documents-webapp/src/main/webapp/skin/less/attachmentsApp.less @@ -255,6 +255,13 @@ color: @greyColorLighten1Default; } + /* Category chip row (search lives in the title bar, standard drawer pattern). */ + .attachmentsTemplatesFilters { + .attachmentsTemplateCategories { + min-width: 0; + } + } + /* Full-width, stacked template cards (each nearly the whole drawer width). The editable name field appears right under the selected card. */ .attachmentsTemplatesGrid { diff --git a/documents-webapp/src/main/webapp/vue-app/attachment/components/attachment-document-creator/AttachmentCreateDocumentDrawer.vue b/documents-webapp/src/main/webapp/vue-app/attachment/components/attachment-document-creator/AttachmentCreateDocumentDrawer.vue index 2cd90d4ff..f59c045e9 100644 --- a/documents-webapp/src/main/webapp/vue-app/attachment/components/attachment-document-creator/AttachmentCreateDocumentDrawer.vue +++ b/documents-webapp/src/main/webapp/vue-app/attachment/components/attachment-document-creator/AttachmentCreateDocumentDrawer.vue @@ -29,7 +29,11 @@ class="createDocumentDrawer" right>