mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-03 12:10:55 -06:00
7dd6372eeb
Extract some of the ACI Tree functionalities, and decouple it from the main source. Also - create some abstractions from the repeated code around the enable/disable the schema children object create/edit/delete functionalities, and also created the dialog wrappers for backup and restore dialogs. Reviewed by: Khushboo and Ashesh Refactored by: Ashesh
24 lines
711 B
JavaScript
24 lines
711 B
JavaScript
/////////////////////////////////////////////////////////////
|
|
//
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
//
|
|
// Copyright (C) 2013 - 2018, The pgAdmin Development Team
|
|
// This software is released under the PostgreSQL Licence
|
|
//
|
|
//////////////////////////////////////////////////////////////
|
|
|
|
import {isValidTreeNodeData} from '../../../../static/js/tree/tree';
|
|
|
|
export const backupSupportedNodes = [
|
|
'database', 'schema', 'table', 'partition',
|
|
];
|
|
|
|
function isNodeAServerAndConnected(treeNodeData) {
|
|
return (('server' === treeNodeData._type) && treeNodeData.connected);
|
|
}
|
|
|
|
export function menuEnabledServer(treeNodeData) {
|
|
return isValidTreeNodeData(treeNodeData)
|
|
&& isNodeAServerAndConnected(treeNodeData);
|
|
}
|