Allow users to convert View/Edit table into a Query tool to enable editing the SQL generated. #5908

This commit is contained in:
Nikhil Mohite
2023-12-19 15:52:57 +05:30
committed by GitHub
parent 4db13facf7
commit 04580652ab
18 changed files with 296 additions and 20 deletions

View File

@@ -13,6 +13,12 @@ const usePreferences = create((set, get)=>({
get().data, {'module': module, 'name': preference}
);
},
setPreference: (data)=> {
// Update Preferences and then refresh cache.
getApiInstance().put(url_for('preferences.update_pref'), data).then(()=> {
preferenceChangeBroadcast.postMessage('refresh');
});
},
getPreferencesForModule: function(module) {
let preferences = {};
_.forEach(
@@ -62,6 +68,9 @@ export function setupPreferenceBroadcast() {
if(ev.data == 'sync') {
broadcast(usePreferences.getState());
}
if(ev.data == 'refresh') {
usePreferences.getState().cache();
}
};
}