Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
check_node_visibility.js41 linesDownload Raw Back to js
1//////////////////////////////////////////////////////////////////////////2//3// pgAdmin 4 - PostgreSQL Tools4//5// Copyright (C) 2013 - 2024, The pgAdmin Development Team6// This software is released under the PostgreSQL Licence7//8//////////////////////////////////////////////////////////////////////////9import _ from 'lodash';10import usePreferences from '../../preferences/static/js/store';11 12export default function checkNodeVisibility(node_type) {13  if(_.isUndefined(node_type) || _.isNull(node_type)) {14    return true;15  }16 17  // Target actual node instead of collection.18  // If node is disabled then there is no meaning of19  // adding collection node menu20  if(node_type.startsWith('coll-')) {21    node_type = node_type.replace('coll-', '');22  }23 24  // Exclude non-applicable nodes25  let nodes_not_supported = [26    'server_group', 'server', 'catalog_object_column',27  ];28  if(_.indexOf(nodes_not_supported, node_type) >= 0) {29    return true;30  }31 32  let preference = usePreferences.getState().getPreferences('browser', 'show_node_'+node_type);33 34  if (preference) {35    return preference.value;36  }37  else {38    return true;39  }40}41 
codekingpro/portable-devtools · Team Ai