fix(sql Lab tabs): Empty SQL Lab tabs (#18817)

* Empty SQL table message on zero tabs

* sql editor no editor tab bug fix

* Revert Error message

* empty state tab state

* added a unit test

* addressed reviews

* kasia feedback

Co-authored-by: Yahya Kayani <yahyakiani1@gmail.com>
This commit is contained in:
AAfghahi
2022-02-25 13:48:15 -05:00
committed by GitHub
parent 099421770c
commit 147dc5af71
4 changed files with 70 additions and 1 deletions

View File

@@ -358,7 +358,7 @@ export default function sqlLabReducer(state = {}, action) {
[actions.SET_ACTIVE_QUERY_EDITOR]() {
const qeIds = state.queryEditors.map(qe => qe.id);
if (
qeIds.indexOf(action.queryEditor.id) > -1 &&
qeIds.indexOf(action.queryEditor?.id) > -1 &&
state.tabHistory[state.tabHistory.length - 1] !== action.queryEditor.id
) {
const tabHistory = state.tabHistory.slice();