mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Infrastructure and changes to the Query Tool for realtime preference handling. Refs #3294
Highlights of this patch include: - Changes will affect SQL Editors in Create dialog boxes, SQL tab of the main screen, Query tool, History entries in the query tool, Query tool opened in New Tab/Window - All the components of SQL editor will refer to single source of preferences which is cached in the Browser object. All other redundant ajax get preference calls are removed. - SQL editor will not refer template JS variables anymore, once all the references are removed the template variables will also be removed. - Code refactoring wherever possible. - Covered JS test cases wherever possible.
This commit is contained in:
committed by
Dave Page
parent
82d77c4608
commit
bdb7e3fde2
@@ -439,8 +439,18 @@ define('pgadmin.preferences', [
|
||||
|
||||
if (e.button.text == gettext('OK')) {
|
||||
preferences.updateAll();
|
||||
|
||||
/* Find the modules changed */
|
||||
let modulesChanged = {};
|
||||
_.each(changed, (val, key)=> {
|
||||
let pref = pgBrowser.get_preference_for_id(Number(key));
|
||||
if(!modulesChanged[pref.module]) {
|
||||
modulesChanged[pref.module] = true;
|
||||
}
|
||||
});
|
||||
|
||||
// Refresh preferences cache
|
||||
setTimeout(pgBrowser.cache_preferences(), 2000);
|
||||
pgBrowser.cache_preferences(modulesChanged);
|
||||
}
|
||||
},
|
||||
build: function() {
|
||||
|
||||
Reference in New Issue
Block a user