File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
src/containers/Tenant/utils Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -44,23 +44,39 @@ export const getActions = (
44
44
ignoreQueryPrefix : true ,
45
45
} ) ;
46
46
47
+ const switchTabToQuery = ( ) => {
48
+ history . push (
49
+ createHref ( routes . tenant , undefined , {
50
+ ...queryParams ,
51
+ [ TenantTabsGroups . general ] : TenantGeneralTabsIds . query ,
52
+ } ) ,
53
+ ) ;
54
+ } ;
55
+
47
56
const onCreateTableClick = ( ) => {
48
57
dispatch ( changeUserInput ( { input : createTableTemplate ( path ) } ) ) ;
58
+ switchTabToQuery ( ) ;
59
+ // here and in the other handlers this should be called after switching tab:
60
+ // redux-location-state catches the history.push event from the tab switching
61
+ // before active path updates in url, preventing its update at all
49
62
setActivePath ( path ) ;
50
63
} ;
51
64
52
65
const onAlterTableClick = ( ) => {
53
66
dispatch ( changeUserInput ( { input : alterTableTemplate ( path ) } ) ) ;
67
+ switchTabToQuery ( ) ;
54
68
setActivePath ( path ) ;
55
69
} ;
56
70
57
71
const onSelectQueryClick = ( ) => {
58
72
dispatch ( changeUserInput ( { input : selectQueryTemplate ( path ) } ) ) ;
73
+ switchTabToQuery ( ) ;
59
74
setActivePath ( path ) ;
60
75
} ;
61
76
62
77
const onUpsertQueryClick = ( ) => {
63
78
dispatch ( changeUserInput ( { input : upsertQueryTemplate ( path ) } ) ) ;
79
+ switchTabToQuery ( ) ;
64
80
setActivePath ( path ) ;
65
81
} ;
66
82
@@ -85,12 +101,7 @@ export const getActions = (
85
101
86
102
const onOpenPreviewClick = ( ) => {
87
103
dispatch ( setShowPreview ( true ) ) ;
88
- history . push (
89
- createHref ( routes . tenant , undefined , {
90
- ...queryParams ,
91
- [ TenantTabsGroups . general ] : TenantGeneralTabsIds . query ,
92
- } ) ,
93
- ) ;
104
+ switchTabToQuery ( ) ;
94
105
setActivePath ( path ) ;
95
106
} ;
96
107
You can’t perform that action at this time.
0 commit comments