Sorted widget names in lightning menu (#263)

This commit is contained in:
vicky-primathon 2020-08-11 16:31:34 +05:30 committed by GitHub
parent e38bd9f37b
commit bd4c34f56e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,6 @@ import {
LIGHTNING_MENU_DATA_WIDGET,
LIGHTNING_MENU_OPTION_HTML,
LIGHTNING_MENU_OPTION_JS,
LIGHTNING_MENU_OPTION_TEXT,
LIGHTNING_MENU_QUERY_CREATE_NEW,
LIGHTNING_MENU_API_CREATE_NEW,
} from "constants/messages";
@ -192,6 +191,9 @@ export const getLightningMenuOptions = (
},
];
if (widgets.length > 0) {
widgets = widgets.sort((a: WidgetProps, b: WidgetProps) => {
return a.widgetName.toUpperCase() > b.widgetName.toUpperCase() ? 1 : -1;
});
options.push({
content: (
<CustomizedDropdown