justinpark commented on code in PR #24205:
URL: https://github.com/apache/superset/pull/24205#discussion_r1205807291


##########
superset-frontend/packages/superset-ui-core/src/ui-overrides/ExtensionsRegistry.ts:
##########
@@ -109,6 +109,27 @@ export interface DatabaseConnectionExtension {
   onEdit?: (componentState: any) => void;
 }
 
+/**
+ * Interface for extensions SQL Form.
+ * These will be passed from the SQLEditor
+ *
+ * You can specify the types to be used for these properties
+ * for better type checking or use the default ones.
+ *
+ * @template TTables - Type for the tables array.
+ * @template TQueryEditor - Type for the query editor.
+ * @template TDatabase - Type for the database.
+ */
+export interface SQLFormExtensionProps<
+  TTables = any[],
+  TQueryEditor = object,
+  TDatabase = any,
+> {
+  tables: TTables[];
+  queryEditor: TQueryEditor;
+  database: TDatabase;

Review Comment:
   @Antonio-RiveroMartnez 
   Not all custom extension requires all these properties such like `tables` 
and `database`
   Therefore, I think it's not a good idea passing these specified properties 
because you can access these values from redux. (you can also access the 
queryEditor object by useQueryEditor hook)
   Only thing you need to pass is `queryEditorId` and then each custom 
extension component should use a hook to retrieve the properties that needed.
   
   ```suggestion
     queryEditorId: string;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to