MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / getNodeListById

Function getNodeListById

web/pgadmin/browser/static/js/node_ajax.js:139–166  ·  view source on GitHub ↗
(nodeObj, treeNodeInfo, itemNodeData, params={}, filter=()=>true, postTransform=(res)=>res)

Source from the content-addressed store, hash-verified

137
138/* Get the nodes list based on current selected node id */
139export function getNodeListById(nodeObj, treeNodeInfo, itemNodeData, params={}, filter=()=>true, postTransform=(res)=>res) {
140 nodeObj = typeof(nodeObj) == 'string' ? pgAdmin.Browser.Nodes[nodeObj] : nodeObj;
141 /* Transform the result to add image details */
142 const transform = (rows) => {
143 let res = [];
144
145 _.each(rows, function(r) {
146 if (filter(r)) {
147 let l = (_.isFunction(nodeObj['node_label']) ?
148 nodeObj['node_label'](r) :
149 r.label),
150 image = (_.isFunction(nodeObj['node_image']) ?
151 nodeObj['node_image'](r) :
152 (nodeObj['node_image'] || ('icon-' + nodeObj.type)));
153
154 res.push({
155 'value': r._id,
156 'image': image,
157 'label': l,
158 });
159 }
160 });
161
162 return postTransform(res);
163 };
164
165 return getNodeAjaxOptions('nodes', nodeObj, treeNodeInfo, itemNodeData, params, transform);
166}
167
168/* Get the nodes list based on node name passed */
169export function getNodeListByName(node, treeNodeInfo, itemNodeData, params={}, filter=()=>true, postTransform=(res)=>res) {

Callers 11

server.jsFile · 0.90
fts_dictionary.jsFile · 0.90
fts_template.jsFile · 0.90
function.jsFile · 0.90
procedure.jsFile · 0.90
fts_parser.jsFile · 0.90
aws.jsFile · 0.90
azure.jsFile · 0.90
google.jsFile · 0.90

Calls 1

getNodeAjaxOptionsFunction · 0.85

Tested by

no test coverage detected