@@ -9,6 +9,7 @@ import createToast from '../../../utils/createToast';
99import { transformPath } from '../ObjectSummary/transformPath' ;
1010import i18n from '../i18n' ;
1111
12+ import type { SchemaQueryParams } from './schemaQueryTemplates' ;
1213import {
1314 addTableIndex ,
1415 alterAsyncReplicationTemplate ,
@@ -22,6 +23,7 @@ import {
2223 createViewTemplate ,
2324 dropAsyncReplicationTemplate ,
2425 dropExternalTableTemplate ,
26+ dropTableIndex ,
2527 dropTopicTemplate ,
2628 dropViewTemplate ,
2729 selectQueryTemplate ,
@@ -35,28 +37,28 @@ interface ActionsAdditionalEffects {
3537}
3638
3739const bindActions = (
38- { path , relativePath } : { path : string ; relativePath : string } ,
40+ schemaQueryParams : SchemaQueryParams ,
3941 dispatch : React . Dispatch < any > ,
4042 additionalEffects : ActionsAdditionalEffects ,
4143) => {
4244 const { setActivePath, updateQueryExecutionSettings, showCreateDirectoryDialog} =
4345 additionalEffects ;
4446
45- const inputQuery = ( tmpl : ( path : string ) => string , mode ?: QueryMode ) => ( ) => {
47+ const inputQuery = ( tmpl : ( params ?: SchemaQueryParams ) => string , mode ?: QueryMode ) => ( ) => {
4648 if ( mode ) {
4749 updateQueryExecutionSettings ( { queryMode : mode } ) ;
4850 }
4951
50- dispatch ( changeUserInput ( { input : tmpl ( relativePath ) } ) ) ;
52+ dispatch ( changeUserInput ( { input : tmpl ( schemaQueryParams ) } ) ) ;
5153 dispatch ( setTenantPage ( TENANT_PAGES_IDS . query ) ) ;
5254 dispatch ( setQueryTab ( TENANT_QUERY_TABS_ID . newQuery ) ) ;
53- setActivePath ( path ) ;
55+ setActivePath ( schemaQueryParams . path ) ;
5456 } ;
5557
5658 return {
5759 createDirectory : showCreateDirectoryDialog
5860 ? ( ) => {
59- showCreateDirectoryDialog ( path ) ;
61+ showCreateDirectoryDialog ( schemaQueryParams . path ) ;
6062 }
6163 : undefined ,
6264 createTable : inputQuery ( createTableTemplate , 'script' ) ,
@@ -75,10 +77,11 @@ const bindActions = (
7577 dropTopic : inputQuery ( dropTopicTemplate , 'script' ) ,
7678 createView : inputQuery ( createViewTemplate , 'script' ) ,
7779 dropView : inputQuery ( dropViewTemplate , 'script' ) ,
80+ dropIndex : inputQuery ( dropTableIndex , 'script' ) ,
7881 addTableIndex : inputQuery ( addTableIndex , 'script' ) ,
7982 copyPath : ( ) => {
8083 try {
81- copy ( relativePath ) ;
84+ copy ( schemaQueryParams . relativePath ) ;
8285 createToast ( {
8386 name : 'Copied' ,
8487 title : i18n ( 'actions.copied' ) ,
@@ -170,6 +173,10 @@ export const getActions =
170173 ] ,
171174 ] ;
172175
176+ const INDEX_SET : ActionsSet = [
177+ [ copyItem , { text : i18n ( 'actions.dropIndex' ) , action : actions . dropIndex } ] ,
178+ ] ;
179+
173180 const JUST_COPY : ActionsSet = [ copyItem ] ;
174181
175182 // verbose mapping to guarantee a correct actions set for new node types
@@ -187,7 +194,7 @@ export const getActions =
187194 topic : TOPIC_SET ,
188195 stream : JUST_COPY ,
189196
190- index : JUST_COPY ,
197+ index : INDEX_SET ,
191198
192199 external_table : EXTERNAL_TABLE_SET ,
193200 external_data_source : EXTERNAL_DATA_SOURCE_SET ,
0 commit comments