EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
list settings no session storage
Yurii61e427d621d4
diff --git a/client/src/helpers/list/settings.js b/client/src/helpers/list/settings.jsindex 38dfb1def4..764f3747b1 100644--- a/client/src/helpers/list/settings.js+++ b/client/src/helpers/list/settings.js@@ -28,7 +28,7 @@import {inject} from 'di';import Storage from 'storage';-import SessionStorage from 'session-storage';+import Utils from 'utils';class ListSettingsHelper {@@ -45,13 +45,6 @@ class ListSettingsHelper {@inject(Storage)storage- /**- * @private- * @type {SessionStorage}- */- @inject(SessionStorage)- sessionStorage-/*** @private* @type {boolean}@@ -96,10 +89,6 @@ class ListSettingsHelper {this.columnWidthChangeFunctions = [];this.useStorage = options.useStorage ?? true;-- if (!this.useStorage) {- this.layoutColumnsKey += 'listSettings-' + Math.random().toString(36).substring(2, 8);- }}/**@@ -112,7 +101,7 @@ class ListSettingsHelper {return this.storage.get(key, this.layoutColumnsKey);}- return this.sessionStorage.get(this.getSessionKey(key));+ return null;}/**@@ -124,8 +113,6 @@ class ListSettingsHelper {if (this.useStorage) {this.storage.set(key, this.layoutColumnsKey, value);}-- return this.sessionStorage.set(this.getSessionKey(key), value);}/**@@ -134,39 +121,8 @@ class ListSettingsHelper {*/clearStored(key) {if (this.useStorage) {- return this.storage.clear(key, this.layoutColumnsKey);- }-- return this.sessionStorage.clear(this.getSessionKey(key));- }--- /**- * @internal- */- clearTemporaryStorage() {- if (this.useStorage) {- return;+ this.storage.clear(key, this.layoutColumnsKey);}-- const keys = [- 'listHiddenColumns',- 'listColumnResize',- 'listColumnsWidths',- ];-- for (const key of keys) {- this.clearStored(this.getSessionKey(key));- }- }-- /**- * @private- * @param {string} key- * @return {string}- */- getSessionKey(key) {- return this.layoutColumnsKey + '-' + key;}/**@@ -252,7 +208,7 @@ class ListSettingsHelper {* @param {Object.<string, boolean>} map*/storeHiddenColumnMap(map) {- this.hiddenColumnMapCache = undefined;+ this.hiddenColumnMapCache = Utils.cloneDeep(map);this.store('listHiddenColumns', map);}@@ -288,7 +244,7 @@ class ListSettingsHelper {* @param {Object.<string, ListSettingsHelper~columnWidth>} map*/storeColumnWidthMap(map) {- this.columnWidthMapCache = undefined;+ this.columnWidthMapCache = Utils.cloneDeep(map);this.store('listColumnsWidths', map);}diff --git a/client/src/views/record/list.js b/client/src/views/record/list.jsindex badf23ea83..eef2f504e3 100644--- a/client/src/views/record/list.js+++ b/client/src/views/record/list.js@@ -2294,10 +2294,6 @@ class ListRecordView extends View {onRemove() {this.destroyStickyBar();-- if (this._listSettingsHelper) {- this._listSettingsHelper.clearTemporaryStorage();- }}afterRender() {