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.
101 lines
2.9 KiB
JavaScript
101 lines
2.9 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 GrantWizard from './GrantWizard';
|
|
import { BROWSER_PANELS } from '../../../../browser/static/js/constants';
|
|
|
|
|
|
// Grant Wizard
|
|
define([
|
|
'sources/gettext', 'pgadmin.browser',
|
|
'tools/grant_wizard/static/js/menu_utils',
|
|
'sources/nodes/supported_database_node',
|
|
], function(
|
|
gettext, pgBrowser, menuUtils, supportedNodes
|
|
) {
|
|
|
|
// if module is already initialized, refer to that.
|
|
if (pgBrowser.GrantWizard) {
|
|
return pgBrowser.GrantWizard;
|
|
}
|
|
|
|
|
|
// Create an Object GrantWizard of pgBrowser class
|
|
pgBrowser.GrantWizard = {
|
|
init: function() {
|
|
if (this.initialized)
|
|
return;
|
|
|
|
this.initialized = true;
|
|
|
|
// Define the nodes on which the menus to be appear
|
|
let menus = [{
|
|
name: 'grant_wizard_schema',
|
|
module: this,
|
|
applies: ['tools'],
|
|
callback: 'start_grant_wizard',
|
|
priority: 1,
|
|
label: gettext('Grant Wizard...'),
|
|
icon: 'fa fa-unlock',
|
|
enable: supportedNodes.enabled.bind(
|
|
null, pgBrowser.tree, menuUtils.supportedNodes
|
|
),
|
|
data: {
|
|
data_disabled: gettext('Please select any database, schema or schema objects from the object explorer to access Grant Wizard Tool.'),
|
|
},
|
|
}];
|
|
|
|
// Add supported menus into the menus list
|
|
for (let mnu_val of menuUtils.supportedNodes) {
|
|
menus.push({
|
|
name: 'grant_wizard_schema_context_' + mnu_val,
|
|
node: mnu_val,
|
|
module: this,
|
|
applies: ['context'],
|
|
callback: 'start_grant_wizard',
|
|
priority: 14,
|
|
label: gettext('Grant Wizard...'),
|
|
enable: supportedNodes.enabled.bind(
|
|
null, pgBrowser.tree, menuUtils.supportedNodes
|
|
),
|
|
});
|
|
}
|
|
pgBrowser.add_menus(menus);
|
|
|
|
return this;
|
|
},
|
|
|
|
// Callback to draw Wizard Dialog
|
|
start_grant_wizard: function() {
|
|
let t = pgBrowser.tree,
|
|
i = t.selected(),
|
|
d = this.d = i ? t.itemData(i) : undefined,
|
|
info = this.info = pgBrowser.tree.getTreeNodeHierarchy(i);
|
|
|
|
let sid = info.server._id,
|
|
did = info.database._id;
|
|
|
|
const panelTitle = gettext('Grant Wizard');
|
|
const panelId = BROWSER_PANELS.GRANT_WIZARD;
|
|
pgBrowser.docker.openDialog({
|
|
id: panelId,
|
|
title: panelTitle,
|
|
manualClose: false,
|
|
content: (
|
|
<GrantWizard sid={sid} did={did} nodeInfo={info} nodeData={d}
|
|
onClose={()=>{pgBrowser.docker.close(panelId);}}
|
|
/>
|
|
)
|
|
}, pgBrowser.stdW.lg, pgBrowser.stdH.lg);
|
|
},
|
|
};
|
|
|
|
return pgBrowser.GrantWizard;
|
|
});
|