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

Method sortMenus

web/pgadmin/static/js/helpers/Menu.js:94–111  ·  view source on GitHub ↗
(menuItems)

Source from the content-addressed store, hash-verified

92 }
93
94 static sortMenus(menuItems) {
95 if(!menuItems || menuItems.length <=0) {
96 return;
97 }
98 // Sort by alphanumeric ordered first
99 menuItems.sort(function (a, b) {
100 return a.label.localeCompare(b.label);
101 });
102
103 // Sort by priority
104 menuItems.sort(function (a, b) {
105 return a.priority - b.priority;
106 });
107
108 menuItems.forEach((mi)=>{
109 Menu.sortMenus(mi.getMenuItems());
110 });
111 }
112
113 getMenuItems() {
114 return this.menuItems;

Callers 1

createMenuItemsMethod · 0.80

Calls 1

getMenuItemsMethod · 0.45

Tested by

no test coverage detected