michael-s-molina commented on code in PR #19598:
URL: https://github.com/apache/superset/pull/19598#discussion_r851201621


##########
superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx:
##########
@@ -88,15 +99,24 @@ export default function SqlEditorLeftBar({
   queryEditor,
   tables = [],
   height = 500,
+  setEmptyState,
 }: SqlEditorLeftBarProps) {
   // Ref needed to avoid infinite rerenders on handlers
   // that require and modify the queryEditor
   const queryEditorRef = useRef<QueryEditor>(queryEditor);
+  const [isDbSearch, setDbSearch] = useState(false);

Review Comment:
   ```suggestion
     const [emptyResultsWithSearch, setEmptyResultsWithSearch] = 
useState(false);
   ```



##########
superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx:
##########
@@ -88,15 +99,24 @@ export default function SqlEditorLeftBar({
   queryEditor,
   tables = [],
   height = 500,
+  setEmptyState,
 }: SqlEditorLeftBarProps) {
   // Ref needed to avoid infinite rerenders on handlers
   // that require and modify the queryEditor
   const queryEditorRef = useRef<QueryEditor>(queryEditor);
+  const [isDbSearch, setDbSearch] = useState(false);
+
   useEffect(() => {
     queryEditorRef.current = queryEditor;
   }, [queryEditor]);
 
+  const onDbSearch = (searchText?: string) => {
+    if (searchText) setDbSearch(true);
+    else setDbSearch(false);
+  };

Review Comment:
   ```suggestion
     const onEmptyResults = (searchText?: string) => {
       setEmptyResultsWithSearch(!!searchText);
     };
   ```



##########
superset-frontend/src/components/DatabaseSelector/index.tsx:
##########
@@ -88,11 +88,13 @@ type SchemaValue = { label: string; value: string };
 
 interface DatabaseSelectorProps {

Review Comment:
   ```suggestion
   export interface DatabaseSelectorProps {
   ```



##########
superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx:
##########
@@ -164,6 +184,22 @@ export default function SqlEditorLeftBar({
   const shouldShowReset = window.location.search === '?reset=1';
   const tableMetaDataHeight = height - 130; // 130 is the height of the 
selects above
 
+  const emptyStateComponent = (
+    <EmptyStateSmall
+      image="empty.svg"
+      title={
+        isDbSearch

Review Comment:
   ```suggestion
           emptyResultsWithSearch
   ```



##########
superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx:
##########
@@ -185,6 +221,8 @@ export default function SqlEditorLeftBar({
   return (
     <div className="SqlEditorLeftBar">
       <TableSelectorMultiple
+        onEmptyResults={onDbSearch}

Review Comment:
   ```suggestion
           onEmptyResults={onEmptyResults}
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to