michael-s-molina opened a new pull request, #36331: URL: https://github.com/apache/superset/pull/36331
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY Implements several SQL Lab extension API events and functions in `src/core/sqlLab/index.ts`: #### New Events Implemented - **`onDidCloseTab`** - Fires when a tab is closed (`REMOVE_QUERY_EDITOR` action) - **`onDidChangeActiveTab`** - Fires when the active tab changes (`SET_ACTIVE_QUERY_EDITOR` action) - **`onDidChangeEditorSchema`** - Fires when the schema selection changes (`QUERY_EDITOR_SET_SCHEMA` action) - **`onDidChangeActivePanel`** - Fires when the active south pane panel changes (`SET_ACTIVE_SOUTHPANE_TAB` action) - **`onDidChangeTabTitle`** - Fires when a tab title changes (`QUERY_EDITOR_SET_TITLE` action) #### New Functions Implemented - **`getTabs()`** - Returns all open tabs as `Tab[]` - **`getDatabases()`** - Returns all available databases as `Database[]` #### Code Improvements - Added `getTab(id)` helper function to reduce code duplication when converting query editors to Tab objects - Added `globalPredicate` for events that are not tab-specific (like panel changes) - Reorganized file to group implemented functions together, with not-implemented functions at the end ### TESTING INSTRUCTIONS 1. Verify that the events are fired when interacting with SQL Lab. 2. Verify that the functions return expected data ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- 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]
