Skip to content

Commit aff4d9c

Browse files
committed
left panel state updates
1 parent d004f2d commit aff4d9c

File tree

6 files changed

+2
-32
lines changed

6 files changed

+2
-32
lines changed

packages/web-console/src/providers/LocalStorageProvider/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const defaultConfig: LocalConfig = {
4545
exampleQueriesVisited: false,
4646
autoRefreshTables: true,
4747
leftPanelState: {
48-
type: null,
48+
type: LeftPanelType.DATASOURCES,
4949
width: 350
5050
}
5151
}

packages/web-console/src/scenes/Console/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,11 @@ const Console = () => {
134134
direction="left"
135135
onClick={() => {
136136
if (isDataSourcesPanelOpen) {
137-
dispatch(actions.console.setActiveTopPanel(undefined))
138137
updateLeftPanelState({
139138
type: null,
140139
width: leftPanelState.width
141140
})
142141
} else {
143-
dispatch(actions.console.setActiveTopPanel("tables"))
144142
updateLeftPanelState({
145143
type: LeftPanelType.DATASOURCES,
146144
width: leftPanelState.width

packages/web-console/src/store/Console/actions.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,10 @@ import {
2525
ConsoleAction,
2626
ConsoleAT,
2727
ImageToZoom,
28-
TopPanel,
2928
Sidebar,
3029
BottomPanel,
3130
} from "./types"
3231

33-
const setActiveTopPanel = (panel: TopPanel): ConsoleAction => ({
34-
payload: panel,
35-
type: ConsoleAT.SET_ACTIVE_TOP_PANEL,
36-
})
3732
const setActiveSidebar = (panel: Sidebar): ConsoleAction => ({
3833
payload: panel,
3934
type: ConsoleAT.SET_ACTIVE_SIDEBAR,
@@ -55,7 +50,6 @@ const toggleSideMenu = (): ConsoleAction => ({
5550

5651
export default {
5752
toggleSideMenu,
58-
setActiveTopPanel,
5953
setActiveSidebar,
6054
setActiveBottomPanel,
6155
setImageToZoom,

packages/web-console/src/store/Console/reducers.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { ConsoleAction, ConsoleAT, ConsoleStateShape } from "./types"
2626

2727
export const initialState: ConsoleStateShape = {
2828
sideMenuOpened: false,
29-
activeTopPanel: "tables",
3029
activeSidebar: undefined,
3130
activeBottomPanel: "zeroState",
3231
imageToZoom: undefined,
@@ -44,13 +43,6 @@ const _console = (
4443
}
4544
}
4645

47-
case ConsoleAT.SET_ACTIVE_TOP_PANEL: {
48-
return {
49-
...state,
50-
activeTopPanel: action.payload,
51-
}
52-
}
53-
5446
case ConsoleAT.SET_ACTIVE_SIDEBAR: {
5547
return {
5648
...state,

packages/web-console/src/store/Console/selectors.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,11 @@
2121
* limitations under the License.
2222
*
2323
******************************************************************************/
24-
import { StoreShape, Sidebar, BottomPanel, TopPanel, ImageToZoom } from "types"
24+
import { StoreShape, Sidebar, BottomPanel, ImageToZoom } from "types"
2525

2626
const getSideMenuOpened: (store: StoreShape) => boolean = (store) =>
2727
store.console.sideMenuOpened
2828

29-
const getActiveTopPanel: (store: StoreShape) => TopPanel = (store) =>
30-
store.console.activeTopPanel
31-
3229
const getActiveSidebar: (store: StoreShape) => Sidebar = (store) =>
3330
store.console.activeSidebar
3431

@@ -41,7 +38,6 @@ const getImageToZoom: (store: StoreShape) => ImageToZoom | undefined = (
4138

4239
export default {
4340
getSideMenuOpened,
44-
getActiveTopPanel,
4541
getActiveSidebar,
4642
getActiveBottomPanel,
4743
getImageToZoom,

packages/web-console/src/store/Console/types.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
*
2323
******************************************************************************/
2424

25-
export type TopPanel = "tables" | undefined
26-
2725
export type Sidebar = "news" | "create" | undefined
2826

2927
export type BottomPanel = "result" | "zeroState" | "import"
@@ -37,15 +35,13 @@ export type ImageToZoom = {
3735

3836
export type ConsoleStateShape = Readonly<{
3937
sideMenuOpened: boolean
40-
activeTopPanel: TopPanel
4138
activeSidebar: Sidebar
4239
activeBottomPanel: BottomPanel
4340
imageToZoom: ImageToZoom | undefined
4441
}>
4542

4643
export enum ConsoleAT {
4744
TOGGLE_SIDE_MENU = "CONSOLE/TOGGLE_SIDE_MENU",
48-
SET_ACTIVE_TOP_PANEL = "CONSOLE/SET_ACTIVE_TOP_PANEL",
4945
SET_ACTIVE_SIDEBAR = "CONSOLE/SET_ACTIVE_SIDEBAR",
5046
SET_ACTIVE_BOTTOM_PANEL = "CONSOLE/SET_ACTIVE_BOTTOM_PANEL",
5147
SET_IMAGE_TO_ZOOM = "CONSOLE/SET_IMAGE_TO_ZOOM",
@@ -55,11 +51,6 @@ type ToggleSideMenuAction = Readonly<{
5551
type: ConsoleAT.TOGGLE_SIDE_MENU
5652
}>
5753

58-
type setActiveTopPanelAction = Readonly<{
59-
payload: TopPanel
60-
type: ConsoleAT.SET_ACTIVE_TOP_PANEL
61-
}>
62-
6354
type setActiveSidebarAction = Readonly<{
6455
payload: Sidebar
6556
type: ConsoleAT.SET_ACTIVE_SIDEBAR
@@ -77,7 +68,6 @@ type setImageToZoomAction = Readonly<{
7768

7869
export type ConsoleAction =
7970
| ToggleSideMenuAction
80-
| setActiveTopPanelAction
8171
| setActiveSidebarAction
8272
| setActiveBottomPanelAction
8373
| setImageToZoomAction

0 commit comments

Comments
 (0)