mirror of
https://github.com/apache/superset.git
synced 2026-05-11 02:45:46 +00:00
fix(sqllab): inactive leftbar selector on empty state (#38833)
(cherry picked from commit cfa1aba1e0)
This commit is contained in:
committed by
Michael S. Molina
parent
686fa44a5f
commit
bd552209e7
@@ -21,6 +21,8 @@ import { useMemo } from 'react';
|
||||
import { shallowEqual, useSelector } from 'react-redux';
|
||||
import { SqlLabRootState, QueryEditor } from 'src/SqlLab/types';
|
||||
|
||||
export const EMPTY_STATE_QE_ID = 'tmp_qe_id';
|
||||
|
||||
export default function useQueryEditor<T extends keyof QueryEditor>(
|
||||
sqlEditorId: string,
|
||||
attributes: ReadonlyArray<T>,
|
||||
@@ -43,6 +45,7 @@ export default function useQueryEditor<T extends keyof QueryEditor>(
|
||||
{
|
||||
...queryEditors[queryEditorsById[sqlEditorId]],
|
||||
...(sqlEditorId === unsavedQueryEditor?.id && unsavedQueryEditor),
|
||||
...(sqlEditorId === EMPTY_STATE_QE_ID && { id: sqlEditorId }),
|
||||
},
|
||||
['id'].concat(attributes),
|
||||
) as Pick<QueryEditor, T | 'id'>,
|
||||
|
||||
Reference in New Issue
Block a user