From 3e94e18b738ebca5601608793aa86f6c56bf6cb5 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Wed, 3 May 2023 11:40:58 +0300 Subject: [PATCH] disable storing text filters param --- application/Espo/Resources/i18n/en_US/Preferences.json | 3 ++- .../Espo/Resources/layouts/Preferences/detail.json | 4 +++- .../Resources/metadata/entityDefs/Preferences.json | 4 ++++ client/src/views/record/search.js | 10 ++++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/application/Espo/Resources/i18n/en_US/Preferences.json b/application/Espo/Resources/i18n/en_US/Preferences.json index 074cada710..92393ae158 100644 --- a/application/Espo/Resources/i18n/en_US/Preferences.json +++ b/application/Espo/Resources/i18n/en_US/Preferences.json @@ -32,7 +32,8 @@ "followCreatedEntityTypeList": "Auto-follow created records of specific entity types", "emailUseExternalClient": "Use an external email client", "scopeColorsDisabled": "Disable scope colors", - "tabColorsDisabled": "Disable tab colors" + "tabColorsDisabled": "Disable tab colors", + "textSearchStoringDisabled": "Disable storing text filters" }, "links": { }, diff --git a/application/Espo/Resources/layouts/Preferences/detail.json b/application/Espo/Resources/layouts/Preferences/detail.json index efbc157b76..ab6d2b61fb 100644 --- a/application/Espo/Resources/layouts/Preferences/detail.json +++ b/application/Espo/Resources/layouts/Preferences/detail.json @@ -46,7 +46,9 @@ } ], [ - false, + { + "name": "textSearchStoringDisabled" + }, { "name": "followCreatedEntityTypeList" } diff --git a/application/Espo/Resources/metadata/entityDefs/Preferences.json b/application/Espo/Resources/metadata/entityDefs/Preferences.json index 14783ac598..2341db19bf 100644 --- a/application/Espo/Resources/metadata/entityDefs/Preferences.json +++ b/application/Espo/Resources/metadata/entityDefs/Preferences.json @@ -187,6 +187,10 @@ "tabColorsDisabled": { "type": "bool", "default": false + }, + "textSearchStoringDisabled": { + "type": "bool", + "default": false } }, "noDeletedAttribute": true, diff --git a/client/src/views/record/search.js b/client/src/views/record/search.js index 350e4907f7..0cddb70bd6 100644 --- a/client/src/views/record/search.js +++ b/client/src/views/record/search.js @@ -102,6 +102,8 @@ define('views/record/search', ['view', 'helpers/misc/stored-text-search'], funct */ this.storedTextSearchHelper = new StoredTextSearch(this.scope, this.getHelper().storage); + this.textSearchStoringDisabled = this.getPreferences().get('textSearchStoringDisabled'); + this.textFilterDisabled = this.options.textFilterDisabled || this.textFilterDisabled || this.getMetadata().get(['clientDefs', this.scope, 'textFilterDisabled']); @@ -695,6 +697,10 @@ define('views/record/search', ['view', 'helpers/misc/stored-text-search'], funct }, initTextSearchAutocomplete: function () { + if (this.textSearchStoringDisabled) { + return; + } + let preventCloseOnBlur = false; let options = { @@ -1297,6 +1303,10 @@ define('views/record/search', ['view', 'helpers/misc/stored-text-search'], funct return; } + if (this.textSearchStoringDisabled) { + return; + } + this.storedTextSearchHelper.store(this.textFilter); }, });