From ab2fff0a682f2303d5f9739d74e8dd0f9cd4cebb Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 8 Oct 2024 09:16:16 +0300 Subject: [PATCH] tab search all tabs --- .../src/views/global-search/global-search.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/client/src/views/global-search/global-search.js b/client/src/views/global-search/global-search.js index 308881e88a..f6c276b0cf 100644 --- a/client/src/views/global-search/global-search.js +++ b/client/src/views/global-search/global-search.js @@ -392,10 +392,24 @@ class GlobalSearchView extends View { }); }); }); - } - return list.filter((item, index) => list.findIndex(it => it.lowerLabel === item.lowerLabel) === index) + /** @type {Record} */ + const scopes = this.getMetadata().get('scopes') || {}; + + Object.entries(scopes) + .filter(([scope, it]) => it.tab && checkTab(scope)) + .forEach(([scope]) => { + const data = toData(scope); + + if (list.find(it => it.lowerLabel === data.lowerLabel)) { + return; + } + + list.push(data); + }); + + return list.filter((item, index) => list.findIndex(it => it.lowerLabel === item.lowerLabel) === index); } }