This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 7a5441bc7a refactor: Remove unimplemented APIs from
@apache-superset/core (#36952)
7a5441bc7a is described below
commit 7a5441bc7a60549815d7c946035ebb232b2f68e3
Author: Michael S. Molina <[email protected]>
AuthorDate: Wed Jan 7 14:17:06 2026 -0300
refactor: Remove unimplemented APIs from @apache-superset/core (#36952)
---
docs/developer_portal/extensions/architecture.md | 2 -
docs/developer_portal/extensions/development.md | 4 -
.../packages/superset-core/src/api/environment.ts | 153 ---------------------
.../packages/superset-core/src/api/index.ts | 2 -
.../packages/superset-core/src/api/sqlLab.ts | 109 ---------------
superset-frontend/src/core/authentication/index.ts | 6 +-
superset-frontend/src/core/commands/index.ts | 10 +-
superset-frontend/src/core/environment/index.ts | 57 --------
superset-frontend/src/core/extensions/index.ts | 11 +-
superset-frontend/src/core/index.ts | 1 -
superset-frontend/src/core/sqlLab/index.ts | 74 ++++------
.../src/extensions/ExtensionsStartup.test.tsx | 1 -
.../src/extensions/ExtensionsStartup.tsx | 11 +-
13 files changed, 37 insertions(+), 404 deletions(-)
diff --git a/docs/developer_portal/extensions/architecture.md
b/docs/developer_portal/extensions/architecture.md
index dd858766b7..b13091bfa3 100644
--- a/docs/developer_portal/extensions/architecture.md
+++ b/docs/developer_portal/extensions/architecture.md
@@ -202,7 +202,6 @@ import {
authentication,
core,
commands,
- environment,
extensions,
sqlLab,
} from 'src/extensions';
@@ -213,7 +212,6 @@ export default function setupExtensionsAPI() {
authentication,
core,
commands,
- environment,
extensions,
sqlLab,
};
diff --git a/docs/developer_portal/extensions/development.md
b/docs/developer_portal/extensions/development.md
index c574d370fa..5c4abf7a5f 100644
--- a/docs/developer_portal/extensions/development.md
+++ b/docs/developer_portal/extensions/development.md
@@ -130,10 +130,6 @@ export const getDatabases: () => Database[];
export const getTabs: () => Tab[];
-export const onDidChangeEditorContent: Event<string>;
-
-export const onDidClosePanel: Event<Panel>;
-
export const onDidChangeActivePanel: Event<Panel>;
export const onDidChangeTabTitle: Event<string>;
diff --git a/superset-frontend/packages/superset-core/src/api/environment.ts
b/superset-frontend/packages/superset-core/src/api/environment.ts
deleted file mode 100644
index 285fae46b1..0000000000
--- a/superset-frontend/packages/superset-core/src/api/environment.ts
+++ /dev/null
@@ -1,153 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * @fileoverview Environment API for Superset extensions.
- *
- * This module provides access to the execution environment, including system
- * clipboard operations, logging capabilities, internationalization features,
- * and environment variables. It allows extensions to interact with the host
- * system and platform in a controlled manner.
- */
-
-import { Event } from './core';
-
-/**
- * Interface for system clipboard operations.
- * Provides methods to read from and write to the system clipboard.
- */
-export interface Clipboard {
- /**
- * Read the current clipboard contents as text.
- *
- * @returns A promise that resolves to the clipboard text content.
- *
- * @example
- * ```typescript
- * const clipboardText = await clipboard.readText();
- * console.log('Clipboard contains:', clipboardText);
- * ```
- */
- readText(): Promise<string>;
-
- /**
- * Writes text into the clipboard, replacing any existing content.
- *
- * @param value The text to write to the clipboard.
- * @returns A promise that resolves when the write operation completes.
- *
- * @example
- * ```typescript
- * await clipboard.writeText('Hello, world!');
- * console.log('Text copied to clipboard');
- * ```
- */
- writeText(value: string): Promise<void>;
-}
-
-/**
- * Logging levels for controlling the verbosity of log output.
- * Higher numeric values indicate more restrictive logging levels.
- */
-export enum LogLevel {
- /**
- * No messages are logged with this level.
- * Use this to completely disable logging.
- */
- Off = 0,
-
- /**
- * All messages are logged with this level.
- * Most verbose logging level, includes all types of messages.
- */
- Trace = 1,
-
- /**
- * Messages with debug and higher log level are logged with this level.
- * Useful for development and troubleshooting.
- */
- Debug = 2,
-
- /**
- * Messages with info and higher log level are logged with this level.
- * General informational messages about application flow.
- */
- Info = 3,
-
- /**
- * Messages with warning and higher log level are logged with this level.
- * Indicates potential issues that don't prevent operation.
- */
- Warning = 4,
-
- /**
- * Only error messages are logged with this level.
- * Most restrictive level, shows only critical failures.
- */
- Error = 5,
-}
-
-/**
- * Represents the preferred user-language, like `de-CH`, `fr`, or `en-US`.
- */
-export declare const language: string;
-
-/**
- * The system clipboard.
- */
-export declare const clipboard: Clipboard;
-
-/**
- * The current log level of the editor.
- */
-export declare const logLevel: LogLevel;
-
-/**
- * An {@link Event} which fires when the log level of the editor changes.
- */
-export declare const onDidChangeLogLevel: Event<LogLevel>;
-
-/**
- * Opens an external URL in the default system browser or application.
- * This function provides a secure way to open external resources while
- * respecting user security preferences.
- *
- * @param target The URL to open externally.
- * @returns A promise that resolves to true if the URL was successfully
opened, false otherwise.
- *
- * @example
- * ```typescript
- * const success = await openExternal(new URL('https://superset.apache.org'));
- * if (success) {
- * console.log('URL opened successfully');
- * } else {
- * console.log('Failed to open URL');
- * }
- * ```
- */
-export declare function openExternal(target: URL): Promise<boolean>;
-
-/**
- * Gets an environment variable value.
- * @param name The name of the environment variable
- * @returns The value of the environment variable or undefined if not found
- */
-export declare function getEnvironmentVariable(
- name: string,
-): string | undefined;
diff --git a/superset-frontend/packages/superset-core/src/api/index.ts
b/superset-frontend/packages/superset-core/src/api/index.ts
index 1c47fe884b..a1964a1eb8 100644
--- a/superset-frontend/packages/superset-core/src/api/index.ts
+++ b/superset-frontend/packages/superset-core/src/api/index.ts
@@ -28,7 +28,6 @@
* - `commands`: Execute Superset commands and operations
* - `contributions`: Register UI contributions and customizations
* - `core`: Access fundamental Superset types and utilities
- * - `environment`: Interact with the execution environment
* - `extensions`: Manage extension lifecycle and metadata
* - `sqlLab`: Integrate with SQL Lab functionality
*/
@@ -37,6 +36,5 @@ export * as authentication from './authentication';
export * as commands from './commands';
export * as contributions from './contributions';
export * as core from './core';
-export * as environment from './environment';
export * as extensions from './extensions';
export * as sqlLab from './sqlLab';
diff --git a/superset-frontend/packages/superset-core/src/api/sqlLab.ts
b/superset-frontend/packages/superset-core/src/api/sqlLab.ts
index a1abe66b83..fb4984994d 100644
--- a/superset-frontend/packages/superset-core/src/api/sqlLab.ts
+++ b/superset-frontend/packages/superset-core/src/api/sqlLab.ts
@@ -254,19 +254,6 @@ export interface QueryResult {
*/
export declare const getCurrentTab: () => Tab | undefined;
-/**
- * Event fired when the content of the SQL editor changes.
- * Provides the new content as the event payload.
- *
- * @example
- * ```typescript
- * onDidChangeEditorContent.event((newContent) => {
- * console.log('Editor content changed:', newContent.length, 'characters');
- * });
- * ```
- */
-export declare const onDidChangeEditorContent: Event<string>;
-
/**
* Event fired when the database selection changes in the editor.
* Provides the new database ID as the event payload.
@@ -280,19 +267,6 @@ export declare const onDidChangeEditorContent:
Event<string>;
*/
export declare const onDidChangeEditorDatabase: Event<number>;
-/**
- * Event fired when the catalog selection changes in the editor.
- * Provides the new catalog name as the event payload.
- *
- * @example
- * ```typescript
- * onDidChangeEditorCatalog.event((catalog) => {
- * console.log('Catalog changed to:', catalog);
- * });
- * ```
- */
-export declare const onDidChangeEditorCatalog: Event<string>;
-
/**
* Event fired when the schema selection changes in the editor.
* Provides the new schema name as the event payload.
@@ -306,32 +280,6 @@ export declare const onDidChangeEditorCatalog:
Event<string>;
*/
export declare const onDidChangeEditorSchema: Event<string>;
-/**
- * Event fired when the table selection changes in the editor.
- * Provides the new table name as the event payload.
- *
- * @example
- * ```typescript
- * onDidChangeEditorTable.event((table) => {
- * console.log('Table changed to:', table);
- * });
- * ```
- */
-export declare const onDidChangeEditorTable: Event<string>;
-
-/**
- * Event fired when a panel is closed in the current tab.
- * Provides the closed panel object as the event payload.
- *
- * @example
- * ```typescript
- * onDidClosePanel.event((panel) => {
- * console.log('Panel closed:', panel.id);
- * });
- * ```
- */
-export declare const onDidClosePanel: Event<Panel>;
-
/**
* Event fired when the active panel changes in the current tab.
* Provides the newly active panel object as the event payload.
@@ -482,60 +430,3 @@ export declare const onDidCloseTab: Event<Tab>;
* ```
*/
export declare const onDidChangeActiveTab: Event<Tab>;
-
-/**
- * Event fired when the databases list is refreshed.
- * This can happen when new databases are added or existing ones are modified.
- *
- * @example
- * ```typescript
- * onDidRefreshDatabases.event(() => {
- * console.log('Databases refreshed, updating UI...');
- * const updatedDatabases = getDatabases();
- * // Update UI with new database list
- * });
- * ```
- */
-export declare const onDidRefreshDatabases: Event<void>;
-
-/**
- * Event fired when the catalogs list is refreshed for the current database.
- * This typically happens when switching databases or when catalog metadata is
updated.
- *
- * @example
- * ```typescript
- * onDidRefreshCatalogs.event(() => {
- * console.log('Catalogs refreshed');
- * // Update catalog dropdown or related UI
- * });
- * ```
- */
-export declare const onDidRefreshCatalogs: Event<void>;
-
-/**
- * Event fired when the schemas list is refreshed for the current
database/catalog.
- * This happens when switching databases/catalogs or when schema metadata is
updated.
- *
- * @example
- * ```typescript
- * onDidRefreshSchemas.event(() => {
- * console.log('Schemas refreshed');
- * // Update schema dropdown or related UI
- * });
- * ```
- */
-export declare const onDidRefreshSchemas: Event<void>;
-
-/**
- * Event fired when the tables list is refreshed for the current
database/catalog/schema.
- * This happens when switching schema contexts or when table metadata is
updated.
- *
- * @example
- * ```typescript
- * onDidRefreshTables.event(() => {
- * console.log('Tables refreshed');
- * // Update table browser or autocomplete suggestions
- * });
- * ```
- */
-export declare const onDidRefreshTables: Event<void>;
diff --git a/superset-frontend/src/core/authentication/index.ts
b/superset-frontend/src/core/authentication/index.ts
index 5b79f19773..db3b08b1ff 100644
--- a/superset-frontend/src/core/authentication/index.ts
+++ b/superset-frontend/src/core/authentication/index.ts
@@ -16,12 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-import type { authentication as authenticationType } from
'@apache-superset/core';
+import { authentication as authenticationApi } from '@apache-superset/core';
import { SupersetClient } from '@superset-ui/core';
-const getCSRFToken: typeof authenticationType.getCSRFToken = () =>
+const getCSRFToken: typeof authenticationApi.getCSRFToken = () =>
SupersetClient.getCSRFToken();
-export const authentication: typeof authenticationType = {
+export const authentication: typeof authenticationApi = {
getCSRFToken,
};
diff --git a/superset-frontend/src/core/commands/index.ts
b/superset-frontend/src/core/commands/index.ts
index ec48eb9f14..362218123b 100644
--- a/superset-frontend/src/core/commands/index.ts
+++ b/superset-frontend/src/core/commands/index.ts
@@ -17,12 +17,12 @@
* under the License.
*/
import { logging } from '@superset-ui/core';
-import type { commands as commandsType } from '@apache-superset/core';
+import { commands as commandsApi } from '@apache-superset/core';
import { Disposable } from '../models';
const commandRegistry: Map<string, (...args: any[]) => any> = new Map();
-const registerCommand: typeof commandsType.registerCommand = (
+const registerCommand: typeof commandsApi.registerCommand = (
command,
callback,
thisArg,
@@ -39,7 +39,7 @@ const registerCommand: typeof commandsType.registerCommand = (
});
};
-const executeCommand: typeof commandsType.executeCommand = async <T>(
+const executeCommand: typeof commandsApi.executeCommand = async <T>(
command: string,
...args: any[]
): Promise<T> => {
@@ -50,14 +50,14 @@ const executeCommand: typeof commandsType.executeCommand =
async <T>(
return callback(...args) as T;
};
-const getCommands: typeof commandsType.getCommands = filterInternal => {
+const getCommands: typeof commandsApi.getCommands = filterInternal => {
const commands = Array.from(commandRegistry.keys());
return Promise.resolve(
filterInternal ? commands.filter(cmd => !cmd.startsWith('_')) : commands,
);
};
-export const commands: typeof commandsType = {
+export const commands: typeof commandsApi = {
registerCommand,
executeCommand,
getCommands,
diff --git a/superset-frontend/src/core/environment/index.ts
b/superset-frontend/src/core/environment/index.ts
deleted file mode 100644
index 54aa758cff..0000000000
--- a/superset-frontend/src/core/environment/index.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import { environment as environmentType } from '@apache-superset/core';
-
-const { LogLevel } = environmentType;
-
-const clipboard: typeof environmentType.clipboard = {
- readText: async () => {
- throw new Error('Not implemented yet');
- },
- writeText: async () => {
- throw new Error('Not implemented yet');
- },
-};
-
-const language: typeof environmentType.language = navigator.language ||
'en-US';
-
-const logLevel: typeof environmentType.logLevel = LogLevel.Info;
-
-const onDidChangeLogLevel: typeof environmentType.onDidChangeLogLevel = () => {
- throw new Error('Not implemented yet');
-};
-
-const openExternal: typeof environmentType.openExternal = async () => {
- throw new Error('Not implemented yet');
-};
-
-const getEnvironmentVariable: typeof environmentType.getEnvironmentVariable =
- () => {
- throw new Error('Not implemented yet');
- };
-
-export const environment: typeof environmentType = {
- clipboard,
- language,
- logLevel,
- onDidChangeLogLevel,
- openExternal,
- getEnvironmentVariable,
- LogLevel,
-};
diff --git a/superset-frontend/src/core/extensions/index.ts
b/superset-frontend/src/core/extensions/index.ts
index 1b213bf793..cfaef49da1 100644
--- a/superset-frontend/src/core/extensions/index.ts
+++ b/superset-frontend/src/core/extensions/index.ts
@@ -16,17 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/
-import type { extensions as extensionsType } from '@apache-superset/core';
+import { extensions as extensionsApi } from '@apache-superset/core';
import ExtensionsManager from 'src/extensions/ExtensionsManager';
-const getExtension: typeof extensionsType.getExtension = id => {
- throw new Error('Not implemented yet');
-};
+const getExtension: typeof extensionsApi.getExtension = id =>
+ ExtensionsManager.getInstance().getExtension(id);
-const getAllExtensions: typeof extensionsType.getAllExtensions = () =>
+const getAllExtensions: typeof extensionsApi.getAllExtensions = () =>
ExtensionsManager.getInstance().getExtensions();
-export const extensions: typeof extensionsType = {
+export const extensions: typeof extensionsApi = {
getExtension,
getAllExtensions,
};
diff --git a/superset-frontend/src/core/index.ts
b/superset-frontend/src/core/index.ts
index 32080bd949..3e4d8b06f3 100644
--- a/superset-frontend/src/core/index.ts
+++ b/superset-frontend/src/core/index.ts
@@ -41,7 +41,6 @@ export const core: typeof coreType = {
export * from './authentication';
export * from './commands';
export * from './extensions';
-export * from './environment';
export * from './models';
export * from './sqlLab';
export * from './utils';
diff --git a/superset-frontend/src/core/sqlLab/index.ts
b/superset-frontend/src/core/sqlLab/index.ts
index dbadd95e45..c4c7ce92f2 100644
--- a/superset-frontend/src/core/sqlLab/index.ts
+++ b/superset-frontend/src/core/sqlLab/index.ts
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { sqlLab as sqlLabType } from '@apache-superset/core';
+import { sqlLab as sqlLabApi } from '@apache-superset/core';
import {
QUERY_FAILED,
QUERY_SUCCESS,
@@ -47,7 +47,7 @@ import {
QueryErrorResultContext,
} from './models';
-const { CTASMethod } = sqlLabType;
+const { CTASMethod } = sqlLabApi;
const getSqlLabState = () => {
const { sqlLab }: { sqlLab: SqlLabRootState['sqlLab'] } = store.getState();
@@ -101,10 +101,6 @@ const getTab = (id: string): Tab | undefined => {
return undefined;
};
-const notImplemented = (): never => {
- throw new Error('Not implemented yet');
-};
-
function extractBaseData(action: any): {
baseParams: [string, Tab, boolean, number];
options: {
@@ -216,17 +212,17 @@ function createQueryErrorContext(
);
}
-const getCurrentTab: typeof sqlLabType.getCurrentTab = () =>
+const getCurrentTab: typeof sqlLabApi.getCurrentTab = () =>
getTab(activeEditorId());
-const getTabs: typeof sqlLabType.getTabs = () => {
+const getTabs: typeof sqlLabApi.getTabs = () => {
const { queryEditors } = getSqlLabState();
return queryEditors
.map(qe => getTab(qe.id))
.filter((tab): tab is Tab => tab !== undefined);
};
-const getDatabases: typeof sqlLabType.getDatabases = () => {
+const getDatabases: typeof sqlLabApi.getDatabases = () => {
const { databases } = getSqlLabState();
return Object.values(databases).map(
db => new Database(db.id, db.database_name, [], []),
@@ -274,8 +270,8 @@ const globalPredicate =
action =>
action.type === actionType;
-const onDidQueryRun: typeof sqlLabType.onDidQueryRun = (
- listener: (queryContext: sqlLabType.QueryContext) => void,
+const onDidQueryRun: typeof sqlLabApi.onDidQueryRun = (
+ listener: (queryContext: sqlLabApi.QueryContext) => void,
thisArgs?: any,
): Disposable =>
createActionListener(
@@ -285,8 +281,8 @@ const onDidQueryRun: typeof sqlLabType.onDidQueryRun = (
thisArgs,
);
-const onDidQuerySuccess: typeof sqlLabType.onDidQuerySuccess = (
- listener: (queryResultContext: sqlLabType.QueryResultContext) => void,
+const onDidQuerySuccess: typeof sqlLabApi.onDidQuerySuccess = (
+ listener: (queryResultContext: sqlLabApi.QueryResultContext) => void,
thisArgs?: any,
): Disposable =>
createActionListener(
@@ -297,8 +293,8 @@ const onDidQuerySuccess: typeof
sqlLabType.onDidQuerySuccess = (
thisArgs,
);
-const onDidQueryStop: typeof sqlLabType.onDidQueryStop = (
- listener: (queryContext: sqlLabType.QueryContext) => void,
+const onDidQueryStop: typeof sqlLabApi.onDidQueryStop = (
+ listener: (queryContext: sqlLabApi.QueryContext) => void,
thisArgs?: any,
): Disposable =>
createActionListener(
@@ -308,9 +304,9 @@ const onDidQueryStop: typeof sqlLabType.onDidQueryStop = (
thisArgs,
);
-const onDidQueryFail: typeof sqlLabType.onDidQueryFail = (
+const onDidQueryFail: typeof sqlLabApi.onDidQueryFail = (
listener: (
- queryErrorResultContext: sqlLabType.QueryErrorResultContext,
+ queryErrorResultContext: sqlLabApi.QueryErrorResultContext,
) => void,
thisArgs?: any,
): Disposable =>
@@ -322,7 +318,7 @@ const onDidQueryFail: typeof sqlLabType.onDidQueryFail = (
thisArgs,
);
-const onDidChangeEditorDatabase: typeof sqlLabType.onDidChangeEditorDatabase =
(
+const onDidChangeEditorDatabase: typeof sqlLabApi.onDidChangeEditorDatabase = (
listener: (e: number) => void,
thisArgs?: any,
): Disposable =>
@@ -334,8 +330,8 @@ const onDidChangeEditorDatabase: typeof
sqlLabType.onDidChangeEditorDatabase = (
thisArgs,
);
-const onDidCloseTab: typeof sqlLabType.onDidCloseTab = (
- listener: (tab: sqlLabType.Tab) => void,
+const onDidCloseTab: typeof sqlLabApi.onDidCloseTab = (
+ listener: (tab: sqlLabApi.Tab) => void,
thisArgs?: any,
): Disposable =>
createActionListener(
@@ -346,8 +342,8 @@ const onDidCloseTab: typeof sqlLabType.onDidCloseTab = (
thisArgs,
);
-const onDidChangeActiveTab: typeof sqlLabType.onDidChangeActiveTab = (
- listener: (tab: sqlLabType.Tab) => void,
+const onDidChangeActiveTab: typeof sqlLabApi.onDidChangeActiveTab = (
+ listener: (tab: sqlLabApi.Tab) => void,
thisArgs?: any,
): Disposable =>
createActionListener(
@@ -358,7 +354,7 @@ const onDidChangeActiveTab: typeof
sqlLabType.onDidChangeActiveTab = (
thisArgs,
);
-const onDidChangeEditorSchema: typeof sqlLabType.onDidChangeEditorSchema = (
+const onDidChangeEditorSchema: typeof sqlLabApi.onDidChangeEditorSchema = (
listener: (schema: string) => void,
thisArgs?: any,
): Disposable =>
@@ -369,8 +365,8 @@ const onDidChangeEditorSchema: typeof
sqlLabType.onDidChangeEditorSchema = (
thisArgs,
);
-const onDidChangeActivePanel: typeof sqlLabType.onDidChangeActivePanel = (
- listener: (panel: sqlLabType.Panel) => void,
+const onDidChangeActivePanel: typeof sqlLabApi.onDidChangeActivePanel = (
+ listener: (panel: sqlLabApi.Panel) => void,
thisArgs?: any,
): Disposable =>
createActionListener(
@@ -380,7 +376,7 @@ const onDidChangeActivePanel: typeof
sqlLabType.onDidChangeActivePanel = (
thisArgs,
);
-const onDidChangeTabTitle: typeof sqlLabType.onDidChangeTabTitle = (
+const onDidChangeTabTitle: typeof sqlLabApi.onDidChangeTabTitle = (
listener: (title: string) => void,
thisArgs?: any,
): Disposable =>
@@ -391,31 +387,11 @@ const onDidChangeTabTitle: typeof
sqlLabType.onDidChangeTabTitle = (
thisArgs,
);
-// Not implemented yet
-const onDidChangeEditorContent: typeof sqlLabType.onDidChangeEditorContent =
- notImplemented;
-const onDidChangeEditorCatalog: typeof sqlLabType.onDidChangeEditorCatalog =
- notImplemented;
-const onDidChangeEditorTable: typeof sqlLabType.onDidChangeEditorTable =
- notImplemented;
-const onDidClosePanel: typeof sqlLabType.onDidClosePanel = notImplemented;
-const onDidRefreshDatabases: typeof sqlLabType.onDidRefreshDatabases =
- notImplemented;
-const onDidRefreshCatalogs: typeof sqlLabType.onDidRefreshCatalogs =
- notImplemented;
-const onDidRefreshSchemas: typeof sqlLabType.onDidRefreshSchemas =
- notImplemented;
-const onDidRefreshTables: typeof sqlLabType.onDidRefreshTables =
notImplemented;
-
-export const sqlLab: typeof sqlLabType = {
+export const sqlLab: typeof sqlLabApi = {
CTASMethod,
getCurrentTab,
- onDidChangeEditorContent,
onDidChangeEditorDatabase,
- onDidChangeEditorCatalog,
onDidChangeEditorSchema,
- onDidChangeEditorTable,
- onDidClosePanel,
onDidChangeActivePanel,
onDidChangeTabTitle,
onDidQueryRun,
@@ -426,10 +402,6 @@ export const sqlLab: typeof sqlLabType = {
getTabs,
onDidCloseTab,
onDidChangeActiveTab,
- onDidRefreshDatabases,
- onDidRefreshCatalogs,
- onDidRefreshSchemas,
- onDidRefreshTables,
};
// Export all models
diff --git a/superset-frontend/src/extensions/ExtensionsStartup.test.tsx
b/superset-frontend/src/extensions/ExtensionsStartup.test.tsx
index d1af44098f..93ae47727b 100644
--- a/superset-frontend/src/extensions/ExtensionsStartup.test.tsx
+++ b/superset-frontend/src/extensions/ExtensionsStartup.test.tsx
@@ -97,7 +97,6 @@ test('sets up global superset object when user is logged in',
async () => {
expect((window as any).superset.authentication).toBeDefined();
expect((window as any).superset.core).toBeDefined();
expect((window as any).superset.commands).toBeDefined();
- expect((window as any).superset.environment).toBeDefined();
expect((window as any).superset.extensions).toBeDefined();
expect((window as any).superset.sqlLab).toBeDefined();
});
diff --git a/superset-frontend/src/extensions/ExtensionsStartup.tsx
b/superset-frontend/src/extensions/ExtensionsStartup.tsx
index 41bb842a89..05c5a38811 100644
--- a/superset-frontend/src/extensions/ExtensionsStartup.tsx
+++ b/superset-frontend/src/extensions/ExtensionsStartup.tsx
@@ -20,14 +20,7 @@ import { useEffect, useState } from 'react';
// eslint-disable-next-line no-restricted-syntax
import * as supersetCore from '@apache-superset/core';
import { FeatureFlag, isFeatureEnabled, logging } from '@superset-ui/core';
-import {
- authentication,
- core,
- commands,
- environment,
- extensions,
- sqlLab,
-} from 'src/core';
+import { authentication, core, commands, extensions, sqlLab } from 'src/core';
import { useSelector } from 'react-redux';
import { RootState } from 'src/views/store';
import { useExtensionsContext } from './ExtensionsContext';
@@ -39,7 +32,6 @@ declare global {
authentication: typeof authentication;
core: typeof core;
commands: typeof commands;
- environment: typeof environment;
extensions: typeof extensions;
sqlLab: typeof sqlLab;
};
@@ -69,7 +61,6 @@ const ExtensionsStartup = () => {
authentication,
core,
commands,
- environment,
extensions,
sqlLab,
};