mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
1. Replace the current layout library wcDocker with ReactJS based rc-dock. #6479 2. Have close buttons on individual panel tabs instead of common. #2821 3. Changes in the context menu on panel tabs - Add close, close all and close others menu items. #5394 4. Allow closing all the tabs, including SQL and Properties. #4733 5. Changes in docking behaviour of different tabs based on user requests and remove lock layout menu. 6. Fix an issue where the scroll position of panels was not remembered on Firefox. #2986 7. Reset layout now will not require page refresh and is done spontaneously. 8. Use the zustand store for storing preferences instead of plain JS objects. This will help reflecting preferences immediately. 9. The above fix incorrect format (no indent) of SQL stored functions/procedures. #6720 10. New version check is moved to an async request now instead of app start to improve startup performance. 11. Remove jQuery and Bootstrap completely. 12. Replace jasmine and karma test runner with jest. Migrate all the JS test cases to jest. This will save time in writing and debugging JS tests. 13. Other important code improvements and cleanup.
100 lines
3.0 KiB
JavaScript
100 lines
3.0 KiB
JavaScript
/////////////////////////////////////////////////////////////
|
|
//
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
//
|
|
// Copyright (C) 2013 - 2023, The pgAdmin Development Team
|
|
// This software is released under the PostgreSQL Licence
|
|
//
|
|
//////////////////////////////////////////////////////////////
|
|
import React from 'react';
|
|
import CloudWizard from './CloudWizard';
|
|
import getApiInstance from '../../../../static/js/api_instance';
|
|
import { BROWSER_PANELS } from '../../../../browser/static/js/constants';
|
|
import pgAdmin from 'sources/pgadmin';
|
|
|
|
// Cloud Wizard
|
|
define('pgadmin.misc.cloud', [
|
|
'sources/gettext', 'sources/url_for',
|
|
'pgadmin.browser',
|
|
], function(
|
|
gettext, url_for, pgBrowser
|
|
) {
|
|
|
|
// if module is already initialized, refer to that.
|
|
if (pgBrowser.Cloud) {
|
|
return pgBrowser.Cloud;
|
|
}
|
|
|
|
|
|
// Create an Object Cloud of pgBrowser class
|
|
pgBrowser.Cloud = {
|
|
init: function() {
|
|
if (this.initialized)
|
|
return;
|
|
|
|
this.initialized = true;
|
|
|
|
// Define the nodes on which the menus to be appear
|
|
let menus = [{
|
|
name: 'register_and_deploy_cloud_instance',
|
|
module: this,
|
|
applies: ['object', 'context'],
|
|
callback: 'start_cloud_wizard',
|
|
priority: 15,
|
|
label: gettext('Deploy Cloud Instance...'),
|
|
icon: 'wcTabIcon icon-server',
|
|
enable: true,
|
|
data: {action: 'create'},
|
|
category: 'register',
|
|
node: 'server_group',
|
|
}, {
|
|
name: 'register_and_deploy_cloud_instance',
|
|
module: this,
|
|
applies: ['object', 'context'],
|
|
callback: 'start_cloud_wizard',
|
|
priority: 15,
|
|
label: gettext('Deploy Cloud Instance...'),
|
|
icon: 'wcTabIcon icon-server',
|
|
enable: true,
|
|
data: {action: 'create'},
|
|
category: 'register',
|
|
node: 'server',
|
|
}];
|
|
|
|
pgBrowser.add_menus(menus);
|
|
return this;
|
|
},
|
|
|
|
// Callback to draw Wizard Dialog
|
|
start_cloud_wizard: function() {
|
|
let t = pgBrowser.tree,
|
|
i = t.selected(),
|
|
d = this.d = i ? t.itemData(i) : undefined,
|
|
info = this.info = pgBrowser.tree.getTreeNodeHierarchy(i);
|
|
|
|
const panelTitle = gettext('Deploy Cloud Instance');
|
|
const panelId = BROWSER_PANELS.CLOUD_WIZARD;
|
|
pgAdmin.Browser.docker.openDialog({
|
|
id: panelId,
|
|
title: panelTitle,
|
|
manualClose: true,
|
|
content: (
|
|
<CloudWizard nodeInfo={info} nodeData={d} cloudPanelId={panelId}
|
|
onClose={() => {
|
|
const axiosApi = getApiInstance();
|
|
let _url = url_for('cloud.clear_cloud_session');
|
|
axiosApi.post(_url)
|
|
.then(() => {/*This is intentional (SonarQube)*/})
|
|
.catch((error) => {
|
|
pgAdmin.Browser.notifier.error(gettext(`Error while clearing cloud wizard data: ${error.response.data.errormsg}`));
|
|
});
|
|
pgAdmin.Browser.docker.close(panelId, true);
|
|
}}/>
|
|
)
|
|
}, pgAdmin.Browser.stdW.lg, pgAdmin.Browser.stdH.lg);
|
|
},
|
|
};
|
|
|
|
return pgBrowser.Cloud;
|
|
});
|