Skip to content

Commit bedc8e3

Browse files
Accomodated Review comments.
1 parent 5073998 commit bedc8e3

3 files changed

Lines changed: 10 additions & 13 deletions

File tree

docs/en_US/release_notes_9_7.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ Bug fixes
4646
| `Issue #8982 <https://github.com/pgadmin-org/pgadmin4/issues/8982>`_ - Fixed an issue where adding breakpoints caused errors, and stepping out of a nested function removed breakpoints from the parent function.
4747
| `Issue #9007 <https://github.com/pgadmin-org/pgadmin4/issues/9007>`_ - Ensure the scratch pad in the Query Tool is not restored after it is closed.
4848
| `Issue #9008 <https://github.com/pgadmin-org/pgadmin4/issues/9008>`_ - Update the documentation for parameters that require file paths.
49-
| `Issue #9047 <https://github.com/pgadmin-org/pgadmin4/issues/9047>`_ - Fixed an issue where downloading images on the ERD tool was not working in desktop mode.
49+
| `Issue #9047 <https://github.com/pgadmin-org/pgadmin4/issues/9047>`_ - Fixed an issue where downloading images on the ERD tool was not working in desktop mode.
50+
| `Issue #9067 <https://github.com/pgadmin-org/pgadmin4/issues/9067>`_ - Ensure that disabling "Save Application State" in Preferences prevents tool data from being saved and stops it from being restored on application restart.

web/pgadmin/misc/workspaces/static/js/AdHocConnection.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,11 @@ class AdHocConnectionSchema extends BaseUISchema {
215215
disabled: (state) => state.sid,
216216
},{
217217
id: 'did', label: gettext('Database'), deps: ['sid', 'connected'],
218-
controlProps: {creatable: true},
219218
type: (state) => {
220219
if (state?.sid) {
221220
return {
222221
type: 'select',
222+
controlProps: {creatable: true},
223223
options: () => this.getOtherOptions(
224224
state.sid, 'get_new_connection_database'
225225
),
@@ -238,11 +238,11 @@ class AdHocConnectionSchema extends BaseUISchema {
238238
}
239239
}, {
240240
id: 'user', label: gettext('User'), deps: ['sid', 'connected'],
241-
controlProps: {creatable: true},
242241
type: (state) => {
243242
if (state?.sid) {
244243
return {
245244
type: 'select',
245+
controlProps: {creatable: true},
246246
options: () => this.getOtherOptions(
247247
state.sid, 'get_new_connection_user'
248248
),
@@ -266,9 +266,9 @@ class AdHocConnectionSchema extends BaseUISchema {
266266
}
267267
},{
268268
id: 'role', label: gettext('Role'), deps: ['sid', 'connected'],
269-
controlProps: {creatable: true},
270269
type: (state)=>({
271270
type: 'select',
271+
controlProps: {creatable: true},
272272
options: () => this.getOtherOptions(
273273
state.sid, 'get_new_connection_role'
274274
),

web/pgadmin/static/js/helpers/Layout/index.jsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,9 @@ export default function Layout({groups, noContextGroups, getLayoutInstance, layo
428428
}
429429

430430
if(!saveAppState && saveAppStateRef.current){
431-
saveAppStateRef.current = saveAppState;
432431
layoutDockerObj.saveLayout();
433432
}
433+
saveAppStateRef.current = saveAppState;
434434

435435
}, [prefStore]);
436436

@@ -479,8 +479,8 @@ export default function Layout({groups, noContextGroups, getLayoutInstance, layo
479479
const saveTab = (tab) => {
480480
// 'tab' here is the full TabData object, potentially with 'title', 'content', etc.
481481
// We only want to save the 'id' and any custom properties needed by loadTab.
482-
const saveAppState = prefStore?.getPreferencesForModule('misc')?.save_app_state;
483-
if (saveAppState && tab.metaData && !BROWSER_PANELS.DEBUGGER_TOOL.includes(tab.id.split('_')[0])) {
482+
const savedTab = { id: tab.id };
483+
if (saveAppStateRef.current && tab.metaData && !BROWSER_PANELS.DEBUGGER_TOOL.includes(tab.id.split('_')[0])) {
484484
// add custom properties that were part of the original TabBase
485485
const updatedMetaData = {
486486
...tab.metaData,
@@ -492,13 +492,9 @@ export default function Layout({groups, noContextGroups, getLayoutInstance, layo
492492
},
493493
restore: true,
494494
};
495-
return {
496-
id: tab.id,
497-
metaData: updatedMetaData
498-
};
499-
}else{
500-
return {id: tab.id};
495+
savedTab.metaData = updatedMetaData;
501496
}
497+
return savedTab;
502498
};
503499

504500
const flatDefaultLayout = useMemo(()=>{

0 commit comments

Comments
 (0)