@@ -23,6 +23,7 @@ import RenameTabContent from './RenameTabContent';
2323import { BROWSER_PANELS } from '../../../browser/static/js/constants' ;
2424import ErrorBoundary from '../helpers/ErrorBoundary' ;
2525import QuickSearch from '../QuickSearch' ;
26+ import { MODAL_DIALOGS } from '../../../browser/static/js/constants' ;
2627
2728// This functions is used to show the connect server password dialog.
2829export function showServerPassword ( ) {
@@ -36,6 +37,7 @@ export function showServerPassword() {
3637 onSuccess = arguments [ 7 ] ,
3738 onFailure = arguments [ 8 ] ;
3839
40+ const modalId = MODAL_DIALOGS . CONNECT_SERVER ;
3941 pgAdmin . Browser . notifier . showModal ( title , ( onClose ) => {
4042 return (
4143 < ConnectServerContent
@@ -67,7 +69,7 @@ export function showServerPassword() {
6769 } }
6870 />
6971 ) ;
70- } ) ;
72+ } , { modalId : modalId } ) ;
7173}
7274
7375function masterPassCallbacks ( masterpass_callback_queue ) {
@@ -136,6 +138,7 @@ export function showMasterPassword(isPWDPresent, errmsg, masterpass_callback_que
136138 ) ; }
137139 } else {
138140
141+ const modalId = MODAL_DIALOGS . MASTER_PASSWORD ;
139142 pgAdmin . Browser . notifier . showModal ( title , ( onClose ) => {
140143 return (
141144 < MasterPasswordContent
@@ -176,7 +179,7 @@ export function showMasterPassword(isPWDPresent, errmsg, masterpass_callback_que
176179 } }
177180 />
178181 ) ;
179- } ) ;
182+ } , { modalId : modalId } ) ;
180183 }
181184}
182185
@@ -230,6 +233,7 @@ export function showChangeServerPassword() {
230233
231234export function showChangeUserPassword ( url ) {
232235 const title = gettext ( 'Change pgAdmin User Password' ) ;
236+ const modalId = MODAL_DIALOGS . CHNAGE_PASSWORD ;
233237 pgAdmin . Browser . notifier . showModal ( title , ( onClose ) => {
234238 return < ChangePasswordContent
235239 getInitData = { ( ) => {
@@ -275,7 +279,7 @@ export function showChangeUserPassword(url) {
275279 /> ;
276280 } ,
277281 { isFullScreen : false , isResizeable : true , showFullScreen : false , isFullWidth : true ,
278- dialogWidth : pgAdmin . Browser . stdW . md , dialogHeight : pgAdmin . Browser . stdH . md } ) ;
282+ dialogWidth : pgAdmin . Browser . stdW . md , dialogHeight : pgAdmin . Browser . stdH . md , modalId : modalId } ) ;
279283}
280284
281285export function showNamedRestorePoint ( ) {
@@ -318,6 +322,7 @@ export function showChangeOwnership() {
318322 deleteUserRow = arguments [ 4 ] ;
319323
320324 // Render Preferences component
325+ const modalId = MODAL_DIALOGS . CHANGE_OWNER ;
321326 pgAdmin . Browser . notifier . showModal ( title , ( onClose ) => {
322327 return < ChangeOwnershipContent
323328 onClose = { ( ) => {
@@ -351,7 +356,7 @@ export function showChangeOwnership() {
351356 /> ;
352357 } ,
353358 { isFullScreen : false , isResizeable : true , showFullScreen : true , isFullWidth : true ,
354- dialogWidth : pgAdmin . Browser . stdW . md , dialogHeight : pgAdmin . Browser . stdH . md } ) ;
359+ dialogWidth : pgAdmin . Browser . stdW . md , dialogHeight : pgAdmin . Browser . stdH . md , modalId : modalId } ) ;
355360}
356361
357362export function showUrlDialog ( ) {
@@ -385,9 +390,10 @@ export function showRenameTab(panelId, panelDocker) {
385390}
386391
387392export function showQuickSearch ( ) {
393+ const modalId = MODAL_DIALOGS . QUICK_SEARCH ;
388394 pgAdmin . Browser . notifier . showModal ( gettext ( 'Quick Search' ) , ( closeModal ) => {
389395 return < QuickSearch closeModal = { closeModal } /> ;
390396 } ,
391- { isFullScreen : false , isResizeable : false , showFullScreen : false , isFullWidth : false , showTitle : false }
397+ { isFullScreen : false , isResizeable : false , showFullScreen : false , isFullWidth : false , showTitle : false , modalId : modalId }
392398 ) ;
393399}
0 commit comments