From ce37b46de0a481b9a76215dca632ff8b012e41e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Wed, 15 Apr 2020 10:03:54 +0200 Subject: [PATCH 1/2] :bug: Retrieve complete information for files in dashboard search --- backend/src/uxbox/services/queries/files.clj | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/src/uxbox/services/queries/files.clj b/backend/src/uxbox/services/queries/files.clj index 6e28c4dcaa..b28b477f7a 100644 --- a/backend/src/uxbox/services/queries/files.clj +++ b/backend/src/uxbox/services/queries/files.clj @@ -55,10 +55,17 @@ ppr.is_owner = true or ppr.can_edit = true) ) - select file.* + select distinct + file.*, + array_agg(page.id) over pages_w as pages, + first_value(page.data) over pages_w as data from file inner join projects as pr on (file.project_id = pr.id) + left join page on (file.id = page.file_id) where file.name ilike ('%' || $3 || '%') + window pages_w as (partition by file.id order by page.created_at + range between unbounded preceding + and unbounded following) order by file.created_at asc") (s/def ::search-files From 43e91883d8da176ad8c83544f09a89a77154ea61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Wed, 15 Apr 2020 10:15:55 +0200 Subject: [PATCH 2/2] :construction: Quick patch to have search working (FIXME) --- frontend/src/uxbox/main/ui/dashboard/sidebar.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/uxbox/main/ui/dashboard/sidebar.cljs b/frontend/src/uxbox/main/ui/dashboard/sidebar.cljs index 51f94f3d20..85a586f936 100644 --- a/frontend/src/uxbox/main/ui/dashboard/sidebar.cljs +++ b/frontend/src/uxbox/main/ui/dashboard/sidebar.cljs @@ -148,8 +148,8 @@ on-search-blur (fn [event] (let [target (dom/get-target event)] - (dom/clean-value! target) - (debounced-emit! (rt/nav :dashboard-team {:team-id team-id})))) + (dom/clean-value! target))) + ;; (debounced-emit! (rt/nav :dashboard-team {:team-id team-id})))) on-search-change (fn [event]