From e38bd9f37b90e82fb9d7ad9b2cd092bd3227c65c Mon Sep 17 00:00:00 2001 From: Abhinav Jha Date: Tue, 11 Aug 2020 16:28:39 +0530 Subject: [PATCH 1/2] Fix: Missing widgets when searching in entity explorer (#270) --- app/client/src/pages/Editor/Explorer/hooks.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/client/src/pages/Editor/Explorer/hooks.ts b/app/client/src/pages/Editor/Explorer/hooks.ts index b6f0f03477..509a4327a4 100644 --- a/app/client/src/pages/Editor/Explorer/hooks.ts +++ b/app/client/src/pages/Editor/Explorer/hooks.ts @@ -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; }; From bd4c34f56e01e7e2b5418d1fa71cde029c71a7b2 Mon Sep 17 00:00:00 2001 From: vicky-primathon <67091118+vicky-primathon@users.noreply.github.com> Date: Tue, 11 Aug 2020 16:31:34 +0530 Subject: [PATCH 2/2] Sorted widget names in lightning menu (#263) --- .../src/components/editorComponents/LightningMenu/helpers.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/client/src/components/editorComponents/LightningMenu/helpers.tsx b/app/client/src/components/editorComponents/LightningMenu/helpers.tsx index 5bacc9f15f..9f4df2fcdb 100644 --- a/app/client/src/components/editorComponents/LightningMenu/helpers.tsx +++ b/app/client/src/components/editorComponents/LightningMenu/helpers.tsx @@ -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: (