Skip to content

Commit b5d7537

Browse files
authored
fix(6240): have Sidebar container always render, and only remove compoenents specific to flux when in SQL mode (#6275)
1 parent 61375e2 commit b5d7537

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/dataExplorer/components/FluxQueryBuilder.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,7 @@ const FluxQueryBuilder: FC = () => {
220220
<ResultsPane />
221221
</DraggableResizer.Panel>
222222
<DraggableResizer.Panel isCollapsible={true}>
223-
{isFlagEnabled('uiSqlSupport') &&
224-
resource?.language === LanguageType.SQL ? null : (
225-
<Sidebar />
226-
)}
223+
<Sidebar />
227224
</DraggableResizer.Panel>
228225
</DraggableResizer>
229226
</FlexBox>

src/dataExplorer/components/Sidebar.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ import {
1616
// Contexts
1717
import {SidebarContext} from 'src/dataExplorer/context/sidebar'
1818
import {EditorContext} from 'src/shared/contexts/editor'
19+
import {PersistanceContext} from 'src/dataExplorer/context/persistance'
1920

2021
// Types
2122
import {FluxFunction, FluxToolbarFunction} from 'src/types'
23+
import {LanguageType} from 'src/dataExplorer/components/resources'
2224

2325
// Utils
2426
import {event} from 'src/cloud/utils/reporting'
@@ -33,6 +35,7 @@ functions, and variables which may be useful when constructing your flux query.`
3335
const Sidebar: FC = () => {
3436
const {injectFunction} = useContext(EditorContext)
3537
const {visible, menu, clear} = useContext(SidebarContext)
38+
const {resource} = useContext(PersistanceContext)
3639

3740
const inject = useCallback(
3841
(fn: FluxFunction | FluxToolbarFunction) => {
@@ -114,8 +117,13 @@ const Sidebar: FC = () => {
114117
justifyContent={JustifyContent.FlexStart}
115118
className="container-right-side-bar"
116119
>
117-
{resultOptions}
118-
{fluxLibrary}
120+
{isFlagEnabled('uiSqlSupport') &&
121+
resource?.language === LanguageType.SQL ? null : (
122+
<>
123+
{resultOptions}
124+
{fluxLibrary}
125+
</>
126+
)}
119127
</FlexBox>
120128
)
121129
}

0 commit comments

Comments
 (0)