Merge branch 'release' of https://github.com/appsmithorg/appsmith into release

This commit is contained in:
Automated Github Action 2020-08-11 11:04:34 +00:00
commit 00c997a4be
2 changed files with 7 additions and 2 deletions

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

View File

@ -29,7 +29,10 @@ const findWidgets = (widgets: WidgetProps, keyword: string) => {
findWidgets(widget, keyword),
),
);
return widgets.children.length > 0 ? widgets : undefined;
return widgets.children.length > 0 ||
widgets.widgetName.toLowerCase().indexOf(keyword) > -1
? widgets
: undefined;
}
if (widgets.widgetName.toLowerCase().indexOf(keyword) > -1) return widgets;
};