diff --git a/RESOURCES/INTHEWILD.yaml b/RESOURCES/INTHEWILD.yaml index 42231566c4f..d84ae68c49d 100644 --- a/RESOURCES/INTHEWILD.yaml +++ b/RESOURCES/INTHEWILD.yaml @@ -625,6 +625,9 @@ categories: - name: Stockarea url: https://stockarea.io + - name: VTG + url: https://www.vtg.de + Sports: - name: Club 25 de Agosto (Femenino / Women's Team) url: https://www.instagram.com/25deagosto.basketfemenino/ diff --git a/docs/.nvmrc b/docs/.nvmrc index 953490f51f6..42a1c98ac5a 100644 --- a/docs/.nvmrc +++ b/docs/.nvmrc @@ -1 +1 @@ -v20.20.0 +v22.22.0 diff --git a/docs/admin_docs/configuration/alerts-reports.mdx b/docs/admin_docs/configuration/alerts-reports.mdx index 8364b8e50ae..b66f641e290 100644 --- a/docs/admin_docs/configuration/alerts-reports.mdx +++ b/docs/admin_docs/configuration/alerts-reports.mdx @@ -233,6 +233,20 @@ def alert_dynamic_minimal_interval(**kwargs) -> int: ALERT_MINIMUM_INTERVAL = alert_dynamic_minimal_interval ``` +## External Link Redirection + +For security, Superset rewrites external links in alert/report email HTML so +they go through a warning page before the user is navigated to the external +site. Internal links (matching your configured base URL) are not affected. + +```python +# Disable external link redirection entirely (default: True) +ALERT_REPORTS_ENABLE_LINK_REDIRECT = False +``` + +The feature uses `WEBDRIVER_BASEURL_USER_FRIENDLY` (or `WEBDRIVER_BASEURL`) +to determine which hosts are internal. + ## Troubleshooting There are many reasons that reports might not be working. Try these steps to check for specific issues. diff --git a/docs/developer_docs/extensions/architecture.md b/docs/developer_docs/extensions/architecture.md index 568f8feff47..2dd642fd997 100644 --- a/docs/developer_docs/extensions/architecture.md +++ b/docs/developer_docs/extensions/architecture.md @@ -33,13 +33,15 @@ The extension architecture is built on six core principles that guide all techni ### 1. Lean Core Superset's core should remain minimal, with many features delegated to extensions. Built-in features use the same APIs and extension mechanisms available to external developers. This approach: + - Reduces maintenance burden and complexity - Encourages modularity - Allows the community to innovate independently of the main codebase ### 2. Explicit Contribution Points -All extension points are clearly defined and documented. Extension authors know exactly where and how they can interact with the host system. Backend contributions are declared in `extension.json`. Frontend contributions are registered directly in code at module load time, giving the host clear visibility into what each extension provides: +All extension points are clearly defined and documented. Extension authors know exactly where and how they can interact with the host system. Both backend and frontend contributions are registered directly in code — backend contributions via classes decorated with `@api` (and other decorators) imported from the auto-discovered entrypoint, frontend contributions via calls like `views.registerView` and `commands.registerCommand` executed at module load time in `index.tsx`. This gives the host clear visibility into what each extension provides: + - Manage the extension lifecycle - Provide a consistent user experience - Validate extension compatibility @@ -47,6 +49,7 @@ All extension points are clearly defined and documented. Extension authors know ### 3. Versioned and Stable APIs Public interfaces for extensions follow semantic versioning, allowing for: + - Safe evolution of the platform - Backward compatibility - Clear upgrade paths for extension authors @@ -54,6 +57,7 @@ Public interfaces for extensions follow semantic versioning, allowing for: ### 4. Lazy Loading and Activation Extensions are loaded and activated only when needed, which: + - Minimizes performance overhead - Reduces resource consumption - Improves startup time @@ -61,6 +65,7 @@ Extensions are loaded and activated only when needed, which: ### 5. Composability and Reuse The architecture encourages reusing extension points and patterns across different modules, promoting: + - Consistency across extensions - Reduced duplication - Shared best practices @@ -80,6 +85,7 @@ Two core packages provide the foundation for extension development: **Frontend: `@apache-superset/core`** This package provides essential building blocks for frontend extensions and the host application: + - Shared UI components - Utility functions - APIs and hooks @@ -90,6 +96,7 @@ By centralizing these resources, both extensions and built-in features use the s **Backend: `apache-superset-core`** This package exposes key classes and APIs for backend extensions: + - Database connectors - API extensions - Security manager customization @@ -102,6 +109,7 @@ It includes dependencies on critical libraries like Flask-AppBuilder and SQLAlch **`apache-superset-extensions-cli`** The CLI provides comprehensive commands for extension development: + - Project scaffolding - Code generation - Building and bundling @@ -114,6 +122,7 @@ By standardizing these processes, the CLI ensures extensions are built consisten The Superset host application serves as the runtime environment for extensions: **Extension Management** + - Exposes `/api/v1/extensions` endpoint for registration and management - Provides a dedicated UI for managing extensions - Stores extension metadata in the `extensions` database table @@ -121,6 +130,7 @@ The Superset host application serves as the runtime environment for extensions: **Extension Storage** The extensions table contains: + - Extension name, version, and author - Metadata and configuration - Built frontend and/or backend code @@ -132,6 +142,7 @@ The following diagram illustrates how these components work together: Extension System Architecture The diagram shows: + 1. **Extension projects** depend on core packages for development 2. **Core packages** provide APIs and type definitions 3. **The host application** implements the APIs and manages extensions @@ -151,23 +162,25 @@ The architecture leverages Webpack's Module Federation to enable dynamic loading Extensions configure Webpack to expose their entry points: -``` typescript -new ModuleFederationPlugin({ - name: 'my_extension', - filename: 'remoteEntry.[contenthash].js', - exposes: { - './index': './src/index.tsx', - }, - externalsType: 'window', - externals: { - '@apache-superset/core': 'superset', - }, - shared: { - react: { singleton: true }, - 'react-dom': { singleton: true }, - 'antd-v5': { singleton: true } - } -}) +```javascript +externalsType: 'window', +externals: { + '@apache-superset/core': 'superset', +}, +plugins: [ + new ModuleFederationPlugin({ + name: 'my_extension', + filename: 'remoteEntry.[contenthash].js', + exposes: { + './index': './src/index.tsx', + }, + shared: { + react: { singleton: true, import: false }, + 'react-dom': { singleton: true, import: false }, + antd: { singleton: true, import: false }, + }, + }), +] ``` This configuration does several important things: @@ -195,24 +208,12 @@ Here's what happens at runtime: On the Superset side, the APIs are mapped to `window.superset` during application bootstrap: -``` typescript +```typescript import * as supersetCore from '@apache-superset/core'; -import { - authentication, - core, - commands, - extensions, - sqlLab, -} from 'src/extensions'; export default function setupExtensionsAPI() { window.superset = { ...supersetCore, - authentication, - core, - commands, - extensions, - sqlLab, }; } ``` diff --git a/docs/developer_docs/extensions/components/alert.mdx b/docs/developer_docs/extensions/components/alert.mdx index f83234a01b5..8c42c821160 100644 --- a/docs/developer_docs/extensions/components/alert.mdx +++ b/docs/developer_docs/extensions/components/alert.mdx @@ -23,7 +23,7 @@ sidebar_label: Alert --> import { StoryWithControls } from '../../../src/components/StorybookWrapper'; -import { Alert } from '@apache-superset/core/ui'; +import { Alert } from '@apache-superset/core/components'; # Alert @@ -105,10 +105,10 @@ function Demo() { ## Usage in Extensions -This component is available in the `@apache-superset/core/ui` package, which is automatically available to Superset extensions. +This component is available in the `@apache-superset/core/components` package, which is automatically available to Superset extensions. ```tsx -import { Alert } from '@apache-superset/core/ui'; +import { Alert } from '@apache-superset/core/components'; function MyExtension() { return ( diff --git a/docs/developer_docs/extensions/components/index.mdx b/docs/developer_docs/extensions/components/index.mdx index e40b4126f7f..d4b4eaa5921 100644 --- a/docs/developer_docs/extensions/components/index.mdx +++ b/docs/developer_docs/extensions/components/index.mdx @@ -25,7 +25,7 @@ sidebar_position: 1 # Extension Components -These UI components are available to Superset extension developers through the `@apache-superset/core/ui` package. They provide a consistent look and feel with the rest of Superset and are designed to be used in extension panels, views, and other UI elements. +These UI components are available to Superset extension developers through the `@apache-superset/core/components` package. They provide a consistent look and feel with the rest of Superset and are designed to be used in extension panels, views, and other UI elements. ## Available Components @@ -33,10 +33,10 @@ These UI components are available to Superset extension developers through the ` ## Usage -All components are exported from the `@apache-superset/core/ui` package: +All components are exported from the `@apache-superset/core/components` package: ```tsx -import { Alert } from '@apache-superset/core/ui'; +import { Alert } from '@apache-superset/core/components'; export function MyExtensionPanel() { return ( @@ -49,7 +49,7 @@ export function MyExtensionPanel() { ## Adding New Components -Components in `@apache-superset/core/ui` are automatically documented here. To add a new extension component: +Components in `@apache-superset/core/components` are automatically documented here. To add a new extension component: 1. Add the component to `superset-frontend/packages/superset-core/src/ui/components/` 2. Export it from `superset-frontend/packages/superset-core/src/ui/components/index.ts` diff --git a/docs/developer_docs/extensions/contribution-types.md b/docs/developer_docs/extensions/contribution-types.md index 945e288b932..6fa8bf7f9a5 100644 --- a/docs/developer_docs/extensions/contribution-types.md +++ b/docs/developer_docs/extensions/contribution-types.md @@ -28,7 +28,7 @@ To facilitate the development of extensions, we define a set of well-defined con ## Frontend -Frontend contribution types allow extensions to extend Superset's user interface with new views, commands, and menu items. Frontend contributions are registered directly in code from your extension's `index.tsx` entry point — they do not need to be declared in `extension.json`. +Frontend contribution types allow extensions to extend Superset's user interface with new views, commands, and menu items. Frontend contributions are registered directly in code from your extension's `index.tsx` entry point. ### Views @@ -68,25 +68,28 @@ commands.registerCommand( ### Menus -Extensions can contribute new menu items or context menus to the host application, providing users with additional actions and options. Each menu item specifies the target area, the command to execute, and its placement (primary, secondary, or context). Menu contribution areas are uniquely identified (e.g., `sqllab.editor` for the SQL Lab editor). +Extensions can contribute new menu items or context menus to the host application, providing users with additional actions and options. Each menu item specifies the view and command to execute, the target area, and the location (`primary`, `secondary`, or `context`). Menu contribution areas are uniquely identified (e.g., `sqllab.editor` for the SQL Lab editor). ```typescript import { menus } from '@apache-superset/core'; -menus.addMenuItem('sqllab.editor', { - placement: 'primary', - command: 'my-extension.copy-query', -}); +menus.registerMenuItem( + { view: 'sqllab.editor', command: 'my-extension.copy-query' }, + 'sqllab.editor', + 'primary', +); -menus.addMenuItem('sqllab.editor', { - placement: 'secondary', - command: 'my-extension.prettify', -}); +menus.registerMenuItem( + { view: 'sqllab.editor', command: 'my-extension.prettify' }, + 'sqllab.editor', + 'secondary', +); -menus.addMenuItem('sqllab.editor', { - placement: 'context', - command: 'my-extension.clear', -}); +menus.registerMenuItem( + { view: 'sqllab.editor', command: 'my-extension.clear' }, + 'sqllab.editor', + 'context', +); ``` ### Editors @@ -111,24 +114,31 @@ See [Editors Extension Point](./extension-points/editors) for implementation det ## Backend -Backend contribution types allow extensions to extend Superset's server-side capabilities with new API endpoints, MCP tools, and MCP prompts. +Backend contribution types allow extensions to extend Superset's server-side capabilities. Backend contributions are registered at startup via classes and functions imported from the auto-discovered `entrypoint.py` file. ### REST API Endpoints Extensions can register custom REST API endpoints under the `/extensions/` namespace. This dedicated namespace prevents conflicts with built-in endpoints and provides a clear separation between core and extension functionality. ```python -from superset_core.api.rest_api import RestApi, api -from flask_appbuilder.api import expose, protect +from flask import Response +from flask_appbuilder.api import expose, permission_name, protect, safe +from superset_core.rest_api.api import RestApi +from superset_core.rest_api.decorators import api @api( id="my_extension_api", name="My Extension API", - description="Custom API endpoints for my extension" + description="Custom API endpoints for my extension", ) class MyExtensionAPI(RestApi): + openapi_spec_tag = "My Extension" + class_permission_name = "my_extension_api" + @expose("/hello", methods=("GET",)) @protect() + @safe + @permission_name("read") def hello(self) -> Response: return self.response(200, result={"message": "Hello from extension!"}) @@ -136,7 +146,7 @@ class MyExtensionAPI(RestApi): from .api import MyExtensionAPI ``` -**Note**: The [`@api`](superset-core/src/superset_core/api/rest_api.py:59) decorator automatically detects context and generates appropriate paths: +**Note**: The [`@api`](superset-core/src/superset_core/rest_api/decorators.py) decorator automatically detects context and generates appropriate paths: - **Extension context**: `/extensions/{publisher}/{name}/` with ID prefixed as `extensions.{publisher}.{name}.{id}` - **Host context**: `/api/v1/` with original ID @@ -152,16 +162,65 @@ You can also specify a `resource_name` parameter to add an additional path segme @api( id="analytics_api", name="Analytics API", - resource_name="analytics" # Adds /analytics to the path + resource_name="analytics", # Adds /analytics to the path ) class AnalyticsAPI(RestApi): + @expose("/insights", methods=("GET",)) - def insights(self): + @protect() + @safe + @permission_name("read") + def insights(self) -> Response: # This endpoint will be available at: # /extensions/my-org/dataset-tools/analytics/insights return self.response(200, result={"insights": []}) ``` -### MCP Tools and Prompts +### MCP Tools -Extensions can contribute Model Context Protocol (MCP) tools and prompts that AI agents can discover and use. See [MCP Integration](./mcp) for detailed documentation. +Extensions can register Python functions as MCP tools that AI agents can discover and call. Tools provide executable functionality such as data processing, custom analytics, or integration with external services. Each tool specifies a unique name and an optional description that helps AI agents decide when to use it. + +```python +from superset_core.mcp.decorators import tool + +@tool( + name="my-extension.get_summary", + description="Get a summary of recent query activity", + tags=["analytics", "queries"], +) +def get_summary() -> dict: + """Returns a summary of recent query activity.""" + return {"status": "success", "result": {"queries_today": 42}} +``` + +See [MCP Integration](./mcp) for implementation details. + +### MCP Prompts + +Extensions can register MCP prompts that provide interactive guidance and context to AI agents. Prompts help agents understand domain-specific workflows, best practices, or troubleshooting steps for your extension's use cases. + +```python +from superset_core.mcp.decorators import prompt +from fastmcp import Context + +@prompt( + "my-extension.analysis_guide", + title="Analysis Guide", + description="Step-by-step guidance for data analysis workflows", +) +async def analysis_guide(ctx: Context) -> str: + """Provides guidance for data analysis workflows.""" + return """ + # Data Analysis Guide + + Follow these steps for effective analysis: + + 1. **Explore your data** - Review available datasets and schema + 2. **Build your query** - Use SQL Lab to craft and test queries + 3. **Visualize results** - Choose the right chart type for your data + + What would you like to analyze today? + """ +``` + +See [MCP Integration](./mcp) for implementation details. diff --git a/docs/developer_docs/extensions/dependencies.md b/docs/developer_docs/extensions/dependencies.md index 6b3eb2e4a46..8fb9e61e988 100644 --- a/docs/developer_docs/extensions/dependencies.md +++ b/docs/developer_docs/extensions/dependencies.md @@ -70,8 +70,8 @@ import { someInternalFunction } from 'src/explore/components/SomeComponent'; ```python # ✅ Public API - stable -from superset_core.api.models import Database -from superset_core.api.daos import DatabaseDAO +from superset_core.common.models import Database +from superset_core.common.daos import DatabaseDAO # ❌ Internal code - may break without notice from superset.views.core import SomeInternalClass @@ -117,7 +117,7 @@ Extension developers should depend on and use core libraries directly: **Frontend (examples):** - [React](https://react.dev/) - UI framework -- [Ant Design](https://ant.design/) - UI component library (prefer Superset components from `@apache-superset/core/ui` when available to preserve visual consistency) +- [Ant Design](https://ant.design/) - UI component library (prefer Superset components from `@apache-superset/core/components` when available to preserve visual consistency) - [Emotion](https://emotion.sh/) - CSS-in-JS styling - ... diff --git a/docs/developer_docs/extensions/development.md b/docs/developer_docs/extensions/development.md index c6baa635986..cd38f1e47d2 100644 --- a/docs/developer_docs/extensions/development.md +++ b/docs/developer_docs/extensions/development.md @@ -38,12 +38,14 @@ superset-extensions build: Builds extension assets. superset-extensions bundle: Packages the extension into a .supx file. superset-extensions dev: Automatically rebuilds the extension as files change. + +superset-extensions validate: Validates the extension structure and metadata. ``` When creating a new extension with `superset-extensions init`, the CLI generates a standardized folder structure: ``` -dataset-references/ +my-org.dataset-references/ ├── extension.json ├── frontend/ │ ├── src/ @@ -52,9 +54,10 @@ dataset-references/ │ └── package.json ├── backend/ │ ├── src/ -│ │ └── superset_extensions/ +│ │ └── my_org/ │ │ └── dataset_references/ -│ ├── tests/ +│ │ ├── api.py +│ │ └── entrypoint.py │ ├── pyproject.toml │ └── requirements.txt ├── dist/ @@ -64,20 +67,20 @@ dataset-references/ │ │ ├── remoteEntry.d7a9225d042e4ccb6354.js │ │ └── 900.038b20cdff6d49cfa8d9.js │ └── backend -│ └── superset_extensions/ +│ └── my_org/ │ └── dataset_references/ -│ ├── __init__.py │ ├── api.py │ └── entrypoint.py -├── dataset-references-1.0.0.supx +├── my-org.dataset-references-1.0.0.supx └── README.md ``` -**Note**: The extension ID (`dataset-references`) serves as the basis for all technical names: -- Directory name: `dataset-references` (kebab-case) -- Backend Python package: `dataset_references` (snake_case) -- Frontend package name: `dataset-references` (kebab-case) -- Module Federation name: `datasetReferences` (camelCase) +**Note**: With publisher `my-org` and name `dataset-references`, the technical names are: +- Directory name: `my-org.dataset-references` (kebab-case) +- Backend Python namespace: `my_org.dataset_references` +- Backend distribution package: `my_org-dataset_references` +- Frontend package name: `@my-org/dataset-references` (scoped) +- Module Federation name: `myOrg_datasetReferences` (camelCase) The `extension.json` file serves as the declared metadata for the extension, containing the extension's name, version, author, description, and a list of capabilities. This file is essential for the host application to understand how to load and manage the extension. @@ -108,7 +111,7 @@ The `extension.json` file contains the metadata necessary for the host applicati Extensions use standardized entry point locations: -- **Backend**: `backend/src/superset_extensions/{publisher}/{name}/entrypoint.py` +- **Backend**: `backend/src/{publisher}/{name}/entrypoint.py` - **Frontend**: `frontend/src/index.tsx` ### Build Configuration @@ -124,7 +127,7 @@ license = "Apache-2.0" [tool.apache_superset_extensions.build] # Files to include in the extension build/bundle include = [ - "src/superset_extensions/my_org/dataset_references/**/*.py", + "src/my_org/dataset_references/**/*.py", ] exclude = [] ``` @@ -201,9 +204,10 @@ Backend APIs (via `apache-superset-core`) follow a similar pattern, providing ac Extension endpoints are registered under a dedicated `/extensions` namespace to avoid conflicting with built-in endpoints and also because they don't share the same version constraints. By grouping all extension endpoints under `/extensions`, Superset establishes a clear boundary between core and extension functionality, making it easier to manage, document, and secure both types of APIs. ```python -from superset_core.api.models import Database, get_session -from superset_core.api.daos import DatabaseDAO -from superset_core.api.rest_api import RestApi, api +from superset_core.common.models import Database, get_session +from superset_core.common.daos import DatabaseDAO +from superset_core.rest_api.api import RestApi +from superset_core.rest_api.decorators import api from flask_appbuilder.api import expose, protect @api( @@ -244,7 +248,7 @@ class DatasetReferencesAPI(RestApi): ### Automatic Context Detection -The [`@api`](superset-core/src/superset_core/api/rest_api.py:59) decorator automatically detects whether it's being used in host or extension code: +The [`@api`](superset-core/src/superset_core/rest_api/decorators.py) decorator automatically detects whether it's being used in host or extension code: - **Extension APIs**: Registered under `/extensions/{publisher}/{name}/` with IDs prefixed as `extensions.{publisher}.{name}.{id}` - **Host APIs**: Registered under `/api/v1/` with original IDs @@ -262,7 +266,7 @@ LOCAL_EXTENSIONS = [ ] ``` -This instructs Superset to load and serve extensions directly from disk, so you can iterate quickly. Running `superset-extensions dev` watches for file changes and rebuilds assets automatically, while the Webpack development server (started separately with `npm run dev-server`) serves updated files as soon as they're modified. This enables immediate feedback for React components, styles, and other frontend code. Changes to backend files are also detected automatically and immediately synced, ensuring that both frontend and backend updates are reflected in your development environment. +This instructs Superset to load and serve extensions directly from disk, so you can iterate quickly. Running `superset-extensions dev` watches for file changes and rebuilds assets automatically, while the Webpack development server (started separately with `npm run start`) serves updated files as soon as they're modified. This enables immediate feedback for React components, styles, and other frontend code. Changes to backend files are also detected automatically and immediately synced, ensuring that both frontend and backend updates are reflected in your development environment. Example output when running in development mode: diff --git a/docs/developer_docs/extensions/extension-points/editors.md b/docs/developer_docs/extensions/extension-points/editors.md index 001ca149300..7eec293d8bd 100644 --- a/docs/developer_docs/extensions/extension-points/editors.md +++ b/docs/developer_docs/extensions/extension-points/editors.md @@ -37,31 +37,11 @@ Superset uses text editors in various places throughout the application: | `css` | Dashboard Properties, CSS Template Modal | | `markdown` | Dashboard Markdown component | | `yaml` | Template Params Editor | +| `javascript` | Custom JavaScript editor contexts | +| `python` | Custom Python editor contexts | +| `text` | Plain text editor contexts | -By registering an editor provider for a language, your extension replaces the default Ace editor in **all** locations that use that language. - -## Manifest Configuration - -Declare editor contributions in your `extension.json` manifest: - -```json -{ - "name": "monaco-editor", - "version": "1.0.0", - "frontend": { - "contributions": { - "editors": [ - { - "id": "monaco-editor.sql", - "name": "Monaco SQL Editor", - "languages": ["sql"], - "description": "Monaco-based SQL editor with IntelliSense" - } - ] - } - } -} -``` +By registering an editor for a language, your extension replaces the default Ace editor in **all** locations that use that language. ## Implementing an Editor @@ -165,21 +145,22 @@ const MonacoSQLEditor = forwardRef( export default MonacoSQLEditor; ``` -### activate.ts +### index.tsx + +Register the editor at module load time from your extension's entry point: ```typescript import { editors } from '@apache-superset/core'; import MonacoSQLEditor from './MonacoSQLEditor'; -export function activate(context) { - // Register the Monaco editor for SQL using the contribution ID from extension.json - const disposable = editors.registerEditorProvider( - 'monaco-sql-editor.sql', - MonacoSQLEditor, - ); - - context.subscriptions.push(disposable); -} +editors.registerEditor( + { + id: 'my-extension.monaco-sql', + name: 'Monaco SQL Editor', + languages: ['sql'], + }, + MonacoSQLEditor, +); ``` ## Handling Hotkeys diff --git a/docs/developer_docs/extensions/extension-points/sqllab.md b/docs/developer_docs/extensions/extension-points/sqllab.md index bc9db014914..fd31f7b22b6 100644 --- a/docs/developer_docs/extensions/extension-points/sqllab.md +++ b/docs/developer_docs/extensions/extension-points/sqllab.md @@ -86,132 +86,73 @@ Extensions can replace the default SQL editor with custom implementations (Monac This example adds a "Data Profiler" panel to SQL Lab: -```json -{ - "name": "data_profiler", - "version": "1.0.0", - "frontend": { - "contributions": { - "views": { - "sqllab": { - "panels": [ - { - "id": "data_profiler.main", - "name": "Data Profiler" - } - ] - } - } - } - } -} -``` - ```typescript -import { core } from '@apache-superset/core'; +import React from 'react'; +import { views } from '@apache-superset/core'; import DataProfilerPanel from './DataProfilerPanel'; -export function activate(context) { - // Register the panel view with the ID declared in extension.json - const disposable = core.registerView('data_profiler.main', ); - context.subscriptions.push(disposable); -} +views.registerView( + { id: 'my-extension.data-profiler', name: 'Data Profiler' }, + 'sqllab.panels', + () => , +); ``` ### Adding Actions to the Editor This example adds primary, secondary, and context actions to the editor: -```json -{ - "name": "query_tools", - "version": "1.0.0", - "frontend": { - "contributions": { - "commands": [ - { - "command": "query_tools.format", - "title": "Format Query", - "icon": "FormatPainterOutlined" - }, - { - "command": "query_tools.explain", - "title": "Explain Query" - }, - { - "command": "query_tools.copy_as_cte", - "title": "Copy as CTE" - } - ], - "menus": { - "sqllab": { - "editor": { - "primary": [ - { - "view": "builtin.editor", - "command": "query_tools.format" - } - ], - "secondary": [ - { - "view": "builtin.editor", - "command": "query_tools.explain" - } - ], - "context": [ - { - "view": "builtin.editor", - "command": "query_tools.copy_as_cte" - } - ] - } - } - } - } - } -} -``` - ```typescript -import { commands, sqlLab } from '@apache-superset/core'; +import { commands, menus, sqlLab } from '@apache-superset/core'; -export function activate(context) { - // Register the commands declared in extension.json - const formatCommand = commands.registerCommand( - 'query_tools.format', - async () => { - const tab = sqlLab.getCurrentTab(); - if (tab) { - const editor = await tab.getEditor(); - // Format the SQL query - } - }, - ); +commands.registerCommand( + { id: 'my-extension.format', title: 'Format Query', icon: 'FormatPainterOutlined' }, + async () => { + const tab = sqlLab.getCurrentTab(); + if (tab) { + const editor = await tab.getEditor(); + // Format the SQL query + } + }, +); - const explainCommand = commands.registerCommand( - 'query_tools.explain', - async () => { - const tab = sqlLab.getCurrentTab(); - if (tab) { - const editor = await tab.getEditor(); - // Show query explanation - } - }, - ); +commands.registerCommand( + { id: 'my-extension.explain', title: 'Explain Query' }, + async () => { + const tab = sqlLab.getCurrentTab(); + if (tab) { + const editor = await tab.getEditor(); + // Show query explanation + } + }, +); - const copyAsCteCommand = commands.registerCommand( - 'query_tools.copy_as_cte', - async () => { - const tab = sqlLab.getCurrentTab(); - if (tab) { - const editor = await tab.getEditor(); - // Copy selected text as CTE - } - }, - ); +commands.registerCommand( + { id: 'my-extension.copy-as-cte', title: 'Copy as CTE' }, + async () => { + const tab = sqlLab.getCurrentTab(); + if (tab) { + const editor = await tab.getEditor(); + // Copy selected text as CTE + } + }, +); - context.subscriptions.push(formatCommand, explainCommand, copyAsCteCommand); -} +menus.registerMenuItem( + { view: 'builtin.editor', command: 'my-extension.format' }, + 'sqllab.editor', + 'primary', +); +menus.registerMenuItem( + { view: 'builtin.editor', command: 'my-extension.explain' }, + 'sqllab.editor', + 'secondary', +); +menus.registerMenuItem( + { view: 'builtin.editor', command: 'my-extension.copy-as-cte' }, + 'sqllab.editor', + 'context', +); ``` ## Next Steps diff --git a/docs/developer_docs/extensions/mcp-server.md b/docs/developer_docs/extensions/mcp-server.md new file mode 100644 index 00000000000..769ada1bc0d --- /dev/null +++ b/docs/developer_docs/extensions/mcp-server.md @@ -0,0 +1,679 @@ +--- +title: MCP Server Deployment & Authentication +hide_title: true +sidebar_position: 9 +version: 1 +--- + + + +# MCP Server Deployment & Authentication + +Superset includes a built-in [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that lets AI assistants -- Claude, ChatGPT, and other MCP-compatible clients -- interact with your Superset instance. Through MCP, clients can list dashboards, query datasets, execute SQL, create charts, and more. + +This guide covers how to run, secure, and deploy the MCP server. + +```mermaid +flowchart LR + A["AI Client
(Claude, ChatGPT, etc.)"] -- "MCP protocol
(HTTP + JSON-RPC)" --> B["MCP Server
(:5008/mcp)"] + B -- "Superset context
(app, db, RBAC)" --> C["Superset
(:8088)"] + C --> D[("Database
(Postgres)")] +``` + +--- + +## Quick Start + +Get the MCP server running locally and connect an AI client in three steps. + +### 1. Start the MCP server + +The MCP server runs as a separate process alongside Superset: + +```bash +superset mcp run --host 127.0.0.1 --port 5008 +``` + +| Flag | Default | Description | +|------|---------|-------------| +| `--host` | `127.0.0.1` | Host to bind to | +| `--port` | `5008` | Port to bind to | +| `--debug` | off | Enable debug logging | + +The endpoint is available at `http://:/mcp`. + +### 2. Set a development user + +For local development, tell the MCP server which Superset user to impersonate (the user must already exist in your database): + +```python +# superset_config.py +MCP_DEV_USERNAME = "admin" +``` + +### 3. Connect an AI client + +Point your MCP client at the server. For **Claude Desktop**, edit the config file: + +- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json` +- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json` +- **Linux**: `~/.config/Claude/claude_desktop_config.json` + +```json +{ + "mcpServers": { + "superset": { + "url": "http://localhost:5008/mcp" + } + } +} +``` + +Restart Claude Desktop. The hammer icon in the chat bar confirms the connection. + +See [Connecting AI Clients](#connecting-ai-clients) for Claude Code, Claude Web, ChatGPT, and raw HTTP examples. + +--- + +## Prerequisites + +- Apache Superset 5.0+ running and accessible +- Python 3.10+ +- The `fastmcp` package (`pip install fastmcp`) + +--- + +## Authentication + +The MCP server supports multiple authentication methods depending on your deployment scenario. + +```mermaid +flowchart TD + R["Incoming MCP Request"] --> F{"MCP_AUTH_FACTORY
set?"} + F -- Yes --> CF["Custom Auth Provider"] + F -- No --> AE{"MCP_AUTH_ENABLED?"} + AE -- "True" --> JWT["JWT Validation"] + AE -- "False" --> DU["Dev Mode
(MCP_DEV_USERNAME)"] + + JWT --> ALG{"MCP_JWT_ALGORITHM"} + ALG -- "RS256 + JWKS" --> JWKS["Fetch keys from
MCP_JWKS_URI"] + ALG -- "RS256 + static" --> PK["Use
MCP_JWT_PUBLIC_KEY"] + ALG -- "HS256" --> SEC["Use
MCP_JWT_SECRET"] + + JWKS --> V["Validate token
(exp, iss, aud, scopes)"] + PK --> V + SEC --> V + V --> UR["Resolve Superset user
from token claims"] + UR --> OK["Authenticated request"] + CF --> OK + DU --> OK +``` + +### Development Mode (No Auth) + +Disable authentication and use a fixed user: + +```python +# superset_config.py +MCP_AUTH_ENABLED = False +MCP_DEV_USERNAME = "admin" +``` + +All operations run as the configured user. + +:::warning +Never use development mode in production. Always enable authentication for any internet-facing deployment. +::: + +### JWT Authentication + +For production, enable JWT-based authentication. The MCP server validates a Bearer token on every request. + +#### Option A: RS256 with JWKS endpoint + +The most common setup for OAuth 2.0 / OIDC providers that publish a JWKS (JSON Web Key Set) endpoint: + +```python +# superset_config.py +MCP_AUTH_ENABLED = True +MCP_JWT_ALGORITHM = "RS256" +MCP_JWKS_URI = "https://your-identity-provider.com/.well-known/jwks.json" +MCP_JWT_ISSUER = "https://your-identity-provider.com/" +MCP_JWT_AUDIENCE = "your-superset-instance" +``` + +#### Option B: RS256 with static public key + +Use this when you have a fixed RSA key pair (e.g., self-signed tokens): + +```python +# superset_config.py +MCP_AUTH_ENABLED = True +MCP_JWT_ALGORITHM = "RS256" +MCP_JWT_PUBLIC_KEY = """-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA... +-----END PUBLIC KEY-----""" +MCP_JWT_ISSUER = "your-issuer" +MCP_JWT_AUDIENCE = "your-audience" +``` + +#### Option C: HS256 with shared secret + +Use this when both the token issuer and the MCP server share a symmetric secret: + +```python +# superset_config.py +MCP_AUTH_ENABLED = True +MCP_JWT_ALGORITHM = "HS256" +MCP_JWT_SECRET = "your-shared-secret-key" +MCP_JWT_ISSUER = "your-issuer" +MCP_JWT_AUDIENCE = "your-audience" +``` + +:::warning +Store `MCP_JWT_SECRET` securely. Never commit it to version control. Use environment variables: +```python +import os +MCP_JWT_SECRET = os.environ.get("MCP_JWT_SECRET") +``` +::: + +#### JWT claims + +The MCP server validates these standard claims: + +| Claim | Config Key | Description | +|-------|-----------|-------------| +| `exp` | -- | Expiration time (always validated) | +| `iss` | `MCP_JWT_ISSUER` | Token issuer (optional but recommended) | +| `aud` | `MCP_JWT_AUDIENCE` | Token audience (optional but recommended) | +| `sub` | -- | Subject -- primary claim used to resolve the Superset user | + +#### User resolution + +After validating the token, the MCP server resolves a Superset username from the claims. It checks these in order, using the first non-empty value: + +1. `subject` -- the standard `sub` claim (via the access token object) +2. `client_id` -- for machine-to-machine tokens +3. `payload["sub"]` -- fallback to raw payload +4. `payload["email"]` -- email-based lookup +5. `payload["username"]` -- explicit username claim + +The resolved value must match a `username` in the Superset `ab_user` table. + +#### Scoped access + +Require specific scopes in the JWT to limit what MCP operations a token can perform: + +```python +# superset_config.py +MCP_REQUIRED_SCOPES = ["mcp:read", "mcp:write"] +``` + +Only tokens that include **all** required scopes are accepted. + +### Custom Auth Provider + +For advanced scenarios (e.g., a proprietary auth system), provide a factory function. This takes precedence over all built-in JWT configuration: + +```python +# superset_config.py +def my_custom_auth_factory(app): + """Return a FastMCP auth provider instance.""" + from fastmcp.server.auth.providers.jwt import JWTVerifier + return JWTVerifier( + jwks_uri="https://my-auth.example.com/.well-known/jwks.json", + issuer="https://my-auth.example.com/", + audience="superset-mcp", + ) + +MCP_AUTH_FACTORY = my_custom_auth_factory +``` + +--- + +## Connecting AI Clients + +### Claude Desktop + +**Local development (no auth):** + +```json +{ + "mcpServers": { + "superset": { + "url": "http://localhost:5008/mcp" + } + } +} +``` + +**With JWT authentication:** + +```json +{ + "mcpServers": { + "superset": { + "command": "npx", + "args": [ + "-y", + "mcp-remote@latest", + "http://your-superset-host:5008/mcp", + "--header", + "Authorization: Bearer YOUR_TOKEN" + ] + } + } +} +``` + +### Claude Code (CLI) + +Add to your project's `.mcp.json`: + +```json +{ + "mcpServers": { + "superset": { + "type": "url", + "url": "http://localhost:5008/mcp" + } + } +} +``` + +With authentication: + +```json +{ + "mcpServers": { + "superset": { + "type": "url", + "url": "http://localhost:5008/mcp", + "headers": { + "Authorization": "Bearer YOUR_TOKEN" + } + } + } +} +``` + +### Claude Web (claude.ai) + +1. Open [claude.ai](https://claude.ai) +2. Click the **+** button (or your profile icon) +3. Select **Connectors** +4. Click **Manage Connectors** > **Add custom connector** +5. Enter a name and your MCP URL (e.g., `https://your-superset-host/mcp`) +6. Click **Add** + +:::info +Custom connectors on Claude Web require a Pro, Max, Team, or Enterprise plan. +::: + +### ChatGPT + +1. Click your profile icon > **Settings** > **Apps and Connectors** +2. Enable **Developer Mode** in Advanced Settings +3. In the chat composer, press **+** > **Add sources** > **App** > **Connect more** > **Create app** +4. Enter a name and your MCP server URL +5. Click **I understand and continue** + +:::info +ChatGPT MCP connectors require a Pro, Team, Enterprise, or Edu plan. +::: + +### Direct HTTP requests + +Call the MCP server directly with any HTTP client: + +```bash +curl -X POST http://localhost:5008/mcp \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer YOUR_JWT_TOKEN' \ + -d '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}' +``` + +--- + +## Deployment + +### Single Process + +The simplest setup: run the MCP server alongside Superset on the same host. + +```mermaid +flowchart TD + subgraph host["Host / VM"] + direction TB + S["Superset
:8088"] --> DB[("Postgres")] + M["MCP Server
:5008"] --> DB + end + C["AI Client"] -- "HTTPS" --> P["Reverse Proxy
(Nginx / Caddy)"] + U["Browser"] -- "HTTPS" --> P + P -- ":8088" --> S + P -- ":5008/mcp" --> M +``` + +**superset_config.py:** + +```python +MCP_SERVICE_HOST = "0.0.0.0" +MCP_SERVICE_PORT = 5008 +MCP_DEV_USERNAME = "admin" # or enable JWT auth + +# If behind a reverse proxy, set the public-facing URL so +# MCP-generated links (chart previews, SQL Lab URLs) resolve correctly: +MCP_SERVICE_URL = "https://superset.example.com" +``` + +**Start both processes:** + +```bash +# Terminal 1 -- Superset web server +superset run -h 0.0.0.0 -p 8088 + +# Terminal 2 -- MCP server +superset mcp run --host 0.0.0.0 --port 5008 +``` + +**Nginx reverse proxy with TLS:** + +```nginx +server { + listen 443 ssl; + server_name superset.example.com; + + ssl_certificate /path/to/cert.pem; + ssl_certificate_key /path/to/key.pem; + + # Superset web UI + location / { + proxy_pass http://127.0.0.1:8088; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + } + + # MCP endpoint + location /mcp { + proxy_pass http://127.0.0.1:5008/mcp; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Authorization $http_authorization; + } +} +``` + +### Docker Compose + +Run Superset and the MCP server as separate containers sharing the same config: + +```yaml +# docker-compose.yml +services: + superset: + image: apache/superset:latest + ports: + - "8088:8088" + volumes: + - ./superset_config.py:/app/superset_config.py + environment: + - SUPERSET_CONFIG_PATH=/app/superset_config.py + + mcp: + image: apache/superset:latest + command: ["superset", "mcp", "run", "--host", "0.0.0.0", "--port", "5008"] + ports: + - "5008:5008" + volumes: + - ./superset_config.py:/app/superset_config.py + environment: + - SUPERSET_CONFIG_PATH=/app/superset_config.py + depends_on: + - superset +``` + +Both containers share the same `superset_config.py`, so authentication settings, database connections, and feature flags stay in sync. + +### Multi-Pod (Kubernetes) + +For high-availability deployments, configure Redis so that replicas share session state: + +```mermaid +flowchart TD + LB["Load Balancer"] --> M1["MCP Pod 1"] + LB --> M2["MCP Pod 2"] + LB --> M3["MCP Pod 3"] + M1 --> R[("Redis
(session store)")] + M2 --> R + M3 --> R + M1 --> DB[("Postgres")] + M2 --> DB + M3 --> DB +``` + +**superset_config.py:** + +```python +MCP_STORE_CONFIG = { + "enabled": True, + "CACHE_REDIS_URL": "redis://redis-host:6379/0", + "event_store_max_events": 100, + "event_store_ttl": 3600, +} +``` + +When `CACHE_REDIS_URL` is set, the MCP server uses a Redis-backed EventStore for session management, allowing replicas to share state. Without Redis, each pod manages its own in-memory sessions and stateful MCP interactions may fail when requests hit different replicas. + +--- + +## Configuration Reference + +All MCP settings go in `superset_config.py`. Defaults are defined in `superset/mcp_service/mcp_config.py`. + +### Core + +| Setting | Default | Description | +|---------|---------|-------------| +| `MCP_SERVICE_HOST` | `"localhost"` | Host the MCP server binds to | +| `MCP_SERVICE_PORT` | `5008` | Port the MCP server binds to | +| `MCP_SERVICE_URL` | `None` | Public base URL for MCP-generated links (set this when behind a reverse proxy) | +| `MCP_DEBUG` | `False` | Enable debug logging | +| `MCP_DEV_USERNAME` | -- | Superset username for development mode (no auth) | + +### Authentication + +| Setting | Default | Description | +|---------|---------|-------------| +| `MCP_AUTH_ENABLED` | `False` | Enable JWT authentication | +| `MCP_JWT_ALGORITHM` | `"RS256"` | JWT signing algorithm (`RS256` or `HS256`) | +| `MCP_JWKS_URI` | `None` | JWKS endpoint URL (RS256) | +| `MCP_JWT_PUBLIC_KEY` | `None` | Static RSA public key string (RS256) | +| `MCP_JWT_SECRET` | `None` | Shared secret string (HS256) | +| `MCP_JWT_ISSUER` | `None` | Expected `iss` claim | +| `MCP_JWT_AUDIENCE` | `None` | Expected `aud` claim | +| `MCP_REQUIRED_SCOPES` | `[]` | Required JWT scopes | +| `MCP_JWT_DEBUG_ERRORS` | `False` | Log detailed JWT errors server-side (never exposed in HTTP responses per RFC 6750) | +| `MCP_AUTH_FACTORY` | `None` | Custom auth provider factory `(flask_app) -> auth_provider`. Takes precedence over built-in JWT | + +### Response Size Guard + +Limits response sizes to prevent exceeding LLM context windows: + +```python +MCP_RESPONSE_SIZE_CONFIG = { + "enabled": True, + "token_limit": 25000, + "warn_threshold_pct": 80, + "excluded_tools": [ + "health_check", + "get_chart_preview", + "generate_explore_link", + "open_sql_lab_with_context", + ], +} +``` + +| Key | Default | Description | +|-----|---------|-------------| +| `enabled` | `True` | Enable response size checking | +| `token_limit` | `25000` | Maximum estimated token count per response | +| `warn_threshold_pct` | `80` | Warn when response exceeds this percentage of the limit | +| `excluded_tools` | See above | Tools exempt from size checking (e.g., tools that return URLs, not data) | + +### Caching + +Optional response caching for read-heavy workloads. Requires Redis when used with multiple replicas. + +```python +MCP_CACHE_CONFIG = { + "enabled": False, + "CACHE_KEY_PREFIX": None, + "list_tools_ttl": 300, # 5 min + "list_resources_ttl": 300, + "list_prompts_ttl": 300, + "read_resource_ttl": 3600, # 1 hour + "get_prompt_ttl": 3600, + "call_tool_ttl": 3600, + "max_item_size": 1048576, # 1 MB + "excluded_tools": [ + "execute_sql", + "generate_dashboard", + "generate_chart", + "update_chart", + ], +} +``` + +| Key | Default | Description | +|-----|---------|-------------| +| `enabled` | `False` | Enable response caching | +| `CACHE_KEY_PREFIX` | `None` | Optional prefix for cache keys (useful for shared Redis) | +| `list_tools_ttl` | `300` | Cache TTL in seconds for `tools/list` | +| `list_resources_ttl` | `300` | Cache TTL for `resources/list` | +| `list_prompts_ttl` | `300` | Cache TTL for `prompts/list` | +| `read_resource_ttl` | `3600` | Cache TTL for `resources/read` | +| `get_prompt_ttl` | `3600` | Cache TTL for `prompts/get` | +| `call_tool_ttl` | `3600` | Cache TTL for `tools/call` | +| `max_item_size` | `1048576` | Maximum cached item size in bytes (1 MB) | +| `excluded_tools` | See above | Tools that are never cached (mutating or non-deterministic) | + +### Redis Store (Multi-Pod) + +Enables Redis-backed session and event storage for multi-replica deployments: + +```python +MCP_STORE_CONFIG = { + "enabled": False, + "CACHE_REDIS_URL": None, + "event_store_max_events": 100, + "event_store_ttl": 3600, +} +``` + +| Key | Default | Description | +|-----|---------|-------------| +| `enabled` | `False` | Enable Redis-backed store | +| `CACHE_REDIS_URL` | `None` | Redis connection URL (e.g., `redis://redis-host:6379/0`) | +| `event_store_max_events` | `100` | Maximum events retained per session | +| `event_store_ttl` | `3600` | Event TTL in seconds | + +### Session & CSRF + +These values are flat-merged into the Flask app config used by the MCP server process: + +```python +MCP_SESSION_CONFIG = { + "SESSION_COOKIE_HTTPONLY": True, + "SESSION_COOKIE_SECURE": False, + "SESSION_COOKIE_SAMESITE": "Lax", + "SESSION_COOKIE_NAME": "superset_session", + "PERMANENT_SESSION_LIFETIME": 86400, +} + +MCP_CSRF_CONFIG = { + "WTF_CSRF_ENABLED": True, + "WTF_CSRF_TIME_LIMIT": None, +} +``` + +--- + +## Troubleshooting + +### Server won't start + +- Verify `fastmcp` is installed: `pip install fastmcp` +- Check that `MCP_DEV_USERNAME` is set if auth is disabled -- the server requires a user identity +- Confirm the port is not already in use: `lsof -i :5008` + +### 401 Unauthorized + +- Verify your JWT token has not expired (`exp` claim) +- Check that `MCP_JWT_ISSUER` and `MCP_JWT_AUDIENCE` match the token's `iss` and `aud` claims exactly +- For RS256 with JWKS: confirm the JWKS URI is reachable from the MCP server +- For RS256 with static key: confirm the public key string includes the `BEGIN`/`END` markers +- For HS256: confirm the secret matches between the token issuer and `MCP_JWT_SECRET` +- Enable `MCP_JWT_DEBUG_ERRORS = True` for detailed server-side logging (errors are never leaked to the client) + +### Tool not found + +- Ensure the MCP server and Superset share the same `superset_config.py` +- Check server logs at startup -- tool registration errors are logged with the tool name and reason + +### Client can't connect + +- Verify the MCP server URL is reachable from the client machine +- For Claude Desktop: fully quit the app (not just close the window) and restart after config changes +- For remote access: ensure your firewall and reverse proxy allow traffic to the MCP port +- Confirm the URL path ends with `/mcp` (e.g., `http://localhost:5008/mcp`) + +### Permission errors on tool calls + +- The MCP server enforces Superset's RBAC permissions -- the authenticated user must have the required roles +- In development mode, ensure `MCP_DEV_USERNAME` maps to a user with appropriate roles (e.g., Admin) +- Check `superset/security/manager.py` for the specific permission tuples required by each tool domain (e.g., `("can_execute_sql_query", "SQLLab")`) + +### Response too large + +- If a tool call returns an error about exceeding token limits, the response size guard is blocking an oversized result +- Reduce `page_size` or `limit` parameters, use `select_columns` to exclude large fields, or add filters to narrow results +- To adjust the threshold, change `token_limit` in `MCP_RESPONSE_SIZE_CONFIG` +- To disable the guard entirely, set `MCP_RESPONSE_SIZE_CONFIG = {"enabled": False}` + +--- + +## Security Best Practices + +- **Use TLS** for all production MCP endpoints -- place the server behind a reverse proxy with HTTPS +- **Enable JWT authentication** for any internet-facing deployment +- **RBAC enforcement** -- The MCP server respects Superset's role-based access control. Users can only access data their roles permit +- **Secrets management** -- Store `MCP_JWT_SECRET`, database credentials, and API keys in environment variables or a secrets manager, never in config files committed to version control +- **Scoped tokens** -- Use `MCP_REQUIRED_SCOPES` to limit what operations a token can perform +- **Network isolation** -- In Kubernetes, restrict MCP pod network policies to only allow traffic from your AI client endpoints +- Review the **[Security documentation](./security)** for additional extension security guidance + +--- + +## Next Steps + +- **[MCP Integration](./mcp)** -- Build custom MCP tools and prompts via Superset extensions +- **[Security](./security)** -- Security best practices for extensions +- **[Deployment](./deployment)** -- Package and deploy Superset extensions diff --git a/docs/developer_docs/extensions/mcp.md b/docs/developer_docs/extensions/mcp.md index ad9b10e6e85..4ba74e3540a 100644 --- a/docs/developer_docs/extensions/mcp.md +++ b/docs/developer_docs/extensions/mcp.md @@ -61,7 +61,7 @@ Prompts provide interactive guidance and context to AI agents. They help agents The simplest way to create an MCP tool is using the `@tool` decorator: ```python -from superset_core.api.mcp import tool +from superset_core.mcp.decorators import tool @tool def hello_world() -> dict: @@ -94,7 +94,7 @@ Here's a more comprehensive example showing best practices: import random from datetime import datetime, timezone from pydantic import BaseModel, Field -from superset_core.api.mcp import tool +from superset_core.mcp.decorators import tool class RandomNumberRequest(BaseModel): """Request schema for random number generation.""" @@ -253,7 +253,7 @@ The AI agent sees your tool's: Create interactive prompts using the `@prompt` decorator: ```python -from superset_core.api.mcp import prompt +from superset_core.mcp.decorators import prompt from fastmcp import Context @prompt("my_extension.workflow_guide") diff --git a/docs/developer_docs/extensions/overview.md b/docs/developer_docs/extensions/overview.md index 2a6bce06c96..74ee7ac98c3 100644 --- a/docs/developer_docs/extensions/overview.md +++ b/docs/developer_docs/extensions/overview.md @@ -43,7 +43,7 @@ Extensions can provide: ## UI Components for Extensions -Extension developers have access to pre-built UI components via `@apache-superset/core/ui`. Browse all available components on the [UI Components](/docs/components/) page and filter by **Extension Compatible** to see components available to extensions. +Extension developers have access to pre-built UI components via `@apache-superset/core/components`. Browse all available components on the [UI Components](/docs/components/) page and filter by **Extension Compatible** to see components available to extensions. ## Next Steps diff --git a/docs/developer_docs/extensions/quick-start.md b/docs/developer_docs/extensions/quick-start.md index 1f0e97720b2..d43e4be6e62 100644 --- a/docs/developer_docs/extensions/quick-start.md +++ b/docs/developer_docs/extensions/quick-start.md @@ -64,10 +64,11 @@ Include backend? [Y/n]: Y ``` **Publisher Namespaces**: Extensions use organizational namespaces similar to VS Code extensions, providing collision-safe naming across organizations: + - **NPM package**: `@my-org/hello-world` (scoped package for frontend distribution) - **Module Federation name**: `myOrg_helloWorld` (collision-safe JavaScript identifier) - **Backend package**: `my_org-hello_world` (collision-safe Python distribution name) -- **Python namespace**: `superset_extensions.my_org.hello_world` +- **Python namespace**: `my_org.hello_world` This approach ensures that extensions from different organizations cannot conflict, even if they use the same technical name (e.g., both `acme.dashboard-widgets` and `corp.dashboard-widgets` can coexist). @@ -78,12 +79,9 @@ my-org.hello-world/ ├── extension.json # Extension metadata and configuration ├── backend/ # Backend Python code │ ├── src/ -│ │ └── superset_extensions/ -│ │ └── my_org/ -│ │ ├── __init__.py -│ │ └── hello_world/ -│ │ ├── __init__.py -│ │ └── entrypoint.py # Backend registration +│ │ └── my_org/ +│ │ └── hello_world/ +│ │ └── entrypoint.py # Backend registration │ └── pyproject.toml └── frontend/ # Frontend TypeScript/React code ├── src/ @@ -95,7 +93,7 @@ my-org.hello-world/ ## Step 3: Configure Extension Metadata -The generated `extension.json` contains the extension's metadata. It is used to identify the extension and declare its backend entry points. Frontend contributions are registered directly in code (see Step 5). +The generated `extension.json` contains the extension's metadata. ```json { @@ -104,10 +102,6 @@ The generated `extension.json` contains the extension's metadata. It is used to "displayName": "Hello World", "version": "0.1.0", "license": "Apache-2.0", - "backend": { - "entryPoints": ["superset_extensions.my_org.hello_world.entrypoint"], - "files": ["backend/src/superset_extensions/my_org/hello_world/**/*.py"] - }, "permissions": ["can_read"] } ``` @@ -117,19 +111,19 @@ The generated `extension.json` contains the extension's metadata. It is used to - `publisher`: Organizational namespace for the extension - `name`: Technical identifier (kebab-case) - `displayName`: Human-readable name shown to users -- `backend.entryPoints`: Python modules to load eagerly when the extension starts -- `backend.files`: Glob patterns for Python source files to include in the bundle +- `permissions`: List of permissions the extension requires ## Step 4: Create Backend API -The CLI generated a basic `backend/src/superset_extensions/my_org/hello_world/entrypoint.py`. We'll create an API endpoint. +The CLI generated a basic `backend/src/my_org/hello_world/entrypoint.py`. We'll create an API endpoint. -**Create `backend/src/superset_extensions/my_org/hello_world/api.py`** +**Create `backend/src/my_org/hello_world/api.py`** ```python from flask import Response from flask_appbuilder.api import expose, protect, safe -from superset_core.api.rest_api import RestApi, api +from superset_core.rest_api.api import RestApi +from superset_core.rest_api.decorators import api @api( @@ -174,25 +168,23 @@ class HelloWorldAPI(RestApi): **Key points:** -- Uses [`@api`](superset-core/src/superset_core/api/rest_api.py:59) decorator with automatic context detection -- Extends `RestApi` from `superset_core.api.rest_api` +- Uses [`@api`](superset-core/src/superset_core/rest_api/decorators.py) decorator with automatic context detection +- Extends `RestApi` from `superset_core.rest_api.api` - Uses Flask-AppBuilder decorators (`@expose`, `@protect`, `@safe`) - Returns responses using `self.response(status_code, result=data)` - The endpoint will be accessible at `/extensions/my-org/hello-world/message` (automatic extension context) - OpenAPI docstrings are crucial - Flask-AppBuilder uses them to automatically generate interactive API documentation at `/swagger/v1`, allowing developers to explore endpoints, understand schemas, and test the API directly from the browser -**Update `backend/src/superset_extensions/my_org/hello_world/entrypoint.py`** +**Update `backend/src/my_org/hello_world/entrypoint.py`** Replace the generated print statement with API import to trigger registration: ```python # Importing the API class triggers the @api decorator registration -from .api import HelloWorldAPI - -print("Hello World extension loaded successfully!") +from .api import HelloWorldAPI # noqa: F401 ``` -The [`@api`](superset-core/src/superset_core/api/rest_api.py:59) decorator automatically detects extension context and registers your API with proper namespacing. +The [`@api`](superset-core/src/superset_core/rest_api/decorators.py) decorator automatically detects extension context and registers your API with proper namespacing. ## Step 5: Create Frontend Component @@ -236,52 +228,53 @@ The webpack configuration requires specific settings for Module Federation. Key **Convention**: Superset always loads extensions by requesting the `./index` module from the Module Federation container. The `exposes` entry must be exactly `'./index': './src/index.tsx'` — do not rename or add additional entries. All API registrations must be reachable from that file. See [Architecture](./architecture#module-federation) for a full explanation. ```javascript -const path = require("path"); -const { ModuleFederationPlugin } = require("webpack").container; -const packageConfig = require("./package.json"); +const path = require('path'); +const { ModuleFederationPlugin } = require('webpack').container; +const packageConfig = require('./package'); +const extensionConfig = require('../extension.json'); module.exports = (env, argv) => { - const isProd = argv.mode === "production"; + const isProd = argv.mode === 'production'; return { - entry: isProd ? {} : "./src/index.tsx", - mode: isProd ? "production" : "development", + entry: isProd ? {} : './src/index.tsx', + mode: isProd ? 'production' : 'development', devServer: { - port: 3001, + port: 3000, headers: { - "Access-Control-Allow-Origin": "*", + 'Access-Control-Allow-Origin': '*', }, }, output: { - filename: isProd ? undefined : "[name].[contenthash].js", - chunkFilename: "[name].[contenthash].js", clean: true, - path: path.resolve(__dirname, "dist"), - publicPath: `/api/v1/extensions/my-org/hello-world/`, + filename: isProd ? undefined : '[name].[contenthash].js', + chunkFilename: '[name].[contenthash].js', + path: path.resolve(__dirname, 'dist'), + publicPath: `/api/v1/extensions/${extensionConfig.publisher}/${extensionConfig.name}/`, }, resolve: { - extensions: [".ts", ".tsx", ".js", ".jsx"], + extensions: ['.ts', '.tsx', '.js', '.jsx'], }, // Map @apache-superset/core imports to window.superset at runtime - externalsType: "window", + externalsType: 'window', externals: { - "@apache-superset/core": "superset", + '@apache-superset/core': 'superset', }, module: { rules: [ { test: /\.tsx?$/, - use: "ts-loader", + use: 'ts-loader', exclude: /node_modules/, }, ], }, plugins: [ new ModuleFederationPlugin({ - name: "myOrg_helloWorld", - filename: "remoteEntry.[contenthash].js", + name: 'myOrg_helloWorld', + filename: 'remoteEntry.[contenthash].js', exposes: { - "./index": "./src/index.tsx", + './index': './src/index.tsx', }, shared: { react: { @@ -289,9 +282,14 @@ module.exports = (env, argv) => { requiredVersion: packageConfig.peerDependencies.react, import: false, // Use host's React, don't bundle }, - "react-dom": { + 'react-dom': { singleton: true, - requiredVersion: packageConfig.peerDependencies["react-dom"], + requiredVersion: packageConfig.peerDependencies['react-dom'], + import: false, + }, + antd: { + singleton: true, + requiredVersion: packageConfig.peerDependencies['antd'], import: false, }, }, @@ -306,8 +304,9 @@ module.exports = (env, argv) => { ```json { "compilerOptions": { - "baseUrl": ".", - "moduleResolution": "node", + "target": "es5", + "module": "esnext", + "moduleResolution": "node10", "jsx": "react", "strict": true, "esModuleInterop": true, @@ -332,16 +331,16 @@ const HelloWorldPanel: React.FC = () => { const [error, setError] = useState(''); useEffect(() => { - const fetchMessage = async () => { - try { - const csrfToken = await authentication.getCSRFToken(); - const response = await fetch('/extensions/my-org/hello-world/message', { - method: 'GET', - headers: { - 'Content-Type': 'application/json', - 'X-CSRFToken': csrfToken!, - }, - }); + const fetchMessage = async () => { + try { + const csrfToken = await authentication.getCSRFToken(); + const response = await fetch('/extensions/my-org/hello-world/message', { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + 'X-CSRFToken': csrfToken!, + }, + }); if (!response.ok) { throw new Error(`Server returned ${response.status}`); @@ -496,8 +495,8 @@ Superset will extract and validate the extension metadata, load the assets, regi Here's what happens when your extension loads: -1. **Superset starts**: Reads `extension.json` and loads the backend entrypoint -2. **Backend registration**: `entrypoint.py` imports your API class, triggering the [`@api`](superset-core/src/superset_core/api/rest_api.py:59) decorator to register it automatically +1. **Superset starts**: Reads `manifest.json` from the `.supx` bundle and loads the backend entrypoint +2. **Backend registration**: `entrypoint.py` imports your API class, triggering the [`@api`](superset-core/src/superset_core/rest_api/decorators.py) decorator to register it automatically 3. **Frontend loads**: When SQL Lab opens, Superset fetches the remote entry file 4. **Module Federation**: Webpack loads your extension module and resolves `@apache-superset/core` to `window.superset` 5. **Registration**: The module executes at load time, calling `views.registerView` to register your panel diff --git a/docs/developer_docs/extensions/registry.md b/docs/developer_docs/extensions/registry.md index 36c05f39803..9fbdb0f2074 100644 --- a/docs/developer_docs/extensions/registry.md +++ b/docs/developer_docs/extensions/registry.md @@ -30,15 +30,15 @@ This page serves as a registry of community-created Superset extensions. These e | Name | Description | Author | Preview | | ------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [Extensions API Explorer](https://github.com/michael-s-molina/superset-extensions/tree/main/api_explorer) | A SQL Lab panel that demonstrates the Extensions API by providing an interactive explorer for testing commands like getTabs, getCurrentTab, and getDatabases. Useful for extension developers to understand and experiment with the available APIs. | Michael S. Molina | Extensions API Explorer | +| [Extensions API Explorer](https://github.com/michael-s-molina/superset-extensions/tree/main/api-explorer) | A SQL Lab panel that demonstrates the Extensions API by providing an interactive explorer for testing commands like getTabs, getCurrentTab, and getDatabases. Useful for extension developers to understand and experiment with the available APIs. | Michael S. Molina | Extensions API Explorer | | [SQL Query Flow Visualizer](https://github.com/msyavuz/superset-sql-visualizer) | A SQL Lab panel that transforms SQL queries into interactive flow diagrams, helping developers and analysts understand query execution paths and data relationships. | Mehmet Salih Yavuz | SQL Flow Visualizer | -| [SQL Lab Export to Google Sheets](https://github.com/michael-s-molina/superset-extensions/tree/main/sqllab_gsheets) | A Superset extension that allows users to export SQL Lab query results directly to Google Sheets. | Michael S. Molina | SQL Lab Export to Google Sheets | +| [SQL Lab Export to Google Sheets](https://github.com/michael-s-molina/superset-extensions/tree/main/sqllab-gsheets) | A Superset extension that allows users to export SQL Lab query results directly to Google Sheets. | Michael S. Molina | SQL Lab Export to Google Sheets | | [SQL Lab Export to Parquet](https://github.com/rusackas/superset-extensions/tree/main/sqllab_parquet) | Export SQL Lab query results directly to Apache Parquet format with Snappy compression. | Evan Rusackas | SQL Lab Export to Parquet | -| [SQL Lab Query Comparison](https://github.com/michael-s-molina/superset-extensions/tree/main/query_comparison) | A SQL Lab extension that enables side-by-side comparison of query results across different tabs, with GitHub-style diff visualization showing added/removed rows and columns. | Michael S. Molina | Query Comparison | -| [SQL Lab Result Stats](https://github.com/michael-s-molina/superset-extensions/tree/main/result_stats) | A SQL Lab extension that automatically computes statistics for query results, providing type-aware analysis including numeric metrics (min, max, mean, median, std dev), string analysis (length, empty counts), and date range information. | Michael S. Molina | Result Stats | -| [SQL Snippets](https://github.com/michael-s-molina/superset-extensions/tree/main/sql_snippets) | A SQL Lab extension that provides reusable SQL code snippets, enabling quick insertion of commonly used code blocks such as license headers, author information, and frequently used SQL patterns. | Michael S. Molina | SQL Snippets | -| [SQL Lab Query Estimator](https://github.com/michael-s-molina/superset-extensions/tree/main/query_estimator) | A SQL Lab panel that analyzes query execution plans to estimate resource impact, detect performance issues like Cartesian products and high-cost operations, and visualize the query plan tree. | Michael S. Molina | Query Estimator | -| [Editors Bundle](https://github.com/michael-s-molina/superset-extensions/tree/main/editors_bundle) | A Superset extension that demonstrates how to provide custom code editors for different languages. This extension showcases the editor contribution system by registering alternative editors that can replace Superset's default Ace editor. | Michael S. Molina | Editors Bundle | +| [SQL Lab Query Comparison](https://github.com/michael-s-molina/superset-extensions/tree/main/query-comparison) | A SQL Lab extension that enables side-by-side comparison of query results across different tabs, with GitHub-style diff visualization showing added/removed rows and columns. | Michael S. Molina | Query Comparison | +| [SQL Lab Result Stats](https://github.com/michael-s-molina/superset-extensions/tree/main/result-stats) | A SQL Lab extension that automatically computes statistics for query results, providing type-aware analysis including numeric metrics (min, max, mean, median, std dev), string analysis (length, empty counts), and date range information. | Michael S. Molina | Result Stats | +| [Editor Snippets](https://github.com/michael-s-molina/superset-extensions/tree/main/editor-snippets) | A SQL Lab extension for managing and inserting reusable code snippets into the editor, with server-side persistence per user. | Michael S. Molina | Editor Snippets | +| [SQL Lab Query Estimator](https://github.com/michael-s-molina/superset-extensions/tree/main/query-estimator) | A SQL Lab panel that analyzes query execution plans to estimate resource impact, detect performance issues like Cartesian products and high-cost operations, and visualize the query plan tree. | Michael S. Molina | Query Estimator | +| [Editors Bundle](https://github.com/michael-s-molina/superset-extensions/tree/main/editors-bundle) | A Superset extension that demonstrates how to provide custom code editors for different languages. This extension showcases the editor contribution system by registering alternative editors that can replace Superset's default Ace editor. | Michael S. Molina | Editors Bundle | ## How to Add Your Extension diff --git a/docs/developer_docs/extensions/tasks.md b/docs/developer_docs/extensions/tasks.md index 47e0e7cf562..c36fa9aaba1 100644 --- a/docs/developer_docs/extensions/tasks.md +++ b/docs/developer_docs/extensions/tasks.md @@ -50,7 +50,7 @@ When GTF is considered stable, it will replace legacy Celery tasks for built-in ### Define a Task ```python -from superset_core.api.tasks import task, get_context +from superset_core.tasks.decorators import task, get_context @task def process_data(dataset_id: int) -> None: @@ -245,7 +245,8 @@ Always implement an abort handler for long-running tasks. This allows users to c Set a timeout to automatically abort tasks that run too long: ```python -from superset_core.api.tasks import task, get_context, TaskOptions +from superset_core.tasks.decorators import task, get_context +from superset_core.tasks.types import TaskOptions # Set default timeout in decorator @task(timeout=300) # 5 minutes @@ -299,7 +300,7 @@ Timeouts require an abort handler to be effective. Without one, the timeout trig Use `task_key` to prevent duplicate task execution: ```python -from superset_core.api.tasks import TaskOptions +from superset_core.tasks.types import TaskOptions # Without key - creates new task each time (random UUID) task1 = my_task.schedule(x=1) @@ -331,7 +332,8 @@ print(task2.status) # "success" (terminal status) ## Task Scopes ```python -from superset_core.api.tasks import task, TaskScope +from superset_core.tasks.decorators import task +from superset_core.tasks.types import TaskScope @task # Private by default def private_task(): ... diff --git a/docs/developer_docs/sidebars.js b/docs/developer_docs/sidebars.js index 7926d80cf61..babdcd41025 100644 --- a/docs/developer_docs/sidebars.js +++ b/docs/developer_docs/sidebars.js @@ -52,6 +52,7 @@ module.exports = { 'extensions/development', 'extensions/deployment', 'extensions/mcp', + 'extensions/mcp-server', 'extensions/security', 'extensions/tasks', 'extensions/registry', diff --git a/docs/package.json b/docs/package.json index 0d11ac24179..e22ebe82b6e 100644 --- a/docs/package.json +++ b/docs/package.json @@ -107,7 +107,7 @@ "prettier": "^3.8.1", "typescript": "~5.9.3", "typescript-eslint": "^8.56.1", - "webpack": "^5.105.3" + "webpack": "^5.105.4" }, "browserslist": { "production": [ diff --git a/docs/scripts/generate-superset-components.mjs b/docs/scripts/generate-superset-components.mjs index 55ee639293f..b3de2ba1dad 100644 --- a/docs/scripts/generate-superset-components.mjs +++ b/docs/scripts/generate-superset-components.mjs @@ -152,8 +152,8 @@ const SOURCES = [ { name: 'Extension Components', path: 'packages/superset-core/src', - importPrefix: '@apache-superset/core/ui', - docImportPrefix: '@apache-superset/core/ui', + importPrefix: '@apache-superset/core/components', + docImportPrefix: '@apache-superset/core/components', category: 'extension', enabled: true, extensionCompatible: true, @@ -1155,7 +1155,7 @@ Help improve it by [editing the story file](https://github.com/apache/superset/e const CATEGORY_LABELS = { ui: { title: 'Core Components', sidebarLabel: 'Core Components', description: 'Buttons, inputs, modals, selects, and other fundamental UI elements.' }, 'design-system': { title: 'Layout Components', sidebarLabel: 'Layout Components', description: 'Grid, Layout, Table, Flex, Space, and container components for page structure.' }, - extension: { title: 'Extension Components', sidebarLabel: 'Extension Components', description: 'Components available to extension developers via @apache-superset/core/ui.' }, + extension: { title: 'Extension Components', sidebarLabel: 'Extension Components', description: 'Components available to extension developers via @apache-superset/core/components.' }, }; /** @@ -1463,7 +1463,7 @@ function generateExtensionTypeDeclarations(extensionComponents) { */ /** - * Type declarations for @apache-superset/core/ui + * Type declarations for @apache-superset/core/components * * AUTO-GENERATED by scripts/generate-superset-components.mjs * Do not edit manually - regenerate by running: yarn generate:superset-components diff --git a/docs/src/components/StorybookWrapper.jsx b/docs/src/components/StorybookWrapper.jsx index 86b1569a872..1220b56add5 100644 --- a/docs/src/components/StorybookWrapper.jsx +++ b/docs/src/components/StorybookWrapper.jsx @@ -39,7 +39,7 @@ function getComponentRegistry() { // eslint-disable-next-line @typescript-eslint/no-require-imports const SupersetComponents = require('@superset/components'); // eslint-disable-next-line @typescript-eslint/no-require-imports - const CoreUI = require('@apache-superset/core/ui'); + const CoreUI = require('@apache-superset/core/components'); // Build component registry with antd as base fallback layer. // Some Superset components (e.g., Typography) use styled-components that may @@ -65,7 +65,7 @@ function getProviders() { try { // eslint-disable-next-line @typescript-eslint/no-require-imports - const { themeObject } = require('@apache-superset/core/ui'); + const { themeObject } = require('@apache-superset/core/theme'); // eslint-disable-next-line @typescript-eslint/no-require-imports const { App, ConfigProvider } = require('antd'); diff --git a/docs/src/theme/Playground/Preview/index.tsx b/docs/src/theme/Playground/Preview/index.tsx index 42552c185b3..f3af23389bf 100644 --- a/docs/src/theme/Playground/Preview/index.tsx +++ b/docs/src/theme/Playground/Preview/index.tsx @@ -35,7 +35,7 @@ function getThemeWrapper() { try { // eslint-disable-next-line @typescript-eslint/no-require-imports - const { themeObject } = require('@apache-superset/core/ui'); + const { themeObject } = require('@apache-superset/core/theme'); // eslint-disable-next-line @typescript-eslint/no-require-imports const { App } = require('antd'); diff --git a/docs/src/theme/ReactLiveScope/index.tsx b/docs/src/theme/ReactLiveScope/index.tsx index 27d35cd6052..fade92f93cf 100644 --- a/docs/src/theme/ReactLiveScope/index.tsx +++ b/docs/src/theme/ReactLiveScope/index.tsx @@ -50,7 +50,7 @@ if (isBrowser) { // eslint-disable-next-line @typescript-eslint/no-require-imports const SupersetComponents = require('@superset/components'); // eslint-disable-next-line @typescript-eslint/no-require-imports - const { Alert } = require('@apache-superset/core/ui'); + const { Alert } = require('@apache-superset/core/components'); console.log('[ReactLiveScope] SupersetComponents keys:', Object.keys(SupersetComponents || {}).slice(0, 10)); console.log('[ReactLiveScope] Has Button?', 'Button' in (SupersetComponents || {})); diff --git a/docs/src/types/apache-superset-core/index.d.ts b/docs/src/types/apache-superset-core/index.d.ts index 6e3a121e1b6..8dbc096ef75 100644 --- a/docs/src/types/apache-superset-core/index.d.ts +++ b/docs/src/types/apache-superset-core/index.d.ts @@ -18,7 +18,7 @@ */ /** - * Type declarations for @apache-superset/core/ui + * Type declarations for @apache-superset/core/components * * AUTO-GENERATED by scripts/generate-superset-components.mjs * Do not edit manually - regenerate by running: yarn generate:superset-components diff --git a/docs/src/webpack.extend.ts b/docs/src/webpack.extend.ts index 0a96ce2d1f5..c86498f09c0 100644 --- a/docs/src/webpack.extend.ts +++ b/docs/src/webpack.extend.ts @@ -156,9 +156,9 @@ export default function webpackExtendPlugin(): Plugin { // to source so the docs build doesn't depend on pre-built lib/ artifacts. // More specific sub-path aliases must come first; webpack matches the // longest prefix. - '@apache-superset/core/ui': path.resolve( + '@apache-superset/core/components': path.resolve( __dirname, - '../../superset-frontend/packages/superset-core/src/ui', + '../../superset-frontend/packages/superset-core/src/components', ), '@apache-superset/core/api/core': path.resolve( __dirname, diff --git a/docs/static/img/databases/datastore.png b/docs/static/img/databases/datastore.png new file mode 100644 index 00000000000..a5fd9dab4a0 Binary files /dev/null and b/docs/static/img/databases/datastore.png differ diff --git a/docs/static/img/extensions/sql-snippets.png b/docs/static/img/extensions/editor-snippets.png similarity index 100% rename from docs/static/img/extensions/sql-snippets.png rename to docs/static/img/extensions/editor-snippets.png diff --git a/docs/tsconfig.json b/docs/tsconfig.json index cdfed3f9f56..ff0f5ac238c 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -14,10 +14,10 @@ "paths": { "@superset-ui/core": ["../superset-frontend/packages/superset-ui-core/src"], "@superset-ui/core/*": ["../superset-frontend/packages/superset-ui-core/src/*"], - // Types for @apache-superset/core/ui are auto-generated by scripts/generate-superset-components.mjs + // Types for @apache-superset/core/components are auto-generated by scripts/generate-superset-components.mjs // Runtime resolution uses webpack alias pointing to actual source (see src/webpack.extend.ts) // Using /ui path matches the established pattern used throughout the Superset codebase - "@apache-superset/core/ui": ["./src/types/apache-superset-core"], + "@apache-superset/core/components": ["./src/types/apache-superset-core"], "*": ["src/*", "node_modules/*"] } }, diff --git a/docs/yarn.lock b/docs/yarn.lock index 8e2890ab157..49cd2412690 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -5509,12 +5509,7 @@ acorn@^6.1.1: resolved "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz" integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== -acorn@^8.0.0, acorn@^8.0.4, acorn@^8.11.0, acorn@^8.14.0, acorn@^8.15.0: - version "8.15.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz" - integrity sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg== - -acorn@^8.16.0: +acorn@^8.0.0, acorn@^8.0.4, acorn@^8.11.0, acorn@^8.14.0, acorn@^8.15.0, acorn@^8.16.0: version "8.16.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.16.0.tgz#4ce79c89be40afe7afe8f3adb902a1f1ce9ac08a" integrity sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw== @@ -7710,10 +7705,10 @@ encodeurl@~2.0.0: resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz" integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg== -enhanced-resolve@^5.19.0: - version "5.19.0" - resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.19.0.tgz" - integrity sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg== +enhanced-resolve@^5.20.0: + version "5.20.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.20.0.tgz#323c2a70d2aa7fb4bdfd6d3c24dfc705c581295d" + integrity sha512-/ce7+jQ1PQ6rVXwe+jKEg5hW5ciicHwIQUagZkp6IufBoY3YDgdTTY1azVs0qoRgVmvsNB+rbjLJxDAeHHtwsQ== dependencies: graceful-fs "^4.2.4" tapable "^2.3.0" @@ -13940,7 +13935,7 @@ serialize-error@^8.1.0: dependencies: type-fest "^0.20.2" -serialize-javascript@^6.0.0, serialize-javascript@^6.0.1, serialize-javascript@^6.0.2: +serialize-javascript@^6.0.0, serialize-javascript@^6.0.1: version "6.0.2" resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz" integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== @@ -14691,15 +14686,14 @@ tapable@^2.0.0, tapable@^2.2.1, tapable@^2.3.0: resolved "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz" integrity sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg== -terser-webpack-plugin@^5.3.16, terser-webpack-plugin@^5.3.9: - version "5.3.16" - resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.16.tgz" - integrity sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q== +terser-webpack-plugin@^5.3.17, terser-webpack-plugin@^5.3.9: + version "5.3.17" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.17.tgz#75ea98876297fbb190d2fbb395e982582b859a67" + integrity sha512-YR7PtUp6GMU91BgSJmlaX/rS2lGDbAF7D+Wtq7hRO+MiljNmodYvqslzCFiYVAgW+Qoaaia/QUIP4lGXufjdZw== dependencies: "@jridgewell/trace-mapping" "^0.3.25" jest-worker "^27.4.5" schema-utils "^4.3.0" - serialize-javascript "^6.0.2" terser "^5.31.1" terser@^5.10.0, terser@^5.15.1, terser@^5.31.1: @@ -15591,11 +15585,6 @@ webpack-merge@^6.0.1: flat "^5.0.2" wildcard "^2.0.1" -webpack-sources@^3.3.3: - version "3.3.3" - resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.3.3.tgz" - integrity sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg== - webpack-sources@^3.3.4: version "3.3.4" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.3.4.tgz#a338b95eb484ecc75fbb196cbe8a2890618b4891" @@ -15606,10 +15595,10 @@ webpack-virtual-modules@^0.6.2: resolved "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz" integrity sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ== -webpack@^5.105.3: - version "5.105.3" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.105.3.tgz#307ad95bafffd08bc81049d6519477b16e42e7ba" - integrity sha512-LLBBA4oLmT7sZdHiYE/PeVuifOxYyE2uL/V+9VQP7YSYdJU7bSf7H8bZRRxW8kEPMkmVjnrXmoR3oejIdX0xbg== +webpack@^5.105.4, webpack@^5.88.1, webpack@^5.95.0: + version "5.105.4" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.105.4.tgz#1b77fcd55a985ac7ca9de80a746caffa38220169" + integrity sha512-jTywjboN9aHxFlToqb0K0Zs9SbBoW4zRUlGzI2tYNxVYcEi/IPpn+Xi4ye5jTLvX2YeLuic/IvxNot+Q1jMoOw== dependencies: "@types/eslint-scope" "^3.7.7" "@types/estree" "^1.0.8" @@ -15621,7 +15610,7 @@ webpack@^5.105.3: acorn-import-phases "^1.0.3" browserslist "^4.28.1" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.19.0" + enhanced-resolve "^5.20.0" es-module-lexer "^2.0.0" eslint-scope "5.1.1" events "^3.2.0" @@ -15633,41 +15622,10 @@ webpack@^5.105.3: neo-async "^2.6.2" schema-utils "^4.3.3" tapable "^2.3.0" - terser-webpack-plugin "^5.3.16" + terser-webpack-plugin "^5.3.17" watchpack "^2.5.1" webpack-sources "^3.3.4" -webpack@^5.88.1, webpack@^5.95.0: - version "5.105.2" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.105.2.tgz#f3b76f9fc36f1152e156e63ffda3bbb82e6739ea" - integrity sha512-dRXm0a2qcHPUBEzVk8uph0xWSjV/xZxenQQbLwnwP7caQCYpqG1qddwlyEkIDkYn0K8tvmcrZ+bOrzoQ3HxCDw== - dependencies: - "@types/eslint-scope" "^3.7.7" - "@types/estree" "^1.0.8" - "@types/json-schema" "^7.0.15" - "@webassemblyjs/ast" "^1.14.1" - "@webassemblyjs/wasm-edit" "^1.14.1" - "@webassemblyjs/wasm-parser" "^1.14.1" - acorn "^8.15.0" - acorn-import-phases "^1.0.3" - browserslist "^4.28.1" - chrome-trace-event "^1.0.2" - enhanced-resolve "^5.19.0" - es-module-lexer "^2.0.0" - eslint-scope "5.1.1" - events "^3.2.0" - glob-to-regexp "^0.4.1" - graceful-fs "^4.2.11" - json-parse-even-better-errors "^2.3.1" - loader-runner "^4.3.1" - mime-types "^2.1.27" - neo-async "^2.6.2" - schema-utils "^4.3.3" - tapable "^2.3.0" - terser-webpack-plugin "^5.3.16" - watchpack "^2.5.1" - webpack-sources "^3.3.3" - webpackbar@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/webpackbar/-/webpackbar-6.0.1.tgz" diff --git a/requirements/base.in b/requirements/base.in index deca6a557b0..2d6100beab3 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -18,8 +18,8 @@ # # Security: CVE-2026-21441 - decompression bomb bypass on redirects urllib3>=2.6.3,<3.0.0 -# Security: GHSA-87hc-h4r5-73f7 - Windows path traversal fix -werkzeug>=3.1.5,<4.0.0 +# Security: CVE-2026-27199 - Windows device name handling in safe_join +werkzeug>=3.1.6,<4.0.0 # Security: CVE-2025-68146 - TOCTOU symlink vulnerability filelock>=3.20.3,<4.0.0 # Security: decompression bomb fix (required by aiohttp 3.13.3) diff --git a/requirements/base.txt b/requirements/base.txt index 4b11bd95fc5..c37afda03f8 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -54,7 +54,7 @@ certifi==2025.6.15 # via # requests # selenium -cffi==1.17.1 +cffi==2.0.0 # via # cryptography # pynacl @@ -86,7 +86,7 @@ cron-descriptor==1.4.5 # via apache-superset (pyproject.toml) croniter==6.0.0 # via apache-superset (pyproject.toml) -cryptography==44.0.3 +cryptography==46.0.5 # via # apache-superset (pyproject.toml) # paramiko @@ -219,7 +219,7 @@ markupsafe==3.0.2 # mako # werkzeug # wtforms -marshmallow==3.26.1 +marshmallow==3.26.2 # via # apache-superset (pyproject.toml) # flask-appbuilder @@ -317,9 +317,9 @@ pyjwt==2.10.1 # flask-appbuilder # flask-jwt-extended # redis -pynacl==1.5.0 +pynacl==1.6.2 # via paramiko -pyopenssl==25.1.0 +pyopenssl==25.3.0 # via shillelagh pyparsing==3.2.3 # via apache-superset (pyproject.toml) @@ -457,7 +457,7 @@ wcwidth==0.2.13 # via prompt-toolkit websocket-client==1.8.0 # via selenium -werkzeug==3.1.5 +werkzeug==3.1.6 # via # -r requirements/base.in # flask diff --git a/requirements/development.txt b/requirements/development.txt index 3cf0ee5b31a..e0a2b801182 100644 --- a/requirements/development.txt +++ b/requirements/development.txt @@ -48,7 +48,7 @@ attrs==25.3.0 # referencing # requests-cache # trio -authlib==1.6.5 +authlib==1.6.7 # via fastmcp babel==2.17.0 # via @@ -115,7 +115,7 @@ certifi==2025.6.15 # httpx # requests # selenium -cffi==1.17.1 +cffi==2.0.0 # via # -c requirements/base-constraint.txt # cryptography @@ -177,7 +177,7 @@ croniter==6.0.0 # via # -c requirements/base-constraint.txt # apache-superset -cryptography==44.0.3 +cryptography==46.0.5 # via # -c requirements/base-constraint.txt # apache-superset @@ -526,7 +526,7 @@ markupsafe==3.0.2 # mako # werkzeug # wtforms -marshmallow==3.26.1 +marshmallow==3.26.2 # via # -c requirements/base-constraint.txt # apache-superset @@ -703,7 +703,7 @@ proto-plus==1.25.0 # via # google-api-core # google-cloud-bigquery-storage -protobuf==4.25.5 +protobuf==4.25.8 # via # google-api-core # google-cloud-bigquery-storage @@ -786,11 +786,11 @@ pyjwt==2.10.1 # redis pylint==3.3.7 # via apache-superset -pynacl==1.5.0 +pynacl==1.6.2 # via # -c requirements/base-constraint.txt # paramiko -pyopenssl==25.1.0 +pyopenssl==25.3.0 # via # -c requirements/base-constraint.txt # shillelagh @@ -1009,7 +1009,7 @@ sshtunnel==0.4.0 # via # -c requirements/base-constraint.txt # apache-superset -starlette==0.48.0 +starlette==0.49.1 # via mcp statsd==4.0.1 # via apache-superset @@ -1111,7 +1111,7 @@ websocket-client==1.8.0 # selenium websockets==15.0.1 # via fastmcp -werkzeug==3.1.5 +werkzeug==3.1.6 # via # -c requirements/base-constraint.txt # flask diff --git a/superset-core/README.md b/superset-core/README.md index 3ee489c7afc..0ca50a252f7 100644 --- a/superset-core/README.md +++ b/superset-core/README.md @@ -48,8 +48,8 @@ The package is organized into logical modules, each providing specific functiona ```python from flask import request, Response from flask_appbuilder.api import expose, permission_name, protect, safe -from superset_core.api import models, query, rest_api -from superset_core.api.rest_api import RestApi +from superset_core import common, queries, rest_api +from superset_core.rest_api.api import RestApi class DatasetReferencesAPI(RestApi): """Example extension API demonstrating core functionality.""" diff --git a/superset-core/src/superset_core/api/__init__.py b/superset-core/src/superset_core/common/__init__.py similarity index 100% rename from superset-core/src/superset_core/api/__init__.py rename to superset-core/src/superset_core/common/__init__.py diff --git a/superset-core/src/superset_core/api/daos.py b/superset-core/src/superset_core/common/daos.py similarity index 72% rename from superset-core/src/superset_core/api/daos.py rename to superset-core/src/superset_core/common/daos.py index f686f0c659d..ab2964f8a7e 100644 --- a/superset-core/src/superset_core/api/daos.py +++ b/superset-core/src/superset_core/common/daos.py @@ -16,13 +16,13 @@ # under the License. """ -Data Access Object API for superset-core. +Common Data Access Object API for superset-core. Provides dependency-injected DAO classes that will be replaced by host implementations during initialization. Usage: - from superset_core.api.daos import DatasetDAO, DatabaseDAO + from superset_core.common.daos import DatasetDAO, DatabaseDAO # Use standard BaseDAO methods datasets = DatasetDAO.find_all() @@ -36,17 +36,14 @@ from typing import Any, ClassVar, Generic, TypeVar from flask_appbuilder.models.filters import BaseFilter from sqlalchemy.orm import Query as SQLAQuery -from superset_core.api.models import ( +from superset_core.common.models import ( Chart, CoreModel, Dashboard, Database, Dataset, KeyValue, - Query, - SavedQuery, Tag, - Task, User, ) @@ -193,34 +190,6 @@ class UserDAO(BaseDAO[User]): id_column_name = "id" -class QueryDAO(BaseDAO[Query]): - """ - Abstract Query DAO interface. - - Host implementations will replace this class during initialization - with a concrete implementation providing actual functionality. - """ - - # Class variables that will be set by host implementation - model_cls = None - base_filter = None - id_column_name = "id" - - -class SavedQueryDAO(BaseDAO[SavedQuery]): - """ - Abstract SavedQuery DAO interface. - - Host implementations will replace this class during initialization - with a concrete implementation providing actual functionality. - """ - - # Class variables that will be set by host implementation - model_cls = None - base_filter = None - id_column_name = "id" - - class TagDAO(BaseDAO[Tag]): """ Abstract Tag DAO interface. @@ -249,48 +218,6 @@ class KeyValueDAO(BaseDAO[KeyValue]): id_column_name = "id" -class TaskDAO(BaseDAO[Task]): - """ - Abstract Task DAO interface. - - Host implementations will replace this class during initialization - with a concrete implementation providing actual functionality. - """ - - # Class variables that will be set by host implementation - model_cls = None - base_filter = None - id_column_name = "id" - uuid_column_name = "uuid" - - @classmethod - @abstractmethod - def find_by_task_key( - cls, - task_type: str, - task_key: str, - scope: str = "private", - user_id: int | None = None, - ) -> Task | None: - """ - Find active task by type, key, scope, and user. - - Uses dedup_key internally for efficient querying with a unique index. - Only returns tasks that are active (pending or in progress). - - Uniqueness logic by scope: - - private: scope + task_type + task_key + user_id - - shared/system: scope + task_type + task_key (user-agnostic) - - :param task_type: Task type to filter by - :param task_key: Task identifier for deduplication - :param scope: Task scope (private/shared/system) - :param user_id: User ID (required for private tasks) - :returns: Task instance or None if not found or not active - """ - ... - - __all__ = [ "BaseDAO", "DatasetDAO", @@ -298,9 +225,6 @@ __all__ = [ "ChartDAO", "DashboardDAO", "UserDAO", - "QueryDAO", - "SavedQueryDAO", "TagDAO", "KeyValueDAO", - "TaskDAO", ] diff --git a/superset-core/src/superset_core/api/models.py b/superset-core/src/superset_core/common/models.py similarity index 62% rename from superset-core/src/superset_core/api/models.py rename to superset-core/src/superset_core/common/models.py index 91e10255d04..742be6fa17b 100644 --- a/superset-core/src/superset_core/api/models.py +++ b/superset-core/src/superset_core/common/models.py @@ -16,13 +16,13 @@ # under the License. """ -Model API for superset-core. +Common model API for superset-core. -Provides model classes that will be replaced by host implementations +Provides core model classes that will be replaced by host implementations during initialization for extension developers to use. Usage: - from superset_core.api.models import Dataset, Database, get_session + from superset_core.common.models import Dataset, Database, get_session # Use as regular model classes dataset = Dataset(name="My Dataset") @@ -40,8 +40,7 @@ from flask_appbuilder import Model from sqlalchemy.orm import scoped_session if TYPE_CHECKING: - from superset_core.api.tasks import TaskProperties - from superset_core.api.types import ( + from superset_core.queries.types import ( AsyncQueryHandle, QueryOptions, QueryResult, @@ -88,8 +87,8 @@ class Database(CoreModel): def execute( self, sql: str, - options: QueryOptions | None = None, - ) -> QueryResult: + options: "QueryOptions | None" = None, + ) -> "QueryResult": """ Execute SQL synchronously. @@ -103,8 +102,8 @@ class Database(CoreModel): :returns: QueryResult with status, data (DataFrame), and metadata Example: - from superset_core.api.daos import DatabaseDAO - from superset_core.api.types import QueryOptions, QueryStatus + from superset_core.common.daos import DatabaseDAO + from superset_core.queries.types import QueryOptions, QueryStatus db = DatabaseDAO.find_one_or_none(id=1) result = db.execute( @@ -136,8 +135,8 @@ class Database(CoreModel): def execute_async( self, sql: str, - options: QueryOptions | None = None, - ) -> AsyncQueryHandle: + options: "QueryOptions | None" = None, + ) -> "AsyncQueryHandle": """ Execute SQL asynchronously. @@ -286,47 +285,6 @@ class User(CoreModel): active: bool -class Query(CoreModel): - """ - Abstract Query model interface. - - Host implementations will replace this class during initialization - with concrete implementation providing actual functionality. - """ - - __abstract__ = True - - # Type hints for expected attributes (no actual field definitions) - id: int - client_id: str | None - database_id: int | None - sql: str | None - status: str | None - user_id: int | None - progress: int - error_message: str | None - - -class SavedQuery(CoreModel): - """ - Abstract SavedQuery model interface. - - Host implementations will replace this class during initialization - with concrete implementation providing actual functionality. - """ - - __abstract__ = True - - # Type hints for expected attributes (no actual field definitions) - id: int - uuid: UUID | None - label: str | None - sql: str | None - database_id: int | None - description: str | None - user_id: int | None - - class Tag(CoreModel): """ Abstract Tag model interface. @@ -362,132 +320,6 @@ class KeyValue(CoreModel): changed_by_fk: int | None -class Task(CoreModel): - """ - Abstract Task model interface. - - Host implementations will replace this class during initialization - with concrete implementation providing actual functionality. - - This model represents async tasks in the Global Task Framework (GTF). - - Non-filterable fields (progress, error info, execution config) are stored - in a `properties` JSON blob for schema flexibility. - """ - - __abstract__ = True - - # Type hints for expected column attributes - id: int - uuid: UUID - task_key: str # For deduplication - task_type: str # e.g., 'sql_execution' - task_name: str | None # Human readable name - scope: str # private/shared/system - status: str - dedup_key: str # Computed deduplication key - - # Timestamps (from AuditMixinNullable) - created_on: datetime | None - changed_on: datetime | None - started_at: datetime | None - ended_at: datetime | None - - # User context - created_by_fk: int | None - user_id: int | None - - # Task output data - payload: str # JSON serialized task output data - - def get_payload(self) -> dict[str, Any]: - """ - Get payload as parsed JSON. - - Payload contains task-specific output data set by task code. - - Host implementations will replace this method during initialization - with concrete implementation providing actual functionality. - - :returns: Dictionary containing payload data - """ - raise NotImplementedError("Method will be replaced during initialization") - - def set_payload(self, data: dict[str, Any]) -> None: - """ - Update payload with new data (merges with existing). - - Host implementations will replace this method during initialization - with concrete implementation providing actual functionality. - - :param data: Dictionary of data to merge into payload - """ - raise NotImplementedError("Method will be replaced during initialization") - - @property - def properties(self) -> Any: - """ - Get typed properties (runtime state and execution config). - - Properties contain: - - is_abortable: bool | None - has abort handler registered - - progress_percent: float | None - progress 0.0-1.0 - - progress_current: int | None - current iteration count - - progress_total: int | None - total iterations - - error_message: str | None - human-readable error message - - exception_type: str | None - exception class name - - stack_trace: str | None - full formatted traceback - - timeout: int | None - timeout in seconds - - Host implementations will replace this property during initialization. - - :returns: TaskProperties dataclass instance - """ - raise NotImplementedError("Property will be replaced during initialization") - - def update_properties(self, updates: "TaskProperties") -> None: - """ - Update specific properties fields (merge semantics). - - Only updates fields present in the updates dict. - - Host implementations will replace this method during initialization. - - :param updates: TaskProperties dict with fields to update - - Example: - task.update_properties({"is_abortable": True}) - """ - raise NotImplementedError("Method will be replaced during initialization") - - -class TaskSubscriber(CoreModel): - """ - Abstract TaskSubscriber model interface. - - Host implementations will replace this class during initialization - with concrete implementation providing actual functionality. - - This model tracks task subscriptions for multi-user shared tasks. When a user - schedules a shared task with the same parameters as an existing task, - they are subscribed to that task instead of creating a duplicate. - """ - - __abstract__ = True - - # Type hints for expected attributes (no actual field definitions) - id: int - task_id: int - user_id: int - subscribed_at: datetime - - # Audit fields from AuditMixinNullable - created_on: datetime | None - changed_on: datetime | None - created_by_fk: int | None - changed_by_fk: int | None - - def get_session() -> scoped_session: """ Retrieve the SQLAlchemy session to directly interface with the @@ -507,12 +339,8 @@ __all__ = [ "Chart", "Dashboard", "User", - "Query", - "SavedQuery", "Tag", "KeyValue", - "Task", - "TaskSubscriber", "CoreModel", "get_session", ] diff --git a/superset-core/src/superset_core/mcp/__init__.py b/superset-core/src/superset_core/mcp/__init__.py new file mode 100644 index 00000000000..13a83393a91 --- /dev/null +++ b/superset-core/src/superset_core/mcp/__init__.py @@ -0,0 +1,16 @@ +# 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. diff --git a/superset-core/src/superset_core/api/mcp.py b/superset-core/src/superset_core/mcp/decorators.py similarity index 99% rename from superset-core/src/superset_core/api/mcp.py rename to superset-core/src/superset_core/mcp/decorators.py index f413a9ec7e7..d8c814a1acd 100644 --- a/superset-core/src/superset_core/api/mcp.py +++ b/superset-core/src/superset_core/mcp/decorators.py @@ -22,7 +22,7 @@ This module provides a decorator interface to register MCP tools with the host application. Usage: - from superset_core.api.mcp import tool + from superset_core.mcp.decorators import tool @tool(name="my_tool", description="Custom business logic", tags=["extension"]) def my_extension_tool(param: str) -> dict: diff --git a/superset-core/src/superset_core/queries/__init__.py b/superset-core/src/superset_core/queries/__init__.py new file mode 100644 index 00000000000..13a83393a91 --- /dev/null +++ b/superset-core/src/superset_core/queries/__init__.py @@ -0,0 +1,16 @@ +# 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. diff --git a/superset-core/src/superset_core/queries/daos.py b/superset-core/src/superset_core/queries/daos.py new file mode 100644 index 00000000000..fcc86674c3b --- /dev/null +++ b/superset-core/src/superset_core/queries/daos.py @@ -0,0 +1,63 @@ +# 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. + +""" +Query Data Access Object API for superset-core. + +Provides query-related DAO classes that will be replaced by host implementations +during initialization. + +Usage: + from superset_core.queries.daos import QueryDAO, SavedQueryDAO +""" + +from superset_core.common.daos import BaseDAO +from superset_core.queries.models import Query, SavedQuery + + +class QueryDAO(BaseDAO[Query]): + """ + Abstract Query DAO interface. + + Host implementations will replace this class during initialization + with a concrete implementation providing actual functionality. + """ + + # Class variables that will be set by host implementation + model_cls = None + base_filter = None + id_column_name = "id" + + +class SavedQueryDAO(BaseDAO[SavedQuery]): + """ + Abstract SavedQuery DAO interface. + + Host implementations will replace this class during initialization + with a concrete implementation providing actual functionality. + """ + + # Class variables that will be set by host implementation + model_cls = None + base_filter = None + id_column_name = "id" + + +__all__ = [ + "QueryDAO", + "SavedQueryDAO", +] diff --git a/superset-core/src/superset_core/queries/models.py b/superset-core/src/superset_core/queries/models.py new file mode 100644 index 00000000000..4b8ce5417f1 --- /dev/null +++ b/superset-core/src/superset_core/queries/models.py @@ -0,0 +1,79 @@ +# 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. + +""" +Query model API for superset-core. + +Provides query-related model classes that will be replaced by host implementations +during initialization for extension developers to use. + +Usage: + from superset_core.queries.models import Query, SavedQuery +""" + +from __future__ import annotations + +from uuid import UUID + +from superset_core.common.models import CoreModel + + +class Query(CoreModel): + """ + Abstract Query model interface. + + Host implementations will replace this class during initialization + with concrete implementation providing actual functionality. + """ + + __abstract__ = True + + # Type hints for expected attributes (no actual field definitions) + id: int + client_id: str | None + database_id: int | None + sql: str | None + status: str | None + user_id: int | None + progress: int + error_message: str | None + + +class SavedQuery(CoreModel): + """ + Abstract SavedQuery model interface. + + Host implementations will replace this class during initialization + with concrete implementation providing actual functionality. + """ + + __abstract__ = True + + # Type hints for expected attributes (no actual field definitions) + id: int + uuid: UUID | None + label: str | None + sql: str | None + database_id: int | None + description: str | None + user_id: int | None + + +__all__ = [ + "Query", + "SavedQuery", +] diff --git a/superset-core/src/superset_core/api/query.py b/superset-core/src/superset_core/queries/query.py similarity index 93% rename from superset-core/src/superset_core/api/query.py rename to superset-core/src/superset_core/queries/query.py index 050067e9e3b..b11d461c443 100644 --- a/superset-core/src/superset_core/api/query.py +++ b/superset-core/src/superset_core/queries/query.py @@ -22,7 +22,7 @@ Provides dependency-injected query utility functions that will be replaced by host implementations during initialization. Usage: - from superset_core.api.query import get_sqlglot_dialect + from superset_core.queries.query import get_sqlglot_dialect dialect = get_sqlglot_dialect(database) """ @@ -32,7 +32,7 @@ from typing import TYPE_CHECKING from sqlglot import Dialects if TYPE_CHECKING: - from superset_core.api.models import Database + from superset_core.common.models import Database def get_sqlglot_dialect(database: "Database") -> Dialects: diff --git a/superset-core/src/superset_core/api/types.py b/superset-core/src/superset_core/queries/types.py similarity index 100% rename from superset-core/src/superset_core/api/types.py rename to superset-core/src/superset_core/queries/types.py diff --git a/superset-core/src/superset_core/rest_api/__init__.py b/superset-core/src/superset_core/rest_api/__init__.py new file mode 100644 index 00000000000..13a83393a91 --- /dev/null +++ b/superset-core/src/superset_core/rest_api/__init__.py @@ -0,0 +1,16 @@ +# 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. diff --git a/superset-core/src/superset_core/rest_api/api.py b/superset-core/src/superset_core/rest_api/api.py new file mode 100644 index 00000000000..ebcc4b83f49 --- /dev/null +++ b/superset-core/src/superset_core/rest_api/api.py @@ -0,0 +1,32 @@ +# 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. + +from flask_appbuilder.api import BaseApi + + +class RestApi(BaseApi): + """ + Base REST API class for Superset with browser login support. + + This class extends Flask-AppBuilder's BaseApi and enables browser-based + authentication by default. + """ + + allow_browser_login = True + + +__all__ = ["RestApi"] diff --git a/superset-core/src/superset_core/api/rest_api.py b/superset-core/src/superset_core/rest_api/decorators.py similarity index 82% rename from superset-core/src/superset_core/api/rest_api.py rename to superset-core/src/superset_core/rest_api/decorators.py index 40d7d2ce8a4..37581713ead 100644 --- a/superset-core/src/superset_core/api/rest_api.py +++ b/superset-core/src/superset_core/rest_api/decorators.py @@ -16,15 +16,11 @@ # under the License. """ -REST API functions and decorators for superset-core. - -Provides dependency-injected REST API utility functions and decorators that will be -replaced by host implementations during initialization. +REST API decorator for superset-core. Usage: - from superset_core.api.rest_api import api + from superset_core.rest_api.decorators import api - # Unified decorator for both host and extension APIs @api( id="main_api", name="Main API", @@ -34,25 +30,15 @@ Usage: pass """ -from typing import Callable, TypeVar +from typing import Callable, TYPE_CHECKING, TypeVar -from flask_appbuilder.api import BaseApi +if TYPE_CHECKING: + from superset_core.rest_api.api import RestApi # Type variable for decorated API classes T = TypeVar("T", bound=type["RestApi"]) -class RestApi(BaseApi): - """ - Base REST API class for Superset with browser login support. - - This class extends Flask-AppBuilder's BaseApi and enables browser-based - authentication by default. - """ - - allow_browser_login = True - - def api( id: str, name: str, @@ -114,4 +100,4 @@ def api( ) -__all__ = ["RestApi", "api"] +__all__ = ["api"] diff --git a/superset-core/src/superset_core/tasks/__init__.py b/superset-core/src/superset_core/tasks/__init__.py new file mode 100644 index 00000000000..13a83393a91 --- /dev/null +++ b/superset-core/src/superset_core/tasks/__init__.py @@ -0,0 +1,16 @@ +# 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. diff --git a/superset-core/src/superset_core/tasks/daos.py b/superset-core/src/superset_core/tasks/daos.py new file mode 100644 index 00000000000..b810edec31a --- /dev/null +++ b/superset-core/src/superset_core/tasks/daos.py @@ -0,0 +1,76 @@ +# 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. + +""" +Task Data Access Object API for superset-core. + +Provides task-related DAO classes that will be replaced by host implementations +during initialization. + +Usage: + from superset_core.tasks.daos import TaskDAO +""" + +from abc import abstractmethod + +from superset_core.common.daos import BaseDAO +from superset_core.tasks.models import Task + + +class TaskDAO(BaseDAO[Task]): + """ + Abstract Task DAO interface. + + Host implementations will replace this class during initialization + with a concrete implementation providing actual functionality. + """ + + # Class variables that will be set by host implementation + model_cls = None + base_filter = None + id_column_name = "id" + uuid_column_name = "uuid" + + @classmethod + @abstractmethod + def find_by_task_key( + cls, + task_type: str, + task_key: str, + scope: str = "private", + user_id: int | None = None, + ) -> Task | None: + """ + Find active task by type, key, scope, and user. + + Uses dedup_key internally for efficient querying with a unique index. + Only returns tasks that are active (pending or in progress). + + Uniqueness logic by scope: + - private: scope + task_type + task_key + user_id + - shared/system: scope + task_type + task_key (user-agnostic) + + :param task_type: Task type to filter by + :param task_key: Task identifier for deduplication + :param scope: Task scope (private/shared/system) + :param user_id: User ID (required for private tasks) + :returns: Task instance or None if not found or not active + """ + ... + + +__all__ = ["TaskDAO"] diff --git a/superset-core/src/superset_core/tasks/decorators.py b/superset-core/src/superset_core/tasks/decorators.py new file mode 100644 index 00000000000..5785add4624 --- /dev/null +++ b/superset-core/src/superset_core/tasks/decorators.py @@ -0,0 +1,152 @@ +# 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. + +from __future__ import annotations + +from typing import Callable, Generic, ParamSpec, TYPE_CHECKING, TypeVar + +from superset_core.tasks.types import TaskContext, TaskScope + +if TYPE_CHECKING: + from superset_core.tasks.models import Task + +P = ParamSpec("P") +R = TypeVar("R") + + +def task( + name: str | None = None, + scope: TaskScope = TaskScope.PRIVATE, + timeout: int | None = None, +) -> Callable[[Callable[P, R]], "TaskWrapper[P]"]: + """ + Decorator to register a task. + + Host implementations will replace this function during initialization + with a concrete implementation providing actual functionality. + + :param name: Optional unique task name (e.g., "superset.generate_thumbnail"). + If not provided, uses the function name as the task name. + :param scope: Task scope (TaskScope.PRIVATE, SHARED, or SYSTEM). + Defaults to TaskScope.PRIVATE. + :param timeout: Optional timeout in seconds. When the timeout is reached, + abort handlers are triggered if registered. Can be overridden + at call time via TaskOptions(timeout=...). + :returns: TaskWrapper with .schedule() method + + Note: + Both direct calls and .schedule() return Task, regardless of the + original function's return type. The decorated function's return value + is discarded; only side effects and context updates matter. + + Example: + from superset_core.tasks.decorators import task, get_context + from superset_core.tasks.types import TaskScope + + # Private task (default scope) + @task + def generate_thumbnail(chart_id: int) -> None: + ctx = get_context() + # ... task implementation + + # Named task with shared scope + @task(name="generate_report", scope=TaskScope.SHARED) + def generate_chart_thumbnail(chart_id: int) -> None: + ctx = get_context() + + # Update progress and payload atomically + ctx.update_task( + progress=0.5, + payload={"chart_id": chart_id, "status": "processing"} + ) + # ... task implementation + + ctx.update_task(progress=1.0) + + # System task (admin-only) + @task(scope=TaskScope.SYSTEM) + def cleanup_old_data() -> None: + ctx = get_context() + # ... cleanup implementation + + # Task with timeout + @task(timeout=300) # 5-minute timeout + def long_running_task() -> None: + ctx = get_context() + + @ctx.on_abort + def handle_abort(): + # Called when timeout or manual abort + pass + + # Schedule async execution + task = generate_chart_thumbnail.schedule(chart_id=123) # Returns Task + + # Direct call for sync execution (blocks until task is complete) + task = generate_chart_thumbnail(chart_id=123) # Also returns Task + """ + raise NotImplementedError("Function will be replaced during initialization") + + +class TaskWrapper(Generic[P]): + """ + Type stub for task wrapper returned by @task decorator. + + Both __call__ and .schedule() return Task. + """ + + def __call__(self, *args: P.args, **kwargs: P.kwargs) -> "Task": + """Execute the task synchronously.""" + raise NotImplementedError("Will be replaced during initialization") + + def schedule(self, *args: P.args, **kwargs: P.kwargs) -> "Task": + """Schedule the task for async execution.""" + raise NotImplementedError("Will be replaced during initialization") + + +def get_context() -> TaskContext: + """ + Get the current task context from ambient context. + + Host implementations will replace this function during initialization + with a concrete implementation providing actual functionality. + + This function provides ambient access to the task context without + requiring it to be passed as a parameter. It can only be called + from within an async task execution. + + :returns: The current TaskContext + :raises RuntimeError: If called outside a task execution context + + Example: + @task("thumbnail_generation") + def generate_chart_thumbnail(chart_id: int): + ctx = get_context() # Access ambient context + + # Update task state - no need to fetch task object + ctx.update_task( + progress=0.5, + payload={"chart_id": chart_id} + ) + """ + raise NotImplementedError("Function will be replaced during initialization") + + +__all__ = [ + "task", + "get_context", +] diff --git a/superset-core/src/superset_core/tasks/models.py b/superset-core/src/superset_core/tasks/models.py new file mode 100644 index 00000000000..1dcf70ad1a8 --- /dev/null +++ b/superset-core/src/superset_core/tasks/models.py @@ -0,0 +1,169 @@ +# 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. + +""" +Task model API for superset-core. + +Provides task-related model classes that will be replaced by host implementations +during initialization for extension developers to use. + +Usage: + from superset_core.tasks.models import Task, TaskSubscriber +""" + +from __future__ import annotations + +from datetime import datetime +from typing import Any, TYPE_CHECKING +from uuid import UUID + +from superset_core.common.models import CoreModel + +if TYPE_CHECKING: + from superset_core.tasks.types import TaskProperties + + +class Task(CoreModel): + """ + Abstract Task model interface. + + Host implementations will replace this class during initialization + with concrete implementation providing actual functionality. + + This model represents async tasks in the Global Task Framework (GTF). + + Non-filterable fields (progress, error info, execution config) are stored + in a `properties` JSON blob for schema flexibility. + """ + + __abstract__ = True + + # Type hints for expected column attributes + id: int + uuid: UUID + task_key: str # For deduplication + task_type: str # e.g., 'sql_execution' + task_name: str | None # Human readable name + scope: str # private/shared/system + status: str + dedup_key: str # Computed deduplication key + + # Timestamps (from AuditMixinNullable) + created_on: datetime | None + changed_on: datetime | None + started_at: datetime | None + ended_at: datetime | None + + # User context + created_by_fk: int | None + user_id: int | None + + # Task output data + payload: str # JSON serialized task output data + + def get_payload(self) -> dict[str, Any]: + """ + Get payload as parsed JSON. + + Payload contains task-specific output data set by task code. + + Host implementations will replace this method during initialization + with concrete implementation providing actual functionality. + + :returns: Dictionary containing payload data + """ + raise NotImplementedError("Method will be replaced during initialization") + + def set_payload(self, data: dict[str, Any]) -> None: + """ + Update payload with new data (merges with existing). + + Host implementations will replace this method during initialization + with concrete implementation providing actual functionality. + + :param data: Dictionary of data to merge into payload + """ + raise NotImplementedError("Method will be replaced during initialization") + + @property + def properties(self) -> Any: + """ + Get typed properties (runtime state and execution config). + + Properties contain: + - is_abortable: bool | None - has abort handler registered + - progress_percent: float | None - progress 0.0-1.0 + - progress_current: int | None - current iteration count + - progress_total: int | None - total iterations + - error_message: str | None - human-readable error message + - exception_type: str | None - exception class name + - stack_trace: str | None - full formatted traceback + - timeout: int | None - timeout in seconds + + Host implementations will replace this property during initialization. + + :returns: TaskProperties dataclass instance + """ + raise NotImplementedError("Property will be replaced during initialization") + + def update_properties(self, updates: "TaskProperties") -> None: + """ + Update specific properties fields (merge semantics). + + Only updates fields present in the updates dict. + + Host implementations will replace this method during initialization. + + :param updates: TaskProperties dict with fields to update + + Example: + task.update_properties({"is_abortable": True}) + """ + raise NotImplementedError("Method will be replaced during initialization") + + +class TaskSubscriber(CoreModel): + """ + Abstract TaskSubscriber model interface. + + Host implementations will replace this class during initialization + with concrete implementation providing actual functionality. + + This model tracks task subscriptions for multi-user shared tasks. When a user + schedules a shared task with the same parameters as an existing task, + they are subscribed to that task instead of creating a duplicate. + """ + + __abstract__ = True + + # Type hints for expected attributes (no actual field definitions) + id: int + task_id: int + user_id: int + subscribed_at: datetime + + # Audit fields from AuditMixinNullable + created_on: datetime | None + changed_on: datetime | None + created_by_fk: int | None + changed_by_fk: int | None + + +__all__ = [ + "Task", + "TaskSubscriber", +] diff --git a/superset-core/src/superset_core/api/tasks.py b/superset-core/src/superset_core/tasks/types.py similarity index 62% rename from superset-core/src/superset_core/api/tasks.py rename to superset-core/src/superset_core/tasks/types.py index cc00689d622..7e4f886f10b 100644 --- a/superset-core/src/superset_core/api/tasks.py +++ b/superset-core/src/superset_core/tasks/types.py @@ -20,12 +20,7 @@ from __future__ import annotations from abc import ABC, abstractmethod from dataclasses import dataclass from enum import Enum -from typing import Any, Callable, Generic, Literal, ParamSpec, TypedDict, TypeVar - -from superset_core.api.models import Task - -P = ParamSpec("P") -R = TypeVar("R") +from typing import Any, Callable, Literal, TypedDict class TaskStatus(str, Enum): @@ -104,7 +99,7 @@ class TaskOptions: - Retry policies and backoff strategies Example: - from superset_core.api.tasks import TaskOptions, TaskScope + from superset_core.tasks.types import TaskOptions, TaskScope # Private task (default) task = my_task.schedule(arg1) @@ -233,129 +228,10 @@ class TaskContext(ABC): ... -def task( - name: str | None = None, - scope: TaskScope = TaskScope.PRIVATE, - timeout: int | None = None, -) -> Callable[[Callable[P, R]], "TaskWrapper[P]"]: - """ - Decorator to register a task. - - Host implementations will replace this function during initialization - with a concrete implementation providing actual functionality. - - :param name: Optional unique task name (e.g., "superset.generate_thumbnail"). - If not provided, uses the function name as the task name. - :param scope: Task scope (TaskScope.PRIVATE, SHARED, or SYSTEM). - Defaults to TaskScope.PRIVATE. - :param timeout: Optional timeout in seconds. When the timeout is reached, - abort handlers are triggered if registered. Can be overridden - at call time via TaskOptions(timeout=...). - :returns: TaskWrapper with .schedule() method - - Note: - Both direct calls and .schedule() return Task, regardless of the - original function's return type. The decorated function's return value - is discarded; only side effects and context updates matter. - - Example: - from superset_core.api.tasks import task, get_context, TaskScope - - # Private task (default scope) - @task - def generate_thumbnail(chart_id: int) -> None: - ctx = get_context() - # ... task implementation - - # Named task with shared scope - @task(name="generate_report", scope=TaskScope.SHARED) - def generate_chart_thumbnail(chart_id: int) -> None: - ctx = get_context() - - # Update progress and payload atomically - ctx.update_task( - progress=0.5, - payload={"chart_id": chart_id, "status": "processing"} - ) - # ... task implementation - - ctx.update_task(progress=1.0) - - # System task (admin-only) - @task(scope=TaskScope.SYSTEM) - def cleanup_old_data() -> None: - ctx = get_context() - # ... cleanup implementation - - # Task with timeout - @task(timeout=300) # 5-minute timeout - def long_running_task() -> None: - ctx = get_context() - - @ctx.on_abort - def handle_abort(): - # Called when timeout or manual abort - pass - - # Schedule async execution - task = generate_chart_thumbnail.schedule(chart_id=123) # Returns Task - - # Direct call for sync execution (blocks until task is complete) - task = generate_chart_thumbnail(chart_id=123) # Also returns Task - """ - raise NotImplementedError("Function will be replaced during initialization") - - -class TaskWrapper(Generic[P]): - """ - Type stub for task wrapper returned by @task decorator. - - Both __call__ and .schedule() return Task. - """ - - def __call__(self, *args: P.args, **kwargs: P.kwargs) -> Task: - """Execute the task synchronously.""" - raise NotImplementedError("Will be replaced during initialization") - - def schedule(self, *args: P.args, **kwargs: P.kwargs) -> Task: - """Schedule the task for async execution.""" - raise NotImplementedError("Will be replaced during initialization") - - -def get_context() -> TaskContext: - """ - Get the current task context from ambient context. - - Host implementations will replace this function during initialization - with a concrete implementation providing actual functionality. - - This function provides ambient access to the task context without - requiring it to be passed as a parameter. It can only be called - from within an async task execution. - - :returns: The current TaskContext - :raises RuntimeError: If called outside a task execution context - - Example: - @task("thumbnail_generation") - def generate_chart_thumbnail(chart_id: int): - ctx = get_context() # Access ambient context - - # Update task state - no need to fetch task object - ctx.update_task( - progress=0.5, - payload={"chart_id": chart_id} - ) - """ - raise NotImplementedError("Function will be replaced during initialization") - - __all__ = [ "TaskStatus", "TaskScope", "TaskProperties", "TaskContext", "TaskOptions", - "task", - "get_context", ] diff --git a/superset-embedded-sdk/.nvmrc b/superset-embedded-sdk/.nvmrc index 4a207c55991..42a1c98ac5a 100644 --- a/superset-embedded-sdk/.nvmrc +++ b/superset-embedded-sdk/.nvmrc @@ -1 +1 @@ -v20.18.3 +v22.22.0 diff --git a/superset-extensions-cli/src/superset_extensions_cli/cli.py b/superset-extensions-cli/src/superset_extensions_cli/cli.py index 18d45f4b682..342baf637e7 100644 --- a/superset-extensions-cli/src/superset_extensions_cli/cli.py +++ b/superset-extensions-cli/src/superset_extensions_cli/cli.py @@ -167,7 +167,7 @@ def build_manifest(cwd: Path, remote_entry: str | None) -> Manifest: # Generate conventional entry point publisher_snake = kebab_to_snake_case(extension.publisher) name_snake = kebab_to_snake_case(extension.name) - entrypoint = f"superset_extensions.{publisher_snake}.{name_snake}.entrypoint" + entrypoint = f"{publisher_snake}.{name_snake}.entrypoint" backend = ManifestBackend(entrypoint=entrypoint) return Manifest( @@ -344,12 +344,7 @@ def validate() -> None: publisher_snake = kebab_to_snake_case(extension.publisher) name_snake = kebab_to_snake_case(extension.name) expected_entry_file = ( - backend_dir - / "src" - / "superset_extensions" - / publisher_snake - / name_snake - / "entrypoint.py" + backend_dir / "src" / publisher_snake / name_snake / "entrypoint.py" ) if not expected_entry_file.exists(): @@ -359,7 +354,7 @@ def validate() -> None: fg="red", ) click.secho( - f" Convention requires: backend/src/superset_extensions/{publisher_snake}/{name_snake}/entrypoint.py", + f" Convention requires: backend/src/{publisher_snake}/{name_snake}/entrypoint.py", fg="yellow", ) sys.exit(1) @@ -713,23 +708,19 @@ def init( (frontend_src_dir / "index.tsx").write_text(index_tsx) click.secho("✅ Created frontend folder structure", fg="green") - # Initialize backend files with superset_extensions.publisher.name structure + # Initialize backend files with publisher.name structure if include_backend: backend_dir = target_dir / "backend" backend_dir.mkdir() backend_src_dir = backend_dir / "src" backend_src_dir.mkdir() - # Create superset_extensions namespace directory - namespace_dir = backend_src_dir / "superset_extensions" - namespace_dir.mkdir() - - # Create publisher directory (e.g., superset_extensions/my_org) + # Create publisher directory (e.g., my_org) publisher_snake = kebab_to_snake_case(names["publisher"]) - publisher_dir = namespace_dir / publisher_snake + publisher_dir = backend_src_dir / publisher_snake publisher_dir.mkdir() - # Create extension package directory (e.g., superset_extensions/my_org/dashboard_widgets) + # Create extension package directory (e.g., my_org/dashboard_widgets) name_snake = kebab_to_snake_case(names["name"]) extension_package_dir = publisher_dir / name_snake extension_package_dir.mkdir() @@ -738,13 +729,7 @@ def init( pyproject_toml = env.get_template("backend/pyproject.toml.j2").render(ctx) (backend_dir / "pyproject.toml").write_text(pyproject_toml) - # Namespace package __init__.py (empty for namespace) - (namespace_dir / "__init__.py").write_text("") - (publisher_dir / "__init__.py").write_text("") - # Extension package files - init_py = env.get_template("backend/src/package/__init__.py.j2").render(ctx) - (extension_package_dir / "__init__.py").write_text(init_py) entrypoint_py = env.get_template("backend/src/package/entrypoint.py.j2").render( ctx ) diff --git a/superset-extensions-cli/src/superset_extensions_cli/templates/backend/src/package/__init__.py.j2 b/superset-extensions-cli/src/superset_extensions_cli/templates/backend/src/package/__init__.py.j2 deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/superset-extensions-cli/src/superset_extensions_cli/types.py b/superset-extensions-cli/src/superset_extensions_cli/types.py index 740b48eb553..868760f2c62 100644 --- a/superset-extensions-cli/src/superset_extensions_cli/types.py +++ b/superset-extensions-cli/src/superset_extensions_cli/types.py @@ -42,8 +42,8 @@ class ExtensionNames(TypedDict): # Backend package name with hyphens for distribution (e.g., "my_org-dashboard_widgets") backend_package: str - # Full backend import path (e.g., "superset_extensions.my_org.dashboard_widgets") + # Full backend import path (e.g., "my_org.dashboard_widgets") backend_path: str - # Backend entry point (e.g., "superset_extensions.my_org.dashboard_widgets.entrypoint") + # Backend entry point (e.g., "my_org.dashboard_widgets.entrypoint") backend_entry: str diff --git a/superset-extensions-cli/src/superset_extensions_cli/utils.py b/superset-extensions-cli/src/superset_extensions_cli/utils.py index 26c1f285847..bda0f3c4a80 100644 --- a/superset-extensions-cli/src/superset_extensions_cli/utils.py +++ b/superset-extensions-cli/src/superset_extensions_cli/utils.py @@ -361,7 +361,7 @@ def generate_extension_names( publisher_snake = kebab_to_snake_case(publisher) name_snake = kebab_to_snake_case(technical_name) backend_package = f"{publisher_snake}-{name_snake}" - backend_path = f"superset_extensions.{publisher_snake}.{name_snake}" + backend_path = f"{publisher_snake}.{name_snake}" backend_entry = f"{backend_path}.entrypoint" # Validate the generated names diff --git a/superset-extensions-cli/tests/conftest.py b/superset-extensions-cli/tests/conftest.py index 2e683835ac5..8c223be5051 100644 --- a/superset-extensions-cli/tests/conftest.py +++ b/superset-extensions-cli/tests/conftest.py @@ -133,14 +133,7 @@ def extension_setup_for_bundling(): (frontend_dir / "main.js").write_text("// main js") # Create some backend files - updated path structure - backend_dir = ( - dist_dir - / "backend" - / "src" - / "superset_extensions" - / "test_org" - / "test_extension" - ) + backend_dir = dist_dir / "backend" / "src" / "test_org" / "test_extension" backend_dir.mkdir(parents=True) (backend_dir / "__init__.py").write_text("# init") diff --git a/superset-extensions-cli/tests/test_cli_build.py b/superset-extensions-cli/tests/test_cli_build.py index 76327af703a..90f63fdd5f5 100644 --- a/superset-extensions-cli/tests/test_cli_build.py +++ b/superset-extensions-cli/tests/test_cli_build.py @@ -56,13 +56,7 @@ def extension_with_build_structure(): backend_dir.mkdir() # Create conventional backend structure - backend_src_dir = ( - backend_dir - / "src" - / "superset_extensions" - / "test_org" - / "test_extension" - ) + backend_src_dir = backend_dir / "src" / "test_org" / "test_extension" backend_src_dir.mkdir(parents=True) # Create conventional entry point file @@ -70,10 +64,7 @@ def extension_with_build_structure(): (backend_src_dir / "__init__.py").write_text("") # Create parent __init__.py files for namespace packages - (backend_dir / "src" / "superset_extensions" / "__init__.py").write_text("") - ( - backend_dir / "src" / "superset_extensions" / "test_org" / "__init__.py" - ).write_text("") + (backend_dir / "src" / "test_org" / "__init__.py").write_text("") # Create pyproject.toml matching the template structure pyproject_content = """[project] @@ -84,7 +75,7 @@ license = "Apache-2.0" [tool.apache_superset_extensions.build] # Files to include in the extension build/bundle include = [ - "src/superset_extensions/test_org/test_extension/**/*.py", + "src/test_org/test_extension/**/*.py", ] exclude = [] """ @@ -133,11 +124,7 @@ def test_build_command_success_flow( "project": {"name": "test"}, "tool": { "apache_superset_extensions": { - "build": { - "include": [ - "src/superset_extensions/test_org/test_extension/**/*.py" - ] - } + "build": {"include": ["src/test_org/test_extension/**/*.py"]} } }, } @@ -178,11 +165,7 @@ def test_build_command_handles_frontend_build_failure( "project": {"name": "test"}, "tool": { "apache_superset_extensions": { - "build": { - "include": [ - "src/superset_extensions/test_org/test_extension/**/*.py" - ] - } + "build": {"include": ["src/test_org/test_extension/**/*.py"]} } }, } @@ -322,10 +305,7 @@ def test_build_manifest_creates_correct_manifest_structure( # Verify backend section and conventional entrypoint assert manifest.backend is not None - assert ( - manifest.backend.entrypoint - == "superset_extensions.test_org.test_extension.entrypoint" - ) + assert manifest.backend.entrypoint == "test_org.test_extension.entrypoint" @pytest.mark.unit @@ -477,7 +457,7 @@ def test_copy_backend_files_skips_non_files(isolated_filesystem): """Test copy_backend_files skips directories and non-files.""" # Create backend structure with directory backend_dir = isolated_filesystem / "backend" - backend_src = backend_dir / "src" / "superset_extensions" / "test_org" / "test_ext" + backend_src = backend_dir / "src" / "test_org" / "test_ext" backend_src.mkdir(parents=True) (backend_src / "__init__.py").write_text("# init") @@ -493,7 +473,7 @@ license = "Apache-2.0" [tool.apache_superset_extensions.build] include = [ - "src/superset_extensions/test_org/test_ext/**/*", + "src/test_org/test_ext/**/*", ] exclude = [] """ @@ -517,25 +497,11 @@ exclude = [] # Verify only files were copied, not directories dist_dir = isolated_filesystem / "dist" assert_file_exists( - dist_dir - / "backend" - / "src" - / "superset_extensions" - / "test_org" - / "test_ext" - / "__init__.py" + dist_dir / "backend" / "src" / "test_org" / "test_ext" / "__init__.py" ) # Directory should not be copied as a file - copied_subdir = ( - dist_dir - / "backend" - / "src" - / "superset_extensions" - / "test_org" - / "test_ext" - / "subdir" - ) + copied_subdir = dist_dir / "backend" / "src" / "test_org" / "test_ext" / "subdir" # The directory might exist but should be empty since we skip non-files if copied_subdir.exists(): assert list(copied_subdir.iterdir()) == [] @@ -546,7 +512,7 @@ def test_copy_backend_files_copies_matched_files(isolated_filesystem): """Test copy_backend_files copies files matching patterns from pyproject.toml.""" # Create backend source files backend_dir = isolated_filesystem / "backend" - backend_src = backend_dir / "src" / "superset_extensions" / "test_org" / "test_ext" + backend_src = backend_dir / "src" / "test_org" / "test_ext" backend_src.mkdir(parents=True) (backend_src / "__init__.py").write_text("# init") (backend_src / "main.py").write_text("# main") @@ -559,7 +525,7 @@ license = "Apache-2.0" [tool.apache_superset_extensions.build] include = [ - "src/superset_extensions/test_org/test_ext/**/*.py", + "src/test_org/test_ext/**/*.py", ] exclude = [] """ @@ -583,22 +549,10 @@ exclude = [] # Verify files were copied dist_dir = isolated_filesystem / "dist" assert_file_exists( - dist_dir - / "backend" - / "src" - / "superset_extensions" - / "test_org" - / "test_ext" - / "__init__.py" + dist_dir / "backend" / "src" / "test_org" / "test_ext" / "__init__.py" ) assert_file_exists( - dist_dir - / "backend" - / "src" - / "superset_extensions" - / "test_org" - / "test_ext" - / "main.py" + dist_dir / "backend" / "src" / "test_org" / "test_ext" / "main.py" ) @@ -607,7 +561,7 @@ def test_copy_backend_files_handles_various_glob_patterns(isolated_filesystem): """Test copy_backend_files correctly handles different glob pattern formats.""" # Create backend structure with files in different locations backend_dir = isolated_filesystem / "backend" - backend_src = backend_dir / "src" / "superset_extensions" / "test_org" / "test_ext" + backend_src = backend_dir / "src" / "test_org" / "test_ext" backend_src.mkdir(parents=True) # Create files that should match different pattern types @@ -628,9 +582,9 @@ license = "Apache-2.0" [tool.apache_superset_extensions.build] include = [ - "config.py", # No '/' - would break old logic - "**/*.py", # Starts with '**' - would break old logic - "src/superset_extensions/test_org/test_ext/main.py", # Specific file + "config.py", # No '/' - would break old logic + "**/*.py", # Starts with '**' - would break old logic + "src/test_org/test_ext/main.py", # Specific file ] exclude = [] """ @@ -659,34 +613,15 @@ exclude = [] # All .py files should be included (pattern: "**/*.py") assert_file_exists( - dist_dir - / "backend" - / "src" - / "superset_extensions" - / "test_org" - / "test_ext" - / "__init__.py" + dist_dir / "backend" / "src" / "test_org" / "test_ext" / "__init__.py" ) assert_file_exists( - dist_dir - / "backend" - / "src" - / "superset_extensions" - / "test_org" - / "test_ext" - / "utils" - / "helper.py" + dist_dir / "backend" / "src" / "test_org" / "test_ext" / "utils" / "helper.py" ) - # Specific file (pattern: "src/superset_extensions/test_org/test_ext/main.py") + # Specific file (pattern: "src/test_org/test_ext/main.py") assert_file_exists( - dist_dir - / "backend" - / "src" - / "superset_extensions" - / "test_org" - / "test_ext" - / "main.py" + dist_dir / "backend" / "src" / "test_org" / "test_ext" / "main.py" ) diff --git a/superset-extensions-cli/tests/test_cli_bundle.py b/superset-extensions-cli/tests/test_cli_bundle.py index 3b09c59a2f8..29ec4355009 100644 --- a/superset-extensions-cli/tests/test_cli_bundle.py +++ b/superset-extensions-cli/tests/test_cli_bundle.py @@ -55,10 +55,7 @@ def test_bundle_command_creates_zip_with_default_name( assert "manifest.json" in file_list assert "frontend/dist/remoteEntry.abc123.js" in file_list assert "frontend/dist/main.js" in file_list - assert ( - "backend/src/superset_extensions/test_org/test_extension/__init__.py" - in file_list - ) + assert "backend/src/test_org/test_extension/__init__.py" in file_list @pytest.mark.cli diff --git a/superset-extensions-cli/tests/test_name_transformations.py b/superset-extensions-cli/tests/test_name_transformations.py index caa490c28d2..79dea36850b 100644 --- a/superset-extensions-cli/tests/test_name_transformations.py +++ b/superset-extensions-cli/tests/test_name_transformations.py @@ -376,13 +376,10 @@ def test_generate_extension_names_complete_flow( assert ( names["backend_package"] == f"{publisher.replace('-', '_')}-{expected_snake}" ) # Collision-safe - assert ( - names["backend_path"] - == f"superset_extensions.{publisher.replace('-', '_')}.{expected_snake}" - ) + assert names["backend_path"] == f"{publisher.replace('-', '_')}.{expected_snake}" assert ( names["backend_entry"] - == f"superset_extensions.{publisher.replace('-', '_')}.{expected_snake}.entrypoint" + == f"{publisher.replace('-', '_')}.{expected_snake}.entrypoint" ) @@ -476,8 +473,8 @@ def test_manual_technical_name_override(): assert names["id"] == "acme.chart-builder" # Composite ID assert names["mf_name"] == "acme_chartBuilder" # Module Federation format assert names["backend_package"] == "acme-chart_builder" # Collision-safe - assert names["backend_path"] == "superset_extensions.acme.chart_builder" - assert names["backend_entry"] == "superset_extensions.acme.chart_builder.entrypoint" + assert names["backend_path"] == "acme.chart_builder" + assert names["backend_entry"] == "acme.chart_builder.entrypoint" def test_generate_names_uses_suggested_technical_names(): diff --git a/superset-extensions-cli/tests/test_templates.py b/superset-extensions-cli/tests/test_templates.py index 918cb75cd94..a04fb013f74 100644 --- a/superset-extensions-cli/tests/test_templates.py +++ b/superset-extensions-cli/tests/test_templates.py @@ -49,8 +49,8 @@ def template_context(): "npm_name": "@test-org/test-extension", "mf_name": "testOrg_testExtension", "backend_package": "test_org-test_extension", - "backend_path": "superset_extensions.test_org.test_extension", - "backend_entry": "superset_extensions.test_org.test_extension.entrypoint", + "backend_path": "test_org.test_extension", + "backend_entry": "test_org.test_extension.entrypoint", "version": "0.1.0", "license": "Apache-2.0", "include_frontend": True, @@ -197,8 +197,8 @@ def test_template_rendering_with_different_ids( "npm_name": f"@{publisher}/{technical_name}", "mf_name": get_module_federation_name(publisher, technical_name), "backend_package": f"{publisher_snake}-{name_snake}", - "backend_path": f"superset_extensions.{publisher_snake}.{name_snake}", - "backend_entry": f"superset_extensions.{publisher_snake}.{name_snake}.entrypoint", + "backend_path": f"{publisher_snake}.{name_snake}", + "backend_entry": f"{publisher_snake}.{name_snake}.entrypoint", "version": "1.0.0", "license": "MIT", "include_frontend": True, @@ -274,8 +274,8 @@ def test_template_rendering_with_different_licenses(jinja_env, license_type): "npm_name": "@test-pub/test-ext", "mf_name": "testPub_testExt", "backend_package": "test_pub-test_ext", - "backend_path": "superset_extensions.test_pub.test_ext", - "backend_entry": "superset_extensions.test_pub.test_ext.entrypoint", + "backend_path": "test_pub.test_ext", + "backend_entry": "test_pub.test_ext.entrypoint", "version": "1.0.0", "license": license_type, "include_frontend": True, @@ -347,8 +347,8 @@ def test_template_context_edge_cases(jinja_env): "npm_name": "@min/minimal", "mf_name": "min_minimal", "backend_package": "min-minimal", - "backend_path": "superset_extensions.min.minimal", - "backend_entry": "superset_extensions.min.minimal.entrypoint", + "backend_path": "min.minimal", + "backend_entry": "min.minimal.entrypoint", "version": "1.0.0", "license": "MIT", "include_frontend": False, diff --git a/superset-frontend/.nvmrc b/superset-frontend/.nvmrc index 4a207c55991..42a1c98ac5a 100644 --- a/superset-frontend/.nvmrc +++ b/superset-frontend/.nvmrc @@ -1 +1 @@ -v20.18.3 +v22.22.0 diff --git a/superset-frontend/.storybook/preview.jsx b/superset-frontend/.storybook/preview.jsx index d216da26875..1dd959257f3 100644 --- a/superset-frontend/.storybook/preview.jsx +++ b/superset-frontend/.storybook/preview.jsx @@ -17,7 +17,7 @@ * under the License. */ import { withJsx } from '@mihkeleidast/storybook-addon-source'; -import { themeObject, css, exampleThemes } from '@apache-superset/core/ui'; +import { themeObject, css, exampleThemes } from '@apache-superset/core/theme'; import { combineReducers, createStore, applyMiddleware, compose } from 'redux'; import thunk from 'redux-thunk'; import { Provider } from 'react-redux'; diff --git a/superset-frontend/.storybook/shared/ResizableChartDemo.tsx b/superset-frontend/.storybook/shared/ResizableChartDemo.tsx index 617e6d87375..81031bdb9ef 100644 --- a/superset-frontend/.storybook/shared/ResizableChartDemo.tsx +++ b/superset-frontend/.storybook/shared/ResizableChartDemo.tsx @@ -18,7 +18,7 @@ */ import { useState, ReactNode, SyntheticEvent } from 'react'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import type { Decorator } from '@storybook/react'; import { ResizeCallbackData } from 'react-resizable'; import ResizablePanel, { Size } from './ResizablePanel'; diff --git a/superset-frontend/.storybook/shared/ResizablePanel.tsx b/superset-frontend/.storybook/shared/ResizablePanel.tsx index 8a18a49fad6..3ac33c57052 100644 --- a/superset-frontend/.storybook/shared/ResizablePanel.tsx +++ b/superset-frontend/.storybook/shared/ResizablePanel.tsx @@ -23,7 +23,7 @@ import { ResizableBoxProps, ResizeCallbackData, } from 'react-resizable'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import 'react-resizable/css/styles.css'; diff --git a/superset-frontend/.storybook/shared/VerifyCORS.tsx b/superset-frontend/.storybook/shared/VerifyCORS.tsx index bbc3e115bf6..78fb78c6fb2 100644 --- a/superset-frontend/.storybook/shared/VerifyCORS.tsx +++ b/superset-frontend/.storybook/shared/VerifyCORS.tsx @@ -18,7 +18,7 @@ */ import { Component, ReactNode } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SupersetClient, Method, diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index 5defc8e7bdb..9f80f2c15e1 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -94,7 +94,7 @@ "geostyler-openlayers-parser": "^4.3.0", "geostyler-style": "7.5.0", "geostyler-wfs-parser": "^2.0.3", - "google-auth-library": "^10.5.0", + "google-auth-library": "^10.6.1", "immer": "^11.1.4", "interweave": "^13.1.1", "jquery": "^4.0.0", @@ -231,7 +231,7 @@ "copy-webpack-plugin": "^13.0.1", "cross-env": "^10.1.0", "css-loader": "^7.1.4", - "css-minimizer-webpack-plugin": "^7.0.4", + "css-minimizer-webpack-plugin": "^8.0.0", "eslint": "^8.56.0", "eslint-config-prettier": "^7.2.0", "eslint-import-resolver-alias": "^1.1.2", @@ -300,7 +300,7 @@ "webpack-visualizer-plugin2": "^2.0.0" }, "engines": { - "node": "^20.18.1", + "node": "^22.22.0", "npm": "^10.8.1" }, "peerDependencies": { @@ -4268,7 +4268,6 @@ "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, "license": "ISC", "dependencies": { "string-width": "^5.1.2", @@ -4286,7 +4285,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -4299,7 +4297,6 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -4312,7 +4309,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", @@ -4330,7 +4326,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^6.0.1" @@ -4346,7 +4341,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^6.1.0", @@ -9088,7 +9082,6 @@ "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, "license": "MIT", "optional": true, "engines": { @@ -22173,9 +22166,9 @@ } }, "node_modules/css-minimizer-webpack-plugin": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-7.0.4.tgz", - "integrity": "sha512-2iACis+P8qdLj1tHcShtztkGhCNIRUajJj7iX0IM9a5FA0wXGwjV8Nf6+HsBjBfb4LO8TTAVoetBbM54V6f3+Q==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-8.0.0.tgz", + "integrity": "sha512-9bEpzHs8gEq6/cbEj418jXL/YWjBUD2YTLLk905Npt2JODqnRITin0+So5Vx4Dp5vyi2Lpt9pp2QHzQ7fdxNrw==", "dev": true, "license": "MIT", "dependencies": { @@ -22184,10 +22177,10 @@ "jest-worker": "^30.0.5", "postcss": "^8.4.40", "schema-utils": "^4.2.0", - "serialize-javascript": "^6.0.2" + "serialize-javascript": "^7.0.3" }, "engines": { - "node": ">= 18.12.0" + "node": ">= 20.9.0" }, "funding": { "type": "opencollective", @@ -22334,6 +22327,16 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/css-minimizer-webpack-plugin/node_modules/serialize-javascript": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.0.4.tgz", + "integrity": "sha512-DuGdB+Po43Q5Jxwpzt1lhyFSYKryqoNjQSA9M92tyw0lyHIOur+XCalOUe0KTJpyqzT8+fQ5A0Jf7vCx/NKmIg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=20.0.0" + } + }, "node_modules/css-minimizer-webpack-plugin/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -24157,7 +24160,6 @@ "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, "license": "MIT" }, "node_modules/emojis-list": { @@ -26660,7 +26662,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", - "dev": true, "license": "ISC", "dependencies": { "cross-spawn": "^7.0.0", @@ -26677,7 +26678,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, "license": "ISC", "engines": { "node": ">=14" @@ -27055,14 +27055,15 @@ } }, "node_modules/gaxios": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.1.1.tgz", - "integrity": "sha512-Odju3uBUJyVCkW64nLD4wKLhbh93bh6vIg/ZIXkWiLPBrdgtc65+tls/qml+un3pr6JqYVFDZbbmLDQT68rTOQ==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.1.3.tgz", + "integrity": "sha512-YGGyuEdVIjqxkxVH1pUTMY/XtmmsApXrCVv5EU25iX6inEPbV+VakJfLealkBtJN69AQmh1eGOdCl9Sm1UP6XQ==", "license": "Apache-2.0", "dependencies": { "extend": "^3.0.2", "https-proxy-agent": "^7.0.1", - "node-fetch": "^3.3.2" + "node-fetch": "^3.3.2", + "rimraf": "^5.0.1" }, "engines": { "node": ">=18" @@ -27077,6 +27078,15 @@ "node": ">= 14" } }, + "node_modules/gaxios/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, "node_modules/gaxios/node_modules/data-uri-to-buffer": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", @@ -27086,6 +27096,27 @@ "node": ">= 12" } }, + "node_modules/gaxios/node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/gaxios/node_modules/https-proxy-agent": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", @@ -27099,6 +27130,21 @@ "node": ">= 14" } }, + "node_modules/gaxios/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/gaxios/node_modules/node-fetch": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", @@ -27117,6 +27163,21 @@ "url": "https://opencollective.com/node-fetch" } }, + "node_modules/gaxios/node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "license": "ISC", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/gcp-metadata": { "version": "8.1.2", "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-8.1.2.tgz", @@ -28312,17 +28373,16 @@ "license": "MIT" }, "node_modules/google-auth-library": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.5.0.tgz", - "integrity": "sha512-7ABviyMOlX5hIVD60YOfHw4/CxOfBhyduaYB+wbFWCWoni4N7SLcV46hrVRktuBbZjFC9ONyqamZITN7q3n32w==", + "version": "10.6.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.6.1.tgz", + "integrity": "sha512-5awwuLrzNol+pFDmKJd0dKtZ0fPLAtoA5p7YO4ODsDu6ONJUVqbYwvv8y2ZBO5MBNp9TJXigB19710kYpBPdtA==", "license": "Apache-2.0", "dependencies": { "base64-js": "^1.3.0", "ecdsa-sig-formatter": "^1.0.11", - "gaxios": "^7.0.0", - "gcp-metadata": "^8.0.0", - "google-logging-utils": "^1.0.0", - "gtoken": "^8.0.0", + "gaxios": "7.1.3", + "gcp-metadata": "8.1.2", + "google-logging-utils": "1.1.3", "jws": "^4.0.0" }, "engines": { @@ -28385,19 +28445,6 @@ "integrity": "sha512-HZRwumpOGUrHyxO5bqKZL0B0GlUpwtCAzZ42sgxUPniu33R1LSFH5yrIcBCHjkctCAh3mtWKcKd9J4vDDdeVHA==", "license": "ISC" }, - "node_modules/gtoken": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-8.0.0.tgz", - "integrity": "sha512-+CqsMbHPiSTdtSO14O51eMNlrp9N79gmeqmXeouJOhfucAedHw9noVe/n5uJk3tbKE6a+6ZCQg3RPhVhHByAIw==", - "license": "MIT", - "dependencies": { - "gaxios": "^7.0.0", - "jws": "^4.0.0" - }, - "engines": { - "node": ">=18" - } - }, "node_modules/h3-js": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/h3-js/-/h3-js-4.2.1.tgz", @@ -30943,7 +30990,6 @@ "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dev": true, "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" @@ -37720,7 +37766,6 @@ "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" @@ -39721,7 +39766,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true, "license": "BlueOak-1.0.0" }, "node_modules/package-json/node_modules/ky": { @@ -40023,7 +40067,6 @@ "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, "license": "BlueOak-1.0.0", "dependencies": { "lru-cache": "^10.2.0", @@ -40040,7 +40083,6 @@ "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true, "license": "ISC" }, "node_modules/path-to-regexp": { @@ -46690,7 +46732,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -46705,14 +46746,12 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, "license": "MIT" }, "node_modules/string-width-cjs/node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -46812,7 +46851,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -51915,7 +51953,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", diff --git a/superset-frontend/package.json b/superset-frontend/package.json index da008390e30..90259766e79 100644 --- a/superset-frontend/package.json +++ b/superset-frontend/package.json @@ -175,7 +175,7 @@ "geostyler-openlayers-parser": "^4.3.0", "geostyler-style": "7.5.0", "geostyler-wfs-parser": "^2.0.3", - "google-auth-library": "^10.5.0", + "google-auth-library": "^10.6.1", "immer": "^11.1.4", "interweave": "^13.1.1", "jquery": "^4.0.0", @@ -312,7 +312,7 @@ "copy-webpack-plugin": "^13.0.1", "cross-env": "^10.1.0", "css-loader": "^7.1.4", - "css-minimizer-webpack-plugin": "^7.0.4", + "css-minimizer-webpack-plugin": "^8.0.0", "eslint": "^8.56.0", "eslint-config-prettier": "^7.2.0", "eslint-import-resolver-alias": "^1.1.2", @@ -388,7 +388,7 @@ "regenerator-runtime": "^0.14.1" }, "engines": { - "node": "^20.18.1", + "node": "^22.22.0", "npm": "^10.8.1" }, "overrides": { diff --git a/superset-frontend/packages/superset-core/package.json b/superset-frontend/packages/superset-core/package.json index caf96df61ea..c6cae725228 100644 --- a/superset-frontend/packages/superset-core/package.json +++ b/superset-frontend/packages/superset-core/package.json @@ -5,6 +5,68 @@ "sideEffects": false, "main": "lib/index.js", "types": "lib/index.d.ts", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "default": "./lib/index.js" + }, + "./common": { + "types": "./lib/common/index.d.ts", + "default": "./lib/common/index.js" + }, + "./authentication": { + "types": "./lib/authentication/index.d.ts", + "default": "./lib/authentication/index.js" + }, + "./commands": { + "types": "./lib/commands/index.d.ts", + "default": "./lib/commands/index.js" + }, + "./editors": { + "types": "./lib/editors/index.d.ts", + "default": "./lib/editors/index.js" + }, + "./extensions": { + "types": "./lib/extensions/index.d.ts", + "default": "./lib/extensions/index.js" + }, + "./menus": { + "types": "./lib/menus/index.d.ts", + "default": "./lib/menus/index.js" + }, + "./sqlLab": { + "types": "./lib/sqlLab/index.d.ts", + "default": "./lib/sqlLab/index.js" + }, + "./views": { + "types": "./lib/views/index.d.ts", + "default": "./lib/views/index.js" + }, + "./contributions": { + "types": "./lib/contributions/index.d.ts", + "default": "./lib/contributions/index.js" + }, + "./theme": { + "types": "./lib/theme/index.d.ts", + "default": "./lib/theme/index.js" + }, + "./translation": { + "types": "./lib/translation/index.d.ts", + "default": "./lib/translation/index.js" + }, + "./components": { + "types": "./lib/components/index.d.ts", + "default": "./lib/components/index.js" + }, + "./utils": { + "types": "./lib/utils/index.d.ts", + "default": "./lib/utils/index.js" + }, + "./testing": { + "types": "./lib/testing.d.ts", + "default": "./lib/testing.js" + } + }, "files": [ "lib" ], diff --git a/superset-frontend/packages/superset-core/src/api/index.ts b/superset-frontend/packages/superset-core/src/api/index.ts deleted file mode 100644 index 0fbe91a7bf3..00000000000 --- a/superset-frontend/packages/superset-core/src/api/index.ts +++ /dev/null @@ -1,44 +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 Main entry point for the Superset Extension API. - * - * This module exports all public APIs for Superset extensions, providing - * a unified interface for extension developers to interact with the Superset - * platform. The API includes: - * - * - `authentication`: Handle user authentication and authorization - * - `commands`: Execute Superset commands and operations - * - `contributions`: Register UI contributions and customizations - * - `core`: Access fundamental Superset types and utilities - * - `editors`: Register custom text editor implementations - * - `extensions`: Manage extension lifecycle and metadata - * - `sqlLab`: Integrate with SQL Lab functionality - */ - -export * as authentication from './authentication'; -export * as commands from './commands'; -export * as contributions from './contributions'; -export * as core from './core'; -export * as editors from './editors'; -export * as extensions from './extensions'; -export * as menus from './menus'; -export * as sqlLab from './sqlLab'; -export * as views from './views'; diff --git a/superset-frontend/packages/superset-core/src/api/authentication.ts b/superset-frontend/packages/superset-core/src/authentication/index.ts similarity index 100% rename from superset-frontend/packages/superset-core/src/api/authentication.ts rename to superset-frontend/packages/superset-core/src/authentication/index.ts diff --git a/superset-frontend/packages/superset-core/src/api/commands.ts b/superset-frontend/packages/superset-core/src/commands/index.ts similarity index 98% rename from superset-frontend/packages/superset-core/src/api/commands.ts rename to superset-frontend/packages/superset-core/src/commands/index.ts index f00aa3a4812..ea758f8532d 100644 --- a/superset-frontend/packages/superset-core/src/api/commands.ts +++ b/superset-frontend/packages/superset-core/src/commands/index.ts @@ -25,7 +25,7 @@ * via keyboard shortcuts, menu items, programmatic calls, or other user interactions. */ -import { Disposable } from './core'; +import { Disposable } from '../common'; /** * Describes a command that can be contributed to the application. @@ -38,7 +38,7 @@ export interface Command { /** The icon associated with the command. */ icon?: string; /** A description of what the command does. */ - description: string; + description?: string; } /** diff --git a/superset-frontend/packages/superset-core/src/api/core.ts b/superset-frontend/packages/superset-core/src/common/index.ts similarity index 100% rename from superset-frontend/packages/superset-core/src/api/core.ts rename to superset-frontend/packages/superset-core/src/common/index.ts diff --git a/superset-frontend/packages/superset-core/src/ui/components/Alert/Alert.stories.tsx b/superset-frontend/packages/superset-core/src/components/Alert/Alert.stories.tsx similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/components/Alert/Alert.stories.tsx rename to superset-frontend/packages/superset-core/src/components/Alert/Alert.stories.tsx diff --git a/superset-frontend/packages/superset-core/src/ui/components/Alert/Alert.test.tsx b/superset-frontend/packages/superset-core/src/components/Alert/Alert.test.tsx similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/components/Alert/Alert.test.tsx rename to superset-frontend/packages/superset-core/src/components/Alert/Alert.test.tsx diff --git a/superset-frontend/packages/superset-core/src/ui/components/Alert/index.tsx b/superset-frontend/packages/superset-core/src/components/Alert/index.tsx similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/components/Alert/index.tsx rename to superset-frontend/packages/superset-core/src/components/Alert/index.tsx diff --git a/superset-frontend/packages/superset-core/src/ui/components/index.ts b/superset-frontend/packages/superset-core/src/components/index.ts similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/components/index.ts rename to superset-frontend/packages/superset-core/src/components/index.ts diff --git a/superset-frontend/packages/superset-core/src/api/contributions.ts b/superset-frontend/packages/superset-core/src/contributions/index.ts similarity index 94% rename from superset-frontend/packages/superset-core/src/api/contributions.ts rename to superset-frontend/packages/superset-core/src/contributions/index.ts index 6aec1bd0122..faccbb305dc 100644 --- a/superset-frontend/packages/superset-core/src/api/contributions.ts +++ b/superset-frontend/packages/superset-core/src/contributions/index.ts @@ -26,10 +26,10 @@ * menus, editors) and re-exported here for the manifest schema. */ -import { Command } from './commands'; -import { View } from './views'; -import { Menu } from './menus'; -import { Editor } from './editors'; +import { Command } from '../commands'; +import { View } from '../views'; +import { Menu } from '../menus'; +import { Editor } from '../editors'; /** * Valid locations within SQL Lab. diff --git a/superset-frontend/packages/superset-core/src/api/editors.ts b/superset-frontend/packages/superset-core/src/editors/index.ts similarity index 94% rename from superset-frontend/packages/superset-core/src/api/editors.ts rename to superset-frontend/packages/superset-core/src/editors/index.ts index 1113bc8d729..a1ed3ed9653 100644 --- a/superset-frontend/packages/superset-core/src/api/editors.ts +++ b/superset-frontend/packages/superset-core/src/editors/index.ts @@ -34,8 +34,8 @@ */ import { ForwardRefExoticComponent, RefAttributes } from 'react'; -import { Disposable, Event } from './core'; -import type { SupersetTheme } from '../ui'; +import { Disposable, Event } from '../common'; +import type { SupersetTheme } from '../theme'; /** * Supported editor languages. @@ -480,6 +480,18 @@ export interface EditorHandle { * @returns A Disposable that removes the provider when disposed */ registerCompletionProvider(provider: CompletionProvider): Disposable; + + /** + * Force the editor to recalculate its dimensions. + * Called when the container size changes or when the editor becomes + * visible after being hidden (e.g., in a tab). + * + * Each editor implementation maps this to their equivalent: + * - Ace: editor.resize() + * - Monaco: editor.layout() + * - CodeMirror: editor.requestMeasure() + */ + resize(): void; } /** @@ -501,17 +513,17 @@ export interface EditorProvider { } /** - * Event fired when an editor provider is registered. + * Event fired when an editor is registered. */ -export interface EditorProviderRegisteredEvent { - /** The registered provider */ - provider: EditorProvider; +export interface EditorRegisteredEvent { + /** The descriptor of the editor that was registered */ + editor: Editor; } /** - * Event fired when an editor provider is unregistered. + * Event fired when an editor is unregistered. */ -export interface EditorProviderUnregisteredEvent { +export interface EditorUnregisteredEvent { /** The descriptor of the editor that was unregistered */ editor: Editor; } @@ -545,7 +557,7 @@ export declare function registerEditor( * @param language The language to get an editor for * @returns The editor provider or undefined if no extension provides one */ -export declare function getEditorProvider( +export declare function getEditor( language: EditorLanguage, ): EditorProvider | undefined; @@ -555,21 +567,21 @@ export declare function getEditorProvider( * @param language The language to check * @returns True if an extension provides an editor for this language */ -export declare function hasEditorProvider(language: EditorLanguage): boolean; +export declare function hasEditor(language: EditorLanguage): boolean; /** * Get all registered editor providers. * * @returns Array of all registered editor providers */ -export declare function getAllEditorProviders(): EditorProvider[]; +export declare function getAllEditors(): EditorProvider[]; /** - * Event fired when an editor provider is registered. + * Event fired when an editor is registered. */ -export declare const onDidRegisterEditorProvider: Event; +export declare const onDidRegisterEditor: Event; /** - * Event fired when an editor provider is unregistered. + * Event fired when an editor is unregistered. */ -export declare const onDidUnregisterEditorProvider: Event; +export declare const onDidUnregisterEditor: Event; diff --git a/superset-frontend/packages/superset-core/src/api/extensions.ts b/superset-frontend/packages/superset-core/src/extensions/index.ts similarity index 98% rename from superset-frontend/packages/superset-core/src/api/extensions.ts rename to superset-frontend/packages/superset-core/src/extensions/index.ts index 5a4caea09a4..2a21f45e91f 100644 --- a/superset-frontend/packages/superset-core/src/api/extensions.ts +++ b/superset-frontend/packages/superset-core/src/extensions/index.ts @@ -26,7 +26,7 @@ * in the extension ecosystem. */ -import { Extension } from './core'; +import { Extension } from '../common'; /** * Get an extension by its full identifier in the form of: `publisher.name`. diff --git a/superset-frontend/packages/superset-core/src/index.ts b/superset-frontend/packages/superset-core/src/index.ts index b02156449f2..75863372409 100644 --- a/superset-frontend/packages/superset-core/src/index.ts +++ b/superset-frontend/packages/superset-core/src/index.ts @@ -16,6 +16,16 @@ * specific language governing permissions and limitations * under the License. */ -export * from './api'; -export * from './ui'; -export * from './utils'; +export * as common from './common'; +export * as authentication from './authentication'; +export * as commands from './commands'; +export * as editors from './editors'; +export * as extensions from './extensions'; +export * as menus from './menus'; +export * as sqlLab from './sqlLab'; +export * as views from './views'; +export * as contributions from './contributions'; +export * as theme from './theme'; +export * as translation from './translation'; +export * as components from './components'; +export * as utils from './utils'; diff --git a/superset-frontend/packages/superset-core/src/api/menus.ts b/superset-frontend/packages/superset-core/src/menus/index.ts similarity index 95% rename from superset-frontend/packages/superset-core/src/api/menus.ts rename to superset-frontend/packages/superset-core/src/menus/index.ts index 8580af6ae2b..a7c7c504cef 100644 --- a/superset-frontend/packages/superset-core/src/api/menus.ts +++ b/superset-frontend/packages/superset-core/src/menus/index.ts @@ -37,7 +37,7 @@ * ``` */ -import { Disposable } from './core'; +import { Disposable } from '../common'; /** * Represents a menu item that links a view to a command. @@ -47,6 +47,8 @@ export interface MenuItem { view: string; /** The command to execute when this menu item is selected. */ command: string; + /** Optional description of the menu item, for display in contribution manifests. */ + description?: string; } /** diff --git a/superset-frontend/packages/superset-core/src/api/sqlLab.ts b/superset-frontend/packages/superset-core/src/sqlLab/index.ts similarity index 99% rename from superset-frontend/packages/superset-core/src/api/sqlLab.ts rename to superset-frontend/packages/superset-core/src/sqlLab/index.ts index f2290676da3..cae3bc2d4e5 100644 --- a/superset-frontend/packages/superset-core/src/api/sqlLab.ts +++ b/superset-frontend/packages/superset-core/src/sqlLab/index.ts @@ -29,8 +29,8 @@ * - Global APIs: Functions and events available across the entire SQL Lab interface */ -import { Event, Database, SupersetError, Column } from './core'; -import { EditorHandle } from './editors'; +import { Event, Database, SupersetError, Column } from '../common'; +import { EditorHandle } from '../editors'; /** * Provides imperative control over the code editor component. diff --git a/superset-frontend/packages/superset-core/src/ui/testing.tsx b/superset-frontend/packages/superset-core/src/testing.tsx similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/testing.tsx rename to superset-frontend/packages/superset-core/src/testing.tsx diff --git a/superset-frontend/packages/superset-core/src/ui/theme/GlobalStyles.tsx b/superset-frontend/packages/superset-core/src/theme/GlobalStyles.tsx similarity index 87% rename from superset-frontend/packages/superset-core/src/ui/theme/GlobalStyles.tsx rename to superset-frontend/packages/superset-core/src/theme/GlobalStyles.tsx index d3350a0efbd..33a30a9fa61 100644 --- a/superset-frontend/packages/superset-core/src/ui/theme/GlobalStyles.tsx +++ b/superset-frontend/packages/superset-core/src/theme/GlobalStyles.tsx @@ -98,6 +98,17 @@ export const GlobalStyles = () => { [role='button'] { cursor: pointer; } + + // Override geostyler CSS that hides AntD ColorPicker alpha input + // See: https://github.com/apache/superset/issues/34721 + .ant-color-picker .ant-color-picker-alpha-input { + display: block; + } + + .ant-color-picker .ant-color-picker-slider-alpha { + display: flex; + margin-top: ${theme.marginXS}px; + } `} /> ); diff --git a/superset-frontend/packages/superset-core/src/ui/theme/Theme.test.tsx b/superset-frontend/packages/superset-core/src/theme/Theme.test.tsx similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/theme/Theme.test.tsx rename to superset-frontend/packages/superset-core/src/theme/Theme.test.tsx diff --git a/superset-frontend/packages/superset-core/src/ui/theme/Theme.tsx b/superset-frontend/packages/superset-core/src/theme/Theme.tsx similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/theme/Theme.tsx rename to superset-frontend/packages/superset-core/src/theme/Theme.tsx diff --git a/superset-frontend/packages/superset-core/src/ui/theme/exampleThemes.ts b/superset-frontend/packages/superset-core/src/theme/exampleThemes.ts similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/theme/exampleThemes.ts rename to superset-frontend/packages/superset-core/src/theme/exampleThemes.ts diff --git a/superset-frontend/packages/superset-core/src/ui/theme/index.tsx b/superset-frontend/packages/superset-core/src/theme/index.tsx similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/theme/index.tsx rename to superset-frontend/packages/superset-core/src/theme/index.tsx diff --git a/superset-frontend/packages/superset-core/src/ui/theme/types.ts b/superset-frontend/packages/superset-core/src/theme/types.ts similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/theme/types.ts rename to superset-frontend/packages/superset-core/src/theme/types.ts diff --git a/superset-frontend/packages/superset-core/src/ui/theme/utils/index.ts b/superset-frontend/packages/superset-core/src/theme/utils/index.ts similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/theme/utils/index.ts rename to superset-frontend/packages/superset-core/src/theme/utils/index.ts diff --git a/superset-frontend/packages/superset-core/src/ui/theme/utils/themeUtils.test.ts b/superset-frontend/packages/superset-core/src/theme/utils/themeUtils.test.ts similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/theme/utils/themeUtils.test.ts rename to superset-frontend/packages/superset-core/src/theme/utils/themeUtils.test.ts diff --git a/superset-frontend/packages/superset-core/src/ui/theme/utils/themeUtils.ts b/superset-frontend/packages/superset-core/src/theme/utils/themeUtils.ts similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/theme/utils/themeUtils.ts rename to superset-frontend/packages/superset-core/src/theme/utils/themeUtils.ts diff --git a/superset-frontend/packages/superset-core/src/ui/theme/utils/utils.test.ts b/superset-frontend/packages/superset-core/src/theme/utils/utils.test.ts similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/theme/utils/utils.test.ts rename to superset-frontend/packages/superset-core/src/theme/utils/utils.test.ts diff --git a/superset-frontend/packages/superset-core/src/ui/translation/README.md b/superset-frontend/packages/superset-core/src/translation/README.md similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/translation/README.md rename to superset-frontend/packages/superset-core/src/translation/README.md diff --git a/superset-frontend/packages/superset-core/src/ui/translation/Translator.ts b/superset-frontend/packages/superset-core/src/translation/Translator.ts similarity index 98% rename from superset-frontend/packages/superset-core/src/ui/translation/Translator.ts rename to superset-frontend/packages/superset-core/src/translation/Translator.ts index 52283a7294e..bf27ec7ce4f 100644 --- a/superset-frontend/packages/superset-core/src/ui/translation/Translator.ts +++ b/superset-frontend/packages/superset-core/src/translation/Translator.ts @@ -17,7 +17,7 @@ * under the License. */ import UntypedJed from 'jed'; -import logging from '../../utils/logging'; +import logging from '../utils/logging'; import { Jed, TranslatorConfig, diff --git a/superset-frontend/packages/superset-core/src/ui/translation/TranslatorSingleton.ts b/superset-frontend/packages/superset-core/src/translation/TranslatorSingleton.ts similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/translation/TranslatorSingleton.ts rename to superset-frontend/packages/superset-core/src/translation/TranslatorSingleton.ts diff --git a/superset-frontend/packages/superset-core/src/ui/translation/index.ts b/superset-frontend/packages/superset-core/src/translation/index.ts similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/translation/index.ts rename to superset-frontend/packages/superset-core/src/translation/index.ts diff --git a/superset-frontend/packages/superset-core/src/ui/translation/types/index.ts b/superset-frontend/packages/superset-core/src/translation/types/index.ts similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/translation/types/index.ts rename to superset-frontend/packages/superset-core/src/translation/types/index.ts diff --git a/superset-frontend/packages/superset-core/src/ui/translation/types/jed.ts b/superset-frontend/packages/superset-core/src/translation/types/jed.ts similarity index 100% rename from superset-frontend/packages/superset-core/src/ui/translation/types/jed.ts rename to superset-frontend/packages/superset-core/src/translation/types/jed.ts diff --git a/superset-frontend/packages/superset-core/src/ui/index.ts b/superset-frontend/packages/superset-core/src/ui/index.ts deleted file mode 100644 index ba78535d95d..00000000000 --- a/superset-frontend/packages/superset-core/src/ui/index.ts +++ /dev/null @@ -1,21 +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. - */ -export * from './theme'; -export * from './components'; -export * from './translation'; diff --git a/superset-frontend/packages/superset-core/src/spec/utils/logging.test.ts b/superset-frontend/packages/superset-core/src/utils/logging.test.ts similarity index 94% rename from superset-frontend/packages/superset-core/src/spec/utils/logging.test.ts rename to superset-frontend/packages/superset-core/src/utils/logging.test.ts index 6b0589156b6..66364a319d9 100644 --- a/superset-frontend/packages/superset-core/src/spec/utils/logging.test.ts +++ b/superset-frontend/packages/superset-core/src/utils/logging.test.ts @@ -22,7 +22,7 @@ beforeEach(() => { }); test('should pipe to `console` methods', () => { - const { logging } = require('@apache-superset/core'); + const { logging } = require('@apache-superset/core/utils'); vi.spyOn(logging, 'debug').mockImplementation(); vi.spyOn(logging, 'log').mockImplementation(); @@ -51,7 +51,7 @@ test('should pipe to `console` methods', () => { test('should use noop functions when console unavailable', () => { Object.assign(window, { console: undefined }); - const { logging } = require('@apache-superset/core'); + const { logging } = require('@apache-superset/core/utils'); expect(() => { logging.debug(); diff --git a/superset-frontend/packages/superset-core/src/api/views.ts b/superset-frontend/packages/superset-core/src/views/index.ts similarity index 94% rename from superset-frontend/packages/superset-core/src/api/views.ts rename to superset-frontend/packages/superset-core/src/views/index.ts index 26c3a0eb4e2..99c8ad09eb2 100644 --- a/superset-frontend/packages/superset-core/src/api/views.ts +++ b/superset-frontend/packages/superset-core/src/views/index.ts @@ -36,7 +36,7 @@ */ import { ReactElement } from 'react'; -import { Disposable } from './core'; +import { Disposable } from '../common'; /** * Represents a contributed view in the application. @@ -46,6 +46,8 @@ export interface View { id: string; /** The display name of the view. */ name: string; + /** Optional description of the view, for display in contribution manifests. */ + description?: string; } /** diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx index 82de6b7cecc..03d7a70438b 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx @@ -17,8 +17,8 @@ * under the License. */ import { kebabCase } from 'lodash'; -import { t } from '@apache-superset/core'; -import { useTheme, styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { useTheme, styled } from '@apache-superset/core/theme'; import { Tooltip } from '@superset-ui/core/components'; interface CertifiedIconWithTooltipProps { diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnOption.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnOption.tsx index 1fc55b7b09b..ca3c9edb164 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnOption.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnOption.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useState, ReactNode, useLayoutEffect, RefObject } from 'react'; -import { css, styled, SupersetTheme } from '@apache-superset/core/ui'; +import { css, styled, SupersetTheme } from '@apache-superset/core/theme'; import { SafeMarkdown, Tooltip, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnTypeLabel/ColumnTypeLabel.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnTypeLabel/ColumnTypeLabel.tsx index 57988ee9651..8ea43bdc8a6 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnTypeLabel/ColumnTypeLabel.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnTypeLabel/ColumnTypeLabel.tsx @@ -18,9 +18,9 @@ * under the License. */ import { ReactNode } from 'react'; -import { t } from '@apache-superset/core'; -import { css, styled } from '@apache-superset/core/ui'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { t } from '@apache-superset/core/translation'; +import { css, styled } from '@apache-superset/core/theme'; +import { GenericDataType } from '@apache-superset/core/common'; import { ClockCircleOutlined, QuestionOutlined, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx index 009d3bc35c2..ff2807be8b1 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx @@ -17,8 +17,8 @@ * under the License. */ import { ReactNode } from 'react'; -import { t } from '@apache-superset/core'; -import { css } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css } from '@apache-superset/core/theme'; import { InfoTooltip, Tooltip, Icons } from '@superset-ui/core/components'; type ValidationError = string; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlSubSectionHeader.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlSubSectionHeader.tsx index 456faf6ba01..79be75e55dd 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlSubSectionHeader.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlSubSectionHeader.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css } from '@apache-superset/core/ui'; +import { styled, css } from '@apache-superset/core/theme'; export const ControlSubSectionHeader = styled.div` ${({ theme }) => css` diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/MetricOption.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/MetricOption.tsx index 1f7f43c4e49..b272403df0c 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/MetricOption.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/MetricOption.tsx @@ -19,7 +19,7 @@ import { useState, ReactNode, useLayoutEffect, RefObject } from 'react'; import { Metric } from '@superset-ui/core'; -import { css, styled, SupersetTheme } from '@apache-superset/core/ui'; +import { css, styled, SupersetTheme } from '@apache-superset/core/theme'; import { SafeMarkdown, Typography, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/SQLPopover.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/SQLPopover.tsx index 68ef3fbbed0..437e933f1f7 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/SQLPopover.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/SQLPopover.tsx @@ -22,8 +22,8 @@ import { SQLEditor, } from '@superset-ui/core/components'; import { CalculatorOutlined } from '@ant-design/icons'; -import { t } from '@apache-superset/core'; -import { css, styled, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; const StyledCalculatorIcon = styled(CalculatorOutlined)` ${({ theme }) => css` diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/labelUtils.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/labelUtils.tsx index 8a4fb2a745e..d4a1aec7fe7 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/labelUtils.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/labelUtils.tsx @@ -18,8 +18,8 @@ */ import { ReactNode, RefObject } from 'react'; -import { t } from '@apache-superset/core'; -import { css, styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, styled } from '@apache-superset/core/theme'; import { ColumnMeta, Metric } from '@superset-ui/chart-controls'; const TooltipSectionWrapper = styled.div` diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/constants.ts b/superset-frontend/packages/superset-ui-chart-controls/src/constants.ts index d467f1c522b..8b53d872663 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/constants.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/constants.ts @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DTTM_ALIAS, QueryColumn, QueryMode } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ColumnMeta, SortSeriesData, SortSeriesType } from './types'; export const DEFAULT_MAX_ROW = 100000; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/fixtures.ts b/superset-frontend/packages/superset-ui-chart-controls/src/fixtures.ts index 9a988a49e9a..fd0aeb516be 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/fixtures.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/fixtures.ts @@ -17,7 +17,7 @@ * under the License. */ import { DatasourceType } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { Dataset } from './types'; export const TestDataset: Dataset = { diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/sections/advancedAnalytics.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/sections/advancedAnalytics.tsx index 12bb52af9e4..cd200003209 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/sections/advancedAnalytics.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/sections/advancedAnalytics.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { RollingType, ComparisonType } from '@superset-ui/core'; import { ControlSubSectionHeader } from '../components/ControlSubSectionHeader'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/sections/annotationsAndLayers.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/sections/annotationsAndLayers.tsx index 97ec274ac58..7ee318a46ae 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/sections/annotationsAndLayers.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/sections/annotationsAndLayers.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelSectionConfig } from '../types'; export const annotationLayers = []; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/sections/chartTitle.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/sections/chartTitle.tsx index c00fa892c30..cc98584223d 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/sections/chartTitle.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/sections/chartTitle.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlSubSectionHeader } from '../components/ControlSubSectionHeader'; import { ControlPanelSectionConfig } from '../types'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/sections/echartsTimeSeriesQuery.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/sections/echartsTimeSeriesQuery.tsx index 17cc5b73b7d..a8c61c5e1b9 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/sections/echartsTimeSeriesQuery.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/sections/echartsTimeSeriesQuery.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelSectionConfig, ControlSetRow } from '../types'; import { contributionModeControl, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/sections/forecastInterval.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/sections/forecastInterval.tsx index a3a874a15dc..fa8b7ed579f 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/sections/forecastInterval.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/sections/forecastInterval.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { legacyValidateInteger, legacyValidateNumber } from '@superset-ui/core'; import { ControlPanelSectionConfig } from '../types'; import { displayTimeRelatedControls } from '../utils'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/sections/matrixify.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/sections/matrixify.tsx index c92e8f911c6..dde1f0431db 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/sections/matrixify.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/sections/matrixify.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelSectionConfig } from '../types'; export const matrixifyEnableSection: ControlPanelSectionConfig = { diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/sections/sections.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/sections/sections.tsx index d5bd0ee2a37..f1e3c793d4c 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/sections/sections.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/sections/sections.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelSectionConfig } from '../types'; // A few standard controls sections that are used internally. diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/sections/timeComparison.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/sections/timeComparison.tsx index aacdbbe16d2..6f0f2641fa4 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/sections/timeComparison.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/sections/timeComparison.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ComparisonType } from '@superset-ui/core'; import { diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/components/RadioButtonControl.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/components/RadioButtonControl.tsx index 95ca7645f04..c244893d614 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/components/RadioButtonControl.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/components/RadioButtonControl.tsx @@ -17,7 +17,7 @@ * under the License. */ import { ReactNode } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { JsonValue } from '@superset-ui/core'; import { Radio, Tooltip, TooltipPlacement } from '@superset-ui/core/components'; import { ControlHeader } from '../../components/ControlHeader'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/customControls.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/customControls.tsx index 1d6a33ba8e9..fd355ff1167 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/customControls.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/customControls.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ContributionType, ensureIsArray, @@ -26,7 +26,7 @@ import { QueryFormColumn, QueryFormMetric, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ControlPanelState, ControlState, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx index bc8c0b0c774..807c698f83d 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx @@ -17,9 +17,9 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { QueryColumn, validateNonEmpty } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ExtraControlProps, SharedControlConfig, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/matrixifyControls.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/matrixifyControls.tsx index 274da0f7f26..be93b6fec1c 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/matrixifyControls.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/matrixifyControls.tsx @@ -18,7 +18,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty } from '@superset-ui/core'; import { SharedControlConfig } from '../types'; import { dndAdhocMetricControl } from './dndControls'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/mixins.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/mixins.tsx index 6587723cc7b..840dfc3a35f 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/mixins.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/mixins.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, NO_TIME_RANGE, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx index 0ec021d11f6..fdedfcac032 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx @@ -33,7 +33,7 @@ * control interface. */ import { isEmpty } from 'lodash'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { getCategoricalSchemeRegistry, getSequentialSchemeRegistry, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/types.ts b/superset-frontend/packages/superset-ui-chart-controls/src/types.ts index 8825f5aca64..1cc9743f4cf 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/types.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/types.ts @@ -36,7 +36,7 @@ import type { QueryResponse, TimeFormatter, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { sharedControls, sharedControlComponents } from './shared-controls'; export type { Metric } from '@superset-ui/core'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/utils/D3Formatting.ts b/superset-frontend/packages/superset-ui-chart-controls/src/utils/D3Formatting.ts index 7c43cef3b33..5a331448b28 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/utils/D3Formatting.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/utils/D3Formatting.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SMART_DATE_ID, NumberFormats, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/utils/checkColumnType.ts b/superset-frontend/packages/superset-ui-chart-controls/src/utils/checkColumnType.ts index 744aadb3912..5981ba09406 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/utils/checkColumnType.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/utils/checkColumnType.ts @@ -17,7 +17,7 @@ * under the License. */ import { ensureIsArray, ValueOf } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ControlPanelState, isDataset, isQueryResponse } from '../types'; export function checkColumnType( diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/utils/columnChoices.ts b/superset-frontend/packages/superset-ui-chart-controls/src/utils/columnChoices.ts index f1dfa22b8da..3c60f9d8f3d 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/utils/columnChoices.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/utils/columnChoices.ts @@ -17,7 +17,7 @@ * under the License. */ import { QueryColumn, QueryResponse } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ColumnMeta, Dataset, isDataset, isQueryResponse } from '../types'; export function columnsByType( diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/utils/getColorFormatters.ts b/superset-frontend/packages/superset-ui-chart-controls/src/utils/getColorFormatters.ts index 81d1ee40a42..5869472de9b 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/utils/getColorFormatters.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/utils/getColorFormatters.ts @@ -18,7 +18,7 @@ */ import memoizeOne from 'memoize-one'; import { isString, isBoolean } from 'lodash'; -import { isBlank } from '@apache-superset/core'; +import { isBlank } from '@apache-superset/core/utils'; import { addAlpha, DataRecord } from '@superset-ui/core'; import { ColorFormatters, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/utils/isSortable.ts b/superset-frontend/packages/superset-ui-chart-controls/src/utils/isSortable.ts index 679878100ba..7de415a03b5 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/utils/isSortable.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/utils/isSortable.ts @@ -21,7 +21,7 @@ import { isPhysicalColumn, QueryFormColumn, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { checkColumnType, ControlStateMapping } from '..'; export function isSortable(controls: ControlStateMapping): boolean { diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnOption.test.tsx b/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnOption.test.tsx index 0b523536ea4..e76dcee0af0 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnOption.test.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnOption.test.tsx @@ -18,7 +18,7 @@ */ import '@testing-library/jest-dom'; import { render } from '@superset-ui/core/spec'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ColumnOption, ColumnOptionProps } from '../../src'; vi.mock('@superset-ui/chart-controls/components/SQLPopover', () => ({ diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnTypeLabel.test.tsx b/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnTypeLabel.test.tsx index c216fba3291..fc65cd26f86 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnTypeLabel.test.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnTypeLabel.test.tsx @@ -19,7 +19,7 @@ import { isValidElement } from 'react'; import { render, screen } from '@superset-ui/core/spec'; import '@testing-library/jest-dom'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ColumnTypeLabel, ColumnTypeLabelProps } from '../../src'; describe('ColumnOption', () => { diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/shared-controls/customControls.test.tsx b/superset-frontend/packages/superset-ui-chart-controls/test/shared-controls/customControls.test.tsx index 6bd8d309a87..ea81c72fd5d 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/shared-controls/customControls.test.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/test/shared-controls/customControls.test.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { xAxisForceCategoricalControl } from '../../src/shared-controls/customControls'; import { checkColumnType } from '../../src/utils/checkColumnType'; import type { ControlState } from '@superset-ui/chart-controls'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/utils/checkColumnType.test.ts b/superset-frontend/packages/superset-ui-chart-controls/test/utils/checkColumnType.test.ts index 00c0bfc20ad..ef0fcf510c2 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/utils/checkColumnType.test.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/test/utils/checkColumnType.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { testQueryResponse } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { checkColumnType, TestDataset } from '../../src'; test('checkColumnType columns from a Dataset', () => { diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/utils/columnChoices.test.tsx b/superset-frontend/packages/superset-ui-chart-controls/test/utils/columnChoices.test.tsx index bc135886b54..c3728c2c37a 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/utils/columnChoices.test.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/test/utils/columnChoices.test.tsx @@ -17,7 +17,7 @@ * under the License. */ import { DatasourceType, testQueryResponse } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { columnChoices } from '../../src'; describe('columnChoices()', () => { diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/utils/getColorFormatters.test.ts b/superset-frontend/packages/superset-ui-chart-controls/test/utils/getColorFormatters.test.ts index 16e4feeb3e7..1ed3f031d70 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/utils/getColorFormatters.test.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/test/utils/getColorFormatters.test.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { configure } from '@apache-superset/core'; +import { configure } from '@apache-superset/core/translation'; import { Comparator, getOpacity, diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/utils/getTemporalColumns.test.ts b/superset-frontend/packages/superset-ui-chart-controls/test/utils/getTemporalColumns.test.ts index e5943882a1b..57a6a3c5daf 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/utils/getTemporalColumns.test.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/test/utils/getTemporalColumns.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { testQueryResponse, testQueryResults } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { Dataset, getTemporalColumns, diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/utils/isSortable.test.ts b/superset-frontend/packages/superset-ui-chart-controls/test/utils/isSortable.test.ts index 05917623613..8c58aba3294 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/utils/isSortable.test.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/test/utils/isSortable.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { ControlStateMapping } from '@superset-ui/chart-controls'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { isSortable } from '../../src/utils/isSortable'; const controls: ControlStateMapping = { diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/FallbackComponent.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/FallbackComponent.tsx index 3d20b8b0f07..3a262c00b72 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/FallbackComponent.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/FallbackComponent.tsx @@ -17,8 +17,8 @@ * under the License. */ -import { t } from '@apache-superset/core'; -import { SupersetTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { SupersetTheme } from '@apache-superset/core/theme'; import { FallbackPropsWithDimension } from './SuperChart'; export type Props = Partial; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.test.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.test.tsx index 62d61a1ed7f..a51fc4da906 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.test.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.test.tsx @@ -19,7 +19,7 @@ import { render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; -import { ThemeProvider, supersetTheme } from '@apache-superset/core/ui'; +import { ThemeProvider, supersetTheme } from '@apache-superset/core/theme'; import MatrixifyGridCell from './MatrixifyGridCell'; import { MatrixifyGridCell as MatrixifyGridCellType } from '../../types/matrixify'; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.tsx index b25dd04a3c6..5a808378c84 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.tsx @@ -18,8 +18,8 @@ */ import { memo, useMemo } from 'react'; -import { t } from '@apache-superset/core'; -import { styled, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, useTheme } from '@apache-superset/core/theme'; import { MatrixifyGridCell as GridCellData } from '../../types/matrixify'; import StatefulChart from '../StatefulChart'; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.test.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.test.tsx index aa59acb7ee1..9e115dfaac7 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.test.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.test.tsx @@ -19,8 +19,8 @@ import { render } from '@testing-library/react'; import '@testing-library/jest-dom'; -import { ThemeProvider } from '@apache-superset/core/ui'; -import { supersetTheme } from '@apache-superset/core'; +import { ThemeProvider } from '@apache-superset/core/theme'; +import { supersetTheme } from '@apache-superset/core/theme'; import MatrixifyGridRenderer from './MatrixifyGridRenderer'; import { generateMatrixifyGrid } from './MatrixifyGridGenerator'; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.tsx index 6d6e53b9031..90402f8e782 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.tsx @@ -18,7 +18,7 @@ */ import { useMemo } from 'react'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { MatrixifyFormData } from '../../types/matrixify'; import { generateMatrixifyGrid } from './MatrixifyGridGenerator'; import MatrixifyGridCell from './MatrixifyGridCell'; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/NoResultsComponent.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/NoResultsComponent.tsx index 90fcbb4d6a5..4e2dce9eb69 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/NoResultsComponent.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/NoResultsComponent.tsx @@ -18,7 +18,8 @@ */ import { CSSProperties } from 'react'; -import { css, styled, t } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; const MESSAGE_STYLES: CSSProperties = { maxWidth: 800 }; const MIN_WIDTH_FOR_BODY = 250; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/StatefulChart.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/StatefulChart.tsx index b3ef2efa2b1..2e9a4903410 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/StatefulChart.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/StatefulChart.tsx @@ -19,7 +19,7 @@ import { useState, useEffect, useRef, useCallback } from 'react'; import { ParentSize } from '@visx/responsive'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { QueryFormData, QueryData, diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/SuperChartCore.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/SuperChartCore.tsx index 9fea3c3153a..844dbae7c6a 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/SuperChartCore.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/SuperChartCore.tsx @@ -19,7 +19,7 @@ /* eslint-disable react/jsx-sort-default-props */ import { PureComponent } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { createSelector } from 'reselect'; import getChartComponentRegistry from '../registries/ChartComponentRegistrySingleton'; import getChartTransformPropsRegistry from '../registries/ChartTransformPropsRegistrySingleton'; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/models/ChartProps.ts b/superset-frontend/packages/superset-ui-core/src/chart/models/ChartProps.ts index 77727e471fd..a66667c5b36 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/models/ChartProps.ts +++ b/superset-frontend/packages/superset-ui-core/src/chart/models/ChartProps.ts @@ -19,7 +19,7 @@ import { RefObject } from 'react'; import { createSelector, lruMemoize } from 'reselect'; -import { supersetTheme, SupersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme, SupersetTheme } from '@apache-superset/core/theme'; import { AppSection, Behavior, diff --git a/superset-frontend/packages/superset-ui-core/src/components/ActionButton/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/ActionButton/index.tsx index 4d2d19c01c5..ccc2cbd2b71 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ActionButton/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ActionButton/index.tsx @@ -23,7 +23,7 @@ import { type TooltipPlacement, type IconType, } from '@superset-ui/core/components'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; export interface ActionProps { label: string; diff --git a/superset-frontend/packages/superset-ui-core/src/components/AsyncAceEditor/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/AsyncAceEditor/index.tsx index 6ec452d5a9e..56230e130f0 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/AsyncAceEditor/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/AsyncAceEditor/index.tsx @@ -32,7 +32,7 @@ import { AsyncEsmComponent, PlaceholderProps, } from '@superset-ui/core/components/AsyncEsmComponent'; -import { useTheme, css } from '@apache-superset/core/ui'; +import { useTheme, css } from '@apache-superset/core/theme'; import { Global } from '@emotion/react'; export { getTooltipHTML } from './Tooltip'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Badge/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Badge/index.tsx index adf0011627a..8ea419c7c99 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Badge/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Badge/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Badge as AntdBadge } from 'antd'; import type { BadgeProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Button/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Button/index.tsx index 3a78ef989bf..626abfaa404 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Button/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Button/index.tsx @@ -19,7 +19,7 @@ import { Children, ReactElement, Fragment } from 'react'; import cx from 'classnames'; import { Button as AntdButton } from 'antd'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import { Tooltip } from '../Tooltip'; import type { ButtonColorType, diff --git a/superset-frontend/packages/superset-ui-core/src/components/CachedLabel/TooltipContent.tsx b/superset-frontend/packages/superset-ui-core/src/components/CachedLabel/TooltipContent.tsx index 4874f50a776..da85ff5cd06 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/CachedLabel/TooltipContent.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/CachedLabel/TooltipContent.tsx @@ -18,7 +18,7 @@ */ import { FC } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { extendedDayjs } from '../../utils/dates'; interface Props { diff --git a/superset-frontend/packages/superset-ui-core/src/components/CachedLabel/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/CachedLabel/index.tsx index b370ad7f6b4..027526fe33f 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/CachedLabel/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/CachedLabel/index.tsx @@ -18,7 +18,7 @@ */ import { useState, FC } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Icons } from '@superset-ui/core/components/Icons'; import { Label } from '../Label'; import { Tooltip } from '../Tooltip'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Card/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Card/index.tsx index 5a34f1a4880..0099728f94d 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Card/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Card/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { SupersetTheme } from '@apache-superset/core/ui'; +import { SupersetTheme } from '@apache-superset/core/theme'; import { Card as AntdCard } from 'antd'; import type { CardProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/CertifiedBadge/CertifiedBadge.stories.tsx b/superset-frontend/packages/superset-ui-core/src/components/CertifiedBadge/CertifiedBadge.stories.tsx index c340a2c2ed7..f755e9324c8 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/CertifiedBadge/CertifiedBadge.stories.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/CertifiedBadge/CertifiedBadge.stories.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { configure as configureTranslation } from '@apache-superset/core'; +import { configure as configureTranslation } from '@apache-superset/core/translation'; import { CertifiedBadge } from '.'; import type { CertifiedBadgeProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/CertifiedBadge/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/CertifiedBadge/index.tsx index 47e1abc84d5..04089b2f90e 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/CertifiedBadge/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/CertifiedBadge/index.tsx @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { useTheme } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { Tooltip } from '../Tooltip'; import type { CertifiedBadgeProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Checkbox/CheckboxIcons.tsx b/superset-frontend/packages/superset-ui-core/src/components/Checkbox/CheckboxIcons.tsx index 77dd457397f..a9d07f73067 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Checkbox/CheckboxIcons.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Checkbox/CheckboxIcons.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; export const CheckboxChecked = () => { const theme = useTheme(); diff --git a/superset-frontend/packages/superset-ui-core/src/components/CodeSyntaxHighlighter/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/CodeSyntaxHighlighter/index.tsx index 0ca6f6c590f..131abad4304 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/CodeSyntaxHighlighter/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/CodeSyntaxHighlighter/index.tsx @@ -20,7 +20,7 @@ import { useEffect, useState } from 'react'; import SyntaxHighlighterBase from 'react-syntax-highlighter/dist/cjs/light'; import github from 'react-syntax-highlighter/dist/cjs/styles/hljs/github'; import tomorrow from 'react-syntax-highlighter/dist/cjs/styles/hljs/tomorrow-night'; -import { isThemeDark, useTheme } from '@apache-superset/core/ui'; +import { isThemeDark, useTheme } from '@apache-superset/core/theme'; export type SupportedLanguage = 'sql' | 'htmlbars' | 'markdown' | 'json'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Collapse/Collapse.tsx b/superset-frontend/packages/superset-ui-core/src/components/Collapse/Collapse.tsx index bcb00f7abc5..eeb45ecaba7 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Collapse/Collapse.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Collapse/Collapse.tsx @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Collapse as AntdCollapse } from 'antd'; import type { CollapseProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Collapse/CollapseLabelInModal.tsx b/superset-frontend/packages/superset-ui-core/src/components/Collapse/CollapseLabelInModal.tsx index d0a5d39cd34..1b434415908 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Collapse/CollapseLabelInModal.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Collapse/CollapseLabelInModal.tsx @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -import { useTheme, css } from '@apache-superset/core/ui'; +import { useTheme, css } from '@apache-superset/core/theme'; import { Typography } from '@superset-ui/core/components/Typography'; import { Icons } from '@superset-ui/core/components'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/ConfirmModal.test.tsx b/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/ConfirmModal.test.tsx index 107191dabef..362e059bd45 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/ConfirmModal.test.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/ConfirmModal.test.tsx @@ -17,7 +17,7 @@ * under the License. */ import { render, screen, userEvent } from '@superset-ui/core/spec'; -import { ThemeProvider, supersetTheme } from '@apache-superset/core/ui'; +import { ThemeProvider, supersetTheme } from '@apache-superset/core/theme'; import { ConfirmModal } from '.'; const defaultProps = { diff --git a/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/index.tsx index bb9d1cc5a41..28eac0522ab 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ConfirmModal/index.tsx @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@apache-superset/core/ui'; -import { t } from '@apache-superset/core'; +import { styled } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import { Icons, Modal, Typography, Button } from '@superset-ui/core/components'; import type { FC, ReactElement, ReactNode } from 'react'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/CronPicker/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/CronPicker/index.tsx index f329e090dcb..7b4f1f68b5a 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/CronPicker/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/CronPicker/index.tsx @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import ReactCronPicker from 'react-js-cron'; import type { Locale, CronProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/DatePicker/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/DatePicker/index.tsx index 0657805d759..7fecc5a9296 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/DatePicker/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/DatePicker/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { DatePicker as AntdDatePicker } from 'antd'; -import { css } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; import type { DatePickerProps, RangePickerProps } from './types'; export const DatePicker = (props: DatePickerProps) => ( diff --git a/superset-frontend/packages/superset-ui-core/src/components/DeleteModal/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/DeleteModal/index.tsx index 3b3e27b466d..55356166ea9 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/DeleteModal/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/DeleteModal/index.tsx @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { useState, useRef, useEffect, ChangeEvent } from 'react'; import { FormLabel } from '../Form'; import { Input, InputRef } from '../Input'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Divider/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Divider/index.tsx index c8e6a85b263..385710f7ba5 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Divider/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Divider/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; import { Divider as AntdDivider } from 'antd'; import type { DividerProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Dropdown/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Dropdown/index.tsx index 19ef2d74bf2..d5092353e43 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Dropdown/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Dropdown/index.tsx @@ -19,7 +19,7 @@ import { ReactElement, cloneElement } from 'react'; import { Dropdown as AntdDropdown, DropdownProps } from 'antd'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { IconOrientation, diff --git a/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/index.tsx index e3ac5aa9b6f..d9cdb5d4632 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/index.tsx @@ -18,7 +18,7 @@ */ import { Dropdown } from 'antd'; import { kebabCase } from 'lodash'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { Tooltip } from '../Tooltip'; import type { DropdownButtonProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.stories.tsx b/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.stories.tsx index 663436ba8fe..8790a2a6f53 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.stories.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.stories.tsx @@ -18,7 +18,7 @@ */ import { useRef, useCallback, useState } from 'react'; import { isEqual } from 'lodash'; -import { css } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; import { Button } from '../Button'; import { Select } from '../Select'; import type { DropdownContainerProps, DropdownRef } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx b/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx index 14df91f4cf1..32a464f2ce8 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx @@ -30,9 +30,9 @@ import { } from 'react'; import { Global } from '@emotion/react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { usePrevious } from '@superset-ui/core'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { useResizeDetector } from 'react-resize-detector'; import { Badge, Icons, Button, Tooltip, Popover } from '..'; import { DropdownContainerProps, DropdownItem, DropdownRef } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/DynamicEditableTitle/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/DynamicEditableTitle/index.tsx index 3f4bc6e5e85..0604b976de0 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/DynamicEditableTitle/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/DynamicEditableTitle/index.tsx @@ -25,8 +25,8 @@ import { useLayoutEffect, useState, } from 'react'; -import { t } from '@apache-superset/core'; -import { css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, SupersetTheme, useTheme } from '@apache-superset/core/theme'; import { useResizeDetector } from 'react-resize-detector'; import { Tooltip } from '../Tooltip'; import { Input } from '../Input'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/EditableTitle/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/EditableTitle/index.tsx index 1c955deaa72..e2c5d139e4b 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/EditableTitle/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/EditableTitle/index.tsx @@ -17,8 +17,8 @@ * under the License. */ -import { t } from '@apache-superset/core'; -import { css, styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, styled } from '@apache-superset/core/theme'; import { useEffect, useState, useRef } from 'react'; import cx from 'classnames'; import { Tooltip } from '../Tooltip'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/EmptyState/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/EmptyState/index.tsx index 30031e50550..71f840e7aab 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/EmptyState/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/EmptyState/index.tsx @@ -17,8 +17,8 @@ * under the License. */ import { ReactNode, SyntheticEvent } from 'react'; -import { t } from '@apache-superset/core'; -import { styled, css, SupersetTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, css, SupersetTheme } from '@apache-superset/core/theme'; // Importing svg images import FilterResultsImage from './svgs/filter-results.svg'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/FaveStar/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/FaveStar/index.tsx index 504341f60d0..308e44e4630 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/FaveStar/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/FaveStar/index.tsx @@ -19,8 +19,8 @@ import { useCallback, useEffect, MouseEvent } from 'react'; -import { t } from '@apache-superset/core'; -import { css, styled, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { Tooltip } from '../Tooltip'; import type { FaveStarProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Flex/Flex.stories.tsx b/superset-frontend/packages/superset-ui-core/src/components/Flex/Flex.stories.tsx index 5ba2311a73a..a9826fdb4e0 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Flex/Flex.stories.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Flex/Flex.stories.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { css } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; import { Flex } from '.'; import type { FlexProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Form/FormItem.tsx b/superset-frontend/packages/superset-ui-core/src/components/Form/FormItem.tsx index 77f59d90463..3b237d6e276 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Form/FormItem.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Form/FormItem.tsx @@ -17,7 +17,7 @@ * under the License. */ import { Form } from 'antd'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; export const FormItem = styled(Form.Item)` ${({ theme }) => ` diff --git a/superset-frontend/packages/superset-ui-core/src/components/Form/FormLabel.tsx b/superset-frontend/packages/superset-ui-core/src/components/Form/FormLabel.tsx index 209312ae652..3cb6c176261 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Form/FormLabel.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Form/FormLabel.tsx @@ -17,7 +17,7 @@ * under the License. */ import { ReactNode } from 'react'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; export type FormLabelProps = { children: ReactNode; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Form/LabeledErrorBoundInput.tsx b/superset-frontend/packages/superset-ui-core/src/components/Form/LabeledErrorBoundInput.tsx index 1506ecde1e7..882fabf8b41 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Form/LabeledErrorBoundInput.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Form/LabeledErrorBoundInput.tsx @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { Button, Icons, InfoTooltip, Tooltip, Flex } from '..'; import { Input } from '../Input'; import { FormLabel } from './FormLabel'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/IconButton/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/IconButton/index.tsx index e2cef0ae681..31a7899d99b 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/IconButton/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/IconButton/index.tsx @@ -18,7 +18,7 @@ */ // eslint-disable-next-line -import { SupersetTheme, css } from '@apache-superset/core/ui'; +import { SupersetTheme, css } from '@apache-superset/core/theme'; import { Typography } from '../Typography'; import { Icons } from '../Icons'; import { Card } from '../Card'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/IconTooltip/IconTooltip.stories.tsx b/superset-frontend/packages/superset-ui-core/src/components/IconTooltip/IconTooltip.stories.tsx index f6bf8361b0f..f61affa3787 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/IconTooltip/IconTooltip.stories.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/IconTooltip/IconTooltip.stories.tsx @@ -17,7 +17,7 @@ * under the License. */ import { Icons } from '@superset-ui/core/components/Icons'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { IconTooltip } from '.'; import type { IconTooltipProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Icons/BaseIcon.tsx b/superset-frontend/packages/superset-ui-core/src/components/Icons/BaseIcon.tsx index 99374dfcc7c..e87e6a04adf 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Icons/BaseIcon.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Icons/BaseIcon.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { css, useTheme, getFontSize } from '@apache-superset/core/ui'; +import { css, useTheme, getFontSize } from '@apache-superset/core/theme'; import { AntdIconType, BaseIconProps, CustomIconType, IconType } from './types'; const genAriaLabel = (fileName: string) => { diff --git a/superset-frontend/packages/superset-ui-core/src/components/Icons/Icons.stories.tsx b/superset-frontend/packages/superset-ui-core/src/components/Icons/Icons.stories.tsx index 8aeea5fd2b8..db107ef282d 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Icons/Icons.stories.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Icons/Icons.stories.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useState } from 'react'; -import { styled, supersetTheme } from '@apache-superset/core/ui'; +import { styled, supersetTheme } from '@apache-superset/core/theme'; import { Input } from '../Input'; import { Icons, IconNameType } from '.'; import type { IconType } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/InfoTooltip/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/InfoTooltip/index.tsx index 553ac193084..171d7ab4790 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/InfoTooltip/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/InfoTooltip/index.tsx @@ -19,8 +19,8 @@ import { KeyboardEvent, useMemo } from 'react'; import { SerializedStyles, CSSObject } from '@emotion/react'; import { kebabCase } from 'lodash'; -import { t } from '@apache-superset/core'; -import { css, useTheme, getFontSize } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, useTheme, getFontSize } from '@apache-superset/core/theme'; import { CloseCircleOutlined, InfoCircleOutlined, diff --git a/superset-frontend/packages/superset-ui-core/src/components/Label/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Label/index.tsx index 6b311e8808a..4d1de1fe125 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Label/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Label/index.tsx @@ -18,7 +18,7 @@ */ import { Tag } from '@superset-ui/core/components/Tag'; import { css } from '@emotion/react'; -import { useTheme, getColorVariants } from '@apache-superset/core/ui'; +import { useTheme, getColorVariants } from '@apache-superset/core/theme'; import { DatasetTypeLabel } from './reusable/DatasetTypeLabel'; import { PublishedLabel } from './reusable/PublishedLabel'; import type { LabelProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/DatasetTypeLabel.tsx b/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/DatasetTypeLabel.tsx index d8567d93b2a..48784d937a3 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/DatasetTypeLabel.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/DatasetTypeLabel.tsx @@ -17,8 +17,8 @@ * under the License. */ import { Icons } from '@superset-ui/core/components/Icons'; -import { t } from '@apache-superset/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { useTheme } from '@apache-superset/core/theme'; import { Label } from '..'; // Define the prop types for DatasetTypeLabel diff --git a/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/PublishedLabel.tsx b/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/PublishedLabel.tsx index 86a80ed2fcd..91fe9facde2 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/PublishedLabel.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Label/reusable/PublishedLabel.tsx @@ -17,8 +17,8 @@ * under the License. */ import { Icons } from '@superset-ui/core/components/Icons'; -import { t } from '@apache-superset/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { useTheme } from '@apache-superset/core/theme'; import { Label } from '..'; // Define props for the PublishedLabel component diff --git a/superset-frontend/packages/superset-ui-core/src/components/LastUpdated/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/LastUpdated/index.tsx index 1816f2310eb..1a070e0be7b 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/LastUpdated/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/LastUpdated/index.tsx @@ -18,8 +18,8 @@ */ import { useEffect, useState, FunctionComponent } from 'react'; -import { t } from '@apache-superset/core'; -import { styled, css, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, css, useTheme } from '@apache-superset/core/theme'; import { Dayjs } from 'dayjs'; import { extendedDayjs } from '../../utils/dates'; import 'dayjs/plugin/updateLocale'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/List/index.ts b/superset-frontend/packages/superset-ui-core/src/components/List/index.ts index 1927d288f75..5c3030e7c97 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/List/index.ts +++ b/superset-frontend/packages/superset-ui-core/src/components/List/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css, styled } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; import { List as AntdList } from 'antd'; import type { ListProps, ListItemProps, ListItemMetaProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/ImageLoader.tsx b/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/ImageLoader.tsx index b2ba0530009..fec42902cab 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/ImageLoader.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/ImageLoader.tsx @@ -18,8 +18,8 @@ */ import { useEffect, useState, DetailedHTMLProps, HTMLAttributes } from 'react'; -import { logging } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { logging } from '@apache-superset/core/utils'; +import { styled } from '@apache-superset/core/theme'; export type BackgroundPosition = 'top' | 'bottom'; interface ImageContainerProps { diff --git a/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/index.tsx index 2e718662f22..c5994181323 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ListViewCard/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { FC } from 'react'; -import { styled, useTheme, css } from '@apache-superset/core/ui'; +import { styled, useTheme, css } from '@apache-superset/core/theme'; import { Skeleton } from '../Skeleton'; import { Card } from '../Card'; import { CertifiedBadge } from '../CertifiedBadge'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Loading/index.test.tsx b/superset-frontend/packages/superset-ui-core/src/components/Loading/index.test.tsx index 3f9616d3842..d0bf38d5efa 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Loading/index.test.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Loading/index.test.tsx @@ -18,7 +18,7 @@ */ import { render, screen } from '@superset-ui/core/spec'; -import * as themeModule from '@apache-superset/core/ui/theme'; +import * as themeModule from '@apache-superset/core/theme'; import { Loading } from '.'; // Mock the loading SVG import since it's a file stub in tests diff --git a/superset-frontend/packages/superset-ui-core/src/components/Loading/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Loading/index.tsx index 7d060f3e465..1b8335e207a 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Loading/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Loading/index.tsx @@ -18,8 +18,8 @@ */ import cls from 'classnames'; -import { t } from '@apache-superset/core'; -import { styled, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, useTheme } from '@apache-superset/core/theme'; import { Loading as LoaderSvg } from '../assets'; import type { LoadingProps, SizeOption } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Menu/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Menu/index.tsx index 9bdbcd34f67..6357471d19d 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Menu/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Menu/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css } from '@apache-superset/core/ui'; +import { styled, css } from '@apache-superset/core/theme'; import { ReactElement } from 'react'; import { Menu as AntdMenu } from 'antd'; import { MenuProps as AntdMenuProps } from 'antd/es/menu'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Metadata/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Metadata/index.tsx index e4328578e8e..11698f305c4 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Metadata/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Metadata/index.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; const MetadataWrapper = styled.div` display: flex; diff --git a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentConfig.tsx b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentConfig.tsx index 12915382006..225549989b5 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentConfig.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentConfig.tsx @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { ContentType, MetadataType } from '.'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.stories.tsx b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.stories.tsx index 9228769255e..bec6b033e18 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.stories.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.stories.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; import { useResizeDetector } from 'react-resize-detector'; import MetadataBar, { MetadataBarProps, MetadataType } from '.'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.test.tsx b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.test.tsx index f7e1f70354c..93f5313d6b3 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.test.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.test.tsx @@ -19,7 +19,7 @@ import { render, screen, userEvent, within } from '@superset-ui/core/spec'; import * as resizeDetector from 'react-resize-detector'; import { hexToRgb } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import MetadataBar, { MIN_NUMBER_ITEMS, MAX_NUMBER_ITEMS, diff --git a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.tsx b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.tsx index ccfca5028c3..32e71f6b1aa 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.tsx @@ -19,7 +19,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import { useResizeDetector } from 'react-resize-detector'; import { uniqWith } from 'lodash'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Tooltip } from '../Tooltip'; import { TooltipPlacement } from '../Tooltip/types'; import { ContentType } from './ContentType'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Modal/FormModal.tsx b/superset-frontend/packages/superset-ui-core/src/components/Modal/FormModal.tsx index d4581e380c7..a7fe66fd898 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Modal/FormModal.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Modal/FormModal.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useState, useCallback } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Button } from '../Button'; import { Form } from '../Form'; import { Modal } from './Modal'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx b/superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx index 173ab6f83a2..890084be4c6 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx @@ -18,8 +18,8 @@ */ import { isValidElement, cloneElement, useMemo, useRef, useState } from 'react'; import { isNil } from 'lodash'; -import { t } from '@apache-superset/core'; -import { css, styled, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import { Modal as AntdModal, ModalProps as AntdModalProps } from 'antd'; import { Resizable } from 're-resizable'; import Draggable, { diff --git a/superset-frontend/packages/superset-ui-core/src/components/PageHeaderWithActions/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/PageHeaderWithActions/index.tsx index 469d9598f99..ae11b6ceff8 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/PageHeaderWithActions/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/PageHeaderWithActions/index.tsx @@ -17,8 +17,8 @@ * under the License. */ import { ReactNode, ReactElement } from 'react'; -import { t } from '@apache-superset/core'; -import { css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, SupersetTheme, useTheme } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import type { DropdownProps } from '../Dropdown/types'; import type { TooltipPlacement } from '../Tooltip/types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/PopoverDropdown/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/PopoverDropdown/index.tsx index 927e38399f5..c619add42c1 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/PopoverDropdown/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/PopoverDropdown/index.tsx @@ -18,7 +18,7 @@ */ import { Key } from 'react'; import cx from 'classnames'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { Dropdown } from '../Dropdown'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/PopoverSection/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/PopoverSection/index.tsx index 200705247d7..39009eba76a 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/PopoverSection/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/PopoverSection/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { MouseEventHandler, ReactNode } from 'react'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { Tooltip } from '../Tooltip'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/ProgressBar/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/ProgressBar/index.tsx index b08caada3f6..f76879eb2c3 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ProgressBar/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ProgressBar/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Progress as AntdProgress } from 'antd'; import { ProgressProps } from 'antd/es/progress/progress'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Radio/Radio.stories.tsx b/superset-frontend/packages/superset-ui-core/src/components/Radio/Radio.stories.tsx index 403fd0eed73..377525a21a1 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Radio/Radio.stories.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Radio/Radio.stories.tsx @@ -17,7 +17,7 @@ * under the License. */ import type { StoryObj } from '@storybook/react'; -import { css } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { Space } from '../Space'; import { Radio, type RadioProps, type RadioGroupWrapperProps } from '.'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/RefreshLabel/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/RefreshLabel/index.tsx index 0489fad65d6..08f5b1c88f9 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/RefreshLabel/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/RefreshLabel/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { MouseEventHandler, forwardRef } from 'react'; -import { SupersetTheme } from '@apache-superset/core/ui'; +import { SupersetTheme } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import type { IconType } from '@superset-ui/core/components/Icons/types'; import { Tooltip } from '../Tooltip'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx b/superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx index 172632da03d..9acd2f4893f 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx @@ -31,7 +31,7 @@ import { ClipboardEvent, } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, usePrevious, diff --git a/superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx b/superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx index 569f865333c..a5863d1a6f4 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx @@ -30,7 +30,7 @@ import { ReactElement, } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, usePrevious } from '@superset-ui/core'; import { Constants } from '@superset-ui/core/components'; import { diff --git a/superset-frontend/packages/superset-ui-core/src/components/Select/constants.ts b/superset-frontend/packages/superset-ui-core/src/components/Select/constants.ts index 4132870b68b..b72b146068a 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Select/constants.ts +++ b/superset-frontend/packages/superset-ui-core/src/components/Select/constants.ts @@ -17,7 +17,7 @@ * under the License. */ import { LabeledValue as AntdLabeledValue } from 'antd/es/select'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { rankedSearchCompare } from '../../utils/rankedSearchCompare'; import { RawValue, SelectProps } from './types'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Select/styles.tsx b/superset-frontend/packages/superset-ui-core/src/components/Select/styles.tsx index 47dc0f297a7..b90d18fd904 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Select/styles.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Select/styles.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Select } from 'antd'; import { Icons } from '@superset-ui/core/components/Icons'; import { Spin } from '../Spin'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Select/utils.tsx b/superset-frontend/packages/superset-ui-core/src/components/Select/utils.tsx index 234fba49c9d..05f5483fe1f 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Select/utils.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Select/utils.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray } from '@superset-ui/core'; import { ReactElement, RefObject } from 'react'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx b/superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx index 35cdc89e8ee..b9bc81715a0 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Table/VirtualTable.tsx @@ -27,7 +27,7 @@ import { useResizeDetector } from 'react-resize-detector'; import { useEffect, useRef, useState, useCallback, CSSProperties } from 'react'; import { VariableSizeGrid as Grid } from 'react-window'; import { safeHtmlSpan } from '@superset-ui/core'; -import { useTheme, styled } from '@apache-superset/core/ui'; +import { useTheme, styled } from '@apache-superset/core/theme'; import { TableSize, ETableAction } from './index'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/ActionCell/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/ActionCell/index.tsx index e14852255d3..6a7102f5b4b 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/ActionCell/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/ActionCell/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useState, useEffect } from 'react'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { MenuDotsDropdown } from '../../../Dropdown'; import { IconOrientation } from '../../../Dropdown/types'; import { Menu, MenuProps } from '../../../Menu'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/NullCell/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/NullCell/index.tsx index 1e30e9f3523..3ea5d20b176 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/NullCell/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/NullCell/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Constants } from '../../..'; const GrayCell = styled.span` diff --git a/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/NumericCell/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/NumericCell/index.tsx index e84aaf0487e..ea609fc80c4 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/NumericCell/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Table/cell-renderers/NumericCell/index.tsx @@ -17,7 +17,7 @@ * specific language governing permissions and limitations * under the License. */ -import { logging } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; export interface NumericCellProps { /** diff --git a/superset-frontend/packages/superset-ui-core/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx b/superset-frontend/packages/superset-ui-core/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx index 80c1cb7d4ca..c0f123ae44e 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Table/header-renderers/HeaderWithRadioGroup.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useState } from 'react'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { Icons, Radio, Popover } from '../..'; export interface HeaderWithRadioGroupProps { diff --git a/superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx index 084bea37530..f3087139886 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Table/index.tsx @@ -21,9 +21,9 @@ import { useState, useEffect, useRef, Key, FC } from 'react'; import { Table as AntTable } from 'antd'; import { ColumnsType, TableProps as AntTableProps } from 'antd/es/table'; import { PaginationProps } from 'antd/es/pagination'; -import { t } from '@apache-superset/core'; -import { logging } from '@apache-superset/core'; -import { useTheme, styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { logging } from '@apache-superset/core/utils'; +import { useTheme, styled } from '@apache-superset/core/theme'; import { Loading } from '@superset-ui/core/components'; import { RowSelectionType } from 'antd/es/table/interface'; import InteractiveTableUtils from './utils/InteractiveTableUtils'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx index 1edd0f440fb..bc6ec88ab65 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/TableCollection/index.tsx @@ -25,7 +25,7 @@ import { TableBodyPropGetter, TablePropGetter, } from 'react-table'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Table, TableSize } from '@superset-ui/core/components/Table'; import { TableRowSelection, SorterResult } from 'antd/es/table/interface'; import { mapColumns, mapRows } from './utils'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/TableView/TableView.tsx b/superset-frontend/packages/superset-ui-core/src/components/TableView/TableView.tsx index 4544013b34c..87e899f7362 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/TableView/TableView.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/TableView/TableView.tsx @@ -18,7 +18,7 @@ */ import { memo, useEffect, useRef, useMemo, useCallback } from 'react'; import { isEqual } from 'lodash'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { useFilters, usePagination, useSortBy, useTable } from 'react-table'; import { Empty } from '@superset-ui/core/components'; import TableCollection from '@superset-ui/core/components/TableCollection'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Tabs/Tabs.tsx b/superset-frontend/packages/superset-ui-core/src/components/Tabs/Tabs.tsx index 16c1c1ffb21..9a192168fae 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Tabs/Tabs.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Tabs/Tabs.tsx @@ -17,7 +17,7 @@ * under the License. */ import type { FC } from 'react'; -import { css, styled, useTheme } from '@apache-superset/core/ui'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; // eslint-disable-next-line no-restricted-imports import { Tabs as AntdTabs, TabsProps as AntdTabsProps } from 'antd'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/ThemedAgGridReact.test.tsx b/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/ThemedAgGridReact.test.tsx index 64ab62cac48..b4dc37b256a 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/ThemedAgGridReact.test.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/ThemedAgGridReact.test.tsx @@ -19,13 +19,14 @@ import { render, screen } from '@superset-ui/core/spec'; import { AgGridReact } from 'ag-grid-react'; import { createRef } from 'react'; -import { ThemeProvider, supersetTheme } from '@apache-superset/core'; -import * as uiModule from '@apache-superset/core/ui'; +import { ThemeProvider, supersetTheme } from '@apache-superset/core/theme'; +import * as uiModule from '@apache-superset/core/theme'; import { ThemedAgGridReact } from './index'; +import { Mock } from 'vitest'; // Mock useThemeMode hook -vi.mock('@apache-superset/core/ui', () => ({ - ...vi.requireActual('@apache-superset/core/ui'), +vi.mock('@apache-superset/core/theme', async (importActual) => ({ + ...(await importActual()), useThemeMode: vi.fn(() => false), // Default to light mode })); @@ -68,7 +69,7 @@ const mockColumnDefs = [ beforeEach(() => { vi.clearAllMocks(); // Reset to light mode by default - (uiModule.useThemeMode as vi.Mock).mockReturnValue(false); + (uiModule.useThemeMode as Mock).mockReturnValue(false); }); test('renders the AgGridReact component', () => { @@ -101,7 +102,7 @@ test('applies light theme when background is light', () => { test('applies dark theme when background is dark', () => { // Mock dark mode - (uiModule.useThemeMode as vi.Mock).mockReturnValue(true); + (uiModule.useThemeMode as Mock).mockReturnValue(true); const darkTheme = { ...supersetTheme, diff --git a/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/index.tsx index 7742eb06eda..507a6d73b2a 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/index.tsx @@ -24,7 +24,7 @@ import { colorSchemeDark, colorSchemeLight, } from 'ag-grid-community'; -import { useTheme, useThemeMode } from '@apache-superset/core/ui'; +import { useTheme, useThemeMode } from '@apache-superset/core/theme'; // Note: With ag-grid v34's new theming API, CSS files are injected automatically // Do NOT import 'ag-grid-community/styles/ag-grid.css' or theme CSS files diff --git a/superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx index 88ddcd1946f..e42ba8cd55a 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Timer/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useEffect, useRef, useState } from 'react'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import { now, fDuration } from '../../utils/dates'; import { Label, Icons, type LabelType } from '..'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/TimezoneSelector/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/TimezoneSelector/index.tsx index aedd9f6c1f1..a790963e333 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/TimezoneSelector/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/TimezoneSelector/index.tsx @@ -18,7 +18,7 @@ */ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Select } from '@superset-ui/core/components'; import { extendedDayjs } from '../../utils/dates'; import { diff --git a/superset-frontend/packages/superset-ui-core/src/components/TruncatedList/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/TruncatedList/index.tsx index e0fc92f37da..9b6653a7511 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/TruncatedList/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/TruncatedList/index.tsx @@ -19,9 +19,9 @@ import { ReactNode, Key, useMemo } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { useTruncation } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Tooltip } from '@superset-ui/core/components'; export type TruncatedListProps = { diff --git a/superset-frontend/packages/superset-ui-core/src/components/Typography/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Typography/index.tsx index 7b5a1bfe45a..aff5b395786 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Typography/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Typography/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css } from '@apache-superset/core/ui'; +import { styled, css } from '@apache-superset/core/theme'; import { Typography as AntdTypography } from 'antd'; export type { TitleProps } from 'antd/es/typography/Title'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/UnsavedChangesModal/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/UnsavedChangesModal/index.tsx index 55f7a51bf83..cca9c7573df 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/UnsavedChangesModal/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/UnsavedChangesModal/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Icons, Modal, Typography, Button } from '@superset-ui/core/components'; import type { FC, ReactElement } from 'react'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/WarningIconWithTooltip/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/WarningIconWithTooltip/index.tsx index cb90977e035..070cfff6d4b 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/WarningIconWithTooltip/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/WarningIconWithTooltip/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import { Icons, type IconType, SafeMarkdown, Tooltip } from '..'; export interface WarningIconWithTooltipProps { diff --git a/superset-frontend/packages/superset-ui-core/src/components/constants.ts b/superset-frontend/packages/superset-ui-core/src/components/constants.ts index 3999febd745..e07111f1b2d 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/constants.ts +++ b/superset-frontend/packages/superset-ui-core/src/components/constants.ts @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core/ui/translation'; +import { t } from '@apache-superset/core/translation'; export const Constants = { FAST_DEBOUNCE: 250, diff --git a/superset-frontend/packages/superset-ui-core/src/query/extractQueryFields.ts b/superset-frontend/packages/superset-ui-core/src/query/extractQueryFields.ts index d544b8fd14e..24c3303b2fd 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/extractQueryFields.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/extractQueryFields.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { removeDuplicates } from '../utils'; import getColumnLabel from './getColumnLabel'; import getMetricLabel from './getMetricLabel'; diff --git a/superset-frontend/packages/superset-ui-core/src/query/getClientErrorObject.ts b/superset-frontend/packages/superset-ui-core/src/query/getClientErrorObject.ts index 78cdf2bde69..cc555fa4e93 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/getClientErrorObject.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/getClientErrorObject.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { COMMON_ERR_MESSAGES, JsonObject, diff --git a/superset-frontend/packages/superset-ui-core/src/query/types/Column.ts b/superset-frontend/packages/superset-ui-core/src/query/types/Column.ts index 0fe1317e3de..c157d05fc1b 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/types/Column.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/types/Column.ts @@ -18,7 +18,7 @@ * under the License. */ -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { QueryFormColumn } from './QueryFormData'; export interface AdhocColumn { diff --git a/superset-frontend/packages/superset-ui-core/src/query/types/Query.ts b/superset-frontend/packages/superset-ui-core/src/query/types/Query.ts index 14d4e2273b2..929a5147c6d 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/types/Query.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/types/Query.ts @@ -17,7 +17,7 @@ * specific language governing permissions and limitations * under the License. */ -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { DatasourceType } from './Datasource'; import { BinaryOperator, SetOperator, UnaryOperator } from './Operator'; import { AppliedTimeExtras, TimeRange } from './Time'; diff --git a/superset-frontend/packages/superset-ui-core/src/query/types/QueryResponse.ts b/superset-frontend/packages/superset-ui-core/src/query/types/QueryResponse.ts index a1786da7389..210685f3480 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/types/QueryResponse.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/types/QueryResponse.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { TimeseriesDataRecord } from '../../chart'; import { AnnotationData } from './AnnotationLayer'; diff --git a/superset-frontend/packages/superset-ui-core/src/spec/index.tsx b/superset-frontend/packages/superset-ui-core/src/spec/index.tsx index 219dcf4fb5b..ac27d4d86e7 100644 --- a/superset-frontend/packages/superset-ui-core/src/spec/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/spec/index.tsx @@ -20,7 +20,7 @@ import userEvent from '@testing-library/user-event'; import { ReactElement } from 'react'; import { render, RenderOptions } from '@testing-library/react'; import '@testing-library/jest-dom/vitest'; -import { themeObject } from '@apache-superset/core/ui'; +import { themeObject } from '@apache-superset/core/theme'; // Define the wrapper component outside const AllTheProviders = ({ children }: { children: React.ReactNode }) => ( diff --git a/superset-frontend/packages/superset-ui-core/src/style/stories/Theme.stories.tsx b/superset-frontend/packages/superset-ui-core/src/style/stories/Theme.stories.tsx index 71b0a8d9f99..eb6a8df95b0 100644 --- a/superset-frontend/packages/superset-ui-core/src/style/stories/Theme.stories.tsx +++ b/superset-frontend/packages/superset-ui-core/src/style/stories/Theme.stories.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; const colorTypes = ['primary', 'error', 'warning', 'success', 'info']; diff --git a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts index 9770951342b..7a5ba44dce8 100644 --- a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts +++ b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { logging as logger } from '@apache-superset/core'; +import { logging as logger } from '@apache-superset/core/utils'; // We can codegen the enum definition based on a list of supported flags that we // check into source control. We're hardcoding the supported flags for now. diff --git a/superset-frontend/packages/superset-ui-core/src/utils/tooltip.ts b/superset-frontend/packages/superset-ui-core/src/utils/tooltip.ts index 2ca22fcd79d..15e5b4be4de 100644 --- a/superset-frontend/packages/superset-ui-core/src/utils/tooltip.ts +++ b/superset-frontend/packages/superset-ui-core/src/utils/tooltip.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { sanitizeHtml } from './html'; const TRUNCATION_STYLE = ` diff --git a/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateInteger.ts b/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateInteger.ts index e2b3303506b..02f70aa3604 100644 --- a/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateInteger.ts +++ b/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateInteger.ts @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; /** * formerly called integer() diff --git a/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateNumber.ts b/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateNumber.ts index e075500c76d..e2f4ed4c248 100644 --- a/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateNumber.ts +++ b/superset-frontend/packages/superset-ui-core/src/validator/legacyValidateNumber.ts @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; /** * formerly called numeric() diff --git a/superset-frontend/packages/superset-ui-core/src/validator/validateInteger.ts b/superset-frontend/packages/superset-ui-core/src/validator/validateInteger.ts index 4aa4af1d21b..dfe6923aeaf 100644 --- a/superset-frontend/packages/superset-ui-core/src/validator/validateInteger.ts +++ b/superset-frontend/packages/superset-ui-core/src/validator/validateInteger.ts @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; export default function validateInteger(v: unknown): string | false { if ( diff --git a/superset-frontend/packages/superset-ui-core/src/validator/validateMapboxStylesUrl.ts b/superset-frontend/packages/superset-ui-core/src/validator/validateMapboxStylesUrl.ts index 66c474d5ad4..06e3c9334a7 100644 --- a/superset-frontend/packages/superset-ui-core/src/validator/validateMapboxStylesUrl.ts +++ b/superset-frontend/packages/superset-ui-core/src/validator/validateMapboxStylesUrl.ts @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; const VALIDE_OSM_URLS = ['https://tile.osm', 'https://tile.openstreetmap']; diff --git a/superset-frontend/packages/superset-ui-core/src/validator/validateMaxValue.ts b/superset-frontend/packages/superset-ui-core/src/validator/validateMaxValue.ts index 353e14315c6..3a8bcb70d44 100644 --- a/superset-frontend/packages/superset-ui-core/src/validator/validateMaxValue.ts +++ b/superset-frontend/packages/superset-ui-core/src/validator/validateMaxValue.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; export default function validateMaxValue( v: unknown, diff --git a/superset-frontend/packages/superset-ui-core/src/validator/validateNonEmpty.ts b/superset-frontend/packages/superset-ui-core/src/validator/validateNonEmpty.ts index 1d8a525c631..3e7ec790f9f 100644 --- a/superset-frontend/packages/superset-ui-core/src/validator/validateNonEmpty.ts +++ b/superset-frontend/packages/superset-ui-core/src/validator/validateNonEmpty.ts @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; export default function validateNonEmpty(v: unknown): string | false { if ( diff --git a/superset-frontend/packages/superset-ui-core/src/validator/validateNumber.ts b/superset-frontend/packages/superset-ui-core/src/validator/validateNumber.ts index 524d27d4b58..8b77468b84b 100644 --- a/superset-frontend/packages/superset-ui-core/src/validator/validateNumber.ts +++ b/superset-frontend/packages/superset-ui-core/src/validator/validateNumber.ts @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; export default function validateNumber(v: unknown): string | false { if ( diff --git a/superset-frontend/packages/superset-ui-core/src/validator/validateServerPagination.ts b/superset-frontend/packages/superset-ui-core/src/validator/validateServerPagination.ts index 4fde0b12aa9..c109e3c8f1d 100644 --- a/superset-frontend/packages/superset-ui-core/src/validator/validateServerPagination.ts +++ b/superset-frontend/packages/superset-ui-core/src/validator/validateServerPagination.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; export default function validateServerPagination( v: unknown, diff --git a/superset-frontend/packages/superset-ui-core/src/validator/validateTimeComparisonRangeValues.ts b/superset-frontend/packages/superset-ui-core/src/validator/validateTimeComparisonRangeValues.ts index 2c8ccc5cb98..d29391cdb03 100644 --- a/superset-frontend/packages/superset-ui-core/src/validator/validateTimeComparisonRangeValues.ts +++ b/superset-frontend/packages/superset-ui-core/src/validator/validateTimeComparisonRangeValues.ts @@ -18,7 +18,7 @@ */ import { ComparisonTimeRangeType } from '../time-comparison'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray } from '../utils'; export const validateTimeComparisonRangeValues = ( diff --git a/superset-frontend/packages/superset-ui-core/test/chart/clients/ChartClient.test.ts b/superset-frontend/packages/superset-ui-core/test/chart/clients/ChartClient.test.ts index f1b69b96de8..5bc0b6a9f1a 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/clients/ChartClient.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/chart/clients/ChartClient.test.ts @@ -29,7 +29,7 @@ import { ChartMetadata, VizType, } from '@superset-ui/core'; -import { configure as configureTranslation } from '@apache-superset/core'; +import { configure as configureTranslation } from '@apache-superset/core/translation'; import { LOGIN_GLOB } from '../fixtures/constants'; import { sankeyFormData } from '../fixtures/formData'; diff --git a/superset-frontend/packages/superset-ui-core/test/chart/components/MockChartPlugins.tsx b/superset-frontend/packages/superset-ui-core/test/chart/components/MockChartPlugins.tsx index d89d7d53879..88a83e818d5 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/components/MockChartPlugins.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/components/MockChartPlugins.tsx @@ -19,7 +19,7 @@ /* eslint-disable max-classes-per-file */ import { QueryFormData, ChartMetadata, ChartPlugin } from '@superset-ui/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; const DIMENSION_STYLE = { fontSize: 36, diff --git a/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChartCore.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChartCore.test.tsx index 0f0d180a7ad..0c3bc4dc2cd 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChartCore.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChartCore.test.tsx @@ -20,7 +20,7 @@ import '@testing-library/jest-dom'; import mockConsole, { RestoreConsole } from 'jest-mock-console'; import { ChartProps } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import { render, screen, waitFor } from '@superset-ui/core/spec'; import SuperChartCore from '../../../src/chart/components/SuperChartCore'; import { diff --git a/superset-frontend/packages/superset-ui-core/test/chart/models/ChartPlugin.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart/models/ChartPlugin.test.tsx index 41a455a734b..c7b43c469cd 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/models/ChartPlugin.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/models/ChartPlugin.test.tsx @@ -32,7 +32,7 @@ import { DatasourceType, VizType, } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; describe('ChartPlugin', () => { const FakeChart = () => test; diff --git a/superset-frontend/packages/superset-ui-core/test/chart/models/ChartProps.test.ts b/superset-frontend/packages/superset-ui-core/test/chart/models/ChartProps.test.ts index 232d40c93a0..72614935ec6 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/models/ChartProps.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/chart/models/ChartProps.test.ts @@ -18,7 +18,7 @@ */ import { Behavior, ChartProps } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; const RAW_FORM_DATA = { some_field: 1, diff --git a/superset-frontend/packages/superset-ui-core/test/components/Icons/AsyncIcon.integration.test.tsx b/superset-frontend/packages/superset-ui-core/test/components/Icons/AsyncIcon.integration.test.tsx index 201f987f263..6109f3237b5 100644 --- a/superset-frontend/packages/superset-ui-core/test/components/Icons/AsyncIcon.integration.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/components/Icons/AsyncIcon.integration.test.tsx @@ -19,7 +19,7 @@ import '@testing-library/jest-dom'; import { render, fireEvent } from '@testing-library/react'; -import { SupersetTheme, ThemeProvider } from '@apache-superset/core/ui'; +import { SupersetTheme, ThemeProvider } from '@apache-superset/core/theme'; // CRITICAL: Don't import from the mocked path - import directly to avoid global mocks import AsyncIcon from '../../../src/components/Icons/AsyncIcon'; diff --git a/superset-frontend/packages/superset-ui-core/test/fixtures.ts b/superset-frontend/packages/superset-ui-core/test/fixtures.ts index 9904d6fa5f4..78a90dd1817 100644 --- a/superset-frontend/packages/superset-ui-core/test/fixtures.ts +++ b/superset-frontend/packages/superset-ui-core/test/fixtures.ts @@ -17,7 +17,7 @@ * under the License. */ import { AdhocMetric } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; export const NUM_METRIC: AdhocMetric = { expressionType: 'SIMPLE', diff --git a/superset-frontend/packages/superset-ui-core/test/query/extractQueryFields.test.ts b/superset-frontend/packages/superset-ui-core/test/query/extractQueryFields.test.ts index 38dd0c72e18..a55fb9e5408 100644 --- a/superset-frontend/packages/superset-ui-core/test/query/extractQueryFields.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/query/extractQueryFields.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { QueryMode } from '@superset-ui/core'; -import { configure } from '@apache-superset/core'; +import { configure } from '@apache-superset/core/translation'; import extractQueryFields from '../../src/query/extractQueryFields'; import { NUM_METRIC } from '../fixtures'; diff --git a/superset-frontend/packages/superset-ui-core/test/utils/featureFlag.test.ts b/superset-frontend/packages/superset-ui-core/test/utils/featureFlag.test.ts index c117d992fe3..0299e90d212 100644 --- a/superset-frontend/packages/superset-ui-core/test/utils/featureFlag.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/utils/featureFlag.test.ts @@ -52,12 +52,12 @@ test('does nothing if feature flags are already initialized', () => { }); test('returns false and raises console error if feature flags have not been initialized', () => { - const logging = vi.spyOn(uiCore.logging, 'error'); + const logging = vi.spyOn(uiCore.utils.logging, 'error'); Object.defineProperty(window, 'featureFlags', { value: undefined, }); expect(isFeatureEnabled(FeatureFlag.DrillBy)).toEqual(false); - expect(uiCore.logging.error).toHaveBeenCalled(); + expect(uiCore.utils.logging.error).toHaveBeenCalled(); expect(logging).toHaveBeenCalledWith('Failed to query feature flag DRILL_BY'); }); diff --git a/superset-frontend/packages/superset-ui-core/test/validator/setup.ts b/superset-frontend/packages/superset-ui-core/test/validator/setup.ts index 5196a451729..5ab46c76665 100644 --- a/superset-frontend/packages/superset-ui-core/test/validator/setup.ts +++ b/superset-frontend/packages/superset-ui-core/test/validator/setup.ts @@ -17,6 +17,6 @@ * under the License. */ -import { configure as configureTranslation } from '@apache-superset/core'; +import { configure as configureTranslation } from '@apache-superset/core/translation'; configureTranslation(); diff --git a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/Calendar.ts b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/Calendar.ts index f5fd3c29f88..794959fe7c4 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/Calendar.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/Calendar.ts @@ -19,7 +19,8 @@ import { extent as d3Extent, range as d3Range } from 'd3-array'; import { select as d3Select } from 'd3-selection'; import { getSequentialSchemeRegistry } from '@superset-ui/core'; -import { SupersetTheme, t } from '@apache-superset/core/ui'; +import { SupersetTheme } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import CalHeatMapImport from './vendor/cal-heatmap'; import { convertUTCTimestampToLocal } from './utils'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.tsx b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.tsx index a40b0d3d216..fdcf5880c16 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.tsx @@ -17,7 +17,7 @@ * under the License. */ import { reactify } from '@superset-ui/core'; -import { styled, css, useTheme } from '@apache-superset/core/ui'; +import { styled, css, useTheme } from '@apache-superset/core/theme'; import { Global } from '@emotion/react'; import Component from './Calendar'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/controlPanel.ts b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/controlPanel.ts index 33780f5ef21..79e5670f7a1 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/controlPanel.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { legacyValidateInteger } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/index.ts b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/index.ts index e83b45b2a8d..ea2ce7e47ec 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/index.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/index.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import transformProps from './transformProps'; import example from './images/example.jpg'; import exampleDark from './images/example-dark.jpg'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/vendor/cal-heatmap.ts b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/vendor/cal-heatmap.ts index 1ccf62f996a..61f74e0d3ac 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/vendor/cal-heatmap.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/vendor/cal-heatmap.ts @@ -10,7 +10,7 @@ /* eslint-disable */ import d3tip from 'd3-tip'; -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { getContrastingColor } from '@superset-ui/core'; var d3 = typeof require === 'function' ? require('d3') : window.d3; diff --git a/superset-frontend/plugins/legacy-plugin-chart-chord/src/ReactChord.tsx b/superset-frontend/plugins/legacy-plugin-chart-chord/src/ReactChord.tsx index 040e67e6d3c..32ae7719df7 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-chord/src/ReactChord.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-chord/src/ReactChord.tsx @@ -17,7 +17,7 @@ * under the License. */ import { reactify } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import Component from './Chord'; // Type-erase the render function to allow flexible prop spreading in the wrapper. diff --git a/superset-frontend/plugins/legacy-plugin-chart-chord/src/controlPanel.ts b/superset-frontend/plugins/legacy-plugin-chart-chord/src/controlPanel.ts index f4469e8d173..011227e6ff4 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-chord/src/controlPanel.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-chord/src/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, validateNonEmpty } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/legacy-plugin-chart-chord/src/index.ts b/superset-frontend/plugins/legacy-plugin-chart-chord/src/index.ts index 7da9d07b1c9..4f96b2f547b 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-chord/src/index.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-chord/src/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import transformProps from './transformProps'; import example from './images/chord.jpg'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-country-map/src/ReactCountryMap.tsx b/superset-frontend/plugins/legacy-plugin-chart-country-map/src/ReactCountryMap.tsx index d1afe8289d9..5d5ee7edef1 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-country-map/src/ReactCountryMap.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-country-map/src/ReactCountryMap.tsx @@ -17,7 +17,7 @@ * under the License. */ import { reactify } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import Component from './CountryMap'; // Type-erase the render function to allow flexible prop spreading in the wrapper. diff --git a/superset-frontend/plugins/legacy-plugin-chart-country-map/src/controlPanel.ts b/superset-frontend/plugins/legacy-plugin-chart-country-map/src/controlPanel.ts index eed4fe0f088..ba163e2617f 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-country-map/src/controlPanel.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-country-map/src/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/legacy-plugin-chart-country-map/src/index.ts b/superset-frontend/plugins/legacy-plugin-chart-country-map/src/index.ts index 0478dc122f8..e59be4ec4b0 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-country-map/src/index.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-country-map/src/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import transformProps from './transformProps'; import exampleUsa from './images/exampleUsa.jpg'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-country-map/src/stories/CountryMap.stories.tsx b/superset-frontend/plugins/legacy-plugin-chart-country-map/src/stories/CountryMap.stories.tsx index 194b77f7c4d..e4f46b2bcbe 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-country-map/src/stories/CountryMap.stories.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-country-map/src/stories/CountryMap.stories.tsx @@ -19,7 +19,7 @@ import { useEffect, useState } from 'react'; import { JsonObject, seed, SuperChart, SequentialD3 } from '@superset-ui/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import CountryMapChartPlugin, { countries, } from '@superset-ui/legacy-plugin-chart-country-map'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonChart.tsx b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonChart.tsx index 0ec77b51b89..a95cae279dd 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonChart.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonChart.tsx @@ -20,7 +20,7 @@ import { PureComponent } from 'react'; import { extent as d3Extent } from 'd3-array'; import { ensureIsArray } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import HorizonRow, { DEFAULT_COLORS } from './HorizonRow'; interface DataValue { diff --git a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/controlPanel.ts b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/controlPanel.ts index 880051fda29..e778b01129a 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/controlPanel.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, formatSelectOptions, diff --git a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/index.ts b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/index.ts index 20564d19576..ea5a357c4b4 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/index.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import transformProps from './transformProps'; import example from './images/Horizon_Chart.jpg'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-map-box/src/controlPanel.ts b/superset-frontend/plugins/legacy-plugin-chart-map-box/src/controlPanel.ts index 58a3f327eb5..80d6ab0c7f6 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-map-box/src/controlPanel.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-map-box/src/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateMapboxStylesUrl } from '@superset-ui/core'; import { columnChoices, diff --git a/superset-frontend/plugins/legacy-plugin-chart-map-box/src/index.ts b/superset-frontend/plugins/legacy-plugin-chart-map-box/src/index.ts index 595387721da..666e8ea2303 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-map-box/src/index.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-map-box/src/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import thumbnail from './images/thumbnail.png'; import thumbnailDark from './images/thumbnail-dark.png'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-map-box/src/stories/MapBox.stories.tsx b/superset-frontend/plugins/legacy-plugin-chart-map-box/src/stories/MapBox.stories.tsx index 1f646df037c..8f68419e769 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-map-box/src/stories/MapBox.stories.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-map-box/src/stories/MapBox.stories.tsx @@ -19,7 +19,7 @@ /* eslint-disable no-magic-numbers */ import { SuperChart } from '@superset-ui/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import MapBoxChartPlugin from '@superset-ui/legacy-plugin-chart-map-box'; import { withResizableChartDemo } from '@storybook-shared'; import { generateData } from './data'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-map-box/src/stories/data.ts b/superset-frontend/plugins/legacy-plugin-chart-map-box/src/stories/data.ts index 589fcc69e34..10edb62dcab 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-map-box/src/stories/data.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-map-box/src/stories/data.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { SupersetTheme } from '@apache-superset/core/ui'; +import { SupersetTheme } from '@apache-superset/core/theme'; /* eslint-disable sort-keys, no-magic-numbers */ export const generateData = (theme: SupersetTheme) => ({ diff --git a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.tsx b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.tsx index 65f94ea66b7..c7a1edfa897 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.tsx @@ -18,7 +18,7 @@ */ /* eslint-disable react/no-array-index-key */ import { PureComponent } from 'react'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import TTestTable, { DataEntry } from './TTestTable'; interface PairedTTestProps { diff --git a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/controlPanel.ts b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/controlPanel.ts index e3fb8b46e7b..973cc0127a4 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/controlPanel.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty } from '@superset-ui/core'; import { ControlPanelConfig } from '@superset-ui/chart-controls'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/index.ts b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/index.ts index 1fefb490678..a2e28a06114 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/index.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import transformProps from './transformProps'; import example from './images/example.jpg'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/ReactParallelCoordinates.tsx b/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/ReactParallelCoordinates.tsx index 6f989daa1ae..f5e8a5c8a9b 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/ReactParallelCoordinates.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/ReactParallelCoordinates.tsx @@ -18,7 +18,7 @@ */ import { type ComponentProps } from 'react'; import { reactify, addAlpha } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import Component from './ParallelCoordinates'; const ReactComponent = reactify(Component); diff --git a/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/controlPanel.ts b/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/controlPanel.ts index 782a8cacc0a..726d06a20e9 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/controlPanel.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig } from '@superset-ui/chart-controls'; const config: ControlPanelConfig = { diff --git a/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/index.ts b/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/index.ts index 641d9a8af63..f5cb8a5c381 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/index.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-partition/src/ReactPartition.tsx b/superset-frontend/plugins/legacy-plugin-chart-partition/src/ReactPartition.tsx index 8677fa1b805..57bed0264e2 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-partition/src/ReactPartition.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-partition/src/ReactPartition.tsx @@ -17,7 +17,7 @@ * under the License. */ import { reactify } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import Component from './Partition'; // Type-erase the render function to allow flexible prop spreading in the wrapper. diff --git a/superset-frontend/plugins/legacy-plugin-chart-partition/src/controlPanel.tsx b/superset-frontend/plugins/legacy-plugin-chart-partition/src/controlPanel.tsx index 537da7a8954..ece7cbe0259 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-partition/src/controlPanel.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-partition/src/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty } from '@superset-ui/core'; import { ColumnMeta, diff --git a/superset-frontend/plugins/legacy-plugin-chart-partition/src/index.ts b/superset-frontend/plugins/legacy-plugin-chart-partition/src/index.ts index ef30851d933..0ae654105c5 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-partition/src/index.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-partition/src/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-rose/src/ReactRose.tsx b/superset-frontend/plugins/legacy-plugin-chart-rose/src/ReactRose.tsx index 6ac6afdf59f..fde642a9b67 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-rose/src/ReactRose.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-rose/src/ReactRose.tsx @@ -17,7 +17,7 @@ * under the License. */ import { reactify } from '@superset-ui/core'; -import { styled, css } from '@apache-superset/core/ui'; +import { styled, css } from '@apache-superset/core/theme'; import { Global } from '@emotion/react'; import Component from './Rose'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-rose/src/controlPanel.tsx b/superset-frontend/plugins/legacy-plugin-chart-rose/src/controlPanel.tsx index fe0c7da0bd8..b4b25661319 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-rose/src/controlPanel.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-rose/src/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, ControlSubSectionHeader, diff --git a/superset-frontend/plugins/legacy-plugin-chart-rose/src/index.ts b/superset-frontend/plugins/legacy-plugin-chart-rose/src/index.ts index 8e005b5d454..3fcf289f8a8 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-rose/src/index.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-rose/src/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.tsx b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.tsx index 53dca6da86f..704edac8315 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.tsx @@ -17,7 +17,7 @@ * under the License. */ import { reactify } from '@superset-ui/core'; -import { styled, useTheme } from '@apache-superset/core/ui'; +import { styled, useTheme } from '@apache-superset/core/theme'; import WorldMap from './WorldMap'; // Type-erase the render function to allow flexible prop spreading in the wrapper. diff --git a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/controlPanel.ts b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/controlPanel.ts index 29cb3680661..974264e80fb 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/controlPanel.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, formatSelectOptions, diff --git a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/index.ts b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/index.ts index 0a8d12bfe6c..4b53c5cb9ec 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/index.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin, Behavior } from '@superset-ui/core'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx index b22de708785..d558532298d 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx @@ -37,7 +37,7 @@ import { StaticMap } from 'react-map-gl'; import DeckGL from '@deck.gl/react'; import type { Layer } from '@deck.gl/core'; import { JsonObject, JsonValue, usePrevious } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Device } from '@luma.gl/core'; import Tooltip, { TooltipProps } from './components/Tooltip'; import 'mapbox-gl/dist/mapbox-gl.css'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/Multi.test.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/Multi.test.tsx index ac310340f4d..70b261a0975 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/Multi.test.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/Multi.test.tsx @@ -18,7 +18,7 @@ */ import { render, screen, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; -import { supersetTheme, ThemeProvider } from '@apache-superset/core/ui'; +import { supersetTheme, ThemeProvider } from '@apache-superset/core/theme'; import { Provider } from 'react-redux'; import { configureStore } from '@reduxjs/toolkit'; import { DatasourceType, SupersetClient } from '@superset-ui/core'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/Multi.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/Multi.tsx index f0f4d34a959..c361eb755c8 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/Multi.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/Multi.tsx @@ -40,7 +40,7 @@ import { SupersetClient, usePrevious, } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Layer } from '@deck.gl/core'; import { diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/controlPanel.ts index 3bf2613e8a5..da720d82868 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty } from '@superset-ui/core'; import { viewport, mapboxStyle, autozoom } from '../utilities/Shared_DeckGL'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/index.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/index.ts index 9777b6fe5bb..84069b4d978 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/index.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import thumbnail from './images/thumbnail.png'; import thumbnailDark from './images/thumbnail-dark.png'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Legend.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Legend.tsx index 05e048a5995..fe21ce2955d 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Legend.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Legend.tsx @@ -21,7 +21,7 @@ */ import { memo } from 'react'; import { formatNumber } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Color } from '@deck.gl/core'; const StyledLegend = styled.div` diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx index a73c16e2b93..11ed4219d7b 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx @@ -18,7 +18,7 @@ */ import { safeHtmlSpan } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { ReactNode } from 'react'; export type TooltipProps = { diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Arc/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Arc/controlPanel.ts index 9cf7a1d08ee..46c5e44bde3 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Arc/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Arc/controlPanel.ts @@ -17,7 +17,7 @@ * under the License. */ import { ControlPanelConfig } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty, legacyValidateInteger } from '@superset-ui/core'; import timeGrainSqlaAnimationOverrides, { columnChoices, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Arc/index.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Arc/index.ts index b3dcabb03de..e077e529f6a 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Arc/index.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Arc/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin, Behavior } from '@superset-ui/core'; import thumbnail from './images/thumbnail.png'; import thumbnailDark from './images/thumbnail-dark.png'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/Contour.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/Contour.tsx index bf5a1daf9ca..9c7f37eb4d3 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/Contour.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/Contour.tsx @@ -19,7 +19,7 @@ import { ContourLayer } from '@deck.gl/aggregation-layers'; import { PolygonLayer } from '@deck.gl/layers'; import { Position } from '@deck.gl/core'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { commonLayerProps } from '../common'; import sandboxedEval from '../../utils/sandbox'; import { GetLayerType, createDeckGLComponent } from '../../factory'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/controlPanel.ts index 9e9d92b46f2..ee53209ec30 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/controlPanel.ts @@ -20,7 +20,7 @@ import { ControlPanelConfig, getStandardizedControls, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty } from '@superset-ui/core'; import { autozoom, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/index.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/index.ts index c2759e0bc83..5fa660e8d04 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/index.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin, Behavior } from '@superset-ui/core'; import thumbnail from './images/thumbnail.png'; import thumbnailDark from './images/thumbnail-dark.png'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/controlPanel.ts index 889af60f094..cfb8c89cba6 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/controlPanel.ts @@ -17,7 +17,7 @@ * under the License. */ import { ControlPanelConfig } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { legacyValidateInteger, isFeatureEnabled, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/index.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/index.ts index 587dcf181d1..9b2a8733b1e 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/index.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin, Behavior } from '@superset-ui/core'; import thumbnail from './images/thumbnail.png'; import thumbnailDark from './images/thumbnail-dark.png'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Grid/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Grid/controlPanel.ts index 6d59561bac0..c0a280e4b75 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Grid/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Grid/controlPanel.ts @@ -20,7 +20,7 @@ import { ControlPanelConfig, getStandardizedControls, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty } from '@superset-ui/core'; import { filterNulls, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Grid/index.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Grid/index.ts index f3326b1bda0..8055b8b716c 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Grid/index.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Grid/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin, Behavior } from '@superset-ui/core'; import thumbnail from './images/thumbnail.png'; import thumbnailDark from './images/thumbnail-dark.png'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/Heatmap.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/Heatmap.tsx index 194906b50d9..4fffc554080 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/Heatmap.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/Heatmap.tsx @@ -18,7 +18,7 @@ */ import { HeatmapLayer } from '@deck.gl/aggregation-layers'; import { Position } from '@deck.gl/core'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { getSequentialSchemeRegistry, JsonObject, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/controlPanel.ts index 21f1dbe8514..efeda7d0b15 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/controlPanel.ts @@ -20,7 +20,7 @@ import { ControlPanelConfig, formatSelectOptions, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty, legacyValidateNumber, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/index.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/index.ts index 95dd519f992..465d9f740f0 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/index.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin, Behavior } from '@superset-ui/core'; import thumbnail from './images/thumbnail.png'; import thumbnailDark from './images/thumbnail-dark.png'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Hex/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Hex/controlPanel.ts index 580769f9a15..df0cf267ed8 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Hex/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Hex/controlPanel.ts @@ -20,7 +20,7 @@ import { ControlPanelConfig, getStandardizedControls, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { autozoom, extruded, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Hex/index.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Hex/index.ts index eacfa995799..0c95e97a2b7 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Hex/index.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Hex/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin, Behavior } from '@superset-ui/core'; import thumbnail from './images/thumbnail.png'; import thumbnailDark from './images/thumbnail-dark.png'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/controlPanel.ts index 194b9d92802..82248cc4923 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/controlPanel.ts @@ -17,7 +17,7 @@ * under the License. */ import { ControlPanelConfig } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { filterNulls, autozoom, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/index.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/index.ts index a3c4f44bb17..e2e64d553f8 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/index.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin, Behavior } from '@superset-ui/core'; import thumbnail from './images/thumbnail.png'; import thumbnailDark from './images/thumbnail-dark.png'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/stories/Path.stories.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/stories/Path.stories.tsx index 1b1a4c0f410..0d5651ad946 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/stories/Path.stories.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/stories/Path.stories.tsx @@ -20,7 +20,7 @@ /* eslint-disable sort-keys */ /* eslint-disable no-magic-numbers */ import { SuperChart } from '@superset-ui/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import { PathChartPlugin } from '@superset-ui/legacy-preset-chart-deckgl'; import { withResizableChartDemo, dummyDatasource } from '@storybook-shared'; import payload from './payload'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.test.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.test.tsx index 3e920321523..31257d422d4 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.test.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.test.tsx @@ -20,7 +20,7 @@ import { render, screen } from '@testing-library/react'; // eslint-disable-next-line import/no-extraneous-dependencies import '@testing-library/jest-dom'; -import { supersetTheme, ThemeProvider } from '@apache-superset/core/ui'; +import { supersetTheme, ThemeProvider } from '@apache-superset/core/theme'; import DeckGLPolygon, { getPoints } from './Polygon'; import { COLOR_SCHEME_TYPES } from '../../utilities/utils'; import * as utils from '../../utils'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.tsx index e85c694b54a..0a4d8088b28 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.tsx @@ -22,7 +22,7 @@ /* eslint no-underscore-dangle: ["error", { "allow": ["", "__timestamp"] }] */ import { memo, useCallback, useEffect, useRef, useState } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ContextMenuFilters, FilterState, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/controlPanel.ts index 56bcdcb93f5..45198a9d291 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/controlPanel.ts @@ -20,7 +20,7 @@ import { ControlPanelConfig, getStandardizedControls, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import timeGrainSqlaAnimationOverrides from '../../utilities/controls'; import { COLOR_SCHEME_TYPES, formatSelectOptions } from '../../utilities/utils'; import { diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/index.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/index.ts index b7499e27e38..0d5a691ab4e 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/index.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin, Behavior } from '@superset-ui/core'; import thumbnail from './images/thumbnail.png'; import thumbnailDark from './images/thumbnail-dark.png'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/Scatter.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/Scatter.tsx index 20545763a65..5209493a3b0 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/Scatter.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/Scatter.tsx @@ -17,7 +17,7 @@ * under the License. */ import { ScatterplotLayer } from '@deck.gl/layers'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { JsonObject, QueryFormData } from '@superset-ui/core'; import { isPointInBonds } from '../../utilities/utils'; import { commonLayerProps } from '../common'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/controlPanel.ts index 7438dcd003f..e670bcde231 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/controlPanel.ts @@ -17,7 +17,7 @@ * under the License. */ import { ControlPanelConfig } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty } from '@superset-ui/core'; import timeGrainSqlaAnimationOverrides from '../../utilities/controls'; import { diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/index.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/index.ts index c0a99d61fe3..ee43b4a2749 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/index.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin, Behavior } from '@superset-ui/core'; import thumbnail from './images/thumbnail.png'; import thumbnailDark from './images/thumbnail-dark.png'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx index e78561d3edb..ec39564387a 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx @@ -19,13 +19,13 @@ import { ScreenGridLayer } from '@deck.gl/aggregation-layers'; import { Color } from '@deck.gl/core'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { JsonObject, QueryFormData, CategoricalColorNamespace, } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { COLOR_SCHEME_TYPES, ColorSchemeType, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/controlPanel.ts index 28884144506..22c31047204 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/controlPanel.ts @@ -20,7 +20,7 @@ import { ControlPanelConfig, getStandardizedControls, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty } from '@superset-ui/core'; import timeGrainSqlaAnimationOverrides from '../../utilities/controls'; import { diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/index.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/index.ts index 04458664eb7..30c6d9d7f67 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/index.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin, Behavior } from '@superset-ui/core'; import thumbnail from './images/thumbnail.png'; import thumbnailDark from './images/thumbnail-dark.png'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/spatialUtils.test.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/spatialUtils.test.ts index e611110cf88..aaf483ff5f3 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/spatialUtils.test.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/spatialUtils.test.ts @@ -21,7 +21,7 @@ import { DatasourceType, QueryObjectFilterClause, } from '@superset-ui/core'; -import { SupersetTheme } from '@apache-superset/core/ui'; +import { SupersetTheme } from '@apache-superset/core/theme'; import { decode } from 'ngeohash'; import { diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/HandlebarsRenderer.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/HandlebarsRenderer.tsx index 7666ec31441..a6d0a0fdc36 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/HandlebarsRenderer.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/HandlebarsRenderer.tsx @@ -17,9 +17,9 @@ * under the License. */ import { useEffect, useState, memo, useMemo } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { sanitizeHtml } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { extendedDayjs as dayjs } from '@superset-ui/core/utils/dates'; import Handlebars from 'handlebars'; import { isPlainObject } from 'lodash'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/Shared_DeckGL.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/Shared_DeckGL.tsx index 7c6680da5de..b2aabf4d931 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/Shared_DeckGL.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/Shared_DeckGL.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { FeatureFlag, isFeatureEnabled, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateControl.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateControl.tsx index 5c03826029d..94bdc970806 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateControl.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateControl.tsx @@ -19,8 +19,8 @@ import { useCallback } from 'react'; import { debounce } from 'lodash'; -import { t } from '@apache-superset/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { useTheme } from '@apache-superset/core/theme'; import { InfoTooltip, Constants } from '@superset-ui/core/components'; import { ControlHeader } from '@superset-ui/chart-controls'; import { TooltipTemplateEditor } from './TooltipTemplateEditor'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateEditor.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateEditor.tsx index 32ea0a2613b..e49ff09895e 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateEditor.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/TooltipTemplateEditor.tsx @@ -18,7 +18,7 @@ */ import { useCallback, useEffect, useState } from 'react'; -import { styled, css, useThemeMode } from '@apache-superset/core/ui'; +import { styled, css, useThemeMode } from '@apache-superset/core/theme'; import { CodeEditor } from '@superset-ui/core/components'; const EditorContainer = styled.div` diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/sharedDndControls.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/sharedDndControls.tsx index 21909c6de0e..63808441c93 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/sharedDndControls.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/sharedDndControls.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { sharedControls } from '@superset-ui/chart-controls'; export const dndLineColumn = { diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/tooltipUtils.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/tooltipUtils.tsx index 994e34e014f..6d7711372a6 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/tooltipUtils.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/tooltipUtils.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { JsonObject, QueryFormData } from '@superset-ui/core'; import { useMemo, memo } from 'react'; import { HandlebarsRenderer } from './HandlebarsRenderer'; diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bubble/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bubble/controlPanel.ts index 03b56e727b2..f6073a37095 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bubble/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bubble/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, formatSelectOptions, diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bubble/index.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bubble/index.ts index 41c7baa8340..6ee81a6ed61 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bubble/index.ts +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bubble/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin, ChartLabel } from '@superset-ui/core'; import transformProps from '../transformProps'; import example from './images/example.jpg'; diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bullet/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bullet/controlPanel.ts index 22ca8771878..0ef99b890aa 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bullet/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bullet/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig } from '@superset-ui/chart-controls'; const config: ControlPanelConfig = { diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bullet/index.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bullet/index.ts index 4f6091424bd..a6689705450 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bullet/index.ts +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bullet/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import transformProps from '../transformProps'; import example from './images/example.jpg'; diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/controlPanel.ts index 139a2c79b0e..5a8f8bfb1a1 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, getStandardizedControls, diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/index.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/index.ts index b33682bdd8e..28229f649b9 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/index.ts +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Compare/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin, ChartLabel } from '@superset-ui/core'; import transformProps from '../transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx index 756959d73c2..aebe4a56574 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx @@ -18,7 +18,7 @@ */ /* eslint-disable react/jsx-key */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelSectionConfig, ControlSubSectionHeader, diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.ts index d3dc4acea32..23b779e09e4 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.ts +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.ts @@ -33,7 +33,7 @@ import { SMART_DATE_VERBOSE_ID, VizType, } from '@superset-ui/core'; -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { extendedDayjs as dayjs } from '@superset-ui/core/utils/dates'; import 'nvd3-fork/build/nv.d3.css'; diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/ReactNVD3.tsx b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/ReactNVD3.tsx index 368f3b2183a..f472ac24528 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/ReactNVD3.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/ReactNVD3.tsx @@ -18,7 +18,7 @@ */ // @ts-nocheck -- legacy reactified component with untyped `this` context from reactify callbacks import { reactify } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import PropTypes from 'prop-types'; import Component from './NVD3Vis'; import { hideTooltips, removeTooltip } from './utils'; diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/TimePivot/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/TimePivot/controlPanel.ts index fef611203d5..da9aaffe3b6 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/TimePivot/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/TimePivot/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, D3_FORMAT_OPTIONS, diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/TimePivot/index.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/TimePivot/index.ts index 48851a88ecd..bf98ec9a44e 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/TimePivot/index.ts +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/TimePivot/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import transformProps from '../transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/vendor/superset/AnnotationTypes.ts b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/vendor/superset/AnnotationTypes.ts index 19b2af126df..bafea70f29b 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/vendor/superset/AnnotationTypes.ts +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/vendor/superset/AnnotationTypes.ts @@ -17,7 +17,7 @@ * under the License. */ // @ts-nocheck -- vendor file; not fully typed -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; function extractTypes(metadata) { return Object.keys(metadata).reduce((prev, key) => { diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/components/CustomHeader.tsx b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/components/CustomHeader.tsx index 61761c0f927..cb6e58e5491 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/components/CustomHeader.tsx +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/components/CustomHeader.tsx @@ -20,7 +20,7 @@ */ import { useRef, useState, useEffect } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ArrowDownOutlined, ArrowUpOutlined } from '@ant-design/icons'; import { Column } from '@superset-ui/core/components/ThemedAgGridReact'; import FilterIcon from './Filter'; diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/components/Pagination.tsx b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/components/Pagination.tsx index 267a0d59d6a..676a24562fb 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/components/Pagination.tsx +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/components/Pagination.tsx @@ -17,7 +17,7 @@ * under the License. */ /* eslint-disable theme-colors/no-literal-colors */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { VerticalLeftOutlined, VerticalRightOutlined, diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/components/TimeComparisonVisibility.tsx b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/components/TimeComparisonVisibility.tsx index 067b8845f2d..f8c8964a673 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/components/TimeComparisonVisibility.tsx +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/components/TimeComparisonVisibility.tsx @@ -20,7 +20,7 @@ import { useState } from 'react'; import { Dropdown } from 'antd'; import { TableOutlined, DownOutlined, CheckOutlined } from '@ant-design/icons'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { InfoText, ColumnLabel, CheckIconWrapper } from '../../styles'; interface ComparisonColumn { diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/index.tsx b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/index.tsx index 45e0c8cb9ed..011c2cf0ef9 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/index.tsx +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTable/index.tsx @@ -42,7 +42,7 @@ import { CellClickedEvent, IMenuActionParams, } from '@superset-ui/core/components/ThemedAgGridReact'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AgGridChartState, DataRecordValue, diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTableChart.tsx b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTableChart.tsx index 79eee9a91ff..b4eae18de41 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTableChart.tsx +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/AgGridTableChart.tsx @@ -16,13 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DataRecord, DataRecordValue, getTimeFormatterForGranularity, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { useCallback, useEffect, useState, useMemo } from 'react'; import { isEqual } from 'lodash'; diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx index 993bdf56f8f..c0aa70ea66d 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx @@ -41,7 +41,7 @@ import { isPercentMetric, ColorSchemeEnum, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, isAdhocColumn, @@ -54,7 +54,7 @@ import { validateServerPagination, withLabel, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { isEmpty, last } from 'lodash'; import { PAGE_SIZE_OPTIONS, SERVER_PAGE_SIZE_OPTIONS } from './consts'; diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/index.ts b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/index.ts index 6818ad020de..d17af0908b0 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/index.ts +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior, ChartMetadata, ChartPlugin } from '@superset-ui/core'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/NumericCellRenderer.tsx b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/NumericCellRenderer.tsx index a13502374af..87529673110 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/NumericCellRenderer.tsx +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/NumericCellRenderer.tsx @@ -16,7 +16,11 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, useTheme, type SupersetTheme } from '@apache-superset/core/ui'; +import { + styled, + useTheme, + type SupersetTheme, +} from '@apache-superset/core/theme'; import { CustomCellRendererProps } from '@superset-ui/core/components/ThemedAgGridReact'; import { BasicColorFormatterType, InputColumn, ValueRange } from '../types'; import { useIsDark } from '../utils/useTableTheme'; diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/TextCellRenderer.tsx b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/TextCellRenderer.tsx index eb52f206a88..9b24fa3cd33 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/TextCellRenderer.tsx +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/TextCellRenderer.tsx @@ -18,7 +18,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { isProbablyHTML, sanitizeHtml } from '@superset-ui/core'; import { InfoCircleOutlined } from '@ant-design/icons'; import { Tooltip } from '@superset-ui/core/components'; diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/stories/data.ts b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/stories/data.ts index 1c9a0db8c35..6dfd11f77ea 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/stories/data.ts +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/stories/data.ts @@ -17,7 +17,7 @@ * under the License. */ -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ChartDataResponseResult, VizType } from '@superset-ui/core'; import { TableChartFormData } from '../types'; diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/styles/index.tsx b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/styles/index.tsx index e3aedf7e6ea..62e1fc35b79 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/styles/index.tsx +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/styles/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css, styled } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; import { Select } from '@superset-ui/core/components'; /* Components for AgGridTable */ diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts index c22b6ff46c4..be174cb5a21 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts @@ -17,7 +17,7 @@ * under the License. */ import memoizeOne from 'memoize-one'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ComparisonType, Currency, @@ -35,7 +35,7 @@ import { TimeFormats, TimeFormatter, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { isEmpty, isEqual, merge } from 'lodash'; import { ConditionalFormattingConfig, diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/formatValue.ts b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/formatValue.ts index a6772d1e13a..2e2b76853c5 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/formatValue.ts +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/formatValue.ts @@ -24,7 +24,7 @@ import { isProbablyHTML, sanitizeHtml, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ValueFormatterParams, ValueGetterParams, diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useColDefs.ts b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useColDefs.ts index e78e51aab70..84606c5013f 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useColDefs.ts +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useColDefs.ts @@ -20,7 +20,7 @@ import { ColDef } from '@superset-ui/core/components/ThemedAgGridReact'; import { useCallback, useMemo } from 'react'; import { DataRecord, DataRecordValue } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ColorFormatters } from '@superset-ui/chart-controls'; import { extent as d3Extent, max as d3Max } from 'd3-array'; import { diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useTableTheme.ts b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useTableTheme.ts index f37bcf4dc51..1ef82fa3839 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useTableTheme.ts +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useTableTheme.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import { colorSchemeDark, colorSchemeLight, diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/test/controlPanel.test.tsx b/superset-frontend/plugins/plugin-chart-ag-grid-table/test/controlPanel.test.tsx index 647ce938d6c..b85535d5340 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/test/controlPanel.test.tsx +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/test/controlPanel.test.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { QueryFormData } from '@superset-ui/core'; import { Dataset, diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/test/utils/useColDefs.test.ts b/superset-frontend/plugins/plugin-chart-ag-grid-table/test/utils/useColDefs.test.ts index 760be579792..9f2a44a82d0 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/test/utils/useColDefs.test.ts +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/test/utils/useColDefs.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { renderHook } from '@testing-library/react-hooks'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { useColDefs } from '../../src/utils/useColDefs'; import { InputColumn } from '../../src/types'; diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/src/CartodiagramPlugin.tsx b/superset-frontend/plugins/plugin-chart-cartodiagram/src/CartodiagramPlugin.tsx index 15d7ca53e57..77f6eeeba83 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/src/CartodiagramPlugin.tsx +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/src/CartodiagramPlugin.tsx @@ -17,7 +17,7 @@ * under the License. */ import { createRef, useState } from 'react'; -import { styled, useTheme } from '@apache-superset/core/ui'; +import { styled, useTheme } from '@apache-superset/core/theme'; import OlMap from 'ol/Map'; import { CartodiagramPluginProps, diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartLayer.tsx b/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartLayer.tsx index 33e3573f974..88f78098a2a 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartLayer.tsx +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartLayer.tsx @@ -20,7 +20,7 @@ import Layer from 'ol/layer/Layer'; import { FrameState } from 'ol/Map'; import { apply as applyTransform } from 'ol/transform'; import ReactDOM from 'react-dom'; -import { SupersetTheme } from '@apache-superset/core/ui'; +import { SupersetTheme } from '@apache-superset/core/theme'; import { ChartConfig, ChartLayerOptions, ChartSizeValues } from '../types'; import { createChartComponent } from '../util/chartUtil'; import { getProjectedCoordinateFromPointGeoJson } from '../util/geometryUtil'; diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartWrapper.tsx b/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartWrapper.tsx index bcdcbec4fc6..efc637f3b2e 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartWrapper.tsx +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/src/components/ChartWrapper.tsx @@ -18,7 +18,7 @@ */ import { configureStore } from '@reduxjs/toolkit'; import { getChartComponentRegistry } from '@superset-ui/core'; -import { ThemeProvider } from '@apache-superset/core/ui'; +import { ThemeProvider } from '@apache-superset/core/theme'; import { FC, useEffect, useState } from 'react'; import { Provider as ReduxProvider } from 'react-redux'; import { ChartWrapperProps } from '../types'; diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/src/plugin/controlPanel.ts b/superset-frontend/plugins/plugin-chart-cartodiagram/src/plugin/controlPanel.ts index 7bb5d2e186b..c472ef4a5b0 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/src/plugin/controlPanel.ts +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/src/plugin/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty } from '@superset-ui/core'; import { ControlPanelConfig } from '@superset-ui/chart-controls'; import { selectedChartMutator } from '../util/controlPanelUtil'; diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/src/plugin/index.ts b/superset-frontend/plugins/plugin-chart-cartodiagram/src/plugin/index.ts index 34c3dcb56d8..7bf99854318 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/src/plugin/index.ts +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/src/plugin/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/src/types.ts b/superset-frontend/plugins/plugin-chart-cartodiagram/src/types.ts index 3e5528f86ec..9f05391dddb 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/src/types.ts +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/src/types.ts @@ -17,7 +17,7 @@ * under the License. */ import { DataRecord, TimeseriesDataRecord } from '@superset-ui/core'; -import { SupersetTheme } from '@apache-superset/core/ui'; +import { SupersetTheme } from '@apache-superset/core/theme'; import { RenderFunction } from 'ol/layer/Layer'; import { Extent } from 'ol/extent'; import Source from 'ol/source/Source'; diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/src/util/chartUtil.tsx b/superset-frontend/plugins/plugin-chart-cartodiagram/src/util/chartUtil.tsx index 9932b9bab96..c37f5acc8c0 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/src/util/chartUtil.tsx +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/src/util/chartUtil.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { SupersetTheme } from '@apache-superset/core/ui'; +import { SupersetTheme } from '@apache-superset/core/theme'; import { ChartConfig, ChartConfigFeature } from '../types'; import ChartWrapper from '../components/ChartWrapper'; diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/src/util/controlPanelUtil.tsx b/superset-frontend/plugins/plugin-chart-cartodiagram/src/util/controlPanelUtil.tsx index a2ae810858c..1048a02c67f 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/src/util/controlPanelUtil.tsx +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/src/util/controlPanelUtil.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig } from '@superset-ui/chart-controls'; /** diff --git a/superset-frontend/plugins/plugin-chart-cartodiagram/test/plugin/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-cartodiagram/test/plugin/transformProps.test.ts index 210bb3c833e..e62c3d044cd 100644 --- a/superset-frontend/plugins/plugin-chart-cartodiagram/test/plugin/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-cartodiagram/test/plugin/transformProps.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps, getChartTransformPropsRegistry } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import { LayerConf, MapViewConfigs, ZoomConfigs } from '../../src/types'; import transformProps from '../../src/plugin/transformProps'; import { diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx index c66e339aae4..209c4a20748 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx @@ -17,13 +17,13 @@ * under the License. */ import { useEffect, useMemo, useState } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, fetchTimeRange, getTimeOffset, } from '@superset-ui/core'; -import { css, styled, useTheme } from '@apache-superset/core/ui'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import { Tooltip } from '@superset-ui/core/components'; import { DEFAULT_DATE_PATTERN, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/controlPanel.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/controlPanel.ts index e8557ced595..9da2cfa8e2e 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/controlPanel.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/controlPanel.ts @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { t } from '@apache-superset/core/translation'; +import { GenericDataType } from '@apache-superset/core/common'; import { ControlPanelConfig, getStandardizedControls, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/index.ts index 03f53fe18f0..77872ac1bc6 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/controlPanel.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/controlPanel.ts index 603fbcf9040..d926f06de01 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/controlPanel.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/controlPanel.ts @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SMART_DATE_ID } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ControlPanelConfig, D3_FORMAT_DOCS, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/index.ts index bfda10d9028..7d8458479d1 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior } from '@superset-ui/core'; import controlPanel from './controlPanel'; import transformProps from './transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.test.ts index c58c148ad80..e36207b0f18 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.test.ts @@ -17,7 +17,7 @@ * under the License. */ -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { getColorFormatters } from '@superset-ui/chart-controls'; import { BigNumberTotalChartProps } from '../types'; import transformProps from './transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.ts index ef9501fe9af..c79e85784ba 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.ts @@ -27,7 +27,7 @@ import { QueryFormData, getValueFormatter, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { BigNumberTotalChartProps, BigNumberVizProps } from '../types'; import { getDateFormatter, getOriginalLabel, parseMetricValue } from '../utils'; import { Refs } from '../../types'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx index e66eda4e13d..3215eb3dd6c 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useState, useEffect, useRef, MouseEvent } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { getNumberFormatter, getTimeFormatter, @@ -27,7 +27,7 @@ import { BinaryQueryObjectFilterClause, DTTM_ALIAS, } from '@superset-ui/core'; -import { styled, useTheme } from '@apache-superset/core/ui'; +import { styled, useTheme } from '@apache-superset/core/theme'; import Echart from '../components/Echart'; import { BigNumberVizProps } from './types'; import { EventHandlers } from '../types'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/controlPanel.tsx index 2928f532312..9351efabeb4 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SMART_DATE_ID } from '@superset-ui/core'; import { aggregationControl, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/index.ts index d76f7a3d48a..74a7da2c043 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior } from '@superset-ui/core'; import controlPanel from './controlPanel'; import transformProps from './transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.test.ts index 73fb3a70b44..d3cb26d2ad8 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.test.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import transformProps from './transformProps'; import { BigNumberWithTrendlineChartProps, BigNumberDatum } from '../types'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.ts index a1e11c63fea..0010a19f8c3 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { extractTimegrain, getNumberFormatter, @@ -27,7 +27,7 @@ import { getValueFormatter, tooltipHtml, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { EChartsCoreOption, graphic } from 'echarts/core'; import { aggregationChoices } from '@superset-ui/chart-controls'; import { TIMESERIES_CONSTANTS } from '../../constants'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/sharedControls.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/sharedControls.ts index d57d998d699..5c7647fa576 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/sharedControls.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/sharedControls.ts @@ -18,7 +18,7 @@ */ // These are control configurations that are shared ONLY within the BigNumberWithTrendline viz plugin repo. -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { CustomControlItem } from '@superset-ui/chart-controls'; const FONT_SIZE_OPTIONS_SMALL = [ diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/controlPanel.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/controlPanel.ts index 64611323f3e..d98c135ced8 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/controlPanel.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/controlPanel.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, isAdhocColumn, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/index.ts index b28e2db187f..cd196b19311 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/controlPanel.tsx index 5d2775aee2f..ccc176e039f 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, formatSelectOptions, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/index.ts index 7d55a84eb5e..5795acd3cd4 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import thumbnail from './images/thumbnail.png'; import thumbnailDark from './images/thumbnail-dark.png'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/controlPanel.tsx index 4d706d4bb42..67910b1b71a 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, ControlSubSectionHeader, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/index.ts index 2fbf81aa270..056443ecfb9 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/EchartsGantt.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/EchartsGantt.tsx index f914b7f4ace..48e7e590022 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/EchartsGantt.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/EchartsGantt.tsx @@ -18,7 +18,7 @@ */ import { useEffect, useRef, useState } from 'react'; import { sharedControlComponents } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import Echart from '../components/Echart'; import { EchartsGanttChartTransformedProps } from './types'; import { EventHandlers } from '../types'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/controlPanel.tsx index 8db566d038e..fd8127d428a 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/controlPanel.tsx @@ -22,8 +22,8 @@ import { sections, sharedControls, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { t } from '@apache-superset/core/translation'; +import { GenericDataType } from '@apache-superset/core/common'; import { legendSection, showExtraControls, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/index.ts index 998b8e49e97..104afe3a44d 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior } from '@superset-ui/core'; import transformProps from './transformProps'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/transformProps.ts index 62893e1cbd9..997cbab1397 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Gantt/transformProps.ts @@ -24,7 +24,7 @@ import { EChartsCoreOption, LineSeriesOption, } from 'echarts'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AxisType, CategoricalColorNamespace, @@ -35,7 +35,7 @@ import { tooltipHtml, } from '@superset-ui/core'; import { extendedDayjs as dayjs } from '@superset-ui/core/utils/dates'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { CallbackDataParams } from 'echarts/types/src/util/types'; import { Cartesian2dCoordSys, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/constants.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/constants.ts index 5e7a23545f0..5f51fd05310 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/constants.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/constants.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { SupersetTheme } from '@apache-superset/core/ui'; +import { SupersetTheme } from '@apache-superset/core/theme'; import type { GaugeSeriesOption } from 'echarts/charts'; export const defaultGaugeSeriesOption = ( diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/controlPanel.tsx index b4aeafacdfa..423fa6f4d81 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { sharedControls, ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/index.ts index dd7d9d5e39b..1347ec21dcd 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior } from '@superset-ui/core'; import controlPanel from './controlPanel'; import transformProps from './transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Graph/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Graph/controlPanel.tsx index d792dc78669..f382dddfaee 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Graph/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Graph/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, ControlSubSectionHeader, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Graph/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Graph/index.ts index a4e7bc25b75..768e4732454 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Graph/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Graph/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior } from '@superset-ui/core'; import controlPanel from './controlPanel'; import transformProps from './transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/controlPanel.tsx index 12fd9bda043..5ac5440f08c 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/index.ts index 39b113af7b3..56965454a11 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import transformProps from './transformProps'; import buildQuery from './buildQuery'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts index 60c6aceaf29..8d6185c05a5 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts @@ -29,8 +29,8 @@ import { tooltipHtml, DataRecordValue, } from '@superset-ui/core'; -import { logging } from '@apache-superset/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { logging } from '@apache-superset/core/utils'; +import { GenericDataType } from '@apache-superset/core/common'; import memoizeOne from 'memoize-one'; import { maxBy, minBy } from 'lodash'; import type { ComposeOption } from 'echarts/core'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Histogram/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Histogram/controlPanel.tsx index 839a2af354f..889f9c04edd 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Histogram/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Histogram/controlPanel.tsx @@ -16,13 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateInteger, validateNonEmpty, withLabel, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ControlPanelConfig, formatSelectOptionsForRange, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Histogram/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Histogram/index.ts index f399c62e88a..f0e0d8905b8 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Histogram/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Histogram/index.ts @@ -17,7 +17,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx index ea5c8ca0053..1945302d031 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray } from '@superset-ui/core'; import { cloneDeep } from 'lodash'; import { diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/index.ts index 393788313f8..82c5496efe0 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AnnotationType, Behavior } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts index 0d58f825322..f4db0afc3d9 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts @@ -42,7 +42,7 @@ import { tooltipHtml, ValueFormatter, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { getOriginalSeries } from '@superset-ui/chart-controls'; import type { EChartsCoreOption } from 'echarts/core'; import type { SeriesOption } from 'echarts'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Pie/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Pie/controlPanel.tsx index e44ee3dddd9..08f84c7bce3 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Pie/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Pie/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsInt, validateNonEmpty } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Pie/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Pie/index.ts index d1e20817916..389bcb5f19c 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Pie/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Pie/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts index d33110f6ab3..3a66e61910e 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Pie/transformProps.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { CategoricalColorNamespace, getColumnLabel, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Radar/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Radar/controlPanel.tsx index 0d2cb9a1fcc..0925962dde0 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Radar/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Radar/controlPanel.tsx @@ -16,13 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartDataResponseResult, QueryFormMetric, validateNumber, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ControlPanelConfig, ControlSubSectionHeader, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Radar/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Radar/index.ts index 732bc039530..357ab9ae790 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Radar/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Radar/index.ts @@ -17,7 +17,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Sankey/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Sankey/controlPanel.tsx index ec5681a96db..4135e1097fa 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Sankey/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Sankey/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Sankey/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Sankey/index.ts index 8ff643616fb..e473bf096b4 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Sankey/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Sankey/index.ts @@ -17,7 +17,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/controlPanel.tsx index 7269eee8967..b19bc2a2fa1 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, ControlPanelsContainerProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/index.ts index cd0205ac4ef..36646e69060 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior } from '@superset-ui/core'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/transformProps.ts index 5deb443372f..9104518625d 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/transformProps.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { CategoricalColorNamespace, DataRecordValue, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx index 8eb4295de58..4909ea38a81 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, ControlPanelsContainerProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/index.ts index f8e134f38fe..b860f9638e6 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AnnotationType, Behavior } from '@superset-ui/core'; import buildQuery from '../buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx index 9a1a92d12b6..8ab2b643809 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, JsonArray } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/index.ts index 69a1cc703ea..604cd60a876 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AnnotationType, Behavior } from '@superset-ui/core'; import { EchartsTimeseriesChartProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx index 2c339e70f30..5d2ca46e3f3 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, ControlPanelsContainerProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/index.ts index 1be5d44d99a..e9eda463d7c 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AnnotationType, Behavior } from '@superset-ui/core'; import { EchartsTimeseriesChartProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx index 99702e13b39..97a6114b367 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, ControlPanelsContainerProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/index.ts index 0d431e24962..d001ad3fe0a 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AnnotationType, Behavior } from '@superset-ui/core'; import { EchartsTimeseriesChartProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx index c5c2f31bead..c13d89787c3 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, ControlPanelsContainerProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/index.ts index bebc8f47199..44665bf5db4 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AnnotationType, Behavior } from '@superset-ui/core'; import { EchartsTimeseriesChartProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx index c31d2a7604a..cbb17d7e0b4 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, ControlPanelsContainerProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/index.ts index 31a53a66567..6b0e656d0bf 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AnnotationType, Behavior } from '@superset-ui/core'; import { EchartsTimeseriesChartProps, EchartsTimeseriesFormData } from '../..'; import buildQuery from '../buildQuery'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/constants.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/constants.ts index 90c05008b5a..c07be715216 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/constants.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/constants.ts @@ -20,7 +20,7 @@ import { DEFAULT_SORT_SERIES_DATA, sections, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { LegendOrientation, LegendType } from '../types'; import { OrientationType, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/index.ts index c65110c52c6..2f4c4a37e78 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AnnotationType, Behavior } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './Regular/Line/controlPanel'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts index eabd63cc901..6eff01ca80b 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts @@ -18,7 +18,7 @@ */ /* eslint-disable camelcase */ import { invert } from 'lodash'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AnnotationLayer, AxisType, @@ -42,7 +42,7 @@ import { TimeseriesDataRecord, NumberFormats, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { extractExtraMetrics, getOriginalSeries, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts index 64f6593ce1f..d6e7f57fc92 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts @@ -30,7 +30,7 @@ import { TimeseriesDataRecord, ValueFormatter, } from '@superset-ui/core'; -import { SupersetTheme, isThemeDark } from '@apache-superset/core/ui'; +import { SupersetTheme, isThemeDark } from '@apache-superset/core/theme'; import { getContrastingColor } from '@superset-ui/core'; import type { CallbackDataParams, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx index f72355ad044..49190078aaf 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, ControlSubSectionHeader, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/index.ts index 9df35c632a7..c1807aec3e2 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import controlPanel from './controlPanel'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/controlPanel.tsx index 712d5698d97..aaee57adfa8 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, ControlSubSectionHeader, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/index.ts index 24f0f6e4ea1..57264b20f1e 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/index.ts @@ -17,7 +17,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/constants.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/constants.ts index 4f41b53bafc..5b6897f2476 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/constants.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/constants.ts @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; export const TOTAL_MARK = t('Total'); export const ASSIST_MARK = t('Assist'); diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx index 475f219a775..0826b9e1472 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ControlPanelConfig, ControlSubSectionHeader, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/index.ts index b04293dca6b..7a67fc90e2a 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/index.ts @@ -17,7 +17,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/transformProps.ts index c77a2783f47..4a82498fd59 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/transformProps.ts @@ -28,7 +28,7 @@ import { rgbToHex, tooltipHtml, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import type { ComposeOption } from 'echarts/core'; import type { BarSeriesOption } from 'echarts/charts'; import { diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx index 3dd9bbd2dab..624316280ca 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx @@ -29,7 +29,7 @@ import { } from 'react'; import { useSelector } from 'react-redux'; -import { styled, useTheme } from '@apache-superset/core/ui'; +import { styled, useTheme } from '@apache-superset/core/theme'; import { use, init, EChartsType, registerLocale } from 'echarts/core'; import { SankeyChart, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx index 5bf1700d2b9..8df8e20af34 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx @@ -18,7 +18,7 @@ */ import { useState, useEffect, useMemo, useCallback } from 'react'; import { HandlerFunction, JsonValue } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { sharedControlComponents } from '@superset-ui/chart-controls'; import { AreaChartStackControlOptions } from '../constants'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/constants.ts b/superset-frontend/plugins/plugin-chart-echarts/src/constants.ts index 036f4324757..286f611e6d3 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/constants.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/constants.ts @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { JsonValue, TimeGranularity } from '@superset-ui/core'; import { ReactNode } from 'react'; import { diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx index 3bf67ade2ae..cec603649ec 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { VizType } from '@superset-ui/core'; import { ControlPanelsContainerProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts b/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts index c380b5ec2ad..882612ec33f 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts @@ -31,8 +31,8 @@ import { TimeFormatter, ValueFormatter, } from '@superset-ui/core'; -import { SupersetTheme } from '@apache-superset/core/ui'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { SupersetTheme } from '@apache-superset/core/theme'; +import { GenericDataType } from '@apache-superset/core/common'; import { SortSeriesType, LegendPaddingType } from '@superset-ui/chart-controls'; import { format } from 'echarts/core'; import type { LegendComponentOption } from 'echarts/components'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/transformProps.test.ts index 66933c4f813..08912e4cbfb 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/BigNumber/transformProps.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { DatasourceType, TimeGranularity, VizType } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import transformProps from '../../src/BigNumber/BigNumberWithTrendline/transformProps'; import { BigNumberDatum, diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/BoxPlot/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/BoxPlot/transformProps.test.ts index 13cbbd78a00..cdf52dd1ae8 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/BoxPlot/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/BoxPlot/transformProps.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps, SqlaFormData } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import { EchartsBoxPlotChartProps } from '../../src/BoxPlot/types'; import transformProps from '../../src/BoxPlot/transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Bubble/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Bubble/transformProps.test.ts index da66802c4e8..297fbad5656 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Bubble/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Bubble/transformProps.test.ts @@ -22,7 +22,7 @@ import { getNumberFormatter, SqlaFormData, } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import { EchartsBubbleChartProps } from '../../src/Bubble/types'; import transformProps, { formatTooltip } from '../../src/Bubble/transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Funnel/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Funnel/transformProps.test.ts index 3987bbc6483..b2e36c42bba 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Funnel/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Funnel/transformProps.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps, getNumberFormatter } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import transformProps, { parseParams } from '../../src/Funnel/transformProps'; import { EchartsFunnelChartProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Gantt/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Gantt/transformProps.test.ts index 759e5eb43d0..fd0545d5e99 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Gantt/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Gantt/transformProps.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { AxisType, ChartProps } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import { LegendOrientation, LegendType, diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Gauge/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Gauge/transformProps.test.ts index 945938a1af9..b8fd46d0527 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Gauge/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Gauge/transformProps.test.ts @@ -22,7 +22,7 @@ import { SqlaFormData, VizType, } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import transformProps, { getIntervalBoundsAndColors, } from '../../src/Gauge/transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Graph/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Graph/transformProps.test.ts index 50057ae148a..5b700ed1396 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Graph/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Graph/transformProps.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps, SqlaFormData } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import transformProps from '../../src/Graph/transformProps'; import { DEFAULT_GRAPH_SERIES_OPTION } from '../../src/Graph/constants'; import { EchartsGraphChartProps } from '../../src/Graph/types'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Heatmap/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Heatmap/transformProps.test.ts index 2fa5775ade1..d91e8ec935a 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Heatmap/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Heatmap/transformProps.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import { HeatmapChartProps, HeatmapFormData } from '../../src/Heatmap/types'; import transformProps from '../../src/Heatmap/transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Pie/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Pie/transformProps.test.ts index d2daf2d1d6a..78b35ddbc65 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Pie/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Pie/transformProps.test.ts @@ -21,7 +21,7 @@ import { getNumberFormatter, SqlaFormData, } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import type { PieSeriesOption } from 'echarts/charts'; import type { LabelFormatterCallback, diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Radar/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Radar/transformProps.test.ts index 1aef6afdc0b..d51f3304f40 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Radar/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Radar/transformProps.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import { RadarSeriesOption } from 'echarts/charts'; import transformProps from '../../src/Radar/transformProps'; import { diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts index e300b7b84de..ec5bdac5a8c 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps, SqlaFormData } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import { EchartsTimeseriesChartProps } from '../../../src/types'; import transformProps from '../../../src/Timeseries/transformProps'; import { DEFAULT_FORM_DATA } from '../../../src/Timeseries/constants'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Scatter/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Scatter/transformProps.test.ts index 4f799eeb41e..401f85ed5cf 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Scatter/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/Scatter/transformProps.test.ts @@ -25,12 +25,12 @@ import { EchartsTimeseriesFormData, EchartsTimeseriesChartProps, } from '../../../src/Timeseries/types'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { D3_FORMAT_OPTIONS, D3_TIME_FORMAT_OPTIONS, } from '@superset-ui/chart-controls'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; describe('Scatter Chart X-axis Time Formatting', () => { const baseFormData: EchartsTimeseriesFormData = { diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts index d1258767588..1a97bfa44e2 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformers.test.ts @@ -17,8 +17,8 @@ * under the License. */ import { CategoricalColorScale, ChartProps } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { GenericDataType } from '@apache-superset/core/common'; +import { supersetTheme } from '@apache-superset/core/theme'; import type { SeriesOption } from 'echarts'; import { EchartsTimeseriesSeriesType } from '../../src'; import { TIMESERIES_CONSTANTS } from '../../src/constants'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Tree/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Tree/transformProps.test.ts index 9721fc64cf4..f4a7f15636a 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Tree/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Tree/transformProps.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import transformProps from '../../src/Tree/transformProps'; import { EchartsTreeChartProps } from '../../src/Tree/types'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Treemap/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Treemap/transformProps.test.ts index e8e832f0b7c..387c9199ef1 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Treemap/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Treemap/transformProps.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import { EchartsTreemapChartProps } from '../../src/Treemap/types'; import transformProps from '../../src/Treemap/transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Waterfall/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Waterfall/transformProps.test.ts index 271bb746b6d..ab5cbd8de43 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Waterfall/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Waterfall/transformProps.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import { EchartsWaterfallChartProps, WaterfallChartTransformedProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/helpers.ts b/superset-frontend/plugins/plugin-chart-echarts/test/helpers.ts index 2fe9dc8ae03..24b19705b54 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/helpers.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/helpers.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps, ChartDataResponseResult } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; /** * Datasource shape used by Echarts Timeseries and Mixed Timeseries chart props. diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts index 2342570712c..292a0fe9c57 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts @@ -23,8 +23,8 @@ import { getNumberFormatter, getTimeFormatter, } from '@superset-ui/core'; -import { supersetTheme as theme } from '@apache-superset/core/ui'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { supersetTheme as theme } from '@apache-superset/core/theme'; +import { GenericDataType } from '@apache-superset/core/common'; import { calculateLowerLogTick, dedupSeries, diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/utils/transformers.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/utils/transformers.test.ts index 24685716ce0..ef372b65047 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/utils/transformers.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/utils/transformers.test.ts @@ -30,7 +30,7 @@ import { TimeseriesAnnotationLayer, TimeseriesDataRecord, } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import { OrientationType } from '../../src'; import { transformEventAnnotation, diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/Handlebars.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/Handlebars.tsx index 82c1c069af2..54d6de1d346 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/Handlebars.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/Handlebars.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { createRef } from 'react'; import { HandlebarsViewer } from './components/Handlebars/HandlebarsViewer'; import { HandlebarsProps, HandlebarsStylesProps } from './types'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx index 19f2193c51d..557290af42f 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { SafeMarkdown } from '@superset-ui/core/components'; import { extendedDayjs as dayjs } from '@superset-ui/core/utils/dates'; import Handlebars from 'handlebars'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controlPanel.tsx index d23f575ba50..c161b46778f 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controlPanel.tsx @@ -20,7 +20,7 @@ import { ControlPanelConfig, getStandardizedControls, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { allColumnsControlSetItem } from './controls/columns'; import { groupByControlSetItem } from './controls/groupBy'; import { handlebarsTemplateControlSetItem } from './controls/handlebarTemplate'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/columns.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/columns.tsx index fe8ee183083..bd7d30a139f 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/columns.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/columns.tsx @@ -23,7 +23,7 @@ import { Dataset, ColumnMeta, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray } from '@superset-ui/core'; import { getQueryMode, isRawMode } from './shared'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/handlebarTemplate.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/handlebarTemplate.tsx index d7edc7f73a1..2f407c6dd92 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/handlebarTemplate.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/handlebarTemplate.tsx @@ -21,9 +21,9 @@ import { CustomControlConfig, sharedControls, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty } from '@superset-ui/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import { InfoTooltip, SafeMarkdown } from '@superset-ui/core/components'; import { CodeEditor } from '../../components/CodeEditor/CodeEditor'; import { ControlHeader } from '../../components/ControlHeader/controlHeader'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/includeTime.ts b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/includeTime.ts index d3e1a2b2d9a..b02530049fc 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/includeTime.ts +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/includeTime.ts @@ -17,7 +17,7 @@ * under the License. */ import { ControlSetItem } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { isAggMode } from './shared'; export const includeTimeControlSetItem: ControlSetItem = { diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/metrics.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/metrics.tsx index 0c866213f66..de33013527b 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/metrics.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/metrics.tsx @@ -25,7 +25,7 @@ import { ColumnMeta, defineSavedMetrics, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { getQueryMode, isAggMode, validateAggControlValues } from './shared'; const percentMetrics: typeof sharedControls.metrics = { diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/orderBy.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/orderBy.tsx index 84feb76ebd2..cd46e8a3880 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/orderBy.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/orderBy.tsx @@ -17,7 +17,7 @@ * under the License. */ import { ControlSetItem, Dataset } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { isEmpty } from 'lodash'; import { isAggMode, isRawMode } from './shared'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/queryMode.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/queryMode.tsx index d2d1e80ace3..9d25c154304 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/queryMode.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/queryMode.tsx @@ -21,7 +21,7 @@ import { ControlSetItem, QueryModeLabel, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { QueryMode } from '@superset-ui/core'; import { getQueryMode } from './shared'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/shared.ts b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/shared.ts index d6bd318e812..895e7f70d3e 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/shared.ts +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/shared.ts @@ -20,7 +20,7 @@ import { ControlPanelsContainerProps, ControlStateMapping, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, QueryFormColumn, QueryMode } from '@superset-ui/core'; export function getQueryMode(controls: ControlStateMapping): QueryMode { diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx index 74c60fdcc39..ce4b6cf48bf 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx @@ -21,8 +21,8 @@ import { CustomControlConfig, sharedControls, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { useTheme } from '@apache-superset/core/theme'; import { InfoTooltip } from '@superset-ui/core/components'; import { CodeEditor } from '../../components/CodeEditor/CodeEditor'; import { ControlHeader } from '../../components/ControlHeader/controlHeader'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/index.ts b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/index.ts index 612e3fb19f4..f8e28f2ad31 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/index.ts +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import thumbnail from '../images/thumbnail.png'; import thumbnailDark from '../images/thumbnail-dark.png'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/test/plugin/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-handlebars/test/plugin/transformProps.test.ts index c73abe9dd5b..c47308e8f87 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/test/plugin/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-handlebars/test/plugin/transformProps.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartProps, QueryFormData, VizType } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import { HandlebarsQueryFormData } from '../../src/types'; import transformProps from '../../src/plugin/transformProps'; diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx b/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx index 7a1fb79f7ad..425c3598117 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx @@ -22,7 +22,7 @@ import { type MouseEvent as ReactMouseEvent, } from 'react'; import { MinusSquareOutlined, PlusSquareOutlined } from '@ant-design/icons'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AdhocMetric, BinaryQueryObjectFilterClause, @@ -40,7 +40,7 @@ import { normalizeCurrency, NumberFormatter, } from '@superset-ui/core'; -import { styled, useTheme } from '@apache-superset/core/ui'; +import { styled, useTheme } from '@apache-superset/core/theme'; import { aggregatorTemplates, PivotTable, sortAs } from './react-pivottable'; import { FilterType, diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx index e6b373a18ea..4e916857b27 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx @@ -23,7 +23,7 @@ import { getStandardizedControls, sharedControls, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, isAdhocColumn, diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/index.ts b/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/index.ts index a5378b45a79..4108faa0c59 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/index.ts +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior, ChartMetadata, diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/transformProps.ts b/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/transformProps.ts index 847247a2141..1bba188ca05 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/transformProps.ts @@ -26,7 +26,7 @@ import { SMART_DATE_ID, TimeFormats, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { getColorFormatters } from '@superset-ui/chart-controls'; import { DateFormatter } from '../types'; diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/Styles.ts b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/Styles.ts index dcc8ccb590b..169913898f4 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/Styles.ts +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/Styles.ts @@ -17,7 +17,7 @@ * under the License. */ -import { css, styled } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; export const Styles = styled.div<{ isDashboardEditMode: boolean }>` ${({ theme, isDashboardEditMode }) => css` diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.tsx b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.tsx index 3d5f29631e0..cc1d8fbe2df 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.tsx +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.tsx @@ -19,7 +19,7 @@ import { Component, ReactNode, MouseEvent } from 'react'; import { safeHtmlSpan } from '@superset-ui/core'; -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import PropTypes from 'prop-types'; import { FaSort } from 'react-icons/fa'; import { FaSortDown as FaSortDesc } from 'react-icons/fa'; diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts index 321387092c3..4c76b4217d7 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts @@ -18,7 +18,7 @@ */ import PropTypes from 'prop-types'; -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; type SortFunction = ( a: string | number | null, diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/test/plugin/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-pivot-table/test/plugin/transformProps.test.ts index 9245e0c0560..5c7891282be 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/test/plugin/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-pivot-table/test/plugin/transformProps.test.ts @@ -18,7 +18,7 @@ */ import { ChartProps, QueryFormData } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import transformProps from '../../src/plugin/transformProps'; import { MetricsLayoutEnum } from '../../src/types'; diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx b/superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx index d3bbf06a527..74ffcbefb1f 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx @@ -29,7 +29,7 @@ import { useMemo, } from 'react'; import { typedMemo, usePrevious } from '@superset-ui/core'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { useTable, usePagination, diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/GlobalFilter.tsx b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/GlobalFilter.tsx index 93dfc4de4a6..baf9fad9b2d 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/GlobalFilter.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/GlobalFilter.tsx @@ -25,7 +25,7 @@ import { Ref, } from 'react'; import { Row, FilterValue } from 'react-table'; -import { t, tn } from '@apache-superset/core'; +import { t, tn } from '@apache-superset/core/translation'; import { Input, type InputRef, Space } from '@superset-ui/core/components'; import useAsyncState from '../utils/useAsyncState'; diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SearchSelectDropdown.tsx b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SearchSelectDropdown.tsx index 54b69b60187..e612742b1fa 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SearchSelectDropdown.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SearchSelectDropdown.tsx @@ -17,7 +17,7 @@ * under the License. */ /* eslint-disable import/no-extraneous-dependencies */ -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { RawAntdSelect } from '@superset-ui/core/components'; import { SearchOption } from '../../types'; diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SelectPageSize.tsx b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SelectPageSize.tsx index 2572e9596e9..ba187383362 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SelectPageSize.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SelectPageSize.tsx @@ -17,8 +17,8 @@ * under the License. */ import { memo } from 'react'; -import { t } from '@apache-superset/core'; -import { css } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css } from '@apache-superset/core/theme'; import { formatSelectOptions } from '@superset-ui/chart-controls'; import { RawAntdSelect } from '@superset-ui/core/components'; diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx b/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx index e6e58939c6a..76bbc2759aa 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx @@ -30,7 +30,7 @@ import { UIEventHandler, } from 'react'; import { TableInstance, Hooks } from 'react-table'; -import { useTheme, css } from '@apache-superset/core/ui'; +import { useTheme, css } from '@apache-superset/core/theme'; import getScrollBarSize from '../utils/getScrollBarSize'; import needScrollBar from '../utils/needScrollBar'; import useMountedMemo from '../utils/useMountedMemo'; diff --git a/superset-frontend/plugins/plugin-chart-table/src/Styles.tsx b/superset-frontend/plugins/plugin-chart-table/src/Styles.tsx index 27bea632bc1..baa54df0198 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/Styles.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/Styles.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css, styled } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; export default styled.div` ${({ theme }) => css` diff --git a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx index d05193edbc3..02be074bf65 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx @@ -54,10 +54,9 @@ import { css, useTheme, SupersetTheme, - t, - tn, -} from '@apache-superset/core/ui'; -import { GenericDataType } from '@apache-superset/core/api/core'; +} from '@apache-superset/core/theme'; +import { t, tn } from '@apache-superset/core/translation'; +import { GenericDataType } from '@apache-superset/core/common'; import { Input, Space, diff --git a/superset-frontend/plugins/plugin-chart-table/src/consts.ts b/superset-frontend/plugins/plugin-chart-table/src/consts.ts index 7f2136767b1..7617aa9c527 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/consts.ts +++ b/superset-frontend/plugins/plugin-chart-table/src/consts.ts @@ -17,7 +17,7 @@ * under the License. */ import { formatSelectOptions } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; export const PAGE_SIZE_OPTIONS = formatSelectOptions([ [0, t('All')], diff --git a/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx index c951887175e..2787fed15a1 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx @@ -43,7 +43,7 @@ import { ObjectFormattingEnum, ColorSchemeEnum, } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, isAdhocColumn, @@ -56,7 +56,7 @@ import { validateServerPagination, withLabel, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { isEmpty, last } from 'lodash'; import { PAGE_SIZE_OPTIONS, SERVER_PAGE_SIZE_OPTIONS } from './consts'; diff --git a/superset-frontend/plugins/plugin-chart-table/src/index.ts b/superset-frontend/plugins/plugin-chart-table/src/index.ts index 48712ebfc2f..d5ec21896be 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/index.ts +++ b/superset-frontend/plugins/plugin-chart-table/src/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior, ChartMetadata, ChartPlugin } from '@superset-ui/core'; import transformProps from './transformProps'; import thumbnail from './images/thumbnail.png'; diff --git a/superset-frontend/plugins/plugin-chart-table/src/stories/testData.ts b/superset-frontend/plugins/plugin-chart-table/src/stories/testData.ts index 0d4daf339f9..d304e5f1558 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/stories/testData.ts +++ b/superset-frontend/plugins/plugin-chart-table/src/stories/testData.ts @@ -17,7 +17,7 @@ * under the License. */ import { ChartDataResponseResult, VizType } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { TableChartFormData, TableChartProps, diff --git a/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts b/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts index 7b86347d1bb..30ad5f9ed69 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts @@ -17,7 +17,7 @@ * under the License. */ import memoizeOne from 'memoize-one'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ComparisonType, CurrencyFormatter, @@ -36,7 +36,7 @@ import { TimeFormats, TimeFormatter, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ColorFormatters, ConditionalFormattingConfig, diff --git a/superset-frontend/plugins/plugin-chart-table/src/utils/formatValue.ts b/superset-frontend/plugins/plugin-chart-table/src/utils/formatValue.ts index 3769abe5514..f15347f1f0d 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/utils/formatValue.ts +++ b/superset-frontend/plugins/plugin-chart-table/src/utils/formatValue.ts @@ -23,7 +23,7 @@ import { isProbablyHTML, sanitizeHtml, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { DataColumnMeta } from '../types'; import DateWithFormatter from './DateWithFormatter'; diff --git a/superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx b/superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx index e6a955b511b..f3963b0477d 100644 --- a/superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx +++ b/superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx @@ -33,7 +33,7 @@ import { getTimeFormatterForGranularity, } from '@superset-ui/core'; import TableChart, { sanitizeHeaderId } from '../src/TableChart'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import transformProps from '../src/transformProps'; import DateWithFormatter from '../src/utils/DateWithFormatter'; import testData from './testData'; diff --git a/superset-frontend/plugins/plugin-chart-table/test/controlPanel.test.tsx b/superset-frontend/plugins/plugin-chart-table/test/controlPanel.test.tsx index 647ce938d6c..b85535d5340 100644 --- a/superset-frontend/plugins/plugin-chart-table/test/controlPanel.test.tsx +++ b/superset-frontend/plugins/plugin-chart-table/test/controlPanel.test.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { QueryFormData } from '@superset-ui/core'; import { Dataset, diff --git a/superset-frontend/plugins/plugin-chart-table/test/testData.ts b/superset-frontend/plugins/plugin-chart-table/test/testData.ts index f4f96ad9d10..16285ff773c 100644 --- a/superset-frontend/plugins/plugin-chart-table/test/testData.ts +++ b/superset-frontend/plugins/plugin-chart-table/test/testData.ts @@ -24,8 +24,8 @@ import { ComparisonType, VizType, } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { supersetTheme } from '@apache-superset/core/theme'; +import { GenericDataType } from '@apache-superset/core/common'; import { TableChartProps, TableChartFormData } from '../src/types'; const basicFormData: TableChartFormData = { diff --git a/superset-frontend/plugins/plugin-chart-table/test/testHelpers.tsx b/superset-frontend/plugins/plugin-chart-table/test/testHelpers.tsx index ebb0db9bd7f..852758e1a63 100644 --- a/superset-frontend/plugins/plugin-chart-table/test/testHelpers.tsx +++ b/superset-frontend/plugins/plugin-chart-table/test/testHelpers.tsx @@ -21,7 +21,7 @@ import { ThemeProvider, EmotionCacheProvider, createEmotionCache, -} from '@apache-superset/core/ui'; +} from '@apache-superset/core/theme'; const emotionCache = createEmotionCache({ key: 'test', diff --git a/superset-frontend/plugins/plugin-chart-table/test/utils/formatValue.test.ts b/superset-frontend/plugins/plugin-chart-table/test/utils/formatValue.test.ts index 74430924142..d8a2b8d2a4a 100644 --- a/superset-frontend/plugins/plugin-chart-table/test/utils/formatValue.test.ts +++ b/superset-frontend/plugins/plugin-chart-table/test/utils/formatValue.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { CurrencyFormatter, getNumberFormatter } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { formatColumnValue } from '../../src/utils/formatValue'; import { DataColumnMeta } from '../../src/types'; diff --git a/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx b/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx index 6d1abedb774..75736057c19 100644 --- a/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx +++ b/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx @@ -20,7 +20,7 @@ import { PureComponent } from 'react'; import cloudLayout from 'd3-cloud'; import { scaleLinear } from 'd3-scale'; import { seed, CategoricalColorNamespace } from '@superset-ui/core'; -import { SupersetTheme, withTheme } from '@apache-superset/core/ui'; +import { SupersetTheme, withTheme } from '@apache-superset/core/theme'; import { isEqual } from 'lodash'; const seedRandom = seed('superset-ui'); diff --git a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controlPanel.tsx index 6408c07b2e8..9098a282c08 100644 --- a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controlPanel.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNonEmpty } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/ColorSchemeControl/ColorSchemeLabel.tsx b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/ColorSchemeControl/ColorSchemeLabel.tsx index 135d7d1134b..557c5d15454 100644 --- a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/ColorSchemeControl/ColorSchemeLabel.tsx +++ b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/ColorSchemeControl/ColorSchemeLabel.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { css, SupersetTheme } from '@apache-superset/core/ui'; +import { css, SupersetTheme } from '@apache-superset/core/theme'; import { useRef, useState } from 'react'; import { Tooltip } from '@superset-ui/core/components'; diff --git a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/ColorSchemeControl/index.tsx b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/ColorSchemeControl/index.tsx index 7400b5358a3..b10654aa270 100644 --- a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/ColorSchemeControl/index.tsx +++ b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/ColorSchemeControl/index.tsx @@ -18,7 +18,7 @@ */ import { useMemo, ReactNode } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ColorScheme, ColorSchemeGroup, @@ -26,7 +26,7 @@ import { getLabelsColorMap, CategoricalColorNamespace, } from '@superset-ui/core'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { sortBy } from 'lodash'; import { ControlHeader } from '@superset-ui/chart-controls'; import { diff --git a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/RotationControl.tsx b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/RotationControl.tsx index 464312ae479..ff8a1f28b27 100644 --- a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/RotationControl.tsx +++ b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/controls/RotationControl.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Select, SelectValue } from '@superset-ui/core/components'; import { ControlHeader } from '@superset-ui/chart-controls'; import { ControlComponentProps } from '@superset-ui/chart-controls'; diff --git a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/index.ts b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/index.ts index c37d27d8cc3..e1977db2a8f 100644 --- a/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/index.ts +++ b/superset-frontend/plugins/plugin-chart-word-cloud/src/plugin/index.ts @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartMetadata, ChartPlugin } from '@superset-ui/core'; import transformProps from './transformProps'; import buildQuery from './buildQuery'; diff --git a/superset-frontend/spec/helpers/ProviderWrapper.tsx b/superset-frontend/spec/helpers/ProviderWrapper.tsx index c355638e7a0..74a90252363 100644 --- a/superset-frontend/spec/helpers/ProviderWrapper.tsx +++ b/superset-frontend/spec/helpers/ProviderWrapper.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { ThemeProvider } from '@apache-superset/core/ui'; +import { ThemeProvider } from '@apache-superset/core/theme'; import querystring from 'query-string'; import { BrowserRouter as Router } from 'react-router-dom'; import { QueryParamProvider } from 'use-query-params'; diff --git a/superset-frontend/spec/helpers/shim.tsx b/superset-frontend/spec/helpers/shim.tsx index e3f412784c0..253e83ba54a 100644 --- a/superset-frontend/spec/helpers/shim.tsx +++ b/superset-frontend/spec/helpers/shim.tsx @@ -22,7 +22,7 @@ import 'regenerator-runtime/runtime'; import jQuery from 'jquery'; // https://jestjs.io/docs/jest-object#jestmockmodulename-factory-options // in order to mock modules in test case, so avoid absolute import module -import { configure as configureTranslation } from '@apache-superset/core/ui'; +import { configure as configureTranslation } from '@apache-superset/core/translation'; import fetchMock from 'fetch-mock'; import { Worker } from './Worker'; import { IntersectionObserver } from './IntersectionObserver'; diff --git a/superset-frontend/spec/helpers/testing-library.tsx b/superset-frontend/spec/helpers/testing-library.tsx index e753a3ac037..2645e68feee 100644 --- a/superset-frontend/spec/helpers/testing-library.tsx +++ b/superset-frontend/spec/helpers/testing-library.tsx @@ -30,7 +30,7 @@ import { ThemeProvider, themeObject, supersetTheme, -} from '@apache-superset/core/ui'; +} from '@apache-superset/core/theme'; import { SupersetThemeProvider } from 'src/theme/ThemeProvider'; import { ThemeController } from 'src/theme/ThemeController'; import { BrowserRouter } from 'react-router-dom'; diff --git a/superset-frontend/src/SqlLab/SqlLabGlobalStyles.tsx b/superset-frontend/src/SqlLab/SqlLabGlobalStyles.tsx index 648067cbab9..6eb17fefccf 100644 --- a/superset-frontend/src/SqlLab/SqlLabGlobalStyles.tsx +++ b/superset-frontend/src/SqlLab/SqlLabGlobalStyles.tsx @@ -18,7 +18,7 @@ */ import { Global } from '@emotion/react'; -import { css } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; export const SqlLabGlobalStyles = () => ( { diff --git a/superset-frontend/src/SqlLab/components/EditorAutoSync/EditorAutoSync.test.tsx b/superset-frontend/src/SqlLab/components/EditorAutoSync/EditorAutoSync.test.tsx index 91ce6c36a2c..80ba3cd79e8 100644 --- a/superset-frontend/src/SqlLab/components/EditorAutoSync/EditorAutoSync.test.tsx +++ b/superset-frontend/src/SqlLab/components/EditorAutoSync/EditorAutoSync.test.tsx @@ -38,11 +38,11 @@ import fetchMock from 'fetch-mock'; import { render, act } from 'spec/helpers/testing-library'; import ToastContainer from 'src/components/MessageToasts/ToastContainer'; import { initialState, defaultQueryEditor } from 'src/SqlLab/fixtures'; -import { logging } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; import EditorAutoSync, { INTERVAL } from '.'; -vi.mock('@apache-superset/core', () => ({ - ...vi.requireActual('@apache-superset/core'), +vi.mock('@apache-superset/core/utils', async (importActual) => ({ + ...(await importActual()), logging: { warn: vi.fn(), }, diff --git a/superset-frontend/src/SqlLab/components/EditorAutoSync/index.tsx b/superset-frontend/src/SqlLab/components/EditorAutoSync/index.tsx index 567842350bf..0a13bcf9c12 100644 --- a/superset-frontend/src/SqlLab/components/EditorAutoSync/index.tsx +++ b/superset-frontend/src/SqlLab/components/EditorAutoSync/index.tsx @@ -20,7 +20,7 @@ import { useRef, useEffect, FC, useMemo } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { logging } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; import { SqlLabRootState, QueryEditor, diff --git a/superset-frontend/src/SqlLab/components/EditorWrapper/index.tsx b/superset-frontend/src/SqlLab/components/EditorWrapper/index.tsx index b096fd3eec4..aafaa234402 100644 --- a/superset-frontend/src/SqlLab/components/EditorWrapper/index.tsx +++ b/superset-frontend/src/SqlLab/components/EditorWrapper/index.tsx @@ -19,7 +19,7 @@ import { useState, useEffect, useRef, useCallback, useMemo } from 'react'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { usePrevious } from '@superset-ui/core'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { Global } from '@emotion/react'; import type { editors } from '@apache-superset/core'; diff --git a/superset-frontend/src/SqlLab/components/EditorWrapper/useAnnotations.ts b/superset-frontend/src/SqlLab/components/EditorWrapper/useAnnotations.ts index 0b4196be295..91c60d75bd0 100644 --- a/superset-frontend/src/SqlLab/components/EditorWrapper/useAnnotations.ts +++ b/superset-frontend/src/SqlLab/components/EditorWrapper/useAnnotations.ts @@ -18,7 +18,7 @@ */ import { useSelector } from 'react-redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { COMMON_ERR_MESSAGES, ClientErrorObject } from '@superset-ui/core'; import { SqlLabRootState } from 'src/SqlLab/types'; import { VALIDATION_DEBOUNCE_MS } from 'src/SqlLab/constants'; diff --git a/superset-frontend/src/SqlLab/components/EditorWrapper/useKeywords.ts b/superset-frontend/src/SqlLab/components/EditorWrapper/useKeywords.ts index 52c0cd818b0..ce1896e0886 100644 --- a/superset-frontend/src/SqlLab/components/EditorWrapper/useKeywords.ts +++ b/superset-frontend/src/SqlLab/components/EditorWrapper/useKeywords.ts @@ -18,7 +18,7 @@ */ import { useEffect, useMemo, useRef } from 'react'; import { useSelector, useDispatch, shallowEqual, useStore } from 'react-redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { getExtensionsRegistry } from '@superset-ui/core'; import type { Editor } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx index 621020c410d..b89290741ae 100644 --- a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx @@ -18,8 +18,9 @@ */ import { useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { t } from '@apache-superset/core'; -import { css, styled, Alert } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { Alert } from '@apache-superset/core/components'; +import { css, styled } from '@apache-superset/core/theme'; import { Button, diff --git a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/index.tsx b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/index.tsx index ee4a0f04860..b7f6978dde8 100644 --- a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useSelector, useDispatch } from 'react-redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { JsonObject, VizType } from '@superset-ui/core'; import { createCtasDatasource, diff --git a/superset-frontend/src/SqlLab/components/ExploreResultsButton/index.tsx b/superset-frontend/src/SqlLab/components/ExploreResultsButton/index.tsx index 39deb485b2c..1312ef02001 100644 --- a/superset-frontend/src/SqlLab/components/ExploreResultsButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/ExploreResultsButton/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Button, type OnClickHandler, diff --git a/superset-frontend/src/SqlLab/components/HighlightedSql/index.tsx b/superset-frontend/src/SqlLab/components/HighlightedSql/index.tsx index 2617babf0db..f958e05a32d 100644 --- a/superset-frontend/src/SqlLab/components/HighlightedSql/index.tsx +++ b/superset-frontend/src/SqlLab/components/HighlightedSql/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ModalTrigger } from '@superset-ui/core/components'; import CodeSyntaxHighlighter from '@superset-ui/core/components/CodeSyntaxHighlighter'; diff --git a/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/index.tsx b/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/index.tsx index c3188f9efa2..d9d4e1ce6b6 100644 --- a/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/index.tsx @@ -17,8 +17,8 @@ * under the License. */ import { FC } from 'react'; -import { t } from '@apache-superset/core'; -import { styled, css } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, css } from '@apache-superset/core/theme'; import { ModalTrigger } from '@superset-ui/core/components'; import { detectOS } from 'src/utils/common'; diff --git a/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx b/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx index 31071473c4d..1e58a30f5c5 100644 --- a/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx @@ -21,9 +21,9 @@ import { shallowEqual, useSelector } from 'react-redux'; import { useInView } from 'react-intersection-observer'; import { omit } from 'lodash'; import { EmptyState, Skeleton } from '@superset-ui/core/components'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { FeatureFlag, isFeatureEnabled } from '@superset-ui/core'; -import { styled, css } from '@apache-superset/core/ui'; +import { styled, css } from '@apache-superset/core/theme'; import QueryTable from 'src/SqlLab/components/QueryTable'; import { SqlLabRootState } from 'src/SqlLab/types'; import { useEditorQueriesQuery } from 'src/hooks/apiResources/queries'; diff --git a/superset-frontend/src/SqlLab/components/QueryLimitSelect/index.tsx b/superset-frontend/src/SqlLab/components/QueryLimitSelect/index.tsx index 9b63b494df7..9dadb22b091 100644 --- a/superset-frontend/src/SqlLab/components/QueryLimitSelect/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryLimitSelect/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useDispatch } from 'react-redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Dropdown, Button } from '@superset-ui/core/components'; import { Menu } from '@superset-ui/core/components/Menu'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/SqlLab/components/QueryStateLabel/index.tsx b/superset-frontend/src/SqlLab/components/QueryStateLabel/index.tsx index 1a56ce9b461..cb616211519 100644 --- a/superset-frontend/src/SqlLab/components/QueryStateLabel/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryStateLabel/index.tsx @@ -19,7 +19,7 @@ import { Label } from '@superset-ui/core/components'; import { STATE_TYPE_MAP, STATE_TYPE_MAP_LOCALIZED } from 'src/SqlLab/constants'; import { Query } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; interface QueryStateLabelProps { query: Pick; diff --git a/superset-frontend/src/SqlLab/components/QueryStatusBar/index.tsx b/superset-frontend/src/SqlLab/components/QueryStatusBar/index.tsx index 69230fea178..317d8646cd9 100644 --- a/superset-frontend/src/SqlLab/components/QueryStatusBar/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryStatusBar/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { FC, useMemo, createContext, useContext, useRef } from 'react'; -import { t, styled } from '@apache-superset/core'; +import { styled } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import { Flex, Steps, diff --git a/superset-frontend/src/SqlLab/components/QueryTable/index.tsx b/superset-frontend/src/SqlLab/components/QueryTable/index.tsx index 9f7c4aaf17e..2ba0985aed7 100644 --- a/superset-frontend/src/SqlLab/components/QueryTable/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryTable/index.tsx @@ -27,9 +27,9 @@ import { TableView, } from '@superset-ui/core/components'; import ProgressBar from '@superset-ui/core/components/ProgressBar'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { QueryResponse, QueryState } from '@superset-ui/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { diff --git a/superset-frontend/src/SqlLab/components/QueryTable/styles.ts b/superset-frontend/src/SqlLab/components/QueryTable/styles.ts index 2aae4e7c90b..30bb0fb71e5 100644 --- a/superset-frontend/src/SqlLab/components/QueryTable/styles.ts +++ b/superset-frontend/src/SqlLab/components/QueryTable/styles.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css } from '@apache-superset/core/ui'; +import { styled, css } from '@apache-superset/core/theme'; import { IconTooltip } from '@superset-ui/core/components'; export const StaticPosition = css` diff --git a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx index de3e64ee55c..510228596d7 100644 --- a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx +++ b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx @@ -44,7 +44,7 @@ import { ErrorMessageWithStackTrace, } from 'src/components'; import { nanoid } from 'nanoid'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { QueryState, usePrevious, @@ -52,8 +52,9 @@ import { getExtensionsRegistry, ErrorTypeEnum, } from '@superset-ui/core'; -import { tn } from '@apache-superset/core'; -import { styled, useTheme, css, Alert } from '@apache-superset/core/ui'; +import { tn } from '@apache-superset/core/translation'; +import { Alert } from '@apache-superset/core/components'; +import { styled, useTheme, css } from '@apache-superset/core/theme'; import { ISaveableDatasource, ISimpleColumn, diff --git a/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx b/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx index 9bc54bb2687..4353951a715 100644 --- a/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx @@ -18,8 +18,8 @@ */ import { useMemo, FC, ReactElement } from 'react'; -import { t } from '@apache-superset/core'; -import { styled, useTheme, SupersetTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, useTheme, SupersetTheme } from '@apache-superset/core/theme'; import { Button, DropdownButton } from '@superset-ui/core/components'; import { IconType, Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx index a68edb7efaa..b82f788f420 100644 --- a/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Icons } from '@superset-ui/core/components/Icons'; import { Button } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx index c1a2fc871f0..e6ead23fbb3 100644 --- a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx +++ b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx @@ -30,7 +30,7 @@ import { Icons, Flex, } from '@superset-ui/core/components'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SupersetClient, JsonResponse, @@ -42,7 +42,7 @@ import { isFeatureEnabled, getClientErrorObject, } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { extendedDayjs as dayjs } from '@superset-ui/core/utils/dates'; import { useSelector, useDispatch } from 'react-redux'; import rison from 'rison'; diff --git a/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx b/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx index fa09eddb8ad..3d235cbd739 100644 --- a/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx +++ b/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx @@ -18,8 +18,8 @@ */ import { useState, useEffect, useMemo, ChangeEvent } from 'react'; import type { DatabaseObject } from 'src/features/databases/types'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { Input, Button, diff --git a/superset-frontend/src/SqlLab/components/ScheduleQueryButton/index.tsx b/superset-frontend/src/SqlLab/components/ScheduleQueryButton/index.tsx index a65416818b3..bf1b0ab2a2b 100644 --- a/superset-frontend/src/SqlLab/components/ScheduleQueryButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/ScheduleQueryButton/index.tsx @@ -21,8 +21,8 @@ import { FunctionComponent, useState, useRef, ChangeEvent } from 'react'; import SchemaForm, { FormProps } from '@rjsf/core'; import { FormValidation } from '@rjsf/utils'; import validator from '@rjsf/validator-ajv8'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { parseDate } from 'chrono-node'; import { ModalTrigger, diff --git a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx index 7b84b5325a6..6be69ca8639 100644 --- a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx +++ b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { getClientErrorObject, SupersetClient } from '@superset-ui/core'; -import { css } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; import { Button } from '@superset-ui/core/components'; import { CopyToClipboard } from 'src/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx b/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx index 14d76300fd4..6ae07d3fcb8 100644 --- a/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx +++ b/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx @@ -19,9 +19,10 @@ import { FC, useMemo } from 'react'; import { shallowEqual, useSelector } from 'react-redux'; import { EmptyState } from '@superset-ui/core/components'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { FeatureFlag, isFeatureEnabled } from '@superset-ui/core'; -import { styled, Alert } from '@apache-superset/core/ui'; +import { Alert } from '@apache-superset/core/components'; +import { styled } from '@apache-superset/core/theme'; import { SqlLabRootState } from 'src/SqlLab/types'; import ResultSet from '../ResultSet'; diff --git a/superset-frontend/src/SqlLab/components/SouthPane/index.tsx b/superset-frontend/src/SqlLab/components/SouthPane/index.tsx index da5a33ad35b..5ee5b172f6d 100644 --- a/superset-frontend/src/SqlLab/components/SouthPane/index.tsx +++ b/superset-frontend/src/SqlLab/components/SouthPane/index.tsx @@ -20,8 +20,8 @@ import { createRef, useCallback, useMemo } from 'react'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { nanoid } from 'nanoid'; import Tabs from '@superset-ui/core/components/Tabs'; -import { t } from '@apache-superset/core'; -import { css, styled, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import { removeTables, setActiveSouthPaneTab } from 'src/SqlLab/actions/sqlLab'; diff --git a/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx b/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx index e1483e6663b..d7ce0e56296 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx @@ -32,7 +32,7 @@ import type { editors } from '@apache-superset/core'; import useEffectEvent from 'src/hooks/useEffectEvent'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import AutoSizer from 'react-virtualized-auto-sizer'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { FeatureFlag, isFeatureEnabled, @@ -40,7 +40,8 @@ import { QueryResponse, Query, } from '@superset-ui/core'; -import { css, styled, useTheme, Alert } from '@apache-superset/core/ui'; +import { Alert } from '@apache-superset/core/components'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import type { QueryEditor, SqlLabRootState, diff --git a/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx b/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx index 91c8fe4e7e9..9ff47fd6223 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx @@ -28,8 +28,8 @@ import { Popover, Typography, } from '@superset-ui/core/components'; -import { t } from '@apache-superset/core'; -import { styled, css } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, css } from '@apache-superset/core/theme'; import type { SchemaOption, CatalogOption } from 'src/hooks/apiResources'; import { DatabaseSelector, type DatabaseObject } from 'src/components'; diff --git a/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx b/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx index 40c11f8a7d7..6753612a8e9 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx @@ -22,9 +22,14 @@ import { bindActionCreators } from 'redux'; import { useSelector, useDispatch, shallowEqual } from 'react-redux'; import { MenuDotsDropdown } from '@superset-ui/core/components'; import { Menu, MenuItemType } from '@superset-ui/core/components/Menu'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { QueryState } from '@superset-ui/core'; -import { styled, css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; +import { + styled, + css, + SupersetTheme, + useTheme, +} from '@apache-superset/core/theme'; import { removeQueryEditor, removeAllOtherQueryEditors, diff --git a/superset-frontend/src/SqlLab/components/SqlEditorTopBar/index.tsx b/superset-frontend/src/SqlLab/components/SqlEditorTopBar/index.tsx index 8b77d0bf5df..db87975ea9b 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditorTopBar/index.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditorTopBar/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { Flex } from '@superset-ui/core/components'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { MenuItemType } from '@superset-ui/core/components/Menu'; import { ViewLocations } from 'src/SqlLab/contributions'; import PanelToolbar from 'src/components/PanelToolbar'; diff --git a/superset-frontend/src/SqlLab/components/StatusBar/index.tsx b/superset-frontend/src/SqlLab/components/StatusBar/index.tsx index 878fdb07cf1..f4ff20cb89b 100644 --- a/superset-frontend/src/SqlLab/components/StatusBar/index.tsx +++ b/superset-frontend/src/SqlLab/components/StatusBar/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@apache-superset/core'; +import { styled } from '@apache-superset/core/theme'; import { Flex } from '@superset-ui/core/components'; import ViewListExtension from 'src/components/ViewListExtension'; import { views } from 'src/core'; diff --git a/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx b/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx index 83c870e1233..f03f399583c 100644 --- a/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx +++ b/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx @@ -20,9 +20,9 @@ import { PureComponent } from 'react'; import { EditableTabs } from '@superset-ui/core/components/Tabs'; import { connect } from 'react-redux'; import type { QueryEditor, SqlLabRootState } from 'src/SqlLab/types'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { FeatureFlag, isFeatureEnabled } from '@superset-ui/core'; -import { styled, css } from '@apache-superset/core/ui'; +import { styled, css } from '@apache-superset/core/theme'; import { Logger } from 'src/logger/LogUtils'; import { EmptyState, Tooltip } from '@superset-ui/core/components'; import { detectOS } from 'src/utils/common'; diff --git a/superset-frontend/src/SqlLab/components/TableElement/index.tsx b/superset-frontend/src/SqlLab/components/TableElement/index.tsx index 6aa508902f0..710f2eb4bdc 100644 --- a/superset-frontend/src/SqlLab/components/TableElement/index.tsx +++ b/superset-frontend/src/SqlLab/components/TableElement/index.tsx @@ -31,8 +31,8 @@ import { type CollapseProps, } from '@superset-ui/core/components'; import { CopyToClipboard } from 'src/components'; -import { t } from '@apache-superset/core'; -import { styled, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, useTheme } from '@apache-superset/core/theme'; import { debounce } from 'lodash'; import { diff --git a/superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx b/superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx index 9f1b9fec345..5e845c45e6b 100644 --- a/superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx +++ b/superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { css, styled, t } from '@apache-superset/core'; +import { css, styled } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import type { NodeRendererProps } from 'react-arborist'; import { Icons, Tooltip, Typography } from '@superset-ui/core/components'; import RefreshLabel from '@superset-ui/core/components/RefreshLabel'; diff --git a/superset-frontend/src/SqlLab/components/TableExploreTree/index.tsx b/superset-frontend/src/SqlLab/components/TableExploreTree/index.tsx index 5840d177339..13b6e700ad5 100644 --- a/superset-frontend/src/SqlLab/components/TableExploreTree/index.tsx +++ b/superset-frontend/src/SqlLab/components/TableExploreTree/index.tsx @@ -24,7 +24,8 @@ import { useMemo, } from 'react'; import { useSelector, useDispatch, shallowEqual } from 'react-redux'; -import { styled, css, t, useTheme } from '@apache-superset/core'; +import { styled, css, useTheme } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import AutoSizer from 'react-virtualized-auto-sizer'; // Due to performance issues with the virtual list in the existing Ant Design (antd)-based tree view, // it has been replaced with react-arborist solution. diff --git a/superset-frontend/src/SqlLab/components/TableExploreTree/useTreeData.ts b/superset-frontend/src/SqlLab/components/TableExploreTree/useTreeData.ts index 7653c0c36dc..0a85f5cbd7c 100644 --- a/superset-frontend/src/SqlLab/components/TableExploreTree/useTreeData.ts +++ b/superset-frontend/src/SqlLab/components/TableExploreTree/useTreeData.ts @@ -17,7 +17,7 @@ * under the License. */ import { useMemo, useReducer, useCallback } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Table, type TableMetaData, diff --git a/superset-frontend/src/SqlLab/components/TablePreview/index.tsx b/superset-frontend/src/SqlLab/components/TablePreview/index.tsx index e69fad4473b..9e38b83ad7a 100644 --- a/superset-frontend/src/SqlLab/components/TablePreview/index.tsx +++ b/superset-frontend/src/SqlLab/components/TablePreview/index.tsx @@ -19,9 +19,10 @@ import { type FC, useCallback, useMemo, useRef, useState } from 'react'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { nanoid } from 'nanoid'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ClientErrorObject, getExtensionsRegistry } from '@superset-ui/core'; -import { css, styled, Alert, useTheme } from '@apache-superset/core/ui'; +import { Alert } from '@apache-superset/core/components'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import { SafeMarkdown, Breadcrumb, diff --git a/superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx b/superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx index 9b27e45427b..10f17f6c593 100644 --- a/superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx +++ b/superset-frontend/src/SqlLab/components/TemplateParamsEditor/index.tsx @@ -17,8 +17,8 @@ * under the License. */ import { useState, useEffect } from 'react'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { debounce } from 'lodash'; import { Badge, diff --git a/superset-frontend/src/SqlLab/constants.ts b/superset-frontend/src/SqlLab/constants.ts index 1f8753453cb..236af259aab 100644 --- a/superset-frontend/src/SqlLab/constants.ts +++ b/superset-frontend/src/SqlLab/constants.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import type { LabelType } from '@superset-ui/core/components'; export const STATE_TYPE_MAP: Record = { diff --git a/superset-frontend/src/SqlLab/fixtures.ts b/superset-frontend/src/SqlLab/fixtures.ts index 3b6d99716c5..65ce527f7ef 100644 --- a/superset-frontend/src/SqlLab/fixtures.ts +++ b/superset-frontend/src/SqlLab/fixtures.ts @@ -26,7 +26,7 @@ import { QueryResponse, QueryState, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { LatestQueryEditorVersion } from 'src/SqlLab/types'; import { ISaveableDatasource } from 'src/SqlLab/components/SaveDatasetModal'; diff --git a/superset-frontend/src/SqlLab/reducers/getInitialState.ts b/superset-frontend/src/SqlLab/reducers/getInitialState.ts index 0f870ac0fb8..6ee4ac50177 100644 --- a/superset-frontend/src/SqlLab/reducers/getInitialState.ts +++ b/superset-frontend/src/SqlLab/reducers/getInitialState.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { nanoid } from 'nanoid'; import type { BootstrapData } from 'src/types/bootstrapTypes'; import type { InitialState } from 'src/hooks/apiResources/sqlLab'; diff --git a/superset-frontend/src/SqlLab/reducers/sqlLab.ts b/superset-frontend/src/SqlLab/reducers/sqlLab.ts index e3f51e3d0c3..46277bb86b6 100644 --- a/superset-frontend/src/SqlLab/reducers/sqlLab.ts +++ b/superset-frontend/src/SqlLab/reducers/sqlLab.ts @@ -17,7 +17,7 @@ * under the License. */ import { normalizeTimestamp, QueryState } from '@superset-ui/core'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { isEqual, omit } from 'lodash'; import { shallowEqual } from 'react-redux'; import { now } from '@superset-ui/core/utils/dates'; diff --git a/superset-frontend/src/SqlLab/utils/newQueryTabName.ts b/superset-frontend/src/SqlLab/utils/newQueryTabName.ts index 94f71559579..12fa765a357 100644 --- a/superset-frontend/src/SqlLab/utils/newQueryTabName.ts +++ b/superset-frontend/src/SqlLab/utils/newQueryTabName.ts @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { QueryEditor } from '../types'; const untitledQueryRegex = /^Untitled Query (\d+)$/; // Literal notation isn't recompiled diff --git a/superset-frontend/src/chartCustomizations/components/DeckglLayerVisibility/DeckglLayerVisibilityCustomizationPlugin.tsx b/superset-frontend/src/chartCustomizations/components/DeckglLayerVisibility/DeckglLayerVisibilityCustomizationPlugin.tsx index dca9832dd64..ff2461683f2 100644 --- a/superset-frontend/src/chartCustomizations/components/DeckglLayerVisibility/DeckglLayerVisibilityCustomizationPlugin.tsx +++ b/superset-frontend/src/chartCustomizations/components/DeckglLayerVisibility/DeckglLayerVisibilityCustomizationPlugin.tsx @@ -17,9 +17,9 @@ * under the License. */ import { useEffect, useState, useMemo, useRef, useCallback } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DataMask, ExtraFormData } from '@superset-ui/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import { Select, FormItem, diff --git a/superset-frontend/src/chartCustomizations/components/DeckglLayerVisibility/index.ts b/superset-frontend/src/chartCustomizations/components/DeckglLayerVisibility/index.ts index a4127b4903b..687ee7a082d 100644 --- a/superset-frontend/src/chartCustomizations/components/DeckglLayerVisibility/index.ts +++ b/superset-frontend/src/chartCustomizations/components/DeckglLayerVisibility/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior, ChartMetadata, ChartPlugin } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/src/chartCustomizations/components/DynamicGroupBy/DynamicGroupByPlugin.tsx b/superset-frontend/src/chartCustomizations/components/DynamicGroupBy/DynamicGroupByPlugin.tsx index 8a8c045e0df..4919246dac0 100644 --- a/superset-frontend/src/chartCustomizations/components/DynamicGroupBy/DynamicGroupByPlugin.tsx +++ b/superset-frontend/src/chartCustomizations/components/DynamicGroupBy/DynamicGroupByPlugin.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t, tn } from '@apache-superset/core'; +import { t, tn } from '@apache-superset/core/translation'; import { ensureIsArray, ExtraFormData } from '@superset-ui/core'; import { useEffect, useState, useMemo } from 'react'; import { diff --git a/superset-frontend/src/chartCustomizations/components/DynamicGroupBy/controlPanel.ts b/superset-frontend/src/chartCustomizations/components/DynamicGroupBy/controlPanel.ts index a09523b6cfb..f1e20b4ef6f 100644 --- a/superset-frontend/src/chartCustomizations/components/DynamicGroupBy/controlPanel.ts +++ b/superset-frontend/src/chartCustomizations/components/DynamicGroupBy/controlPanel.ts @@ -17,7 +17,7 @@ * under the License. */ import { ControlPanelConfig } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; const config: ControlPanelConfig = { controlPanelSections: [ diff --git a/superset-frontend/src/chartCustomizations/components/DynamicGroupBy/index.ts b/superset-frontend/src/chartCustomizations/components/DynamicGroupBy/index.ts index 4b81919fca6..57d3a986ef3 100644 --- a/superset-frontend/src/chartCustomizations/components/DynamicGroupBy/index.ts +++ b/superset-frontend/src/chartCustomizations/components/DynamicGroupBy/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior, ChartMetadata, ChartPlugin } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/src/chartCustomizations/components/TimeColumn/TimeColumnFilterPlugin.tsx b/superset-frontend/src/chartCustomizations/components/TimeColumn/TimeColumnFilterPlugin.tsx index 7377816429e..72849696247 100644 --- a/superset-frontend/src/chartCustomizations/components/TimeColumn/TimeColumnFilterPlugin.tsx +++ b/superset-frontend/src/chartCustomizations/components/TimeColumn/TimeColumnFilterPlugin.tsx @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -import { t, tn } from '@apache-superset/core'; +import { t, tn } from '@apache-superset/core/translation'; import { ensureIsArray, ExtraFormData } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { useEffect, useState } from 'react'; import { FormItem, diff --git a/superset-frontend/src/chartCustomizations/components/TimeColumn/controlPanel.ts b/superset-frontend/src/chartCustomizations/components/TimeColumn/controlPanel.ts index cef113e3865..119a992ab89 100644 --- a/superset-frontend/src/chartCustomizations/components/TimeColumn/controlPanel.ts +++ b/superset-frontend/src/chartCustomizations/components/TimeColumn/controlPanel.ts @@ -17,7 +17,7 @@ * under the License. */ import { ControlPanelConfig } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; const config: ControlPanelConfig = { controlPanelSections: [ diff --git a/superset-frontend/src/chartCustomizations/components/TimeColumn/index.ts b/superset-frontend/src/chartCustomizations/components/TimeColumn/index.ts index 6971be03d2b..5c9dce38ee9 100644 --- a/superset-frontend/src/chartCustomizations/components/TimeColumn/index.ts +++ b/superset-frontend/src/chartCustomizations/components/TimeColumn/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior, ChartMetadata, ChartPlugin } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/src/chartCustomizations/components/TimeGrain/TimeGrainFilterPlugin.tsx b/superset-frontend/src/chartCustomizations/components/TimeGrain/TimeGrainFilterPlugin.tsx index 4fdd0a33aae..5ff909e8375 100644 --- a/superset-frontend/src/chartCustomizations/components/TimeGrain/TimeGrainFilterPlugin.tsx +++ b/superset-frontend/src/chartCustomizations/components/TimeGrain/TimeGrainFilterPlugin.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t, tn } from '@apache-superset/core'; +import { t, tn } from '@apache-superset/core/translation'; import { ensureIsArray, ExtraFormData, diff --git a/superset-frontend/src/chartCustomizations/components/TimeGrain/controlPanel.ts b/superset-frontend/src/chartCustomizations/components/TimeGrain/controlPanel.ts index 49049f70ba2..cd9079fa097 100644 --- a/superset-frontend/src/chartCustomizations/components/TimeGrain/controlPanel.ts +++ b/superset-frontend/src/chartCustomizations/components/TimeGrain/controlPanel.ts @@ -17,7 +17,7 @@ * under the License. */ import { ControlPanelConfig } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; const config: ControlPanelConfig = { controlPanelSections: [ diff --git a/superset-frontend/src/chartCustomizations/components/TimeGrain/index.ts b/superset-frontend/src/chartCustomizations/components/TimeGrain/index.ts index 8c2c95632c4..885797e6484 100644 --- a/superset-frontend/src/chartCustomizations/components/TimeGrain/index.ts +++ b/superset-frontend/src/chartCustomizations/components/TimeGrain/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior, ChartMetadata, ChartPlugin } from '@superset-ui/core'; import buildQuery from './buildQuery'; import controlPanel from './controlPanel'; diff --git a/superset-frontend/src/chartCustomizations/components/common.ts b/superset-frontend/src/chartCustomizations/components/common.ts index 38d98a5ae09..01725ccb18e 100644 --- a/superset-frontend/src/chartCustomizations/components/common.ts +++ b/superset-frontend/src/chartCustomizations/components/common.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { FormItem } from '@superset-ui/core/components'; import { PluginFilterStylesProps } from './types'; diff --git a/superset-frontend/src/components/AlteredSliceTag/index.tsx b/superset-frontend/src/components/AlteredSliceTag/index.tsx index 2ad313bbd69..0637bba6006 100644 --- a/superset-frontend/src/components/AlteredSliceTag/index.tsx +++ b/superset-frontend/src/components/AlteredSliceTag/index.tsx @@ -18,7 +18,7 @@ */ import { useEffect, useMemo, useState, FC } from 'react'; import { isEmpty } from 'lodash'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import getControlsForVizType from 'src/utils/getControlsForVizType'; import { Label, diff --git a/superset-frontend/src/components/AuditInfo/index.tsx b/superset-frontend/src/components/AuditInfo/index.tsx index 1df21c848cc..37f49cafd57 100644 --- a/superset-frontend/src/components/AuditInfo/index.tsx +++ b/superset-frontend/src/components/AuditInfo/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import getOwnerName from 'src/utils/getOwnerName'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Tooltip } from '@superset-ui/core/components'; import type { AuditInfoProps } from './types'; diff --git a/superset-frontend/src/components/Chart/Chart.tsx b/superset-frontend/src/components/Chart/Chart.tsx index a9797f4f56a..a7e38aa61a4 100644 --- a/superset-frontend/src/components/Chart/Chart.tsx +++ b/superset-frontend/src/components/Chart/Chart.tsx @@ -17,7 +17,8 @@ * under the License. */ import { PureComponent } from 'react'; -import { t, logging } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, FeatureFlag, @@ -30,7 +31,7 @@ import { type JsonObject, type AgGridChartState, } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import type { ChartState, Datasource, ChartStatus } from 'src/explore/types'; import { PLACEHOLDER_DATASOURCE } from 'src/dashboard/constants'; import { EmptyState, Loading } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/components/Chart/ChartContextMenu/ChartContextMenu.tsx b/superset-frontend/src/components/Chart/ChartContextMenu/ChartContextMenu.tsx index 56b295b0cf7..ecb52a7d87d 100644 --- a/superset-frontend/src/components/Chart/ChartContextMenu/ChartContextMenu.tsx +++ b/superset-frontend/src/components/Chart/ChartContextMenu/ChartContextMenu.tsx @@ -28,7 +28,7 @@ import { } from 'react'; import ReactDOM from 'react-dom'; import { useDispatch, useSelector } from 'react-redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior, BinaryQueryObjectFilterClause, @@ -41,7 +41,7 @@ import { isFeatureEnabled, QueryFormData, } from '@superset-ui/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import { RootState } from 'src/dashboard/types'; import { MenuItem } from '@superset-ui/core/components/Menu'; import { usePermissions } from 'src/hooks/usePermissions'; diff --git a/superset-frontend/src/components/Chart/ChartRenderer.tsx b/superset-frontend/src/components/Chart/ChartRenderer.tsx index be6fd3aeaec..33528f78a38 100644 --- a/superset-frontend/src/components/Chart/ChartRenderer.tsx +++ b/superset-frontend/src/components/Chart/ChartRenderer.tsx @@ -35,8 +35,8 @@ import { ContextMenuFilters, DataRecordFilters, } from '@superset-ui/core'; -import { logging } from '@apache-superset/core'; -import { t } from '@apache-superset/core/ui'; +import { logging } from '@apache-superset/core/utils'; +import { t } from '@apache-superset/core/translation'; import { Logger, LOG_ACTIONS_RENDER_CHART } from 'src/logger/LogUtils'; import { EmptyState } from '@superset-ui/core/components'; import { ChartSource } from 'src/types/ChartSource'; diff --git a/superset-frontend/src/components/Chart/DisabledMenuItemTooltip.tsx b/superset-frontend/src/components/Chart/DisabledMenuItemTooltip.tsx index 8e47d36ddcb..46ccc5b9647 100644 --- a/superset-frontend/src/components/Chart/DisabledMenuItemTooltip.tsx +++ b/superset-frontend/src/components/Chart/DisabledMenuItemTooltip.tsx @@ -18,7 +18,7 @@ */ import { ReactNode } from 'react'; -import { css, SupersetTheme } from '@apache-superset/core/ui'; +import { css, SupersetTheme } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { Tooltip } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/components/Chart/DrillBy/DrillByChart.tsx b/superset-frontend/src/components/Chart/DrillBy/DrillByChart.tsx index 6463948827e..b977433e853 100644 --- a/superset-frontend/src/components/Chart/DrillBy/DrillByChart.tsx +++ b/superset-frontend/src/components/Chart/DrillBy/DrillByChart.tsx @@ -23,7 +23,7 @@ import { SuperChart, ContextMenuFilters, } from '@superset-ui/core'; -import { css } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; import { Dataset } from '../types'; interface DrillByChartProps { diff --git a/superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx b/superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx index 6245945de45..1bb63d0d81e 100644 --- a/superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx +++ b/superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx @@ -18,7 +18,7 @@ */ import { useCallback, useContext, useEffect, useMemo, useState } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { BinaryQueryObjectFilterClause, BaseFormData, @@ -29,7 +29,8 @@ import { ContextMenuFilters, AdhocFilter, } from '@superset-ui/core'; -import { css, useTheme, Alert } from '@apache-superset/core/ui'; +import { Alert } from '@apache-superset/core/components'; +import { css, useTheme } from '@apache-superset/core/theme'; import { useDispatch, useSelector } from 'react-redux'; import { Link } from 'react-router-dom'; import { diff --git a/superset-frontend/src/components/Chart/DrillBy/DrillBySubmenu.tsx b/superset-frontend/src/components/Chart/DrillBy/DrillBySubmenu.tsx index 9e3ebde3a07..8bb347e7dfa 100644 --- a/superset-frontend/src/components/Chart/DrillBy/DrillBySubmenu.tsx +++ b/superset-frontend/src/components/Chart/DrillBy/DrillBySubmenu.tsx @@ -26,7 +26,7 @@ import { useRef, useState, } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { BaseFormData, Behavior, @@ -35,7 +35,7 @@ import { ensureIsArray, getChartMetadataRegistry, } from '@superset-ui/core'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { Constants, Input, diff --git a/superset-frontend/src/components/Chart/DrillBy/useDisplayModeToggle.tsx b/superset-frontend/src/components/Chart/DrillBy/useDisplayModeToggle.tsx index 8676d9fdb83..e4744378726 100644 --- a/superset-frontend/src/components/Chart/DrillBy/useDisplayModeToggle.tsx +++ b/superset-frontend/src/components/Chart/DrillBy/useDisplayModeToggle.tsx @@ -18,8 +18,8 @@ */ import { useMemo, useState } from 'react'; -import { t } from '@apache-superset/core'; -import { css, SupersetTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, SupersetTheme } from '@apache-superset/core/theme'; import { Radio } from '@superset-ui/core/components/Radio'; import { DrillByType } from '../types'; diff --git a/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.tsx b/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.tsx index ce27989a003..f84a2f3be40 100644 --- a/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.tsx +++ b/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.tsx @@ -17,7 +17,8 @@ * under the License. */ import { isDefined, QueryData } from '@superset-ui/core'; -import { css, styled, t } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import { SingleQueryResultPane } from 'src/explore/components/DataTablesPane/components/SingleQueryResultPane'; import Tabs from '@superset-ui/core/components/Tabs'; diff --git a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx index 89b61ecf42f..fcf3d96f9df 100644 --- a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx +++ b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailModal.tsx @@ -19,12 +19,12 @@ import { useCallback, useContext, useMemo } from 'react'; import { useHistory } from 'react-router-dom'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { BinaryQueryObjectFilterClause, QueryFormData, } from '@superset-ui/core'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { Button, Modal } from '@superset-ui/core/components'; import { useSelector } from 'react-redux'; import { DashboardPageIdContext } from 'src/dashboard/containers/DashboardPage'; diff --git a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx index 5dfb9ccc86e..747c17d80bf 100644 --- a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx +++ b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx @@ -26,7 +26,7 @@ import { useState, } from 'react'; import { useSelector } from 'react-redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { BinaryQueryObjectFilterClause, DatasourceType, @@ -34,8 +34,8 @@ import { JsonObject, QueryFormData, } from '@superset-ui/core'; -import { css, useTheme } from '@apache-superset/core/ui'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { css, useTheme } from '@apache-superset/core/theme'; +import { GenericDataType } from '@apache-superset/core/common'; import { useResizeDetector } from 'react-resize-detector'; import BooleanCell from '@superset-ui/core/components/Table/cell-renderers/BooleanCell'; import NullCell from '@superset-ui/core/components/Table/cell-renderers/NullCell'; diff --git a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx index 9f4b2bd0c76..f1c7e23af39 100644 --- a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx +++ b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx @@ -19,12 +19,12 @@ import { useCallback, useMemo } from 'react'; import { Tag } from 'src/components/Tag'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { BinaryQueryObjectFilterClause, isAdhocColumn, } from '@superset-ui/core'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import RowCountLabel from 'src/components/RowCountLabel'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/components/Chart/DrillDetail/types.ts b/superset-frontend/src/components/Chart/DrillDetail/types.ts index 430de0cde3d..f300e165a1a 100644 --- a/superset-frontend/src/components/Chart/DrillDetail/types.ts +++ b/superset-frontend/src/components/Chart/DrillDetail/types.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; export type ResultsPage = { total: number; diff --git a/superset-frontend/src/components/Chart/MenuItemWithTruncation.tsx b/superset-frontend/src/components/Chart/MenuItemWithTruncation.tsx index 45fb77ad2da..89cdec80c32 100644 --- a/superset-frontend/src/components/Chart/MenuItemWithTruncation.tsx +++ b/superset-frontend/src/components/Chart/MenuItemWithTruncation.tsx @@ -19,7 +19,7 @@ import { ReactNode, CSSProperties, useCallback } from 'react'; import { truncationCSS, useCSSTextTruncation } from '@superset-ui/core'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { Menu, type ItemType } from '@superset-ui/core/components/Menu'; import { Flex, Tooltip } from '@superset-ui/core/components'; import { MenuItemProps } from 'antd'; diff --git a/superset-frontend/src/components/Chart/chartAction.ts b/superset-frontend/src/components/Chart/chartAction.ts index 2ed8bba83b7..40d8ed79b16 100644 --- a/superset-frontend/src/components/Chart/chartAction.ts +++ b/superset-frontend/src/components/Chart/chartAction.ts @@ -31,7 +31,7 @@ import { DatasourceType, LatestQueryFormData, } from '@superset-ui/core'; -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import type { ControlStateMapping } from '@superset-ui/chart-controls'; import { getControlsState } from 'src/explore/store'; import { diff --git a/superset-frontend/src/components/Chart/chartReducer.ts b/superset-frontend/src/components/Chart/chartReducer.ts index 416e3843bf4..874c7d18cf8 100644 --- a/superset-frontend/src/components/Chart/chartReducer.ts +++ b/superset-frontend/src/components/Chart/chartReducer.ts @@ -17,7 +17,7 @@ * under the License. */ /* eslint camelcase: 0 */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { omit } from 'lodash'; import { HYDRATE_DASHBOARD } from 'src/dashboard/actions/hydrate'; import { DatasourcesAction } from 'src/dashboard/actions/datasources'; diff --git a/superset-frontend/src/components/Chart/useDrillDetailMenuItems/index.tsx b/superset-frontend/src/components/Chart/useDrillDetailMenuItems/index.tsx index 13c64f1550d..74ca3f5be0c 100644 --- a/superset-frontend/src/components/Chart/useDrillDetailMenuItems/index.tsx +++ b/superset-frontend/src/components/Chart/useDrillDetailMenuItems/index.tsx @@ -25,7 +25,7 @@ import { useMemo, } from 'react'; import { isEmpty } from 'lodash'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior, BinaryQueryObjectFilterClause, @@ -34,7 +34,7 @@ import { QueryFormData, removeHTMLTags, } from '@superset-ui/core'; -import { css, styled } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; import { useSelector } from 'react-redux'; import { type ItemType } from '@superset-ui/core/components/Menu'; import { RootState } from 'src/dashboard/types'; diff --git a/superset-frontend/src/components/CopyToClipboard/index.tsx b/superset-frontend/src/components/CopyToClipboard/index.tsx index 976f0059c30..3c3a51a845b 100644 --- a/superset-frontend/src/components/CopyToClipboard/index.tsx +++ b/superset-frontend/src/components/CopyToClipboard/index.tsx @@ -17,8 +17,8 @@ * under the License. */ import { Component, cloneElement, ReactElement } from 'react'; -import { t } from '@apache-superset/core'; -import { css, SupersetTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, SupersetTheme } from '@apache-superset/core/theme'; import copyTextToClipboard from 'src/utils/copy'; import { Tooltip } from '@superset-ui/core/components'; import withToasts from '../MessageToasts/withToasts'; diff --git a/superset-frontend/src/components/CrudThemeProvider.tsx b/superset-frontend/src/components/CrudThemeProvider.tsx index 4ecc1c68ce2..506d5a64688 100644 --- a/superset-frontend/src/components/CrudThemeProvider.tsx +++ b/superset-frontend/src/components/CrudThemeProvider.tsx @@ -18,7 +18,7 @@ */ import { ReactNode, useEffect, useState } from 'react'; import { useThemeContext } from 'src/theme/ThemeProvider'; -import { Theme } from '@apache-superset/core/ui'; +import { Theme } from '@apache-superset/core/theme'; import { Loading } from '@superset-ui/core/components'; interface CrudThemeProviderProps { diff --git a/superset-frontend/src/components/DatabaseSelector/index.tsx b/superset-frontend/src/components/DatabaseSelector/index.tsx index 47820e475b2..ee5f39b9979 100644 --- a/superset-frontend/src/components/DatabaseSelector/index.tsx +++ b/superset-frontend/src/components/DatabaseSelector/index.tsx @@ -24,9 +24,9 @@ import { useRef, useCallback, } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SupersetClient, SupersetError } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import rison from 'rison'; import RefreshLabel from '@superset-ui/core/components/RefreshLabel'; import { useToasts } from 'src/components/MessageToasts/withToasts'; diff --git a/superset-frontend/src/components/DatabaseSelector/styles.ts b/superset-frontend/src/components/DatabaseSelector/styles.ts index 5b6b576aa1f..f3dab563bbd 100644 --- a/superset-frontend/src/components/DatabaseSelector/styles.ts +++ b/superset-frontend/src/components/DatabaseSelector/styles.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { FormLabel } from '@superset-ui/core/components'; export const StyledFormLabel = styled(FormLabel)` diff --git a/superset-frontend/src/components/Datasource/ChangeDatasourceModal/index.tsx b/superset-frontend/src/components/Datasource/ChangeDatasourceModal/index.tsx index ea1e1e56298..3b8f3531039 100644 --- a/superset-frontend/src/components/Datasource/ChangeDatasourceModal/index.tsx +++ b/superset-frontend/src/components/Datasource/ChangeDatasourceModal/index.tsx @@ -25,9 +25,10 @@ import { ChangeEvent, } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SupersetClient, getClientErrorObject } from '@superset-ui/core'; -import { styled, Alert } from '@apache-superset/core/ui'; +import { Alert } from '@apache-superset/core/components'; +import { styled } from '@apache-superset/core/theme'; import { Button, Constants, diff --git a/superset-frontend/src/components/Datasource/DatasourceModal/index.tsx b/superset-frontend/src/components/Datasource/DatasourceModal/index.tsx index f8b9f5dbb30..d3e34b76484 100644 --- a/superset-frontend/src/components/Datasource/DatasourceModal/index.tsx +++ b/superset-frontend/src/components/Datasource/DatasourceModal/index.tsx @@ -18,7 +18,7 @@ */ import { FunctionComponent, useState, useEffect, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SupersetClient, getClientErrorObject, @@ -26,7 +26,8 @@ import { isFeatureEnabled, FeatureFlag, } from '@superset-ui/core'; -import { styled, useTheme, css, Alert } from '@apache-superset/core/ui'; +import { Alert } from '@apache-superset/core/components'; +import { styled, useTheme, css } from '@apache-superset/core/theme'; import { Icons, diff --git a/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.styles.ts b/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.styles.ts index 86d7bfaba1f..8c95a3a4a6a 100644 --- a/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.styles.ts +++ b/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.styles.ts @@ -17,7 +17,7 @@ * under the License. */ -import { styled, css } from '@apache-superset/core/ui'; +import { styled, css } from '@apache-superset/core/theme'; export const FOLDER_INDENTATION_WIDTH = 24; export const ITEM_INDENTATION_WIDTH = 4; diff --git a/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.tsx b/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.tsx index 11e4c31c59e..46d2a08bbda 100644 --- a/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.tsx +++ b/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.tsx @@ -21,7 +21,8 @@ import { CSSProperties, useState, memo, useMemo } from 'react'; import { useSortable } from '@dnd-kit/sortable'; import { useDroppable } from '@dnd-kit/core'; import { CSS } from '@dnd-kit/utilities'; -import { css, t } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import { Checkbox, Input, @@ -35,7 +36,7 @@ import { ColumnTypeLabel, Metric, } from '@superset-ui/chart-controls'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { OptionControlContainer, Label, diff --git a/superset-frontend/src/components/Datasource/FoldersEditor/components/DragOverlayContent.tsx b/superset-frontend/src/components/Datasource/FoldersEditor/components/DragOverlayContent.tsx index 1fd6a4d5251..63c6a406ba5 100644 --- a/superset-frontend/src/components/Datasource/FoldersEditor/components/DragOverlayContent.tsx +++ b/superset-frontend/src/components/Datasource/FoldersEditor/components/DragOverlayContent.tsx @@ -18,7 +18,7 @@ */ import { memo } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Metric } from '@superset-ui/core'; import { ColumnMeta } from '@superset-ui/chart-controls'; import { FoldersEditorItemType } from '../../types'; diff --git a/superset-frontend/src/components/Datasource/FoldersEditor/components/FoldersToolbarComponent.tsx b/superset-frontend/src/components/Datasource/FoldersEditor/components/FoldersToolbarComponent.tsx index e62cff18444..a222f638bc9 100644 --- a/superset-frontend/src/components/Datasource/FoldersEditor/components/FoldersToolbarComponent.tsx +++ b/superset-frontend/src/components/Datasource/FoldersEditor/components/FoldersToolbarComponent.tsx @@ -18,7 +18,7 @@ */ import { memo, useMemo } from 'react'; -import { t, tn } from '@apache-superset/core'; +import { t, tn } from '@apache-superset/core/translation'; import { Button, Input, Tooltip } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; import { diff --git a/superset-frontend/src/components/Datasource/FoldersEditor/components/ResetConfirmModal.tsx b/superset-frontend/src/components/Datasource/FoldersEditor/components/ResetConfirmModal.tsx index 0aabc92d8ac..c5b82d3e308 100644 --- a/superset-frontend/src/components/Datasource/FoldersEditor/components/ResetConfirmModal.tsx +++ b/superset-frontend/src/components/Datasource/FoldersEditor/components/ResetConfirmModal.tsx @@ -18,7 +18,7 @@ */ import { memo } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Modal } from '@superset-ui/core/components'; interface ResetConfirmModalProps { diff --git a/superset-frontend/src/components/Datasource/FoldersEditor/folderOperations.ts b/superset-frontend/src/components/Datasource/FoldersEditor/folderOperations.ts index cb810bd4a01..e251b2fbb67 100644 --- a/superset-frontend/src/components/Datasource/FoldersEditor/folderOperations.ts +++ b/superset-frontend/src/components/Datasource/FoldersEditor/folderOperations.ts @@ -23,7 +23,7 @@ */ import { Metric, ColumnMeta } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { v4 as uuidv4 } from 'uuid'; import { DatasourceFolder, diff --git a/superset-frontend/src/components/Datasource/FoldersEditor/folderValidation.ts b/superset-frontend/src/components/Datasource/FoldersEditor/folderValidation.ts index a9430da322c..3acfcc9365b 100644 --- a/superset-frontend/src/components/Datasource/FoldersEditor/folderValidation.ts +++ b/superset-frontend/src/components/Datasource/FoldersEditor/folderValidation.ts @@ -22,7 +22,7 @@ * Determines what actions are allowed based on folder structure and types. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DatasourceFolder } from 'src/explore/components/DatasourcePanel/types'; import { ValidationResult, diff --git a/superset-frontend/src/components/Datasource/FoldersEditor/hooks/useDragHandlers.ts b/superset-frontend/src/components/Datasource/FoldersEditor/hooks/useDragHandlers.ts index d5388f84eff..9437872010c 100644 --- a/superset-frontend/src/components/Datasource/FoldersEditor/hooks/useDragHandlers.ts +++ b/superset-frontend/src/components/Datasource/FoldersEditor/hooks/useDragHandlers.ts @@ -18,7 +18,7 @@ */ import { useCallback, useMemo, useRef, useState } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { UniqueIdentifier, DragStartEvent, diff --git a/superset-frontend/src/components/Datasource/FoldersEditor/hooks/useItemHeights.ts b/superset-frontend/src/components/Datasource/FoldersEditor/hooks/useItemHeights.ts index e45382a663f..240a9d8023c 100644 --- a/superset-frontend/src/components/Datasource/FoldersEditor/hooks/useItemHeights.ts +++ b/superset-frontend/src/components/Datasource/FoldersEditor/hooks/useItemHeights.ts @@ -18,7 +18,7 @@ */ import { useMemo } from 'react'; -import { useTheme, SupersetTheme } from '@apache-superset/core/ui'; +import { useTheme, SupersetTheme } from '@apache-superset/core/theme'; import { FOLDER_INDENTATION_WIDTH, ITEM_INDENTATION_WIDTH, diff --git a/superset-frontend/src/components/Datasource/FoldersEditor/styles.tsx b/superset-frontend/src/components/Datasource/FoldersEditor/styles.tsx index 95e91a0343a..b5ed9e615f6 100644 --- a/superset-frontend/src/components/Datasource/FoldersEditor/styles.tsx +++ b/superset-frontend/src/components/Datasource/FoldersEditor/styles.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css } from '@apache-superset/core/ui'; +import { styled, css } from '@apache-superset/core/theme'; import { calculateItemHeights } from './hooks/useItemHeights'; export const FoldersContainer = styled.div` diff --git a/superset-frontend/src/components/Datasource/components/CollectionTable/index.tsx b/superset-frontend/src/components/Datasource/components/CollectionTable/index.tsx index a99e7f344f5..0004ade750a 100644 --- a/superset-frontend/src/components/Datasource/components/CollectionTable/index.tsx +++ b/superset-frontend/src/components/Datasource/components/CollectionTable/index.tsx @@ -18,8 +18,8 @@ */ import { PureComponent, ReactNode } from 'react'; import { nanoid } from 'nanoid'; -import { t } from '@apache-superset/core'; -import { styled, css, SupersetTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, css, SupersetTheme } from '@apache-superset/core/theme'; import { Icons, Button, InfoTooltip } from '@superset-ui/core/components'; import { FilterValue } from 'react-table'; import Table, { diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx b/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx index 5e8be8d450b..6150927ca6a 100644 --- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx +++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx @@ -20,7 +20,7 @@ import rison from 'rison'; import { PureComponent, useCallback, type ReactNode } from 'react'; import { connect, ConnectedProps } from 'react-redux'; import type { JsonObject } from '@superset-ui/core'; -import type { SupersetTheme } from '@apache-superset/core/ui'; +import { type SupersetTheme } from '@apache-superset/core/theme'; import type { AnyAction } from 'redux'; import type { ThunkDispatch } from 'redux-thunk'; import { Radio } from '@superset-ui/core/components/Radio'; @@ -31,15 +31,15 @@ import { getClientErrorObject, getExtensionsRegistry, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; +import { Alert } from '@apache-superset/core/components'; import { css, styled, themeObject, - Alert, withTheme, - t, -} from '@apache-superset/core/ui'; +} from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import Tabs from '@superset-ui/core/components/Tabs'; import WarningIconWithTooltip from '@superset-ui/core/components/WarningIconWithTooltip'; import TableSelector from 'src/components/TableSelector'; diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DashboardLinksExternal/index.tsx b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DashboardLinksExternal/index.tsx index 5f6e4d15485..d9b25673dae 100644 --- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DashboardLinksExternal/index.tsx +++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DashboardLinksExternal/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { GenericLink } from 'src/components'; const DashboardLinksWrapper = styled.span` diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DatasetUsageTab/index.tsx b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DatasetUsageTab/index.tsx index 85b52f5f08f..8c1456a07f0 100644 --- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DatasetUsageTab/index.tsx +++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DatasetUsageTab/index.tsx @@ -17,8 +17,8 @@ * under the License. */ import { useState, useEffect, useMemo, useCallback, useRef } from 'react'; -import { t } from '@apache-superset/core'; -import { styled, css } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, css } from '@apache-superset/core/theme'; import { CertifiedBadge, InfoTooltip, diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorCurrency.test.tsx b/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorCurrency.test.tsx index 783053370bd..9e4376ea50a 100644 --- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorCurrency.test.tsx +++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorCurrency.test.tsx @@ -23,7 +23,7 @@ import { userEvent, selectOption, } from 'spec/helpers/testing-library'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import type { DatasetObject } from 'src/features/datasets/types'; import { createProps, diff --git a/superset-frontend/src/components/Datasource/components/Field/index.tsx b/superset-frontend/src/components/Datasource/components/Field/index.tsx index 9c940c7e962..6c20adf6f84 100644 --- a/superset-frontend/src/components/Datasource/components/Field/index.tsx +++ b/superset-frontend/src/components/Datasource/components/Field/index.tsx @@ -18,7 +18,7 @@ */ import { useCallback, ReactNode, ReactElement, cloneElement } from 'react'; -import { css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; +import { css, SupersetTheme, useTheme } from '@apache-superset/core/theme'; import { Icons, Tooltip, diff --git a/superset-frontend/src/components/Datasource/components/Fieldset/index.tsx b/superset-frontend/src/components/Datasource/components/Fieldset/index.tsx index 151120cf560..85107403c39 100644 --- a/superset-frontend/src/components/Datasource/components/Fieldset/index.tsx +++ b/superset-frontend/src/components/Datasource/components/Fieldset/index.tsx @@ -18,7 +18,7 @@ */ import { ReactNode, useCallback } from 'react'; import { Divider, Form, Typography } from '@superset-ui/core/components'; -import { css } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; import { recurseReactClone } from '../../utils'; import Field from '../Field'; diff --git a/superset-frontend/src/components/Datasource/utils/index.ts b/superset-frontend/src/components/Datasource/utils/index.ts index 3d5ef8c3f88..221be9d8abf 100644 --- a/superset-frontend/src/components/Datasource/utils/index.ts +++ b/superset-frontend/src/components/Datasource/utils/index.ts @@ -25,7 +25,7 @@ import { } from 'react'; import { nanoid } from 'nanoid'; import { SupersetClient } from '@superset-ui/core'; -import { tn } from '@apache-superset/core/ui'; +import { tn } from '@apache-superset/core/translation'; import rison from 'rison'; // Type definitions diff --git a/superset-frontend/src/components/Datasource/utils/utils.test.tsx b/superset-frontend/src/components/Datasource/utils/utils.test.tsx index 3f77cf4c128..8eeef1b494f 100644 --- a/superset-frontend/src/components/Datasource/utils/utils.test.tsx +++ b/superset-frontend/src/components/Datasource/utils/utils.test.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { tn } from '@apache-superset/core'; +import { tn } from '@apache-superset/core/translation'; import { updateColumns } from '.'; // eslint-disable-next-line no-restricted-globals -- TODO: Migrate from describe blocks diff --git a/superset-frontend/src/components/DynamicPlugins/index.tsx b/superset-frontend/src/components/DynamicPlugins/index.tsx index f1170480a8b..22601f29c65 100644 --- a/superset-frontend/src/components/DynamicPlugins/index.tsx +++ b/superset-frontend/src/components/DynamicPlugins/index.tsx @@ -26,7 +26,7 @@ import { getChartMetadataRegistry, makeApi, } from '@superset-ui/core'; -import { logging } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; import { omitBy } from 'lodash'; import type { Plugin, PluginAction, PluginContextType } from './types'; diff --git a/superset-frontend/src/components/ErrorBoundary/index.tsx b/superset-frontend/src/components/ErrorBoundary/index.tsx index 8dcef63b406..59f5f582a50 100644 --- a/superset-frontend/src/components/ErrorBoundary/index.tsx +++ b/superset-frontend/src/components/ErrorBoundary/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { Component, ErrorInfo } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ErrorAlert } from '../ErrorMessage'; import type { ErrorBoundaryProps, ErrorBoundaryState } from './types'; diff --git a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx index 02e6e4ac144..8b33f0ed6f5 100644 --- a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx +++ b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.test.tsx @@ -19,7 +19,7 @@ import { render, screen } from 'spec/helpers/testing-library'; import { ErrorLevel } from '@superset-ui/core'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import { BasicErrorAlert } from './BasicErrorAlert'; vi.mock( diff --git a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx index 92ce75e0806..213182ffec4 100644 --- a/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx +++ b/superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx @@ -17,7 +17,11 @@ * under the License. */ import { ErrorLevel } from '@superset-ui/core'; -import { styled, useTheme, getColorVariants } from '@apache-superset/core/ui'; +import { + styled, + useTheme, + getColorVariants, +} from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components'; const StyledContent = styled.div` diff --git a/superset-frontend/src/components/ErrorMessage/DatabaseErrorMessage.tsx b/superset-frontend/src/components/ErrorMessage/DatabaseErrorMessage.tsx index fad71169c58..60f2de47824 100644 --- a/superset-frontend/src/components/ErrorMessage/DatabaseErrorMessage.tsx +++ b/superset-frontend/src/components/ErrorMessage/DatabaseErrorMessage.tsx @@ -17,8 +17,8 @@ * under the License. */ import { ReactNode } from 'react'; -import { t } from '@apache-superset/core'; -import { tn } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; +import { tn } from '@apache-superset/core/translation'; import type { ErrorMessageComponentProps } from './types'; import { IssueCode } from './IssueCode'; diff --git a/superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.tsx b/superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.tsx index 6623715ee0b..e74da4d0649 100644 --- a/superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.tsx +++ b/superset-frontend/src/components/ErrorMessage/DatasetNotFoundErrorMessage.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import type { ErrorMessageComponentProps } from './types'; import { ErrorAlert } from './ErrorAlert'; diff --git a/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx b/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx index 97c6ed70471..228668973ff 100644 --- a/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx +++ b/superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx @@ -17,8 +17,9 @@ * under the License. */ import { useState } from 'react'; -import { t } from '@apache-superset/core'; -import { useTheme, Alert } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { Alert } from '@apache-superset/core/components'; +import { useTheme } from '@apache-superset/core/theme'; import { Icons, Modal, diff --git a/superset-frontend/src/components/ErrorMessage/ErrorMessageWithStackTrace.tsx b/superset-frontend/src/components/ErrorMessage/ErrorMessageWithStackTrace.tsx index 2dc7f793bbe..a98820837e5 100644 --- a/superset-frontend/src/components/ErrorMessage/ErrorMessageWithStackTrace.tsx +++ b/superset-frontend/src/components/ErrorMessage/ErrorMessageWithStackTrace.tsx @@ -17,7 +17,7 @@ * under the License. */ import { ReactNode } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ErrorSource, SupersetError } from '@superset-ui/core'; import { Typography } from '@superset-ui/core/components'; import { getErrorMessageComponentRegistry } from './getErrorMessageComponentRegistry'; diff --git a/superset-frontend/src/components/ErrorMessage/FrontendNetworkErrorMessage.tsx b/superset-frontend/src/components/ErrorMessage/FrontendNetworkErrorMessage.tsx index e52b96b8fee..899e332410c 100644 --- a/superset-frontend/src/components/ErrorMessage/FrontendNetworkErrorMessage.tsx +++ b/superset-frontend/src/components/ErrorMessage/FrontendNetworkErrorMessage.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import type { ErrorMessageComponentProps } from './types'; import { ErrorAlert } from './ErrorAlert'; diff --git a/superset-frontend/src/components/ErrorMessage/InvalidSQLErrorMessage.tsx b/superset-frontend/src/components/ErrorMessage/InvalidSQLErrorMessage.tsx index 5792f2d4db3..4c89a0c08e2 100644 --- a/superset-frontend/src/components/ErrorMessage/InvalidSQLErrorMessage.tsx +++ b/superset-frontend/src/components/ErrorMessage/InvalidSQLErrorMessage.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import type { ErrorMessageComponentProps } from './types'; import { ErrorAlert } from './ErrorAlert'; diff --git a/superset-frontend/src/components/ErrorMessage/IssueCode.tsx b/superset-frontend/src/components/ErrorMessage/IssueCode.tsx index 918d3c8f784..6b117578cb2 100644 --- a/superset-frontend/src/components/ErrorMessage/IssueCode.tsx +++ b/superset-frontend/src/components/ErrorMessage/IssueCode.tsx @@ -17,8 +17,8 @@ * under the License. */ import { Icons } from '@superset-ui/core/components'; -import { t } from '@apache-superset/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { useTheme } from '@apache-superset/core/theme'; interface IssueCodeProps { code: number; diff --git a/superset-frontend/src/components/ErrorMessage/MarshmallowErrorMessage.tsx b/superset-frontend/src/components/ErrorMessage/MarshmallowErrorMessage.tsx index 871c4eef394..b65b0e4d61f 100644 --- a/superset-frontend/src/components/ErrorMessage/MarshmallowErrorMessage.tsx +++ b/superset-frontend/src/components/ErrorMessage/MarshmallowErrorMessage.tsx @@ -17,7 +17,7 @@ * under the License. */ import { JSONTree } from 'react-json-tree'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { useJsonTreeTheme } from 'src/hooks/useJsonTreeTheme'; import { Collapse, List, Typography } from '@superset-ui/core/components'; import type { ErrorMessageComponentProps } from './types'; diff --git a/superset-frontend/src/components/ErrorMessage/OAuth2RedirectMessage.tsx b/superset-frontend/src/components/ErrorMessage/OAuth2RedirectMessage.tsx index 1c6ede178b7..2dc655fdec0 100644 --- a/superset-frontend/src/components/ErrorMessage/OAuth2RedirectMessage.tsx +++ b/superset-frontend/src/components/ErrorMessage/OAuth2RedirectMessage.tsx @@ -25,7 +25,7 @@ import { RootState } from 'src/dashboard/types'; import { reRunQuery } from 'src/SqlLab/actions/sqlLab'; import { triggerQuery } from 'src/components/Chart/chartAction'; import { onRefresh } from 'src/dashboard/actions/dashboardState'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { QueryResponse } from '@superset-ui/core'; import type { ErrorMessageComponentProps } from './types'; diff --git a/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.tsx b/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.tsx index 73d8b264c7f..bc79d52613a 100644 --- a/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.tsx +++ b/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.tsx @@ -17,8 +17,8 @@ * under the License. */ import { ReactNode } from 'react'; -import { t } from '@apache-superset/core'; -import { tn } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; +import { tn } from '@apache-superset/core/translation'; import levenshtein from 'js-levenshtein'; import { List } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.tsx b/superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.tsx index 298d1859832..c359efcde28 100644 --- a/superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.tsx +++ b/superset-frontend/src/components/ErrorMessage/TimeoutErrorMessage.tsx @@ -17,8 +17,8 @@ * under the License. */ import { ReactNode } from 'react'; -import { t } from '@apache-superset/core'; -import { tn } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; +import { tn } from '@apache-superset/core/translation'; import type { ErrorMessageComponentProps } from './types'; import { IssueCode } from './IssueCode'; diff --git a/superset-frontend/src/components/FilterableTable/utils.tsx b/superset-frontend/src/components/FilterableTable/utils.tsx index 9eae059b28d..336f64383b9 100644 --- a/superset-frontend/src/components/FilterableTable/utils.tsx +++ b/superset-frontend/src/components/FilterableTable/utils.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { safeHtmlSpan } from '@superset-ui/core'; import { JsonModal } from '../JsonModal'; import { safeJsonObjectParse } from '../JsonModal/utils'; diff --git a/superset-frontend/src/components/GridTable/Header.tsx b/superset-frontend/src/components/GridTable/Header.tsx index f47d9432d6a..ece0a8eb251 100644 --- a/superset-frontend/src/components/GridTable/Header.tsx +++ b/superset-frontend/src/components/GridTable/Header.tsx @@ -17,8 +17,8 @@ * under the License. */ import { useCallback, useEffect, useRef, useState } from 'react'; -import { t } from '@apache-superset/core'; -import { styled, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, useTheme } from '@apache-superset/core/theme'; import type { Column, GridApi } from 'ag-grid-community'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/components/GridTable/HeaderMenu.tsx b/superset-frontend/src/components/GridTable/HeaderMenu.tsx index fbf517619e1..783feb42c0e 100644 --- a/superset-frontend/src/components/GridTable/HeaderMenu.tsx +++ b/superset-frontend/src/components/GridTable/HeaderMenu.tsx @@ -17,8 +17,8 @@ * under the License. */ import { useCallback } from 'react'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import type { Column, ColumnPinnedType, GridApi } from 'ag-grid-community'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/components/GridTable/index.tsx b/superset-frontend/src/components/GridTable/index.tsx index 2860847df62..33d48b8394c 100644 --- a/superset-frontend/src/components/GridTable/index.tsx +++ b/superset-frontend/src/components/GridTable/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useCallback, useMemo } from 'react'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { ThemedAgGridReact } from '@superset-ui/core/components'; import type { Column, GridOptions } from 'ag-grid-community'; import type { AgGridReactProps } from 'ag-grid-react'; diff --git a/superset-frontend/src/components/ImportModal/ErrorAlert.tsx b/superset-frontend/src/components/ImportModal/ErrorAlert.tsx index 571d7bd9a5d..24551678c38 100644 --- a/superset-frontend/src/components/ImportModal/ErrorAlert.tsx +++ b/superset-frontend/src/components/ImportModal/ErrorAlert.tsx @@ -18,8 +18,9 @@ */ import { FunctionComponent } from 'react'; -import { t } from '@apache-superset/core'; -import { SupersetTheme, Alert } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { Alert } from '@apache-superset/core/components'; +import { SupersetTheme } from '@apache-superset/core/theme'; import { getDatabaseDocumentationLinks } from 'src/views/CRUD/hooks'; import { antdWarningAlertStyles } from './styles'; diff --git a/superset-frontend/src/components/ImportModal/ImportErrorAlert.tsx b/superset-frontend/src/components/ImportModal/ImportErrorAlert.tsx index a485aecb5e6..30c360f3c77 100644 --- a/superset-frontend/src/components/ImportModal/ImportErrorAlert.tsx +++ b/superset-frontend/src/components/ImportModal/ImportErrorAlert.tsx @@ -18,7 +18,7 @@ */ import { FunctionComponent } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { getDatabaseDocumentationLinks } from 'src/views/CRUD/hooks'; import { ErrorAlert } from 'src/components'; diff --git a/superset-frontend/src/components/ImportModal/index.tsx b/superset-frontend/src/components/ImportModal/index.tsx index dd43e57b178..39fa38398ef 100644 --- a/superset-frontend/src/components/ImportModal/index.tsx +++ b/superset-frontend/src/components/ImportModal/index.tsx @@ -17,8 +17,8 @@ * under the License. */ import { FunctionComponent, useEffect, useState, ChangeEvent } from 'react'; -import { t } from '@apache-superset/core'; -import { styled, css } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, css } from '@apache-superset/core/theme'; import { useImportResource } from 'src/views/CRUD/hooks'; import { Upload, diff --git a/superset-frontend/src/components/ImportModal/styles.ts b/superset-frontend/src/components/ImportModal/styles.ts index 99b660512d0..a63de41334a 100644 --- a/superset-frontend/src/components/ImportModal/styles.ts +++ b/superset-frontend/src/components/ImportModal/styles.ts @@ -17,7 +17,7 @@ * under the License. */ -import { css, SupersetTheme } from '@apache-superset/core/ui'; +import { css, SupersetTheme } from '@apache-superset/core/theme'; export const antdWarningAlertStyles = (theme: SupersetTheme) => css` margin: ${theme.sizeUnit * 4}px 0; diff --git a/superset-frontend/src/components/JsonModal/index.tsx b/superset-frontend/src/components/JsonModal/index.tsx index cc38d28454d..b365ea0705d 100644 --- a/superset-frontend/src/components/JsonModal/index.tsx +++ b/superset-frontend/src/components/JsonModal/index.tsx @@ -19,7 +19,7 @@ import { FC, useMemo } from 'react'; import { JSONTree } from 'react-json-tree'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { useJsonTreeTheme } from 'src/hooks/useJsonTreeTheme'; import { Button, ModalTrigger } from '@superset-ui/core/components'; import { CopyToClipboard } from '../CopyToClipboard'; diff --git a/superset-frontend/src/components/LastQueriedLabel/index.tsx b/superset-frontend/src/components/LastQueriedLabel/index.tsx index 30d54523321..0e60aff3fb6 100644 --- a/superset-frontend/src/components/LastQueriedLabel/index.tsx +++ b/superset-frontend/src/components/LastQueriedLabel/index.tsx @@ -17,8 +17,8 @@ * under the License. */ import { FC } from 'react'; -import { t } from '@apache-superset/core'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, useTheme } from '@apache-superset/core/theme'; import { extendedDayjs } from '@superset-ui/core/utils/dates'; interface LastQueriedLabelProps { diff --git a/superset-frontend/src/components/ListView/ActionsBar.tsx b/superset-frontend/src/components/ListView/ActionsBar.tsx index 503b3bbee91..33bde585790 100644 --- a/superset-frontend/src/components/ListView/ActionsBar.tsx +++ b/superset-frontend/src/components/ListView/ActionsBar.tsx @@ -36,7 +36,7 @@ * under the License. */ import { ReactElement } from 'react'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { IconNameType, Icons, diff --git a/superset-frontend/src/components/ListView/CardCollection.tsx b/superset-frontend/src/components/ListView/CardCollection.tsx index 8d192037f38..d3e8999713a 100644 --- a/superset-frontend/src/components/ListView/CardCollection.tsx +++ b/superset-frontend/src/components/ListView/CardCollection.tsx @@ -18,7 +18,7 @@ */ import { ReactNode, MouseEvent as ReactMouseEvent } from 'react'; import { TableInstance, Row, UseRowSelectRowProps } from 'react-table'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import cx from 'classnames'; interface CardCollectionProps { diff --git a/superset-frontend/src/components/ListView/CardSortSelect.tsx b/superset-frontend/src/components/ListView/CardSortSelect.tsx index 5ec2a001b31..57617fc2f25 100644 --- a/superset-frontend/src/components/ListView/CardSortSelect.tsx +++ b/superset-frontend/src/components/ListView/CardSortSelect.tsx @@ -17,8 +17,8 @@ * under the License. */ import { useState, useMemo } from 'react'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { FormLabel, Select } from '@superset-ui/core/components'; import { SELECT_WIDTH } from './utils'; import { CardSortSelectOption, SortColumn } from './types'; diff --git a/superset-frontend/src/components/ListView/CrossLinks.tsx b/superset-frontend/src/components/ListView/CrossLinks.tsx index 05c5cee227b..6f4cd6d262b 100644 --- a/superset-frontend/src/components/ListView/CrossLinks.tsx +++ b/superset-frontend/src/components/ListView/CrossLinks.tsx @@ -18,7 +18,7 @@ */ import { memo, useMemo } from 'react'; import { useTruncation } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Link } from 'react-router-dom'; import CrossLinksTooltip from './CrossLinksTooltip'; diff --git a/superset-frontend/src/components/ListView/CrossLinksTooltip.tsx b/superset-frontend/src/components/ListView/CrossLinksTooltip.tsx index 88504e45e92..2f8517ca2fb 100644 --- a/superset-frontend/src/components/ListView/CrossLinksTooltip.tsx +++ b/superset-frontend/src/components/ListView/CrossLinksTooltip.tsx @@ -17,8 +17,8 @@ * under the License. */ import { ReactNode } from 'react'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { Link } from 'react-router-dom'; import { Tooltip } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/components/ListView/Filters/Base.ts b/superset-frontend/src/components/ListView/Filters/Base.ts index 7f5fd9d05e3..2924f490a96 100644 --- a/superset-frontend/src/components/ListView/Filters/Base.ts +++ b/superset-frontend/src/components/ListView/Filters/Base.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css } from '@apache-superset/core/ui'; +import { styled, css } from '@apache-superset/core/theme'; import { Flex } from '@superset-ui/core/components'; interface FilterContainerProps { diff --git a/superset-frontend/src/components/ListView/Filters/DateRange.tsx b/superset-frontend/src/components/ListView/Filters/DateRange.tsx index 00703f63bb2..1b735a5c9b0 100644 --- a/superset-frontend/src/components/ListView/Filters/DateRange.tsx +++ b/superset-frontend/src/components/ListView/Filters/DateRange.tsx @@ -24,7 +24,7 @@ import { RefObject, } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Dayjs } from 'dayjs'; import { useLocale } from 'src/hooks/useLocale'; import { extendedDayjs } from '@superset-ui/core/utils/dates'; diff --git a/superset-frontend/src/components/ListView/Filters/NumericalRange.tsx b/superset-frontend/src/components/ListView/Filters/NumericalRange.tsx index 11efbad1b5e..4079693961a 100644 --- a/superset-frontend/src/components/ListView/Filters/NumericalRange.tsx +++ b/superset-frontend/src/components/ListView/Filters/NumericalRange.tsx @@ -17,8 +17,8 @@ * under the License. */ import { useState, forwardRef, useImperativeHandle, RefObject } from 'react'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { InputNumber } from '@superset-ui/core/components/Input'; import { FormLabel } from '@superset-ui/core/components/Form'; import type { BaseFilter, FilterHandler } from './types'; diff --git a/superset-frontend/src/components/ListView/Filters/Search.tsx b/superset-frontend/src/components/ListView/Filters/Search.tsx index 9655a29b6c5..d06a6c1b1cc 100644 --- a/superset-frontend/src/components/ListView/Filters/Search.tsx +++ b/superset-frontend/src/components/ListView/Filters/Search.tsx @@ -24,8 +24,8 @@ import { ChangeEvent, } from 'react'; -import { t } from '@apache-superset/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { useTheme } from '@apache-superset/core/theme'; import { Input, InfoTooltip, diff --git a/superset-frontend/src/components/ListView/Filters/Select.tsx b/superset-frontend/src/components/ListView/Filters/Select.tsx index 7c7273e5ee2..5e38d99bd84 100644 --- a/superset-frontend/src/components/ListView/Filters/Select.tsx +++ b/superset-frontend/src/components/ListView/Filters/Select.tsx @@ -24,7 +24,7 @@ import { type RefObject, } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Select, AsyncSelect, FormLabel } from '@superset-ui/core/components'; import { ListViewFilter as Filter, SelectOption } from '../types'; import type { BaseFilter, FilterHandler } from './types'; diff --git a/superset-frontend/src/components/ListView/Filters/index.tsx b/superset-frontend/src/components/ListView/Filters/index.tsx index a0895fe87ef..c32d2393b21 100644 --- a/superset-frontend/src/components/ListView/Filters/index.tsx +++ b/superset-frontend/src/components/ListView/Filters/index.tsx @@ -24,7 +24,7 @@ import { RefObject, } from 'react'; -import { withTheme } from '@apache-superset/core/ui'; +import { withTheme } from '@apache-superset/core/theme'; import type { ListViewFilterValue as FilterValue, diff --git a/superset-frontend/src/components/ListView/ListView.tsx b/superset-frontend/src/components/ListView/ListView.tsx index 397ebb0f85d..87135397554 100644 --- a/superset-frontend/src/components/ListView/ListView.tsx +++ b/superset-frontend/src/components/ListView/ListView.tsx @@ -16,8 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; -import { styled, Alert } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { Alert } from '@apache-superset/core/components'; +import { styled } from '@apache-superset/core/theme'; import { useCallback, useEffect, useRef, useState, ReactNode } from 'react'; import cx from 'classnames'; import TableCollection from '@superset-ui/core/components/TableCollection'; diff --git a/superset-frontend/src/components/MessageToasts/Toast.tsx b/superset-frontend/src/components/MessageToasts/Toast.tsx index 87d0be567be..97205384058 100644 --- a/superset-frontend/src/components/MessageToasts/Toast.tsx +++ b/superset-frontend/src/components/MessageToasts/Toast.tsx @@ -16,8 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; -import { t } from '@apache-superset/core'; +import { + styled, + css, + SupersetTheme, + useTheme, +} from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import cx from 'classnames'; import { Interweave } from 'interweave'; import { useCallback, useEffect, useRef, useState } from 'react'; diff --git a/superset-frontend/src/components/MessageToasts/ToastPresenter.tsx b/superset-frontend/src/components/MessageToasts/ToastPresenter.tsx index ca6d694c1db..de90f4a8f31 100644 --- a/superset-frontend/src/components/MessageToasts/ToastPresenter.tsx +++ b/superset-frontend/src/components/MessageToasts/ToastPresenter.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { ToastMeta } from 'src/components/MessageToasts/types'; import Toast from './Toast'; diff --git a/superset-frontend/src/components/Modal/CollapsibleModalSection.tsx b/superset-frontend/src/components/Modal/CollapsibleModalSection.tsx index a83114ba947..cad4424ed1a 100644 --- a/superset-frontend/src/components/Modal/CollapsibleModalSection.tsx +++ b/superset-frontend/src/components/Modal/CollapsibleModalSection.tsx @@ -18,7 +18,7 @@ */ import { ReactNode } from 'react'; import { Collapse, CollapseLabelInModal } from '@superset-ui/core/components'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; interface CollapsibleModalSectionProps { sectionKey: string; diff --git a/superset-frontend/src/components/Modal/ModalFormField.tsx b/superset-frontend/src/components/Modal/ModalFormField.tsx index 14e71e245e1..c825e465b58 100644 --- a/superset-frontend/src/components/Modal/ModalFormField.tsx +++ b/superset-frontend/src/components/Modal/ModalFormField.tsx @@ -17,7 +17,7 @@ * under the License. */ import { ReactNode } from 'react'; -import { css, styled } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; import { InfoTooltip } from '@superset-ui/core/components'; interface ModalFormFieldProps { diff --git a/superset-frontend/src/components/Modal/StandardModal.tsx b/superset-frontend/src/components/Modal/StandardModal.tsx index 97e4f8d638e..0ab85a4e187 100644 --- a/superset-frontend/src/components/Modal/StandardModal.tsx +++ b/superset-frontend/src/components/Modal/StandardModal.tsx @@ -17,8 +17,8 @@ * under the License. */ import { ReactNode } from 'react'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { Modal, Loading, Flex } from '@superset-ui/core/components'; import { ModalTitleWithIcon } from 'src/components/ModalTitleWithIcon'; diff --git a/superset-frontend/src/components/Modal/useModalValidation.tsx b/superset-frontend/src/components/Modal/useModalValidation.tsx index 4c3ab352cde..845bb3f220f 100644 --- a/superset-frontend/src/components/Modal/useModalValidation.tsx +++ b/superset-frontend/src/components/Modal/useModalValidation.tsx @@ -17,8 +17,8 @@ * under the License. */ import { useState, useCallback, useMemo, ReactNode } from 'react'; -import { t } from '@apache-superset/core'; -import { css } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css } from '@apache-superset/core/theme'; import { List } from '@superset-ui/core/components'; export interface SectionValidationObject { diff --git a/superset-frontend/src/components/ModalTitleWithIcon/index.tsx b/superset-frontend/src/components/ModalTitleWithIcon/index.tsx index 037e24159a5..f1b4575fdc7 100644 --- a/superset-frontend/src/components/ModalTitleWithIcon/index.tsx +++ b/superset-frontend/src/components/ModalTitleWithIcon/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { isValidElement, cloneElement } from 'react'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { Typography, Icons, TitleProps } from '@superset-ui/core/components'; import type { IconType } from '@superset-ui/core/components/Icons/types'; diff --git a/superset-frontend/src/components/PanelToolbar/index.tsx b/superset-frontend/src/components/PanelToolbar/index.tsx index 16aa8930176..8f1dcd93705 100644 --- a/superset-frontend/src/components/PanelToolbar/index.tsx +++ b/superset-frontend/src/components/PanelToolbar/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useMemo } from 'react'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { Button, Divider, Dropdown } from '@superset-ui/core/components'; import { Menu, MenuItemType } from '@superset-ui/core/components/Menu'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/components/ResizableSidebar/index.tsx b/superset-frontend/src/components/ResizableSidebar/index.tsx index 500283a436e..507d8e7c440 100644 --- a/superset-frontend/src/components/ResizableSidebar/index.tsx +++ b/superset-frontend/src/components/ResizableSidebar/index.tsx @@ -18,7 +18,7 @@ */ import { FC, ReactNode } from 'react'; import { Resizable } from 're-resizable'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import useStoredSidebarWidth from './useStoredSidebarWidth'; const ResizableWrapper = styled.div` diff --git a/superset-frontend/src/components/RowCountLabel/index.tsx b/superset-frontend/src/components/RowCountLabel/index.tsx index fc367e307ea..b36ac0e7ccb 100644 --- a/superset-frontend/src/components/RowCountLabel/index.tsx +++ b/superset-frontend/src/components/RowCountLabel/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t, tn } from '@apache-superset/core'; +import { t, tn } from '@apache-superset/core/translation'; import { getNumberFormatter } from '@superset-ui/core'; import { Label, Tooltip } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/components/SQLEditorWithValidation/index.tsx b/superset-frontend/src/components/SQLEditorWithValidation/index.tsx index de483fd90c3..8f43d513b1c 100644 --- a/superset-frontend/src/components/SQLEditorWithValidation/index.tsx +++ b/superset-frontend/src/components/SQLEditorWithValidation/index.tsx @@ -17,10 +17,10 @@ * under the License. */ import { useCallback, useState, useEffect, forwardRef } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import type { editors } from '@apache-superset/core'; import { SupersetClient } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Button, Icons, Tooltip, Flex } from '@superset-ui/core/components'; import { EditorHost } from 'src/core/editors'; import { diff --git a/superset-frontend/src/components/StreamingExportModal/StreamingExportModal.tsx b/superset-frontend/src/components/StreamingExportModal/StreamingExportModal.tsx index 995bcc53f64..301cb82d7bd 100644 --- a/superset-frontend/src/components/StreamingExportModal/StreamingExportModal.tsx +++ b/superset-frontend/src/components/StreamingExportModal/StreamingExportModal.tsx @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; -import { styled, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, useTheme } from '@apache-superset/core/theme'; import { Modal, Button, diff --git a/superset-frontend/src/components/TableSelector/index.tsx b/superset-frontend/src/components/TableSelector/index.tsx index 1527b40f7bb..69b17bffcf8 100644 --- a/superset-frontend/src/components/TableSelector/index.tsx +++ b/superset-frontend/src/components/TableSelector/index.tsx @@ -25,9 +25,9 @@ import { } from 'react'; import type { SelectValue } from '@superset-ui/core/components'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SupersetError } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { CertifiedBadge, Select } from '@superset-ui/core/components'; import { DatabaseSelector, ErrorMessageWithStackTrace } from 'src/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/components/Tag/index.tsx b/superset-frontend/src/components/Tag/index.tsx index 385338e5fc1..d09334e175b 100644 --- a/superset-frontend/src/components/Tag/index.tsx +++ b/superset-frontend/src/components/Tag/index.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Link } from 'react-router-dom'; import type { TagType } from 'src/types/TagType'; import { Tag as AntdTag } from '@superset-ui/core/components/Tag'; diff --git a/superset-frontend/src/components/Tag/utils.tsx b/superset-frontend/src/components/Tag/utils.tsx index bcb913f54a1..75cc840fa45 100644 --- a/superset-frontend/src/components/Tag/utils.tsx +++ b/superset-frontend/src/components/Tag/utils.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ClientErrorObject, getClientErrorObject, diff --git a/superset-frontend/src/components/TagsList/index.tsx b/superset-frontend/src/components/TagsList/index.tsx index 4cc3c9e39ab..654b828bfb2 100644 --- a/superset-frontend/src/components/TagsList/index.tsx +++ b/superset-frontend/src/components/TagsList/index.tsx @@ -18,7 +18,7 @@ */ import { useMemo, useState } from 'react'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import type { TagType } from 'src/types/TagType'; import { Tag } from 'src/components/Tag'; diff --git a/superset-frontend/src/core/commands/index.ts b/superset-frontend/src/core/commands/index.ts index 1eac191f112..05e64851137 100644 --- a/superset-frontend/src/core/commands/index.ts +++ b/superset-frontend/src/core/commands/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { logging } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; import { commands as commandsApi } from '@apache-superset/core'; import { Disposable } from '../models'; diff --git a/superset-frontend/src/core/editors/AceEditorProvider.test.tsx b/superset-frontend/src/core/editors/AceEditorProvider.test.tsx index 0d7715c3140..de531fc0293 100644 --- a/superset-frontend/src/core/editors/AceEditorProvider.test.tsx +++ b/superset-frontend/src/core/editors/AceEditorProvider.test.tsx @@ -25,7 +25,7 @@ import { } from '@testing-library/react'; import '@testing-library/jest-dom'; import userEvent from '@testing-library/user-event'; -import { ThemeProvider, supersetTheme } from '@apache-superset/core/ui'; +import { ThemeProvider, supersetTheme } from '@apache-superset/core/theme'; import type { editors } from '@apache-superset/core'; import AceEditorProvider from './AceEditorProvider'; diff --git a/superset-frontend/src/core/editors/AceEditorProvider.tsx b/superset-frontend/src/core/editors/AceEditorProvider.tsx index 9236403a3b3..abdf76d14f1 100644 --- a/superset-frontend/src/core/editors/AceEditorProvider.tsx +++ b/superset-frontend/src/core/editors/AceEditorProvider.tsx @@ -182,6 +182,10 @@ const createAceEditorHandle = ( completionProviders.current.delete(provider.id); }); }, + + resize: () => { + aceEditorRef.current?.editor?.resize(); + }, }); /** diff --git a/superset-frontend/src/core/editors/EditorHost.tsx b/superset-frontend/src/core/editors/EditorHost.tsx index 210d2241b19..80c3ba1a138 100644 --- a/superset-frontend/src/core/editors/EditorHost.tsx +++ b/superset-frontend/src/core/editors/EditorHost.tsx @@ -28,7 +28,7 @@ import { useState, useEffect, forwardRef } from 'react'; import type { editors } from '@apache-superset/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import EditorProviders from './EditorProviders'; import AceEditorProvider from './AceEditorProvider'; @@ -61,7 +61,7 @@ const useEditorProvider = (language: EditorLanguage) => { // Subscribe to provider changes const registerDisposable = manager.onDidRegister(event => { - if (event.provider.editor.languages.includes(language)) { + if (event.editor.languages.includes(language)) { updateProvider(); } }); diff --git a/superset-frontend/src/core/editors/EditorProviders.test.ts b/superset-frontend/src/core/editors/EditorProviders.test.ts index 628b4bb5aa9..3b35e030d5e 100644 --- a/superset-frontend/src/core/editors/EditorProviders.test.ts +++ b/superset-frontend/src/core/editors/EditorProviders.test.ts @@ -204,10 +204,7 @@ test('fires onDidRegister event when provider is registered', () => { expect(listener).toHaveBeenCalledTimes(1); expect(listener).toHaveBeenCalledWith({ - provider: { - editor, - component, - }, + editor, }); }); diff --git a/superset-frontend/src/core/editors/EditorProviders.ts b/superset-frontend/src/core/editors/EditorProviders.ts index d5bbdf973a4..81e35268e41 100644 --- a/superset-frontend/src/core/editors/EditorProviders.ts +++ b/superset-frontend/src/core/editors/EditorProviders.ts @@ -24,8 +24,8 @@ type EditorLanguage = editors.EditorLanguage; type EditorProvider = editors.EditorProvider; type Editor = editors.Editor; type EditorComponent = editors.EditorComponent; -type EditorProviderRegisteredEvent = editors.EditorProviderRegisteredEvent; -type EditorProviderUnregisteredEvent = editors.EditorProviderUnregisteredEvent; +type EditorRegisteredEvent = editors.EditorRegisteredEvent; +type EditorUnregisteredEvent = editors.EditorUnregisteredEvent; /** * Listener function type for events. @@ -86,13 +86,12 @@ class EditorProviders { /** * Event emitter for provider registration events. */ - private registerEmitter = new EventEmitter(); + private registerEmitter = new EventEmitter(); /** * Event emitter for provider unregistration events. */ - private unregisterEmitter = - new EventEmitter(); + private unregisterEmitter = new EventEmitter(); // eslint-disable-next-line no-useless-constructor private constructor() { @@ -145,7 +144,7 @@ class EditorProviders { }); // Fire registration event - this.registerEmitter.fire({ provider }); + this.registerEmitter.fire({ editor }); // Return disposable for cleanup return new Disposable(() => { @@ -214,9 +213,7 @@ class EditorProviders { * @param listener The listener function. * @returns A Disposable to unsubscribe. */ - public onDidRegister( - listener: Listener, - ): Disposable { + public onDidRegister(listener: Listener): Disposable { return this.registerEmitter.subscribe(listener); } @@ -226,7 +223,7 @@ class EditorProviders { * @returns A Disposable to unsubscribe. */ public onDidUnregister( - listener: Listener, + listener: Listener, ): Disposable { return this.unregisterEmitter.subscribe(listener); } diff --git a/superset-frontend/src/core/editors/index.ts b/superset-frontend/src/core/editors/index.ts index f7fe4caa03c..641fad56e8f 100644 --- a/superset-frontend/src/core/editors/index.ts +++ b/superset-frontend/src/core/editors/index.ts @@ -32,9 +32,8 @@ type EditorLanguage = editorsApi.EditorLanguage; type Editor = editorsApi.Editor; type EditorProvider = editorsApi.EditorProvider; type EditorComponent = editorsApi.EditorComponent; -type EditorProviderRegisteredEvent = editorsApi.EditorProviderRegisteredEvent; -type EditorProviderUnregisteredEvent = - editorsApi.EditorProviderUnregisteredEvent; +type EditorRegisteredEvent = editorsApi.EditorRegisteredEvent; +type EditorUnregisteredEvent = editorsApi.EditorUnregisteredEvent; /** * Register an editor provider as a module-level side effect. @@ -60,7 +59,7 @@ export const registerEditor = ( * @param language The language to get an editor for * @returns The editor provider or undefined if no extension provides one */ -export const getEditorProvider = ( +export const getEditor = ( language: EditorLanguage, ): EditorProvider | undefined => { const manager = EditorProviders.getInstance(); @@ -73,7 +72,7 @@ export const getEditorProvider = ( * @param language The language to check * @returns True if an extension provides an editor for this language */ -export const hasEditorProvider = (language: EditorLanguage): boolean => { +export const hasEditor = (language: EditorLanguage): boolean => { const manager = EditorProviders.getInstance(); return manager.hasProvider(language); }; @@ -83,28 +82,28 @@ export const hasEditorProvider = (language: EditorLanguage): boolean => { * * @returns Array of all registered editor providers */ -export const getAllEditorProviders = (): EditorProvider[] => { +export const getAllEditors = (): EditorProvider[] => { const manager = EditorProviders.getInstance(); return manager.getAllProviders(); }; /** - * Event fired when an editor provider is registered. + * Event fired when an editor is registered. * Subscribe to this event to react when extensions register new editors. */ -export const onDidRegisterEditorProvider = ( - listener: (e: EditorProviderRegisteredEvent) => void, +export const onDidRegisterEditor = ( + listener: (e: EditorRegisteredEvent) => void, ): Disposable => { const manager = EditorProviders.getInstance(); return manager.onDidRegister(listener); }; /** - * Event fired when an editor provider is unregistered. + * Event fired when an editor is unregistered. * Subscribe to this event to react when extensions unregister editors. */ -export const onDidUnregisterEditorProvider = ( - listener: (e: EditorProviderUnregisteredEvent) => void, +export const onDidUnregisterEditor = ( + listener: (e: EditorUnregisteredEvent) => void, ): Disposable => { const manager = EditorProviders.getInstance(); return manager.onDidUnregister(listener); @@ -115,11 +114,11 @@ export const onDidUnregisterEditorProvider = ( */ export const editors: typeof editorsApi = { registerEditor, - getEditorProvider, - hasEditorProvider, - getAllEditorProviders, - onDidRegisterEditorProvider, - onDidUnregisterEditorProvider, + getEditor, + hasEditor, + getAllEditors, + onDidRegisterEditor, + onDidUnregisterEditor, }; export { EditorProviders }; diff --git a/superset-frontend/src/core/index.ts b/superset-frontend/src/core/index.ts index 3dba313cf97..6a106ebe87a 100644 --- a/superset-frontend/src/core/index.ts +++ b/superset-frontend/src/core/index.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { core as coreType } from '@apache-superset/core'; +import { common as coreType } from '@apache-superset/core'; import { Disposable } from './models'; const { GenericDataType } = coreType; diff --git a/superset-frontend/src/core/models.ts b/superset-frontend/src/core/models.ts index 0acd614c6b4..7dfa53b621f 100644 --- a/superset-frontend/src/core/models.ts +++ b/superset-frontend/src/core/models.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { core as coreType } from '@apache-superset/core'; +import { common as coreType } from '@apache-superset/core'; export class Table implements coreType.Table { name: string; diff --git a/superset-frontend/src/core/sqlLab/models.ts b/superset-frontend/src/core/sqlLab/models.ts index 747c914acf6..ce593c582f1 100644 --- a/superset-frontend/src/core/sqlLab/models.ts +++ b/superset-frontend/src/core/sqlLab/models.ts @@ -16,7 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -import { sqlLab as sqlLabType, core as coreType } from '@apache-superset/core'; +import { + sqlLab as sqlLabType, + common as coreType, +} from '@apache-superset/core'; const { CTASMethod } = sqlLabType; diff --git a/superset-frontend/src/core/utils.ts b/superset-frontend/src/core/utils.ts index 8b192e96cfd..1e4dded93c3 100644 --- a/superset-frontend/src/core/utils.ts +++ b/superset-frontend/src/core/utils.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import type { core } from '@apache-superset/core'; +import type { common as core } from '@apache-superset/core'; import { AnyAction } from 'redux'; import { listenerMiddleware, RootState, store } from 'src/views/store'; import { AnyListenerPredicate } from '@reduxjs/toolkit'; diff --git a/superset-frontend/src/dashboard/actions/chartCustomizationActions.ts b/superset-frontend/src/dashboard/actions/chartCustomizationActions.ts index 672cd104206..348f65c9b86 100644 --- a/superset-frontend/src/dashboard/actions/chartCustomizationActions.ts +++ b/superset-frontend/src/dashboard/actions/chartCustomizationActions.ts @@ -18,7 +18,7 @@ */ import { AnyAction } from 'redux'; import { ThunkAction, ThunkDispatch } from 'redux-thunk'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { makeApi, getClientErrorObject, diff --git a/superset-frontend/src/dashboard/actions/dashboardInfo.ts b/superset-frontend/src/dashboard/actions/dashboardInfo.ts index e65b7143fb7..fb10123d307 100644 --- a/superset-frontend/src/dashboard/actions/dashboardInfo.ts +++ b/superset-frontend/src/dashboard/actions/dashboardInfo.ts @@ -17,7 +17,7 @@ * under the License. */ import { Dispatch } from 'redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { makeApi, getClientErrorObject } from '@superset-ui/core'; import { addDangerToast } from 'src/components/MessageToasts/actions'; import { diff --git a/superset-frontend/src/dashboard/actions/dashboardLayout.ts b/superset-frontend/src/dashboard/actions/dashboardLayout.ts index 176b89c3a8d..38030cdace2 100644 --- a/superset-frontend/src/dashboard/actions/dashboardLayout.ts +++ b/superset-frontend/src/dashboard/actions/dashboardLayout.ts @@ -17,7 +17,7 @@ * under the License. */ import { ActionCreators as UndoActionCreators } from 'redux-undo'; -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import type { AnyAction } from 'redux'; import type { ThunkDispatch } from 'redux-thunk'; import { addWarningToast } from 'src/components/MessageToasts/actions'; diff --git a/superset-frontend/src/dashboard/actions/dashboardState.ts b/superset-frontend/src/dashboard/actions/dashboardState.ts index 61907bb2e6d..af5f7707dec 100644 --- a/superset-frontend/src/dashboard/actions/dashboardState.ts +++ b/superset-frontend/src/dashboard/actions/dashboardState.ts @@ -35,8 +35,8 @@ import { removeChart, refreshChart, } from 'src/components/Chart/chartAction'; -import { logging } from '@apache-superset/core'; -import { t } from '@apache-superset/core/ui'; +import { logging } from '@apache-superset/core/utils'; +import { t } from '@apache-superset/core/translation'; import { chart as initChart } from 'src/components/Chart/chartReducer'; import { applyDefaultFormData } from 'src/explore/store'; import { diff --git a/superset-frontend/src/dashboard/actions/sliceEntities.ts b/superset-frontend/src/dashboard/actions/sliceEntities.ts index 719bf20f195..f28a7a19604 100644 --- a/superset-frontend/src/dashboard/actions/sliceEntities.ts +++ b/superset-frontend/src/dashboard/actions/sliceEntities.ts @@ -17,7 +17,7 @@ * under the License. */ import rison from 'rison'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DatasourceType, SupersetClient, diff --git a/superset-frontend/src/dashboard/components/AddSliceCard/AddSliceCard.tsx b/superset-frontend/src/dashboard/components/AddSliceCard/AddSliceCard.tsx index e49b3b93a73..56229cc2bc3 100644 --- a/superset-frontend/src/dashboard/components/AddSliceCard/AddSliceCard.tsx +++ b/superset-frontend/src/dashboard/components/AddSliceCard/AddSliceCard.tsx @@ -29,9 +29,9 @@ import { FC, } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { isFeatureEnabled, FeatureFlag } from '@superset-ui/core'; -import { css } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; import { Tooltip, ImageLoader } from '@superset-ui/core/components'; import { GenericLink, usePluginContext } from 'src/components'; import { assetUrl } from 'src/utils/assetUrl'; diff --git a/superset-frontend/src/dashboard/components/AnchorLink/index.tsx b/superset-frontend/src/dashboard/components/AnchorLink/index.tsx index 9412085db9d..b613df4a213 100644 --- a/superset-frontend/src/dashboard/components/AnchorLink/index.tsx +++ b/superset-frontend/src/dashboard/components/AnchorLink/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useEffect } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import URLShortLinkButton, { URLShortLinkButtonProps, diff --git a/superset-frontend/src/dashboard/components/AutoRefreshIndicator/index.tsx b/superset-frontend/src/dashboard/components/AutoRefreshIndicator/index.tsx index 8e7ac3c8f9a..bc10f8b4abe 100644 --- a/superset-frontend/src/dashboard/components/AutoRefreshIndicator/index.tsx +++ b/superset-frontend/src/dashboard/components/AutoRefreshIndicator/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { FC, useMemo } from 'react'; -import { css, useTheme, t } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import { Label, Tooltip } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; import { useRealTimeDashboard } from '../../hooks/useRealTimeDashboard'; diff --git a/superset-frontend/src/dashboard/components/AutoRefreshStatus/StatusIndicatorDot.tsx b/superset-frontend/src/dashboard/components/AutoRefreshStatus/StatusIndicatorDot.tsx index c6c7c434231..6d1766c1052 100644 --- a/superset-frontend/src/dashboard/components/AutoRefreshStatus/StatusIndicatorDot.tsx +++ b/superset-frontend/src/dashboard/components/AutoRefreshStatus/StatusIndicatorDot.tsx @@ -17,7 +17,7 @@ * under the License. */ import { FC, useMemo, useRef, useEffect, useState } from 'react'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { AutoRefreshStatus } from '../../types/autoRefresh'; export interface StatusIndicatorDotProps { diff --git a/superset-frontend/src/dashboard/components/AutoRefreshStatus/StatusTooltipContent.tsx b/superset-frontend/src/dashboard/components/AutoRefreshStatus/StatusTooltipContent.tsx index d7e252b331d..061b8ac2aae 100644 --- a/superset-frontend/src/dashboard/components/AutoRefreshStatus/StatusTooltipContent.tsx +++ b/superset-frontend/src/dashboard/components/AutoRefreshStatus/StatusTooltipContent.tsx @@ -17,7 +17,7 @@ * under the License. */ import { FC } from 'react'; -import { t, tn } from '@apache-superset/core/ui'; +import { t, tn } from '@apache-superset/core/translation'; import { AutoRefreshStatus } from '../../types/autoRefresh'; export interface StatusTooltipContentProps { diff --git a/superset-frontend/src/dashboard/components/BuilderComponentPane/index.tsx b/superset-frontend/src/dashboard/components/BuilderComponentPane/index.tsx index bf48c8ed33d..e772a38b934 100644 --- a/superset-frontend/src/dashboard/components/BuilderComponentPane/index.tsx +++ b/superset-frontend/src/dashboard/components/BuilderComponentPane/index.tsx @@ -19,8 +19,8 @@ /* eslint-env browser */ import tinycolor from 'tinycolor2'; import Tabs from '@superset-ui/core/components/Tabs'; -import { t } from '@apache-superset/core'; -import { css, SupersetTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, SupersetTheme } from '@apache-superset/core/theme'; import SliceAdder from 'src/dashboard/containers/SliceAdder'; import dashboardComponents from 'src/visualizations/presets/dashboardComponents'; import NewColumn from '../gridComponents/new/NewColumn'; diff --git a/superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.tsx b/superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.tsx index e6f116f12e0..5000ecc8efe 100644 --- a/superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.tsx +++ b/superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.tsx @@ -17,7 +17,7 @@ * under the License. */ /* eslint-env browser */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { getCategoricalSchemeRegistry } from '@superset-ui/core'; import { useEffect, useState } from 'react'; import ColorSchemeControl from 'src/explore/components/controls/ColorSchemeControl'; diff --git a/superset-frontend/src/dashboard/components/ColorSchemeSelect.tsx b/superset-frontend/src/dashboard/components/ColorSchemeSelect.tsx index a6fb1b25d0f..58906e4fd7c 100644 --- a/superset-frontend/src/dashboard/components/ColorSchemeSelect.tsx +++ b/superset-frontend/src/dashboard/components/ColorSchemeSelect.tsx @@ -17,14 +17,14 @@ * under the License. */ import { ReactNode, useMemo } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ColorScheme, ColorSchemeGroup, getCategoricalSchemeRegistry, CategoricalScheme, } from '@superset-ui/core'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { sortBy } from 'lodash'; import { Select, Tooltip } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/dashboard/components/CustomizationsBadge/index.tsx b/superset-frontend/src/dashboard/components/CustomizationsBadge/index.tsx index b67a99e275b..dbe3c91c8c7 100644 --- a/superset-frontend/src/dashboard/components/CustomizationsBadge/index.tsx +++ b/superset-frontend/src/dashboard/components/CustomizationsBadge/index.tsx @@ -19,9 +19,9 @@ import { memo, useMemo, useState, useRef } from 'react'; import { useSelector } from 'react-redux'; import { createSelector } from '@reduxjs/toolkit'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartCustomization, DataMaskStateWithId } from '@superset-ui/core'; -import { styled, useTheme } from '@apache-superset/core/ui'; +import { styled, useTheme } from '@apache-superset/core/theme'; import { Icons, Badge, Tooltip, Tag } from '@superset-ui/core/components'; import { getFilterValueForDisplay } from '../nativeFilters/utils'; import { extractLabel } from '../nativeFilters/selectors'; diff --git a/superset-frontend/src/dashboard/components/Dashboard.tsx b/superset-frontend/src/dashboard/components/Dashboard.tsx index f760156d95a..d349a89464c 100644 --- a/superset-frontend/src/dashboard/components/Dashboard.tsx +++ b/superset-frontend/src/dashboard/components/Dashboard.tsx @@ -17,7 +17,7 @@ * under the License. */ import { PureComponent, ReactNode } from 'react'; -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { JsonObject } from '@superset-ui/core'; import { Loading } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx index 36dbd29e12f..c2ea76ca2f8 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx @@ -19,9 +19,9 @@ /* eslint-env browser */ import cx from 'classnames'; import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { addAlpha, JsonObject, useElementOnScreen } from '@superset-ui/core'; -import { css, styled, useTheme } from '@apache-superset/core/ui'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import { useDispatch, useSelector } from 'react-redux'; import { EmptyState, Loading } from '@superset-ui/core/components'; import { ErrorBoundary, BasicErrorAlert } from 'src/components'; @@ -503,9 +503,9 @@ const DashboardBuilder = () => { currentTopLevelTabs.current = topLevelTabs; }, [topLevelTabs]); - const renderDraggableContent = useCallback( - ({ dropIndicatorProps }: { dropIndicatorProps: JsonObject }) => ( -
+ const headerContent = useMemo( + () => ( + <> {!hideDashboardHeader && } {showFilterBar && filterBarOrientation === FilterBarOrientation.Horizontal && ( @@ -514,6 +514,14 @@ const DashboardBuilder = () => { hidden={isReport} /> )} + + ), + [hideDashboardHeader, showFilterBar, filterBarOrientation, isReport], + ); + + const renderDraggableContent = useCallback( + ({ dropIndicatorProps }: { dropIndicatorProps: JsonObject }) => ( +
{dropIndicatorProps &&
} {!isReport && topLevelTabs && !uiConfig.hideNav && ( {
), [ - nativeFiltersEnabled, - filterBarOrientation, editMode, handleChangeTab, handleDeleteTopLevelTabs, - hideDashboardHeader, isReport, topLevelTabs, uiConfig.hideNav, @@ -622,6 +627,7 @@ const DashboardBuilder = () => { ref={headerRef} filterBarWidth={headerFilterBarWidth} > + {headerContent} css` diff --git a/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx b/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx index 41b2e2fd813..a1df06aa1d7 100644 --- a/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx +++ b/superset-frontend/src/dashboard/components/FiltersBadge/index.tsx @@ -29,14 +29,14 @@ import { import { useDispatch, useSelector } from 'react-redux'; import { uniqWith } from 'lodash'; import cx from 'classnames'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DataMaskStateWithId, Filters, JsonObject, usePrevious, } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { setDirectPathToChild } from 'src/dashboard/actions/dashboardState'; import { useChartLayoutItems } from 'src/dashboard/util/useChartLayoutItems'; diff --git a/superset-frontend/src/dashboard/components/Header/index.tsx b/superset-frontend/src/dashboard/components/Header/index.tsx index 547bd6f5fc2..417c332fd2a 100644 --- a/superset-frontend/src/dashboard/components/Header/index.tsx +++ b/superset-frontend/src/dashboard/components/Header/index.tsx @@ -23,7 +23,8 @@ import { FeatureFlag, getExtensionsRegistry, } from '@superset-ui/core'; -import { styled, css, SupersetTheme, t } from '@apache-superset/core/ui'; +import { styled, css, SupersetTheme } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import { Global } from '@emotion/react'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { bindActionCreators } from 'redux'; diff --git a/superset-frontend/src/dashboard/components/Header/useDashboardMetadataBar.tsx b/superset-frontend/src/dashboard/components/Header/useDashboardMetadataBar.tsx index d5819a14faa..f9556464d7b 100644 --- a/superset-frontend/src/dashboard/components/Header/useDashboardMetadataBar.tsx +++ b/superset-frontend/src/dashboard/components/Header/useDashboardMetadataBar.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useMemo } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DashboardInfo } from 'src/dashboard/types'; import MetadataBar, { MetadataType, diff --git a/superset-frontend/src/dashboard/components/Header/useHeaderActionsDropdownMenu.tsx b/superset-frontend/src/dashboard/components/Header/useHeaderActionsDropdownMenu.tsx index 5eeff33dd65..7c648458024 100644 --- a/superset-frontend/src/dashboard/components/Header/useHeaderActionsDropdownMenu.tsx +++ b/superset-frontend/src/dashboard/components/Header/useHeaderActionsDropdownMenu.tsx @@ -21,7 +21,7 @@ import { useState, useEffect, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; import { useHistory } from 'react-router-dom'; import { Menu, MenuItem } from '@superset-ui/core/components/Menu'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { isEmpty } from 'lodash'; import { URL_PARAMS } from 'src/constants'; import { useShareMenuItems } from 'src/dashboard/components/menu/ShareMenuItems'; diff --git a/superset-frontend/src/dashboard/components/IconButton.tsx b/superset-frontend/src/dashboard/components/IconButton.tsx index df1298097ca..a70d7c3d217 100644 --- a/superset-frontend/src/dashboard/components/IconButton.tsx +++ b/superset-frontend/src/dashboard/components/IconButton.tsx @@ -17,7 +17,7 @@ * under the License. */ import { MouseEventHandler } from 'react'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; interface IconButtonProps { icon: JSX.Element; diff --git a/superset-frontend/src/dashboard/components/MissingChart.tsx b/superset-frontend/src/dashboard/components/MissingChart.tsx index 6ff520af789..4f3a56042b4 100644 --- a/superset-frontend/src/dashboard/components/MissingChart.tsx +++ b/superset-frontend/src/dashboard/components/MissingChart.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; interface MissingChartProps { height: number; diff --git a/superset-frontend/src/dashboard/components/OverwriteConfirm/OverwriteConfirmModal.tsx b/superset-frontend/src/dashboard/components/OverwriteConfirm/OverwriteConfirmModal.tsx index 39f27192ab9..af03f2c1190 100644 --- a/superset-frontend/src/dashboard/components/OverwriteConfirm/OverwriteConfirmModal.tsx +++ b/superset-frontend/src/dashboard/components/OverwriteConfirm/OverwriteConfirmModal.tsx @@ -27,8 +27,8 @@ import { saveDashboardRequest, setOverrideConfirm, } from 'src/dashboard/actions/dashboardState'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { SAVE_TYPE_OVERWRITE_CONFIRMED } from 'src/dashboard/util/constants'; const STICKY_HEADER_TOP = 16; diff --git a/superset-frontend/src/dashboard/components/PropertiesModal/PropertiesModal.test.tsx b/superset-frontend/src/dashboard/components/PropertiesModal/PropertiesModal.test.tsx index f84d580fd57..a01a138be03 100644 --- a/superset-frontend/src/dashboard/components/PropertiesModal/PropertiesModal.test.tsx +++ b/superset-frontend/src/dashboard/components/PropertiesModal/PropertiesModal.test.tsx @@ -26,7 +26,7 @@ import fetchMock from 'fetch-mock'; import * as ColorSchemeSelect from 'src/dashboard/components/ColorSchemeSelect'; import * as SupersetCore from '@superset-ui/core'; import { isFeatureEnabled, FeatureFlag } from '@superset-ui/core'; -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import PropertiesModal from '.'; // Increase timeout for CI environment diff --git a/superset-frontend/src/dashboard/components/PropertiesModal/index.tsx b/superset-frontend/src/dashboard/components/PropertiesModal/index.tsx index 786d9fc7b1e..8fbcbb690b8 100644 --- a/superset-frontend/src/dashboard/components/PropertiesModal/index.tsx +++ b/superset-frontend/src/dashboard/components/PropertiesModal/index.tsx @@ -27,7 +27,7 @@ import { import { useJsonValidation } from '@superset-ui/core/components/AsyncAceEditor'; import { type TagType } from 'src/components'; import rison from 'rison'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, isFeatureEnabled, diff --git a/superset-frontend/src/dashboard/components/PropertiesModal/sections/AccessSection.tsx b/superset-frontend/src/dashboard/components/PropertiesModal/sections/AccessSection.tsx index 1ef452d8bf7..d2bd52f760e 100644 --- a/superset-frontend/src/dashboard/components/PropertiesModal/sections/AccessSection.tsx +++ b/superset-frontend/src/dashboard/components/PropertiesModal/sections/AccessSection.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useMemo } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { isFeatureEnabled, FeatureFlag } from '@superset-ui/core'; import { AsyncSelect } from '@superset-ui/core/components'; import { type TagType } from 'src/components'; diff --git a/superset-frontend/src/dashboard/components/PropertiesModal/sections/AdvancedSection.tsx b/superset-frontend/src/dashboard/components/PropertiesModal/sections/AdvancedSection.tsx index 9717a2de9ba..e9fd5d869d7 100644 --- a/superset-frontend/src/dashboard/components/PropertiesModal/sections/AdvancedSection.tsx +++ b/superset-frontend/src/dashboard/components/PropertiesModal/sections/AdvancedSection.tsx @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import type { editors } from '@apache-superset/core'; import { EditorHost } from 'src/core/editors'; import { ModalFormField } from 'src/components/Modal'; diff --git a/superset-frontend/src/dashboard/components/PropertiesModal/sections/BasicInfoSection.tsx b/superset-frontend/src/dashboard/components/PropertiesModal/sections/BasicInfoSection.tsx index 1da89e8534a..1aafc74fb8d 100644 --- a/superset-frontend/src/dashboard/components/PropertiesModal/sections/BasicInfoSection.tsx +++ b/superset-frontend/src/dashboard/components/PropertiesModal/sections/BasicInfoSection.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { FormItem, Input, FormInstance } from '@superset-ui/core/components'; import { ModalFormField } from 'src/components/Modal'; import { ValidationObject } from 'src/components/Modal/useModalValidation'; diff --git a/superset-frontend/src/dashboard/components/PropertiesModal/sections/CertificationSection.tsx b/superset-frontend/src/dashboard/components/PropertiesModal/sections/CertificationSection.tsx index c5ceaeacad4..c5dbe124296 100644 --- a/superset-frontend/src/dashboard/components/PropertiesModal/sections/CertificationSection.tsx +++ b/superset-frontend/src/dashboard/components/PropertiesModal/sections/CertificationSection.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { FormItem, Input } from '@superset-ui/core/components'; import { ModalFormField } from 'src/components/Modal'; diff --git a/superset-frontend/src/dashboard/components/PropertiesModal/sections/RefreshSection.tsx b/superset-frontend/src/dashboard/components/PropertiesModal/sections/RefreshSection.tsx index 6f9bfa746db..87eac044c69 100644 --- a/superset-frontend/src/dashboard/components/PropertiesModal/sections/RefreshSection.tsx +++ b/superset-frontend/src/dashboard/components/PropertiesModal/sections/RefreshSection.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ModalFormField } from 'src/components/Modal'; import { RefreshFrequencySelect } from '../../RefreshFrequency/RefreshFrequencySelect'; diff --git a/superset-frontend/src/dashboard/components/PropertiesModal/sections/StylingSection.tsx b/superset-frontend/src/dashboard/components/PropertiesModal/sections/StylingSection.tsx index 1aa5e4b5412..5194b910282 100644 --- a/superset-frontend/src/dashboard/components/PropertiesModal/sections/StylingSection.tsx +++ b/superset-frontend/src/dashboard/components/PropertiesModal/sections/StylingSection.tsx @@ -17,13 +17,14 @@ * under the License. */ import { useCallback, useEffect, useState } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SupersetClient, isFeatureEnabled, FeatureFlag, } from '@superset-ui/core'; -import { styled, Alert } from '@apache-superset/core/ui'; +import { Alert } from '@apache-superset/core/components'; +import { styled } from '@apache-superset/core/theme'; import { Select, Switch } from '@superset-ui/core/components'; import { EditorHost } from 'src/core/editors'; import rison from 'rison'; diff --git a/superset-frontend/src/dashboard/components/PublishedStatus/index.tsx b/superset-frontend/src/dashboard/components/PublishedStatus/index.tsx index b05cd30bf3b..8696fbbbb67 100644 --- a/superset-frontend/src/dashboard/components/PublishedStatus/index.tsx +++ b/superset-frontend/src/dashboard/components/PublishedStatus/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { Component } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Tooltip, PublishedLabel } from '@superset-ui/core/components'; import { HeaderProps, HeaderDropdownProps } from '../Header/types'; diff --git a/superset-frontend/src/dashboard/components/RefreshButton/index.tsx b/superset-frontend/src/dashboard/components/RefreshButton/index.tsx index a16d11d8fbd..1240753ce69 100644 --- a/superset-frontend/src/dashboard/components/RefreshButton/index.tsx +++ b/superset-frontend/src/dashboard/components/RefreshButton/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { FC, useState, useCallback } from 'react'; -import { css, useTheme, t } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import { Tooltip } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/dashboard/components/RefreshFrequency/RefreshFrequencySelect.tsx b/superset-frontend/src/dashboard/components/RefreshFrequency/RefreshFrequencySelect.tsx index c1d918fc5b2..6f5736d9078 100644 --- a/superset-frontend/src/dashboard/components/RefreshFrequency/RefreshFrequencySelect.tsx +++ b/superset-frontend/src/dashboard/components/RefreshFrequency/RefreshFrequencySelect.tsx @@ -17,8 +17,8 @@ * under the License. */ import { ChangeEvent, useEffect, useState } from 'react'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { Input } from '@superset-ui/core/components'; import { Radio, RadioChangeEvent } from '@superset-ui/core/components/Radio'; diff --git a/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx b/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx index a0ae4aa959c..a4ec52d7313 100644 --- a/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx +++ b/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx @@ -18,8 +18,8 @@ */ import { useMemo, useState } from 'react'; import { useSelector } from 'react-redux'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { Form, Checkbox } from '@superset-ui/core/components'; import { StandardModal } from 'src/components/Modal'; import { RootState } from 'src/dashboard/types'; diff --git a/superset-frontend/src/dashboard/components/SaveModal.tsx b/superset-frontend/src/dashboard/components/SaveModal.tsx index 4daf944df69..0e451d3f3af 100644 --- a/superset-frontend/src/dashboard/components/SaveModal.tsx +++ b/superset-frontend/src/dashboard/components/SaveModal.tsx @@ -27,8 +27,8 @@ import { Divider, Flex, } from '@superset-ui/core/components'; -import { t } from '@apache-superset/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { useTheme } from '@apache-superset/core/theme'; import { ModalTrigger, diff --git a/superset-frontend/src/dashboard/components/SliceAdder.tsx b/superset-frontend/src/dashboard/components/SliceAdder.tsx index afe5d2056fb..8ad34e3c065 100644 --- a/superset-frontend/src/dashboard/components/SliceAdder.tsx +++ b/superset-frontend/src/dashboard/components/SliceAdder.tsx @@ -22,8 +22,8 @@ import AutoSizer from 'react-virtualized-auto-sizer'; import { FixedSizeList as List } from 'react-window'; // @ts-expect-error import { createFilter } from 'react-search-input'; -import { t } from '@apache-superset/core'; -import { styled, css } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, css } from '@apache-superset/core/theme'; import { Button, Checkbox, diff --git a/superset-frontend/src/dashboard/components/SliceHeader/index.tsx b/superset-frontend/src/dashboard/components/SliceHeader/index.tsx index 77da178b246..be29e3c8e89 100644 --- a/superset-frontend/src/dashboard/components/SliceHeader/index.tsx +++ b/superset-frontend/src/dashboard/components/SliceHeader/index.tsx @@ -24,9 +24,14 @@ import { useRef, useState, } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { getExtensionsRegistry, QueryData } from '@superset-ui/core'; -import { css, styled, SupersetTheme, useTheme } from '@apache-superset/core/ui'; +import { + css, + styled, + SupersetTheme, + useTheme, +} from '@apache-superset/core/theme'; import { useUiConfig } from 'src/components/UiConfigContext'; import { isEmbedded } from 'src/dashboard/util/isEmbedded'; import { Tooltip, EditableTitle, Icons } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/dashboard/components/SliceHeaderControls/ViewResultsModalTrigger.tsx b/superset-frontend/src/dashboard/components/SliceHeaderControls/ViewResultsModalTrigger.tsx index c7295ce8be4..c9c9845cc5a 100644 --- a/superset-frontend/src/dashboard/components/SliceHeaderControls/ViewResultsModalTrigger.tsx +++ b/superset-frontend/src/dashboard/components/SliceHeaderControls/ViewResultsModalTrigger.tsx @@ -18,8 +18,8 @@ */ import { ReactChild, RefObject, useCallback } from 'react'; import { useHistory } from 'react-router-dom'; -import { t } from '@apache-superset/core'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, useTheme } from '@apache-superset/core/theme'; import { Button, ModalTrigger } from '@superset-ui/core/components'; export const ViewResultsModalTrigger = ({ diff --git a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx index cec1ed1b5e3..9fcf2ab0096 100644 --- a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx +++ b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx @@ -27,7 +27,7 @@ import { import { RouteComponentProps, useHistory } from 'react-router-dom'; import { extendedDayjs } from '@superset-ui/core/utils/dates'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior, isFeatureEnabled, @@ -37,7 +37,7 @@ import { BinaryQueryObjectFilterClause, QueryFormData, } from '@superset-ui/core'; -import { css, useTheme, styled } from '@apache-superset/core/ui'; +import { css, useTheme, styled } from '@apache-superset/core/theme'; import { useSelector } from 'react-redux'; import { Menu, MenuItem } from '@superset-ui/core/components/Menu'; import { diff --git a/superset-frontend/src/dashboard/components/URLShortLinkButton/index.tsx b/superset-frontend/src/dashboard/components/URLShortLinkButton/index.tsx index 49e6de249f9..136c44425b9 100644 --- a/superset-frontend/src/dashboard/components/URLShortLinkButton/index.tsx +++ b/superset-frontend/src/dashboard/components/URLShortLinkButton/index.tsx @@ -17,9 +17,9 @@ * under the License. */ import { useState } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { getClientErrorObject } from '@superset-ui/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import { Button, Icons, diff --git a/superset-frontend/src/dashboard/components/dnd/DragDroppable.tsx b/superset-frontend/src/dashboard/components/dnd/DragDroppable.tsx index 7b1d60e59ff..cd603b6af6d 100644 --- a/superset-frontend/src/dashboard/components/dnd/DragDroppable.tsx +++ b/superset-frontend/src/dashboard/components/dnd/DragDroppable.tsx @@ -32,7 +32,7 @@ import { ConnectDropTarget, } from 'react-dnd'; import cx from 'classnames'; -import { css, styled } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; import { dragConfig, dropConfig } from './dragDroppableConfig'; import type { DragDroppableProps as BaseDragDroppableProps } from './dragDroppableConfig'; @@ -92,6 +92,15 @@ const DragDroppableStyles = styled.div` &.dragdroppable-row { width: 100%; } + /* workaround to avoid a bug in react-dnd where the drag + preview expands outside of the bounds of the drag source card, see: + https://github.com/react-dnd/react-dnd/issues/832 */ + &.dragdroppable-column { + /* for chrome */ + transform: translate3d(0, 0, 0); + /* for safari */ + backface-visibility: hidden; + } &.dragdroppable-column .resizable-container span div { z-index: 10; diff --git a/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx b/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx index caa947d902a..4d3023e72d5 100644 --- a/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx +++ b/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx @@ -17,7 +17,7 @@ * under the License. */ import { LegacyRef } from 'react'; -import { css, styled } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; interface DragHandleProps { diff --git a/superset-frontend/src/dashboard/components/filterscope/FilterScope.test.tsx b/superset-frontend/src/dashboard/components/filterscope/FilterScope.test.tsx index f182791f91d..c4dae3a1699 100644 --- a/superset-frontend/src/dashboard/components/filterscope/FilterScope.test.tsx +++ b/superset-frontend/src/dashboard/components/filterscope/FilterScope.test.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import { cleanup, render, diff --git a/superset-frontend/src/dashboard/components/filterscope/FilterScopeModal.tsx b/superset-frontend/src/dashboard/components/filterscope/FilterScopeModal.tsx index 428daf4ec33..5dd6b01ee54 100644 --- a/superset-frontend/src/dashboard/components/filterscope/FilterScopeModal.tsx +++ b/superset-frontend/src/dashboard/components/filterscope/FilterScopeModal.tsx @@ -17,7 +17,7 @@ * under the License. */ import { createRef, PureComponent } from 'react'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { ModalTrigger, ModalTriggerRef, diff --git a/superset-frontend/src/dashboard/components/filterscope/FilterScopeSelector.tsx b/superset-frontend/src/dashboard/components/filterscope/FilterScopeSelector.tsx index 0e4eca61ee9..7d10c1b691d 100644 --- a/superset-frontend/src/dashboard/components/filterscope/FilterScopeSelector.tsx +++ b/superset-frontend/src/dashboard/components/filterscope/FilterScopeSelector.tsx @@ -19,7 +19,8 @@ import { PureComponent, ChangeEvent, type ReactElement } from 'react'; import cx from 'classnames'; import { Button, Input } from '@superset-ui/core/components'; -import { css, styled, t } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import buildFilterScopeTreeEntry from 'src/dashboard/util/buildFilterScopeTreeEntry'; import getFilterScopeNodesTree from 'src/dashboard/util/getFilterScopeNodesTree'; diff --git a/superset-frontend/src/dashboard/components/filterscope/renderFilterScopeTreeNodes.tsx b/superset-frontend/src/dashboard/components/filterscope/renderFilterScopeTreeNodes.tsx index 3867a69aad9..8930868d21a 100644 --- a/superset-frontend/src/dashboard/components/filterscope/renderFilterScopeTreeNodes.tsx +++ b/superset-frontend/src/dashboard/components/filterscope/renderFilterScopeTreeNodes.tsx @@ -18,7 +18,7 @@ */ import { ReactNode } from 'react'; import cx from 'classnames'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { CHART_TYPE } from 'src/dashboard/util/componentTypes'; diff --git a/superset-frontend/src/dashboard/components/filterscope/treeIcons.tsx b/superset-frontend/src/dashboard/components/filterscope/treeIcons.tsx index 294faf968ba..c77a69e3b44 100644 --- a/superset-frontend/src/dashboard/components/filterscope/treeIcons.tsx +++ b/superset-frontend/src/dashboard/components/filterscope/treeIcons.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import 'react-checkbox-tree/lib/react-checkbox-tree.css'; import { diff --git a/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx b/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx index cbf930183be..3c6c136159c 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx @@ -19,7 +19,8 @@ import cx from 'classnames'; import { useCallback, useEffect, useRef, useMemo, useState, memo } from 'react'; import type { ChartCustomization, JsonObject } from '@superset-ui/core'; -import { styled, t } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import { debounce } from 'lodash'; import { bindActionCreators } from 'redux'; import { useDispatch, useSelector } from 'react-redux'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/ChartHolder/ChartHolder.tsx b/superset-frontend/src/dashboard/components/gridComponents/ChartHolder/ChartHolder.tsx index 6b7560d3613..597f8887796 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/ChartHolder/ChartHolder.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/ChartHolder/ChartHolder.tsx @@ -21,7 +21,7 @@ import { useState, useMemo, useCallback, useEffect, memo } from 'react'; import { ResizeCallback, ResizeStartCallback } from 're-resizable'; import cx from 'classnames'; import { useSelector } from 'react-redux'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { LayoutItem, RootState } from 'src/dashboard/types'; import AnchorLink from 'src/dashboard/components/AnchorLink'; import Chart from 'src/dashboard/components/gridComponents/Chart'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/Column/Column.tsx b/superset-frontend/src/dashboard/components/gridComponents/Column/Column.tsx index 6d8d5871abf..4f8baf16a69 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Column/Column.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Column/Column.tsx @@ -18,7 +18,8 @@ */ import { Fragment, useCallback, useState, useMemo, memo } from 'react'; import cx from 'classnames'; -import { t, css, styled, SupersetTheme } from '@apache-superset/core/ui'; +import { css, styled, SupersetTheme } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import { Icons } from '@superset-ui/core/components/Icons'; import type { LayoutItem } from 'src/dashboard/types'; import type { DropResult } from 'src/dashboard/components/dnd/dragDroppableConfig'; @@ -109,6 +110,8 @@ const ColumnStyles = styled.div<{ editMode: boolean }>` } &:first-child:not(.droptarget-edge) { position: absolute; + top: 0; + left: 0; z-index: ${EMPTY_CONTAINER_Z_INDEX}; width: 100%; height: 100%; diff --git a/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.tsx b/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.tsx index a241f3dd627..f6b26b48928 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.tsx @@ -18,7 +18,7 @@ */ import { PureComponent } from 'react'; -import { css, styled } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; import { Draggable } from '../../dnd/DragDroppable'; import HoverMenu from '../../menu/HoverMenu'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/DynamicComponent/DynamicComponent.tsx b/superset-frontend/src/dashboard/components/gridComponents/DynamicComponent/DynamicComponent.tsx index c2233dfda79..124b91dbf1f 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/DynamicComponent/DynamicComponent.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/DynamicComponent/DynamicComponent.tsx @@ -17,7 +17,7 @@ * under the License. */ import { FC, Suspense } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DashboardComponentMetadata, JsonObject } from '@superset-ui/core'; import backgroundStyleOptions from 'src/dashboard/util/backgroundStyleOptions'; import cx from 'classnames'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/Header/Header.tsx b/superset-frontend/src/dashboard/components/gridComponents/Header/Header.tsx index f61a2d1de14..dd9b2a6a6d6 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Header/Header.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Header/Header.tsx @@ -18,7 +18,7 @@ */ import { PureComponent } from 'react'; import cx from 'classnames'; -import { css, styled } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; import PopoverDropdown from '@superset-ui/core/components/PopoverDropdown'; import { EditableTitle } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.test.tsx b/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.test.tsx index 9bd02b1ae66..e01bcbe7f19 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.test.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.test.tsx @@ -25,7 +25,7 @@ import { userEvent, RenderResult, } from 'spec/helpers/testing-library'; -import { supersetTheme } from '@apache-superset/core/ui'; +import { supersetTheme } from '@apache-superset/core/theme'; import { mockStore } from 'spec/fixtures/mockStore'; import { dashboardLayout as mockLayout } from 'spec/fixtures/mockDashboardLayout'; import MarkdownConnected from './Markdown'; @@ -403,6 +403,27 @@ test('shouldFocusMarkdown returns false when clicking outside markdown container expect(screen.queryByRole('textbox')).not.toBeInTheDocument(); }); +test('should re-enter edit mode on a single click after clicking outside', async () => { + await setup({ editMode: true }); + + const markdownContainer = screen.getByTestId( + 'dashboard-component-chart-holder', + ); + + // Click to enter edit mode + userEvent.click(markdownContainer); + expect(await screen.findByRole('textbox')).toBeInTheDocument(); + + // Click outside to exit edit mode + userEvent.click(document.body); + await new Promise(resolve => setTimeout(resolve, 50)); + expect(screen.queryByRole('textbox')).not.toBeInTheDocument(); + + // Click back inside — editor should appear on a single click + userEvent.click(markdownContainer); + expect(await screen.findByRole('textbox')).toBeInTheDocument(); +}); + test('shouldFocusMarkdown keeps focus when clicking on menu items', async () => { await setup({ editMode: true }); @@ -417,9 +438,8 @@ test('shouldFocusMarkdown keeps focus when clicking on menu items', async () => const editButton = screen.getByText('Edit'); userEvent.click(editButton); - await new Promise(resolve => setTimeout(resolve, 50)); - expect(screen.queryByRole('textbox')).toBeInTheDocument(); + expect(await screen.findByRole('textbox')).toBeInTheDocument(); }); test('should exit edit mode when clicking outside in same row', async () => { diff --git a/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.tsx b/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.tsx index fd931625d69..b10e4e23224 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.tsx @@ -22,7 +22,8 @@ import cx from 'classnames'; import type { JsonObject } from '@superset-ui/core'; import type { ResizeStartCallback, ResizeCallback } from 're-resizable'; -import { t, css, styled } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import { SafeMarkdown } from '@superset-ui/core/components'; import { EditorHost } from 'src/core/editors'; import { Logger, LOG_ACTIONS_RENDER_CHART } from 'src/logger/LogUtils'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/Row/Row.tsx b/superset-frontend/src/dashboard/components/gridComponents/Row/Row.tsx index 5651712e29d..707370d4050 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Row/Row.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Row/Row.tsx @@ -22,15 +22,16 @@ import { useCallback, useRef, useEffect, + useLayoutEffect, useMemo, memo, RefObject, } from 'react'; import cx from 'classnames'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { FeatureFlag, isFeatureEnabled, JsonObject } from '@superset-ui/core'; -import { css, styled, SupersetTheme } from '@apache-superset/core/ui'; -import { Icons, Constants } from '@superset-ui/core/components'; +import { css, styled, SupersetTheme } from '@apache-superset/core/theme'; +import { Icons } from '@superset-ui/core/components'; import { Draggable, Droppable, @@ -47,7 +48,6 @@ import { BACKGROUND_TRANSPARENT } from 'src/dashboard/util/constants'; import { isEmbedded } from 'src/dashboard/util/isEmbedded'; import { EMPTY_CONTAINER_Z_INDEX } from 'src/dashboard/constants'; import { isCurrentUserBot } from 'src/utils/isBot'; -import { useDebouncedEffect } from '../../../../explore/exploreUtils'; export type RowProps = { id: string; @@ -215,20 +215,13 @@ const Row = memo((props: RowProps) => { }; }, []); - useDebouncedEffect( - () => { - const updatedHeight = containerRef.current?.clientHeight; - if ( - editMode && - containerRef.current && - updatedHeight !== containerHeight - ) { - setContainerHeight(updatedHeight ?? null); - } - }, - Constants.FAST_DEBOUNCE, - [editMode, containerHeight], - ); + useLayoutEffect(() => { + if (!editMode) return; + const updatedHeight = containerRef.current?.clientHeight; + if (updatedHeight !== undefined && updatedHeight !== containerHeight) { + setContainerHeight(updatedHeight); + } + }); const handleChangeFocus = useCallback((nextFocus: boolean) => { setIsFocused(Boolean(nextFocus)); diff --git a/superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.tsx b/superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.tsx index 6b2fe507e91..60c0da870c1 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.tsx @@ -27,7 +27,8 @@ import { } from 'react'; import classNames from 'classnames'; import { useDispatch, useSelector } from 'react-redux'; -import { t, styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import { EditableTitle, EmptyState } from '@superset-ui/core/components'; import { setEditMode, onRefresh } from 'src/dashboard/actions/dashboardState'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/Tabs/Tabs.tsx b/superset-frontend/src/dashboard/components/gridComponents/Tabs/Tabs.tsx index 33f91af1b1b..d3eacb0cf7d 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Tabs/Tabs.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Tabs/Tabs.tsx @@ -25,7 +25,8 @@ import { ReactElement, } from 'react'; import { usePrevious } from '@superset-ui/core'; -import { t, useTheme, styled } from '@apache-superset/core/ui'; +import { useTheme, styled } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import { useSelector } from 'react-redux'; import { Icons } from '@superset-ui/core/components/Icons'; import { LOG_ACTIONS_SELECT_DASHBOARD_TAB } from 'src/logger/LogUtils'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.tsx b/superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.tsx index 72761e6d914..6d030b06a56 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.tsx @@ -25,7 +25,7 @@ import { useRef, useState, } from 'react'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { LineEditableTabs, TabsProps as AntdTabsProps, diff --git a/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.tsx b/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.tsx index 542de90040e..8426521d4e0 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/new/DraggableNewComponent.tsx @@ -18,7 +18,7 @@ */ import { PureComponent } from 'react'; import cx from 'classnames'; -import { css, styled } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; import { DragDroppable } from 'src/dashboard/components/dnd/DragDroppable'; import type { ConnectDragSource } from 'react-dnd'; import { NEW_COMPONENTS_SOURCE_ID } from 'src/dashboard/util/constants'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/new/NewColumn.tsx b/superset-frontend/src/dashboard/components/gridComponents/new/NewColumn.tsx index 11f38b468b9..7040ad40675 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/new/NewColumn.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/new/NewColumn.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Icons } from '@superset-ui/core/components'; import { COLUMN_TYPE } from '../../../util/componentTypes'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/new/NewDivider.tsx b/superset-frontend/src/dashboard/components/gridComponents/new/NewDivider.tsx index b95fa1c30b5..ae7a161ef09 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/new/NewDivider.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/new/NewDivider.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Icons } from '@superset-ui/core/components'; import { DIVIDER_TYPE } from '../../../util/componentTypes'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/new/NewHeader.tsx b/superset-frontend/src/dashboard/components/gridComponents/new/NewHeader.tsx index 0513cb6fa58..835e4bea46f 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/new/NewHeader.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/new/NewHeader.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Icons } from '@superset-ui/core/components'; import { HEADER_TYPE } from '../../../util/componentTypes'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/new/NewMarkdown.tsx b/superset-frontend/src/dashboard/components/gridComponents/new/NewMarkdown.tsx index 96dedf76880..39b70f3c1c5 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/new/NewMarkdown.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/new/NewMarkdown.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Icons } from '@superset-ui/core/components'; import { MARKDOWN_TYPE } from '../../../util/componentTypes'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/new/NewRow.tsx b/superset-frontend/src/dashboard/components/gridComponents/new/NewRow.tsx index c8a87fabb7c..e62bf032421 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/new/NewRow.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/new/NewRow.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Icons } from '@superset-ui/core/components'; import { ROW_TYPE } from '../../../util/componentTypes'; diff --git a/superset-frontend/src/dashboard/components/gridComponents/new/NewTabs.tsx b/superset-frontend/src/dashboard/components/gridComponents/new/NewTabs.tsx index 71145550492..f66add5f392 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/new/NewTabs.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/new/NewTabs.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Icons } from '@superset-ui/core/components'; import { TABS_TYPE } from '../../../util/componentTypes'; diff --git a/superset-frontend/src/dashboard/components/menu/BackgroundStyleDropdown.tsx b/superset-frontend/src/dashboard/components/menu/BackgroundStyleDropdown.tsx index 6c20491a5c0..46d8eb2f5f3 100644 --- a/superset-frontend/src/dashboard/components/menu/BackgroundStyleDropdown.tsx +++ b/superset-frontend/src/dashboard/components/menu/BackgroundStyleDropdown.tsx @@ -18,8 +18,8 @@ */ import { PureComponent } from 'react'; import cx from 'classnames'; -import { t } from '@apache-superset/core'; -import { css, styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, styled } from '@apache-superset/core/theme'; import backgroundStyleOptions from 'src/dashboard/util/backgroundStyleOptions'; import PopoverDropdown, { diff --git a/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/index.tsx b/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/index.tsx index a3511e3cb83..d30d552974d 100644 --- a/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/index.tsx +++ b/superset-frontend/src/dashboard/components/menu/DownloadMenuItems/index.tsx @@ -17,7 +17,8 @@ * under the License. */ import { SyntheticEvent } from 'react'; -import { logging, t } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; +import { t } from '@apache-superset/core/translation'; import { FeatureFlag, isFeatureEnabled, diff --git a/superset-frontend/src/dashboard/components/menu/HoverMenu.tsx b/superset-frontend/src/dashboard/components/menu/HoverMenu.tsx index 4ee784fd2ba..9e45c96b986 100644 --- a/superset-frontend/src/dashboard/components/menu/HoverMenu.tsx +++ b/superset-frontend/src/dashboard/components/menu/HoverMenu.tsx @@ -19,7 +19,7 @@ */ import { RefObject, ReactNode, PureComponent } from 'react'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import cx from 'classnames'; interface HoverMenuProps { diff --git a/superset-frontend/src/dashboard/components/menu/MarkdownModeDropdown.tsx b/superset-frontend/src/dashboard/components/menu/MarkdownModeDropdown.tsx index 3cd434aaae4..8dccc4921df 100644 --- a/superset-frontend/src/dashboard/components/menu/MarkdownModeDropdown.tsx +++ b/superset-frontend/src/dashboard/components/menu/MarkdownModeDropdown.tsx @@ -17,7 +17,7 @@ * under the License. */ import { PureComponent } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import PopoverDropdown, { OnChangeHandler, diff --git a/superset-frontend/src/dashboard/components/menu/ShareMenuItems/index.tsx b/superset-frontend/src/dashboard/components/menu/ShareMenuItems/index.tsx index 42a321ebc0a..37f6ebf6c1f 100644 --- a/superset-frontend/src/dashboard/components/menu/ShareMenuItems/index.tsx +++ b/superset-frontend/src/dashboard/components/menu/ShareMenuItems/index.tsx @@ -18,7 +18,8 @@ */ import { ComponentProps, RefObject } from 'react'; import copyTextToClipboard from 'src/utils/copy'; -import { t, logging } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; +import { t } from '@apache-superset/core/translation'; import { FeatureFlag, isFeatureEnabled, diff --git a/superset-frontend/src/dashboard/components/menu/WithPopoverMenu.tsx b/superset-frontend/src/dashboard/components/menu/WithPopoverMenu.tsx index 4644bc3a7d8..3fb061ed15b 100644 --- a/superset-frontend/src/dashboard/components/menu/WithPopoverMenu.tsx +++ b/superset-frontend/src/dashboard/components/menu/WithPopoverMenu.tsx @@ -19,7 +19,7 @@ import { ReactNode, CSSProperties, PureComponent } from 'react'; import cx from 'classnames'; import { addAlpha } from '@superset-ui/core'; -import { css, styled } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; type ShouldFocusContainer = HTMLDivElement & { contains: (event_target: EventTarget & HTMLElement) => boolean; @@ -112,6 +112,8 @@ export default class WithPopoverMenu extends PureComponent< menuRef: HTMLDivElement | null; + focusEvent: Event | null; + static defaultProps = { children: null, disableClick: false, @@ -136,6 +138,7 @@ export default class WithPopoverMenu extends PureComponent< isFocused: props.isFocused!, }; this.menuRef = null; + this.focusEvent = null; this.setRef = this.setRef.bind(this); this.setMenuRef = this.setMenuRef.bind(this); this.handleClick = this.handleClick.bind(this); @@ -181,6 +184,17 @@ export default class WithPopoverMenu extends PureComponent< return; } + // Skip if this is the same event that just triggered focus via onClick. + // The document-level listener registered during focus will see the same + // event bubble up; by that time a re-render may have detached the + // original event.target, causing shouldFocus to return false and + // immediately undoing the focus. + const nativeEvent = event.nativeEvent || event; + if (this.focusEvent === nativeEvent) { + this.focusEvent = null; + return; + } + const { onChangeFocus, shouldFocus: shouldFocusFunc, @@ -194,6 +208,7 @@ export default class WithPopoverMenu extends PureComponent< if (!disableClick && shouldFocus && !this.state.isFocused) { document.addEventListener('click', this.handleClick); document.addEventListener('drag', this.handleClick); + this.focusEvent = event.nativeEvent || event; this.setState(() => ({ isFocused: true })); diff --git a/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/ModalFooter.tsx b/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/ModalFooter.tsx index 5675c2ec807..133918665a6 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/ModalFooter.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/ModalFooter.tsx @@ -23,8 +23,9 @@ import { Icons, Flex, } from '@superset-ui/core/components'; -import { t } from '@apache-superset/core'; -import { styled, css, useTheme, Alert } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { Alert } from '@apache-superset/core/components'; +import { styled, css, useTheme } from '@apache-superset/core/theme'; import { BaseExpandButtonWrapper } from './SharedStyles'; const StyledAlert = styled(Alert)` diff --git a/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/SharedStyles.tsx b/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/SharedStyles.tsx index 51ee24051a3..8677cfa5bc8 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/SharedStyles.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/ConfigModal/SharedStyles.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css } from '@apache-superset/core/ui'; +import { styled, css } from '@apache-superset/core/theme'; import { Form, StyledModal } from '@superset-ui/core/components'; const MODAL_MARGIN = 16; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/index.tsx index 24fe7a30a1e..d2cc5b8187c 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/index.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useMemo } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DataMaskState, DataMaskStateWithId, @@ -25,7 +25,7 @@ import { ChartCustomization, ChartCustomizationDivider, } from '@superset-ui/core'; -import { css, SupersetTheme, styled } from '@apache-superset/core/ui'; +import { css, SupersetTheme, styled } from '@apache-superset/core/theme'; import { Button } from '@superset-ui/core/components'; import { OPEN_FILTER_BAR_WIDTH } from 'src/dashboard/constants'; import tinycolor from 'tinycolor2'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilter.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilter.tsx index dfc40e11b80..fd43a6b4beb 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilter.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilter.tsx @@ -18,7 +18,7 @@ */ import { useCallback } from 'react'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { CrossFilterIndicator } from 'src/dashboard/components/nativeFilters/selectors'; import { useDispatch } from 'react-redux'; import { setDirectPathToChild } from 'src/dashboard/actions/dashboardState'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTag.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTag.tsx index eb81cd13b87..81b76579579 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTag.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTag.tsx @@ -18,7 +18,7 @@ */ import { getColumnLabel, useCSSTextTruncation } from '@superset-ui/core'; -import { styled, css, useTheme } from '@apache-superset/core/ui'; +import { styled, css, useTheme } from '@apache-superset/core/theme'; import { CrossFilterIndicator } from 'src/dashboard/components/nativeFilters/selectors'; import { Tag } from 'src/components/Tag'; import { Tooltip } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx index dc97928471d..459551f125b 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx @@ -17,9 +17,9 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { useCSSTextTruncation } from '@superset-ui/core'; -import { css, styled, useTheme } from '@apache-superset/core/ui'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import { Tooltip } from '@superset-ui/core/components'; import { FilterBarOrientation } from 'src/dashboard/types'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.tsx index 58df9ddc141..9775de8022e 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ChartsScopingListPanel.tsx @@ -18,8 +18,8 @@ */ import { ReactNode, useMemo } from 'react'; -import { t } from '@apache-superset/core'; -import { css, styled, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import { ChartConfiguration, DashboardLayout, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModal.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModal.tsx index 132f6319963..395c6a4e271 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModal.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModal.tsx @@ -18,7 +18,7 @@ */ import { useCallback, useMemo, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { isDefined, NativeFilterScope } from '@superset-ui/core'; import { Modal } from '@superset-ui/core/components'; import { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModalContent.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModalContent.tsx index 374a35690ab..41d2518c642 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModalContent.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingModalContent.tsx @@ -17,7 +17,7 @@ * under the License. */ import { NativeFilterScope } from '@superset-ui/core'; -import { css, styled, useTheme } from '@apache-superset/core/ui'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import { ChartConfiguration } from 'src/dashboard/types'; import { ScopingTreePanel } from './ScopingTreePanel'; import { ChartsScopingListPanel } from './ChartsScopingListPanel'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx index bb1a547c448..6140bbb8aaa 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx @@ -18,9 +18,10 @@ */ import { useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { isDefined, NativeFilterScope } from '@superset-ui/core'; -import { css, styled, useTheme, Alert } from '@apache-superset/core/ui'; +import { Alert } from '@apache-superset/core/components'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import { Select, Tooltip } from '@superset-ui/core/components'; import { noOp } from 'src/utils/common'; import ScopingTree from 'src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/VerticalCollapse.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/VerticalCollapse.tsx index e2dcf047782..7389d70ede8 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/VerticalCollapse.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/VerticalCollapse.tsx @@ -18,8 +18,8 @@ */ import { useMemo, useState, useCallback } from 'react'; -import { t } from '@apache-superset/core'; -import { css, useTheme, SupersetTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, useTheme, SupersetTheme } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { FilterBarOrientation } from 'src/dashboard/types'; import CrossFilter from './CrossFilter'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/styles.ts b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/styles.ts index ccd7e2c5f45..1ba2f182917 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/styles.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/styles.ts @@ -17,7 +17,7 @@ * under the License. */ -import { css } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; export const ellipsisCss = css` white-space: nowrap; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CustomizationsOutOfScopeCollapsible/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CustomizationsOutOfScopeCollapsible/index.tsx index b548d6ac41d..42bbf4f387d 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CustomizationsOutOfScopeCollapsible/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CustomizationsOutOfScopeCollapsible/index.tsx @@ -17,12 +17,12 @@ * under the License. */ import { ReactNode } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartCustomization, ChartCustomizationDivider, } from '@superset-ui/core'; -import { css, SupersetTheme } from '@apache-superset/core/ui'; +import { css, SupersetTheme } from '@apache-superset/core/theme'; import { Collapse } from '@superset-ui/core/components'; export interface CustomizationsOutOfScopeCollapsibleProps { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx index 6f1f9f0d521..199287e678d 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx @@ -19,8 +19,8 @@ import { useCallback, useMemo, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { t } from '@apache-superset/core'; -import { styled, useTheme, css } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, useTheme, css } from '@apache-superset/core/theme'; import { MenuProps } from '@superset-ui/core/components/Menu'; import { FilterBarOrientation, RootState } from 'src/dashboard/types'; import { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControlShared.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControlShared.tsx index 6b42fde4d3c..e7e06439e87 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControlShared.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControlShared.tsx @@ -18,7 +18,7 @@ */ import { useMemo } from 'react'; import { truncationCSS } from '@superset-ui/core'; -import { styled, SupersetTheme } from '@apache-superset/core/ui'; +import { styled, SupersetTheme } from '@apache-superset/core/theme'; import { FormItem as StyledFormItem, Form, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx index 49ebc4b5866..35efda04623 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx @@ -26,7 +26,7 @@ import { useRef, useState, } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DataMask, DataMaskStateWithId, @@ -38,7 +38,12 @@ import { isChartCustomizationDivider, ChartCustomizationDivider, } from '@superset-ui/core'; -import { css, SupersetTheme, useTheme, styled } from '@apache-superset/core/ui'; +import { + css, + SupersetTheme, + useTheme, + styled, +} from '@apache-superset/core/theme'; import { createHtmlPortalNode, InPortal, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.stories.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.stories.tsx index f80a74f0463..bf35dac079d 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.stories.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.stories.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { css } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; import { FilterBarOrientation } from 'src/dashboard/types'; import FilterDivider from './FilterDivider'; import { FilterDividerProps } from './types'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.tsx index 52ac346264d..22d32e64a4c 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterDivider.tsx @@ -18,7 +18,7 @@ */ import { useCSSTextTruncation, truncationCSS } from '@superset-ui/core'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { Tooltip } from '@superset-ui/core/components'; import { FilterBarOrientation } from 'src/dashboard/types'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx index f19ff75d73d..5a71656a958 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx @@ -26,7 +26,7 @@ import { useState, } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartDataResponseResult, Behavior, @@ -41,7 +41,7 @@ import { getClientErrorObject, isChartCustomization, } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { useDispatch, useSelector } from 'react-redux'; import { isEqual, isEqualWith } from 'lodash'; import { getChartDataRequest } from 'src/components/Chart/chartAction'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/GroupByFilterCard.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/GroupByFilterCard.tsx index 7145784699f..b079f133af9 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/GroupByFilterCard.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/GroupByFilterCard.tsx @@ -17,7 +17,7 @@ * under the License. */ import { FC, useCallback, useEffect, useMemo, useState } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DataMask, DataMaskStateWithId, @@ -28,7 +28,12 @@ import { Filters, NativeFilterType, } from '@superset-ui/core'; -import { styled, css, useTheme, SupersetTheme } from '@apache-superset/core/ui'; +import { + styled, + css, + useTheme, + SupersetTheme, +} from '@apache-superset/core/theme'; import { Typography, Select, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersDropdownContent/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersDropdownContent/index.tsx index c09e4d77833..07c3696eb8f 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersDropdownContent/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersDropdownContent/index.tsx @@ -19,7 +19,7 @@ import { ReactNode } from 'react'; import { Divider, Filter } from '@superset-ui/core'; -import { css, SupersetTheme } from '@apache-superset/core/ui'; +import { css, SupersetTheme } from '@apache-superset/core/theme'; import { FilterBarOrientation } from 'src/dashboard/types'; import { FiltersOutOfScopeCollapsible } from '../FiltersOutOfScopeCollapsible'; import { CrossFilterIndicator } from '../../selectors'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersOutOfScopeCollapsible/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersOutOfScopeCollapsible/index.tsx index 63e86324b15..7c9a2262907 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersOutOfScopeCollapsible/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FiltersOutOfScopeCollapsible/index.tsx @@ -17,9 +17,9 @@ * under the License. */ import { ReactNode } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Divider, Filter } from '@superset-ui/core'; -import { css, SupersetTheme } from '@apache-superset/core/ui'; +import { css, SupersetTheme } from '@apache-superset/core/theme'; import { Collapse } from '@superset-ui/core/components'; export interface FiltersOutOfScopeCollapsibleProps { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx index b0c903c0300..6fae1d5c6ed 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx @@ -17,8 +17,8 @@ * under the License. */ /* eslint-disable no-param-reassign */ -import { t } from '@apache-superset/core'; -import { css, styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, styled } from '@apache-superset/core/theme'; import { memo, FC } from 'react'; import { Icons } from '@superset-ui/core/components/Icons'; import { Button } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Horizontal.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Horizontal.tsx index 41799a9eeeb..96e05dddba5 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Horizontal.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Horizontal.tsx @@ -18,9 +18,9 @@ */ import { FC, memo, useMemo } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DataMaskStateWithId } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Loading } from '@superset-ui/core/components'; import { RootState } from 'src/dashboard/types'; import { useChartLayoutItems } from 'src/dashboard/util/useChartLayoutItems'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx index f6ea8e8883d..9db9b8b0579 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx @@ -31,8 +31,8 @@ import { } from 'react'; import { useSelector } from 'react-redux'; import cx from 'classnames'; -import { t } from '@apache-superset/core'; -import { styled, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, useTheme } from '@apache-superset/core/theme'; import { RootState } from 'src/dashboard/types'; import { DataMaskStateWithId } from '@superset-ui/core'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx index 2db15214c64..7bb0987353d 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx @@ -41,7 +41,7 @@ import { ChartCustomization, ChartCustomizationDivider, } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Constants } from '@superset-ui/core/components'; import { useHistory } from 'react-router-dom'; import { updateDataMask, removeDataMask } from 'src/dataMask/actions'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/keyValue.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/keyValue.tsx index 9ba19fc15be..3dea16864d7 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/keyValue.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/keyValue.tsx @@ -17,7 +17,7 @@ * under the License. */ import { SupersetClient } from '@superset-ui/core'; -import { logging } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; import { DashboardPermalinkValue } from 'src/dashboard/types'; const assembleEndpoint = ( diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/DependenciesRow.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/DependenciesRow.tsx index b02102dfd6e..d2e6b4d8e13 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/DependenciesRow.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/DependenciesRow.tsx @@ -18,9 +18,9 @@ */ import { memo, useCallback, useMemo } from 'react'; import { useDispatch } from 'react-redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { useTruncation } from '@superset-ui/core'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { setDirectPathToChild } from 'src/dashboard/actions/dashboardState'; import { List } from '@superset-ui/core/components/List'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx index 5e0f6c7678c..07292072cbf 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/NameRow.tsx @@ -18,7 +18,7 @@ */ import { useSelector } from 'react-redux'; import { isChartCustomization, useTruncation } from '@superset-ui/core'; -import { css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; +import { css, SupersetTheme, useTheme } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { useFilterConfigModal } from 'src/dashboard/components/nativeFilters/FilterBar/FilterConfigurationLink/useFilterConfigModal'; import { RootState } from 'src/dashboard/types'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/ScopeRow.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/ScopeRow.tsx index 3761e6ae04c..fdd9e5ddc94 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/ScopeRow.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/ScopeRow.tsx @@ -17,9 +17,9 @@ * under the License. */ import { memo, useMemo } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { useTruncation } from '@superset-ui/core'; -import { css } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; import { List } from '@superset-ui/core/components/List'; import { useFilterScope } from './useFilterScope'; import { Row, RowLabel, RowTruncationCount, RowValue } from './Styles'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/Styles.ts b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/Styles.ts index 618937dbbee..c268a963f7a 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/Styles.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/Styles.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css, styled } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; export const Row = styled.div` ${({ theme }) => css` diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/TypeRow.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/TypeRow.tsx index 25b4b583bf9..fa6b7d83cdb 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/TypeRow.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/TypeRow.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useMemo } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { getChartMetadataRegistry, isChartCustomization, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/useFilterScope.ts b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/useFilterScope.ts index 9b7cd356696..542ac07ed1a 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/useFilterScope.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterCard/useFilterScope.ts @@ -18,7 +18,7 @@ */ import { useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Layout, LayoutItem, RootState } from 'src/dashboard/types'; import { DASHBOARD_ROOT_ID } from 'src/dashboard/util/constants'; import { CHART_TYPE } from 'src/dashboard/util/componentTypes'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ConfigModalContent/ConfigModalContent.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ConfigModalContent/ConfigModalContent.tsx index 30c7471010c..156a710e498 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ConfigModalContent/ConfigModalContent.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ConfigModalContent/ConfigModalContent.tsx @@ -24,7 +24,7 @@ import { ChartCustomizationDivider, } from '@superset-ui/core'; import type { FormInstance } from '@superset-ui/core/components'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Flex } from '@superset-ui/core/components'; import FilterContentRenderer from './FilterContentRenderer'; import CustomizationContentRenderer from './CustomizationContentRenderer'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ConfigModalSidebar/ConfigModalSidebar.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ConfigModalSidebar/ConfigModalSidebar.tsx index a2b9fdc31d0..feb6ce87679 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ConfigModalSidebar/ConfigModalSidebar.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ConfigModalSidebar/ConfigModalSidebar.tsx @@ -17,9 +17,9 @@ * under the License. */ import { FC, ReactNode, useCallback, useState } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { NativeFilterType, ChartCustomizationType } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Collapse, Flex } from '@superset-ui/core/components'; import type { DragEndEvent } from '@dnd-kit/core'; import { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DividerConfigForm.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DividerConfigForm.tsx index da00b8dbe6c..11f511548cc 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DividerConfigForm.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DividerConfigForm.tsx @@ -18,9 +18,9 @@ */ import { FC } from 'react'; import { FormItem, Input } from '@superset-ui/core/components'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { NativeFilterType, ChartCustomizationType } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { CHART_CUSTOMIZATION_DIVIDER_PREFIX } from './utils'; interface Props { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx index 170c22566db..4cb66c2ed65 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/DraggableFilter.tsx @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import type { CSSProperties, FC, ReactNode } from 'react'; import { useSortable } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterConfigurePane.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterConfigurePane.tsx index 74567b95f76..d2ca28ef557 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterConfigurePane.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterConfigurePane.tsx @@ -18,7 +18,7 @@ */ import { FC, ReactNode } from 'react'; import { NativeFilterType } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import FilterTitlePane from './FilterTitlePane'; import { FilterRemoval } from './types'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx index a5414fd5b82..343be64c6f3 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx @@ -18,8 +18,8 @@ */ import { forwardRef, useCallback, useState } from 'react'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import type { DragEndEvent } from '@dnd-kit/core'; import { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx index c938f45c5dd..264398b9d45 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx @@ -18,9 +18,9 @@ */ import { useRef, FC } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { NativeFilterType } from '@superset-ui/core'; -import { styled, useTheme } from '@apache-superset/core/ui'; +import { styled, useTheme } from '@apache-superset/core/theme'; import { Button } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/CollapsibleControl.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/CollapsibleControl.tsx index e96203fea4e..0eb2f92de39 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/CollapsibleControl.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/CollapsibleControl.tsx @@ -17,7 +17,7 @@ * under the License. */ import { ReactNode, useEffect, useState } from 'react'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Checkbox, InfoTooltip } from '@superset-ui/core/components'; interface CollapsibleControlProps { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx index 133bef7d9f1..2e8f43bb21f 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx @@ -18,7 +18,7 @@ */ import { useCallback, useState, useMemo, useEffect } from 'react'; import rison from 'rison'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Column, ensureIsArray, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DatasetSelect.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DatasetSelect.tsx index 6b52b06ba03..f48e6dc039f 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DatasetSelect.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DatasetSelect.tsx @@ -18,7 +18,7 @@ */ import { useCallback, useMemo, ReactNode } from 'react'; import rison from 'rison'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { JsonResponse, ClientErrorObject, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DefaultValue.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DefaultValue.tsx index 1fd52107938..3d3d5e4d77f 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DefaultValue.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DefaultValue.tsx @@ -17,7 +17,7 @@ * under the License. */ import { FC, useMemo } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior, SetDataMaskHook, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx index ac34c107d49..d3a4c010b92 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx @@ -17,8 +17,8 @@ * under the License. */ import { useState, useEffect } from 'react'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { Select } from '@superset-ui/core/components'; import { CollapsibleControl } from './CollapsibleControl'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/FilterScope.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/FilterScope.tsx index 3423fd46322..c212eef9de8 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/FilterScope.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/FilterScope.tsx @@ -19,7 +19,7 @@ import { FC, useCallback, useEffect, useMemo, useState } from 'react'; import { NativeFilterScope } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { FormItem } from '@superset-ui/core/components'; import ScopingTree from './ScopingTree'; import { getDefaultScopeValue } from './utils'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree.tsx index 019c2da8cb0..82a1f5e0ce4 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree.tsx @@ -19,7 +19,7 @@ import { FC, useMemo, useState, memo } from 'react'; import { NativeFilterScope } from '@superset-ui/core'; -import { styled, css } from '@apache-superset/core/ui'; +import { styled, css } from '@apache-superset/core/theme'; import Tree from '@superset-ui/core/components/Tree'; import { DASHBOARD_ROOT_ID } from 'src/dashboard/util/constants'; import { Tooltip } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/state.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/state.ts index c015cd0db02..db0a7b0d70b 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/state.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/state.ts @@ -18,7 +18,7 @@ */ import { useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Charts, Layout, RootState } from 'src/dashboard/types'; import { DASHBOARD_ROOT_ID } from 'src/dashboard/util/constants'; import { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/utils.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/utils.ts index 8864c256164..af62f19034b 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/utils.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/utils.ts @@ -23,9 +23,9 @@ import { TAB_TYPE, } from 'src/dashboard/util/componentTypes'; import { DASHBOARD_ROOT_ID } from 'src/dashboard/util/constants'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { NativeFilterScope } from '@superset-ui/core'; -import { logging } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; import { BuildTreeLeafTitle, TreeItem } from './types'; export const isShowTypeInTree = ({ type }: LayoutItem) => diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx index e7800e583c0..c59eb1b20aa 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx @@ -18,7 +18,7 @@ */ /* eslint-disable react-hooks/rules-of-hooks */ import { ColumnMeta, Metric } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Behavior, ChartDataResponseResult, @@ -36,8 +36,8 @@ import { getClientErrorObject, getExtensionsRegistry, } from '@superset-ui/core'; -import { styled, useTheme, css } from '@apache-superset/core/ui'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { styled, useTheme, css } from '@apache-superset/core/theme'; +import { GenericDataType } from '@apache-superset/core/common'; import { debounce, isEqual } from 'lodash'; import { forwardRef, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/RemovedFilter.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/RemovedFilter.tsx index 52f0fd83565..a861d980abc 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/RemovedFilter.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/RemovedFilter.tsx @@ -18,8 +18,8 @@ */ import { Button, type OnClickHandler } from '@superset-ui/core/components'; import { FC } from 'react'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; const RemovedContent = styled.div` display: flex; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/constants.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/constants.ts index 52952a2d0f4..9fc2ce6dd91 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/constants.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/constants.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; export const INPUT_HEIGHT = 32; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx index 35ec66ad90a..23348694fdf 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx @@ -25,13 +25,13 @@ import { Tooltip, type FormInstance, } from '@superset-ui/core/components'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Filter, ChartCustomization, getChartControlPanelRegistry, } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { doesColumnMatchFilterType, getControlItems, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/state.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/state.ts index 34cb567e07c..3c339b07042 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/state.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/state.ts @@ -18,7 +18,7 @@ */ import { useEffect, useState } from 'react'; import type { FormInstance } from '@superset-ui/core/components'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartCustomization, Filter } from '@superset-ui/core'; import { NativeFiltersForm, NativeFiltersFormItem } from '../types'; import { setNativeFilterFieldValues, useForceUpdate } from './utils'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/utils.test.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/utils.test.ts index 386eb87c718..65d5313d86e 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/utils.test.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/utils.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { Column } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ChartsState, DatasourcesState, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/utils.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/utils.ts index 82c3319660e..7c05f393cee 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/utils.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/utils.ts @@ -21,7 +21,7 @@ import type { FormInstance } from '@superset-ui/core/components'; import { useState, useCallback } from 'react'; import { CustomControlItem, Dataset } from '@superset-ui/chart-controls'; import { Column, ensureIsArray } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { DatasourcesState, ChartsState } from 'src/dashboard/types'; import { FILTER_SUPPORTED_TYPES } from './constants'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx index c5c2143b480..3cfe83434fe 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx @@ -18,9 +18,9 @@ */ import { memo, useEffect, useCallback, useMemo, useState, useRef } from 'react'; import { uniq, debounce } from 'lodash'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ChartCustomizationType, NativeFilterType } from '@superset-ui/core'; -import { styled, css, useTheme } from '@apache-superset/core/ui'; +import { styled, css, useTheme } from '@apache-superset/core/theme'; import { Constants, Form, Icons, Flex } from '@superset-ui/core/components'; import { ErrorBoundary } from 'src/components'; import { testWithId } from 'src/utils/testUtils'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/CancelConfirmationAlert.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/CancelConfirmationAlert.tsx index 05eaa30969a..4b2f7925ebf 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/CancelConfirmationAlert.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/CancelConfirmationAlert.tsx @@ -17,9 +17,9 @@ * under the License. */ import { ReactNode } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Button, type OnClickHandler } from '@superset-ui/core/components'; -import { Alert } from '@apache-superset/core/ui'; +import { Alert } from '@apache-superset/core/components'; export interface ConfirmationAlertProps { title: string; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/Footer.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/Footer.tsx index ce586b10c38..cdcc950b8ba 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/Footer.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/Footer.tsx @@ -18,7 +18,7 @@ */ import { FC } from 'react'; import { Button, type OnClickHandler } from '@superset-ui/core/components'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { CancelConfirmationAlert } from './CancelConfirmationAlert'; type FooterProps = { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ItemTitleContainer.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ItemTitleContainer.tsx index 70c4692e1e0..a75165226b3 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ItemTitleContainer.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ItemTitleContainer.tsx @@ -18,8 +18,8 @@ */ import { forwardRef, useState } from 'react'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { useDndMonitor } from '@dnd-kit/core'; import { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ItemTitlePane.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ItemTitlePane.tsx index 5b3a29265c9..88bf0295b40 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ItemTitlePane.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ItemTitlePane.tsx @@ -18,7 +18,7 @@ */ import { useRef, FC } from 'react'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import ItemTitleContainer from './ItemTitleContainer'; import { FilterRemoval } from './types'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/NewItemDropdown.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/NewItemDropdown.tsx index 7c34ac0bdeb..beda6da35a9 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/NewItemDropdown.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/NewItemDropdown.tsx @@ -17,9 +17,9 @@ * under the License. */ import { FC } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { NativeFilterType, ChartCustomizationType } from '@superset-ui/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import { Button, Dropdown, Menu } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useFilterOperations.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useFilterOperations.ts index b0ad46eb437..b57143e8533 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useFilterOperations.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useFilterOperations.ts @@ -17,7 +17,7 @@ * under the License. */ import { useCallback } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Filter, Divider, NativeFilterType } from '@superset-ui/core'; import type { FormInstance } from '@superset-ui/core/components'; import { NativeFiltersForm } from '../types'; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useModalSaveLogic.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useModalSaveLogic.ts index f07cf0128d9..51f4e56ce45 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useModalSaveLogic.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useModalSaveLogic.ts @@ -18,7 +18,7 @@ */ import { useCallback, useMemo } from 'react'; import { isEqual, sortBy } from 'lodash'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Filter, Divider, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/utils.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/utils.ts index c69bf424303..d412349adc3 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/utils.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/utils.ts @@ -30,7 +30,7 @@ import { ChartCustomization, ChartCustomizationDivider, } from '@superset-ui/core'; -import { logging } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; import { DASHBOARD_ROOT_ID } from 'src/dashboard/util/constants'; import { ChartCustomizationsForm, diff --git a/superset-frontend/src/dashboard/components/nativeFilters/utils.ts b/superset-frontend/src/dashboard/components/nativeFilters/utils.ts index de988be8e5a..7fc18f0aeab 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/utils.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/utils.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AdhocFilter, Behavior, diff --git a/superset-frontend/src/dashboard/components/resizable/ResizableContainer.tsx b/superset-frontend/src/dashboard/components/resizable/ResizableContainer.tsx index d9d6ea8d501..d76070458d5 100644 --- a/superset-frontend/src/dashboard/components/resizable/ResizableContainer.tsx +++ b/superset-frontend/src/dashboard/components/resizable/ResizableContainer.tsx @@ -19,7 +19,7 @@ import { useState, useCallback, useMemo } from 'react'; import { ResizeCallback, ResizeStartCallback, Resizable } from 're-resizable'; import cx from 'classnames'; -import { css, styled } from '@apache-superset/core/ui'; +import { css, styled } from '@apache-superset/core/theme'; import { RightResizeHandle, diff --git a/superset-frontend/src/dashboard/containers/DashboardPage.tsx b/superset-frontend/src/dashboard/containers/DashboardPage.tsx index 6c9198ffc5f..e345f5a469d 100644 --- a/superset-frontend/src/dashboard/containers/DashboardPage.tsx +++ b/superset-frontend/src/dashboard/containers/DashboardPage.tsx @@ -19,8 +19,8 @@ import { createContext, lazy, FC, useEffect, useMemo, useRef } from 'react'; import { Global } from '@emotion/react'; import { useHistory } from 'react-router-dom'; -import { t } from '@apache-superset/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { useTheme } from '@apache-superset/core/theme'; import { useDispatch, useSelector } from 'react-redux'; import { createSelector } from '@reduxjs/toolkit'; import { useToasts } from 'src/components/MessageToasts/withToasts'; diff --git a/superset-frontend/src/dashboard/hooks/useDownloadScreenshot.ts b/superset-frontend/src/dashboard/hooks/useDownloadScreenshot.ts index 0d52ccaec2f..df494bad20a 100644 --- a/superset-frontend/src/dashboard/hooks/useDownloadScreenshot.ts +++ b/superset-frontend/src/dashboard/hooks/useDownloadScreenshot.ts @@ -21,9 +21,9 @@ import { useSelector } from 'react-redux'; import { useToasts } from 'src/components/MessageToasts/withToasts'; import { last } from 'lodash'; import contentDisposition from 'content-disposition'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SupersetClient, SupersetApiError } from '@superset-ui/core'; -import { logging } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; import { LOG_ACTIONS_DASHBOARD_DOWNLOAD_AS_IMAGE, LOG_ACTIONS_DASHBOARD_DOWNLOAD_AS_PDF, diff --git a/superset-frontend/src/dashboard/reducers/sliceEntities.ts b/superset-frontend/src/dashboard/reducers/sliceEntities.ts index e3203fa6bed..3a7dc66e0c6 100644 --- a/superset-frontend/src/dashboard/reducers/sliceEntities.ts +++ b/superset-frontend/src/dashboard/reducers/sliceEntities.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { FETCH_ALL_SLICES_FAILED, diff --git a/superset-frontend/src/dashboard/styles.ts b/superset-frontend/src/dashboard/styles.ts index e281094a3bf..ca456b5e239 100644 --- a/superset-frontend/src/dashboard/styles.ts +++ b/superset-frontend/src/dashboard/styles.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { css, SupersetTheme } from '@apache-superset/core/ui'; +import { css, SupersetTheme } from '@apache-superset/core/theme'; export const headerStyles = (theme: SupersetTheme) => css` body { diff --git a/superset-frontend/src/dashboard/types.ts b/superset-frontend/src/dashboard/types.ts index 85df31047bc..49b05812468 100644 --- a/superset-frontend/src/dashboard/types.ts +++ b/superset-frontend/src/dashboard/types.ts @@ -29,7 +29,7 @@ import { NativeFilterTarget, ColumnOption, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { Dataset } from '@superset-ui/chart-controls'; import { chart } from 'src/components/Chart/chartReducer'; import componentTypes from 'src/dashboard/util/componentTypes'; diff --git a/superset-frontend/src/dashboard/util/backgroundStyleOptions.ts b/superset-frontend/src/dashboard/util/backgroundStyleOptions.ts index ea055846210..2151891f255 100644 --- a/superset-frontend/src/dashboard/util/backgroundStyleOptions.ts +++ b/superset-frontend/src/dashboard/util/backgroundStyleOptions.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { BACKGROUND_TRANSPARENT, BACKGROUND_WHITE } from './constants'; export default [ diff --git a/superset-frontend/src/dashboard/util/getFilterFieldNodesTree.ts b/superset-frontend/src/dashboard/util/getFilterFieldNodesTree.ts index 21f84f4a129..8928f51ad51 100644 --- a/superset-frontend/src/dashboard/util/getFilterFieldNodesTree.ts +++ b/superset-frontend/src/dashboard/util/getFilterFieldNodesTree.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { getDashboardFilterKey } from './getDashboardFilterKey'; import { ALL_FILTERS_ROOT } from './constants'; diff --git a/superset-frontend/src/dashboard/util/getFilterScopeNodesTree.ts b/superset-frontend/src/dashboard/util/getFilterScopeNodesTree.ts index e5bf06421fb..ec9dbe78f13 100644 --- a/superset-frontend/src/dashboard/util/getFilterScopeNodesTree.ts +++ b/superset-frontend/src/dashboard/util/getFilterScopeNodesTree.ts @@ -17,7 +17,7 @@ * under the License. */ import { isEmpty } from 'lodash'; -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { DASHBOARD_ROOT_ID } from './constants'; import { CHART_TYPE, DASHBOARD_ROOT_TYPE, TAB_TYPE } from './componentTypes'; diff --git a/superset-frontend/src/dashboard/util/getSliceHeaderTooltip.tsx b/superset-frontend/src/dashboard/util/getSliceHeaderTooltip.tsx index 1e2c10c9bfc..b266e23b151 100644 --- a/superset-frontend/src/dashboard/util/getSliceHeaderTooltip.tsx +++ b/superset-frontend/src/dashboard/util/getSliceHeaderTooltip.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { detectOS } from 'src/utils/common'; export const getSliceHeaderTooltip = (sliceName: string | undefined) => { diff --git a/superset-frontend/src/dashboard/util/headerStyleOptions.ts b/superset-frontend/src/dashboard/util/headerStyleOptions.ts index 73afacb811c..d1f82290e47 100644 --- a/superset-frontend/src/dashboard/util/headerStyleOptions.ts +++ b/superset-frontend/src/dashboard/util/headerStyleOptions.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SMALL_HEADER, MEDIUM_HEADER, LARGE_HEADER } from './constants'; export default [ diff --git a/superset-frontend/src/dashboard/util/newComponentFactory.ts b/superset-frontend/src/dashboard/util/newComponentFactory.ts index 1e33cdfc064..2855d4a63f1 100644 --- a/superset-frontend/src/dashboard/util/newComponentFactory.ts +++ b/superset-frontend/src/dashboard/util/newComponentFactory.ts @@ -17,7 +17,7 @@ * under the License. */ import { nanoid } from 'nanoid'; -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { CHART_TYPE, diff --git a/superset-frontend/src/dashboard/util/updateComponentParentsList.ts b/superset-frontend/src/dashboard/util/updateComponentParentsList.ts index 5df87114efb..67499d642c6 100644 --- a/superset-frontend/src/dashboard/util/updateComponentParentsList.ts +++ b/superset-frontend/src/dashboard/util/updateComponentParentsList.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { logging } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; interface LayoutComponent { id: string; diff --git a/superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.ts b/superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.ts index 9bcf9d5e25c..0a32b3be57e 100644 --- a/superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.ts +++ b/superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.ts @@ -18,7 +18,7 @@ */ import { useMemo } from 'react'; import { Filter, ChartCustomization } from '@superset-ui/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import { useSelector } from 'react-redux'; import { RootState } from 'src/dashboard/types'; import { useChartCustomizationFromRedux } from 'src/dashboard/components/nativeFilters/state'; diff --git a/superset-frontend/src/embedded/EmbeddedContextProviders.tsx b/superset-frontend/src/embedded/EmbeddedContextProviders.tsx index e233010e36d..9ea9c0744ab 100644 --- a/superset-frontend/src/embedded/EmbeddedContextProviders.tsx +++ b/superset-frontend/src/embedded/EmbeddedContextProviders.tsx @@ -26,7 +26,7 @@ import { DynamicPluginProvider } from 'src/components'; import { EmbeddedUiConfigProvider } from 'src/components/UiConfigContext'; import { SupersetThemeProvider } from 'src/theme/ThemeProvider'; import { ThemeController } from 'src/theme/ThemeController'; -import type { ThemeStorage } from '@apache-superset/core/ui'; +import { type ThemeStorage } from '@apache-superset/core/theme'; import { store } from 'src/views/store'; import querystring from 'query-string'; diff --git a/superset-frontend/src/embedded/index.tsx b/superset-frontend/src/embedded/index.tsx index 305b254e314..5609877f77c 100644 --- a/superset-frontend/src/embedded/index.tsx +++ b/superset-frontend/src/embedded/index.tsx @@ -21,10 +21,13 @@ import 'src/public-path'; import { lazy, Suspense } from 'react'; import ReactDOM from 'react-dom'; import { BrowserRouter as Router, Route } from 'react-router-dom'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { makeApi } from '@superset-ui/core'; -import { logging } from '@apache-superset/core'; -import { type SupersetThemeConfig, ThemeMode } from '@apache-superset/core/ui'; +import { logging } from '@apache-superset/core/utils'; +import { + type SupersetThemeConfig, + ThemeMode, +} from '@apache-superset/core/theme'; import Switchboard from '@superset-ui/switchboard'; import getBootstrapData, { applicationRoot } from 'src/utils/getBootstrapData'; import setupClient from 'src/setup/setupClient'; diff --git a/superset-frontend/src/embedded/utils.ts b/superset-frontend/src/embedded/utils.ts index 404c493962c..cc9e8612f03 100644 --- a/superset-frontend/src/embedded/utils.ts +++ b/superset-frontend/src/embedded/utils.ts @@ -22,7 +22,7 @@ import { JsonObject, QueryFormData, } from '@superset-ui/core'; -import { logging } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; import { isEmpty, isEqual } from 'lodash'; import { NATIVE_FILTER_PREFIX } from 'src/dashboard/components/nativeFilters/FiltersConfigModal/utils'; import { diff --git a/superset-frontend/src/explore/actions/exploreActions.ts b/superset-frontend/src/explore/actions/exploreActions.ts index 3855e3b93bf..cfcbd8a524e 100644 --- a/superset-frontend/src/explore/actions/exploreActions.ts +++ b/superset-frontend/src/explore/actions/exploreActions.ts @@ -19,7 +19,7 @@ /* eslint camelcase: 0 */ import rison from 'rison'; import { Dataset } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SupersetClient, QueryFormData } from '@superset-ui/core'; import { Dispatch } from 'redux'; import { diff --git a/superset-frontend/src/explore/actions/saveModalActions.ts b/superset-frontend/src/explore/actions/saveModalActions.ts index c09f8e9b408..7c1df6ec8b7 100644 --- a/superset-frontend/src/explore/actions/saveModalActions.ts +++ b/superset-frontend/src/explore/actions/saveModalActions.ts @@ -18,7 +18,7 @@ */ import rison from 'rison'; import { Dispatch } from 'redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DatasourceType, type QueryFormData, diff --git a/superset-frontend/src/explore/components/ChartPills.tsx b/superset-frontend/src/explore/components/ChartPills.tsx index 7794cf147d5..9531c8ba361 100644 --- a/superset-frontend/src/explore/components/ChartPills.tsx +++ b/superset-frontend/src/explore/components/ChartPills.tsx @@ -18,7 +18,7 @@ */ import { forwardRef, RefObject } from 'react'; import { QueryData } from '@superset-ui/core'; -import { css, SupersetTheme } from '@apache-superset/core/ui'; +import { css, SupersetTheme } from '@apache-superset/core/theme'; import { CachedLabel, type LabelType, diff --git a/superset-frontend/src/explore/components/Control.tsx b/superset-frontend/src/explore/components/Control.tsx index f6eed7623f4..794525111e9 100644 --- a/superset-frontend/src/explore/components/Control.tsx +++ b/superset-frontend/src/explore/components/Control.tsx @@ -23,7 +23,7 @@ import { ControlComponentProps as BaseControlComponentProps, } from '@superset-ui/chart-controls'; import { JsonValue, QueryFormData, usePrevious } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { ErrorBoundary } from 'src/components'; import { ExploreActions } from 'src/explore/actions/exploreActions'; import controlMap from './controls'; diff --git a/superset-frontend/src/explore/components/ControlHeader.tsx b/superset-frontend/src/explore/components/ControlHeader.tsx index 8213bf6267c..d4563a8dbbd 100644 --- a/superset-frontend/src/explore/components/ControlHeader.tsx +++ b/superset-frontend/src/explore/components/ControlHeader.tsx @@ -17,8 +17,8 @@ * under the License. */ import { FC, ReactNode } from 'react'; -import { t } from '@apache-superset/core'; -import { css, useTheme, SupersetTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, useTheme, SupersetTheme } from '@apache-superset/core/theme'; import { FormLabel, InfoTooltip, Tooltip } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/explore/components/ControlPanelsContainer.test.tsx b/superset-frontend/src/explore/components/ControlPanelsContainer.test.tsx index 368cffff910..fecc2f9228b 100644 --- a/superset-frontend/src/explore/components/ControlPanelsContainer.test.tsx +++ b/superset-frontend/src/explore/components/ControlPanelsContainer.test.tsx @@ -23,7 +23,7 @@ import { userEvent, waitFor, } from 'spec/helpers/testing-library'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DatasourceType, getChartControlPanelRegistry, diff --git a/superset-frontend/src/explore/components/ControlPanelsContainer.tsx b/superset-frontend/src/explore/components/ControlPanelsContainer.tsx index a7450ed7b6f..fba0cc3c0fd 100644 --- a/superset-frontend/src/explore/components/ControlPanelsContainer.tsx +++ b/superset-frontend/src/explore/components/ControlPanelsContainer.tsx @@ -28,7 +28,7 @@ import { useRef, useState, } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, getChartControlPanelRegistry, @@ -42,7 +42,12 @@ import { FeatureFlag, VizType, } from '@superset-ui/core'; -import { styled, css, SupersetTheme, useTheme } from '@apache-superset/core/ui'; +import { + styled, + css, + SupersetTheme, + useTheme, +} from '@apache-superset/core/theme'; import { ControlPanelSectionConfig, ControlState, diff --git a/superset-frontend/src/explore/components/DataTableControl/index.tsx b/superset-frontend/src/explore/components/DataTableControl/index.tsx index 2e9e11776d3..823da872857 100644 --- a/superset-frontend/src/explore/components/DataTableControl/index.tsx +++ b/superset-frontend/src/explore/components/DataTableControl/index.tsx @@ -17,10 +17,10 @@ * under the License. */ import { useMemo, useState, useEffect, useRef, RefObject } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { getTimeFormatter, safeHtmlSpan, TimeFormats } from '@superset-ui/core'; -import { css, styled, useTheme } from '@apache-superset/core/ui'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; +import { GenericDataType } from '@apache-superset/core/common'; import { Column } from 'react-table'; import { debounce } from 'lodash'; import { diff --git a/superset-frontend/src/explore/components/DataTableControl/useTableColumns.test.ts b/superset-frontend/src/explore/components/DataTableControl/useTableColumns.test.ts index acfb4987879..4304da6b748 100644 --- a/superset-frontend/src/explore/components/DataTableControl/useTableColumns.test.ts +++ b/superset-frontend/src/explore/components/DataTableControl/useTableColumns.test.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { renderHook } from '@testing-library/react-hooks'; import { Constants } from '@superset-ui/core/components'; import { useTableColumns } from '.'; diff --git a/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx b/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx index 19300e29c57..22431227cb3 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx @@ -17,9 +17,9 @@ * under the License. */ import { useCallback, useEffect, useMemo, useState, MouseEvent } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { isFeatureEnabled, FeatureFlag } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import Tabs from '@superset-ui/core/components/Tabs'; import { diff --git a/superset-frontend/src/explore/components/DataTablesPane/components/DataTableControls.tsx b/superset-frontend/src/explore/components/DataTablesPane/components/DataTableControls.tsx index 88125ef32aa..5206032b03b 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/components/DataTableControls.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/components/DataTableControls.tsx @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { styled, css } from '@apache-superset/core/ui'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { styled, css } from '@apache-superset/core/theme'; +import { GenericDataType } from '@apache-superset/core/common'; import { useMemo } from 'react'; import { zip } from 'lodash'; import { diff --git a/superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx b/superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx index 196bed0b1d9..70e4f755ebc 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import Tabs from '@superset-ui/core/components/Tabs'; import { ResultTypes, ResultsPaneProps } from '../types'; import { useResultsPane } from './useResultsPane'; diff --git a/superset-frontend/src/explore/components/DataTablesPane/components/SamplesPane.tsx b/superset-frontend/src/explore/components/DataTablesPane/components/SamplesPane.tsx index b48e19a44cc..1c58bd9ae69 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/components/SamplesPane.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/components/SamplesPane.tsx @@ -17,9 +17,9 @@ * under the License. */ import { useState, useEffect, useMemo, useCallback } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { TableView, TableSize, @@ -27,7 +27,7 @@ import { Loading, EmptyWrapperType, } from '@superset-ui/core/components'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { useFilteredTableData, useTableColumns, diff --git a/superset-frontend/src/explore/components/DataTablesPane/components/SingleQueryResultPane.tsx b/superset-frontend/src/explore/components/DataTablesPane/components/SingleQueryResultPane.tsx index 6e096182234..cf44d415538 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/components/SingleQueryResultPane.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/components/SingleQueryResultPane.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useState, useCallback } from 'react'; -import { t } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; import { TableView, TableSize, diff --git a/superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx b/superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx index a25a7974101..9ba54e5b62e 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx @@ -18,13 +18,13 @@ */ import { useState, useEffect, ReactElement, useCallback } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, getChartMetadataRegistry, getClientErrorObject, } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { EmptyState, Loading } from '@superset-ui/core/components'; import { getChartDataRequest } from 'src/components/Chart/chartAction'; import { ResultsPaneProps, QueryResultInterface } from '../types'; diff --git a/superset-frontend/src/explore/components/DataTablesPane/types.ts b/superset-frontend/src/explore/components/DataTablesPane/types.ts index 90ba2b98cb0..b0fdb987c9f 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/types.ts +++ b/superset-frontend/src/explore/components/DataTablesPane/types.ts @@ -17,7 +17,7 @@ * under the License. */ import { JsonObject, LatestQueryFormData } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import type { ChartStatus, Datasource } from 'src/explore/types'; export enum ResultTypes { diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/index.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/index.tsx index 7540b235513..dad76da609d 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/index.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragOption/index.tsx @@ -19,7 +19,7 @@ import { RefObject } from 'react'; import { useDrag } from 'react-dnd'; import { Metric } from '@superset-ui/core'; -import { css, styled, useTheme } from '@apache-superset/core/ui'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import { ColumnMeta } from '@superset-ui/chart-controls'; import { DndItemType } from 'src/explore/components/DndItemType'; import { diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx index d97ada34d1b..c19753eaa3d 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelItem.tsx @@ -18,9 +18,9 @@ */ import { CSSProperties, ReactNode, useCallback } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { useCSSTextTruncation } from '@superset-ui/core'; -import { css, styled, useTheme } from '@apache-superset/core/ui'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { Tooltip } from '@superset-ui/core/components/Tooltip'; diff --git a/superset-frontend/src/explore/components/DatasourcePanel/fixtures.tsx b/superset-frontend/src/explore/components/DatasourcePanel/fixtures.tsx index 0c7825b9d98..39d200cba1b 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/fixtures.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/fixtures.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; export const columns = [ { diff --git a/superset-frontend/src/explore/components/DatasourcePanel/index.tsx b/superset-frontend/src/explore/components/DatasourcePanel/index.tsx index 1278a2282f1..74718ae3751 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/index.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/index.tsx @@ -17,9 +17,10 @@ * under the License. */ import { useContext, useMemo, useState } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DatasourceType, Metric, QueryFormData } from '@superset-ui/core'; -import { css, styled, useTheme, Alert } from '@apache-superset/core/ui'; +import { Alert } from '@apache-superset/core/components'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import { ControlConfig } from '@superset-ui/chart-controls'; import AutoSizer from 'react-virtualized-auto-sizer'; diff --git a/superset-frontend/src/explore/components/DatasourcePanel/transformDatasourceFolders.ts b/superset-frontend/src/explore/components/DatasourcePanel/transformDatasourceFolders.ts index eb94823069a..32f2eba3d62 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/transformDatasourceFolders.ts +++ b/superset-frontend/src/explore/components/DatasourcePanel/transformDatasourceFolders.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Metric } from '@superset-ui/core'; import { FoldersEditorItemType } from 'src/components/Datasource/types'; import { diff --git a/superset-frontend/src/explore/components/EmbedCodeContent.tsx b/superset-frontend/src/explore/components/EmbedCodeContent.tsx index 9d1ebb81bdf..deda9002a97 100644 --- a/superset-frontend/src/explore/components/EmbedCodeContent.tsx +++ b/superset-frontend/src/explore/components/EmbedCodeContent.tsx @@ -25,7 +25,8 @@ import { useState, } from 'react'; import { LatestQueryFormData } from '@superset-ui/core'; -import { css, t } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import { Input, Space, Typography } from '@superset-ui/core/components'; import { CopyToClipboard } from 'src/components'; import { URL_PARAMS } from 'src/constants'; diff --git a/superset-frontend/src/explore/components/ExploreAlert.tsx b/superset-frontend/src/explore/components/ExploreAlert.tsx index 6afbb056198..d4a8a4b4405 100644 --- a/superset-frontend/src/explore/components/ExploreAlert.tsx +++ b/superset-frontend/src/explore/components/ExploreAlert.tsx @@ -20,7 +20,7 @@ import { forwardRef, RefObject, MouseEvent } from 'react'; import { Button } from '@superset-ui/core/components'; import { ErrorAlert } from 'src/components'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; interface ControlPanelAlertProps { title: string; diff --git a/superset-frontend/src/explore/components/ExploreChartHeader/index.tsx b/superset-frontend/src/explore/components/ExploreChartHeader/index.tsx index 8da1bd91569..a839fbfaab5 100644 --- a/superset-frontend/src/explore/components/ExploreChartHeader/index.tsx +++ b/superset-frontend/src/explore/components/ExploreChartHeader/index.tsx @@ -32,8 +32,9 @@ import { isMatrixifyEnabled, MatrixifyFormData, } from '@superset-ui/core'; -import { logging } from '@apache-superset/core'; -import { css, t, SupersetTheme } from '@apache-superset/core/ui'; +import { logging } from '@apache-superset/core/utils'; +import { css, SupersetTheme } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; import { Icons } from '@superset-ui/core/components/Icons'; import PropertiesModal from 'src/explore/components/PropertiesModal'; import { sliceUpdated } from 'src/explore/actions/exploreActions'; diff --git a/superset-frontend/src/explore/components/ExploreChartHeader/useExploreMetadataBar.tsx b/superset-frontend/src/explore/components/ExploreChartHeader/useExploreMetadataBar.tsx index 0b95f29bde6..20bfcfb849e 100644 --- a/superset-frontend/src/explore/components/ExploreChartHeader/useExploreMetadataBar.tsx +++ b/superset-frontend/src/explore/components/ExploreChartHeader/useExploreMetadataBar.tsx @@ -17,8 +17,8 @@ * under the License. */ import { useMemo } from 'react'; -import { t } from '@apache-superset/core'; -import { tn } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; +import { tn } from '@apache-superset/core/translation'; import MetadataBar, { MetadataType, } from '@superset-ui/core/components/MetadataBar'; diff --git a/superset-frontend/src/explore/components/ExploreChartPanel/index.tsx b/superset-frontend/src/explore/components/ExploreChartPanel/index.tsx index fd29a604383..c692e65bfd1 100644 --- a/superset-frontend/src/explore/components/ExploreChartPanel/index.tsx +++ b/superset-frontend/src/explore/components/ExploreChartPanel/index.tsx @@ -18,7 +18,7 @@ */ import { useState, useEffect, useCallback, useMemo, ReactNode } from 'react'; import Split from 'react-split'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DatasourceType, ensureIsArray, @@ -30,7 +30,8 @@ import { JsonObject, getExtensionsRegistry, } from '@superset-ui/core'; -import { css, styled, useTheme, Alert } from '@apache-superset/core/ui'; +import { Alert } from '@apache-superset/core/components'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import ChartContainer from 'src/components/Chart/ChartContainer'; import { getItem, diff --git a/superset-frontend/src/explore/components/ExploreContainer/index.tsx b/superset-frontend/src/explore/components/ExploreContainer/index.tsx index 5cf714ea740..fbac64cf1f6 100644 --- a/superset-frontend/src/explore/components/ExploreContainer/index.tsx +++ b/superset-frontend/src/explore/components/ExploreContainer/index.tsx @@ -25,7 +25,7 @@ import { useReducer, } from 'react'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { useDragDropManager } from 'react-dnd'; import { DatasourcePanelDndItem } from '../DatasourcePanel/types'; diff --git a/superset-frontend/src/explore/components/ExploreContentPopover.tsx b/superset-frontend/src/explore/components/ExploreContentPopover.tsx index 3a006601cc7..a0f97b7543e 100644 --- a/superset-frontend/src/explore/components/ExploreContentPopover.tsx +++ b/superset-frontend/src/explore/components/ExploreContentPopover.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; export const ExplorePopoverContent = styled.div` .edit-popover-resize { diff --git a/superset-frontend/src/explore/components/ExploreViewContainer/index.tsx b/superset-frontend/src/explore/components/ExploreViewContainer/index.tsx index 3fddda72aef..26110471a7f 100644 --- a/superset-frontend/src/explore/components/ExploreViewContainer/index.tsx +++ b/superset-frontend/src/explore/components/ExploreViewContainer/index.tsx @@ -41,8 +41,9 @@ import { ControlStateMapping, ControlPanelState, } from '@superset-ui/chart-controls'; -import { t, styled, css, useTheme } from '@apache-superset/core/ui'; -import { logging } from '@apache-superset/core'; +import { styled, css, useTheme } from '@apache-superset/core/theme'; +import { t } from '@apache-superset/core/translation'; +import { logging } from '@apache-superset/core/utils'; import { debounce, isEqual, isObjectLike, omit, pick } from 'lodash'; import { Resizable } from 're-resizable'; import { Tooltip } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/explore/components/ExportToCSVDropdown/index.tsx b/superset-frontend/src/explore/components/ExportToCSVDropdown/index.tsx index b182f6bc662..a2b09d64cd6 100644 --- a/superset-frontend/src/explore/components/ExportToCSVDropdown/index.tsx +++ b/superset-frontend/src/explore/components/ExportToCSVDropdown/index.tsx @@ -18,8 +18,8 @@ */ import { ReactChild, useCallback, Key } from 'react'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; import { Dropdown } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/explore/components/PropertiesModal/index.tsx b/superset-frontend/src/explore/components/PropertiesModal/index.tsx index 675323a13a8..6e1ba30939f 100644 --- a/superset-frontend/src/explore/components/PropertiesModal/index.tsx +++ b/superset-frontend/src/explore/components/PropertiesModal/index.tsx @@ -26,7 +26,7 @@ import { type SelectValue, } from '@superset-ui/core/components'; import rison from 'rison'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SupersetClient, isFeatureEnabled, diff --git a/superset-frontend/src/explore/components/RunQueryButton/index.tsx b/superset-frontend/src/explore/components/RunQueryButton/index.tsx index 9e2e71e3bdb..22cf4782396 100644 --- a/superset-frontend/src/explore/components/RunQueryButton/index.tsx +++ b/superset-frontend/src/explore/components/RunQueryButton/index.tsx @@ -18,8 +18,8 @@ */ import { ReactNode } from 'react'; -import { t } from '@apache-superset/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { useTheme } from '@apache-superset/core/theme'; import { Button } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/explore/components/SaveModal.tsx b/superset-frontend/src/explore/components/SaveModal.tsx index 91c27f90002..a78b4ce7dc1 100644 --- a/superset-frontend/src/explore/components/SaveModal.tsx +++ b/superset-frontend/src/explore/components/SaveModal.tsx @@ -36,15 +36,16 @@ import { Flex, TreeSelect, } from '@superset-ui/core/components'; -import { t, logging } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; +import { t } from '@apache-superset/core/translation'; import { DatasourceType, isDefined, SupersetClient } from '@superset-ui/core'; +import { Alert } from '@apache-superset/core/components'; import { css, styled, withTheme, - Alert, type SupersetTheme, -} from '@apache-superset/core/ui'; +} from '@apache-superset/core/theme'; import { Radio } from '@superset-ui/core/components/Radio'; import { GRID_COLUMN_COUNT } from 'src/dashboard/util/constants'; import { canUserEditDashboard } from 'src/dashboard/util/permissionUtils'; diff --git a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.tsx b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.tsx index e7b7494be01..c9f2904abc8 100644 --- a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.tsx +++ b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.tsx @@ -34,12 +34,12 @@ import { VizType, type QueryFormColumn, } from '@superset-ui/core'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { styled, withTheme, type SupersetTheme, -} from '@apache-superset/core/ui'; +} from '@apache-superset/core/theme'; import SelectControl from 'src/explore/components/controls/SelectControl'; import TextControl from 'src/explore/components/controls/TextControl'; import CheckboxControl from 'src/explore/components/controls/CheckboxControl'; diff --git a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationTypes.ts b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationTypes.ts index 2c44a6fd97c..f4b9903f6d2 100644 --- a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationTypes.ts +++ b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationTypes.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; interface Annotation { sourceType?: string; diff --git a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx index 9339f7433fe..9538264b22a 100644 --- a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/index.tsx @@ -18,14 +18,14 @@ */ import { connect } from 'react-redux'; import { PureComponent } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { HandlerFunction, JsonObject, Payload, QueryFormData, } from '@superset-ui/core'; -import { SupersetTheme, withTheme } from '@apache-superset/core/ui'; +import { SupersetTheme, withTheme } from '@apache-superset/core/theme'; import { AsyncEsmComponent, List, diff --git a/superset-frontend/src/explore/components/controls/BoundsControl.tsx b/superset-frontend/src/explore/components/controls/BoundsControl.tsx index 788ba89aa23..6d132595258 100644 --- a/superset-frontend/src/explore/components/controls/BoundsControl.tsx +++ b/superset-frontend/src/explore/components/controls/BoundsControl.tsx @@ -18,8 +18,8 @@ */ import { useEffect, useRef, useState } from 'react'; import { InputNumber } from '@superset-ui/core/components'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { debounce } from 'lodash'; import ControlHeader from 'src/explore/components/ControlHeader'; diff --git a/superset-frontend/src/explore/components/controls/CheckboxControl.tsx b/superset-frontend/src/explore/components/controls/CheckboxControl.tsx index f9120159e90..363ac67ed24 100644 --- a/superset-frontend/src/explore/components/controls/CheckboxControl.tsx +++ b/superset-frontend/src/explore/components/controls/CheckboxControl.tsx @@ -17,7 +17,7 @@ * under the License. */ import { Component, type ReactNode } from 'react'; -import { styled, css } from '@apache-superset/core/ui'; +import { styled, css } from '@apache-superset/core/theme'; import { Checkbox } from '@superset-ui/core/components'; import ControlHeader from '../ControlHeader'; diff --git a/superset-frontend/src/explore/components/controls/CollectionControl/index.tsx b/superset-frontend/src/explore/components/controls/CollectionControl/index.tsx index 0243b669f2b..d21ffeecc69 100644 --- a/superset-frontend/src/explore/components/controls/CollectionControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/CollectionControl/index.tsx @@ -19,8 +19,8 @@ import React, { Component } from 'react'; import { IconTooltip, List } from '@superset-ui/core/components'; import { nanoid } from 'nanoid'; -import { t } from '@apache-superset/core'; -import { withTheme, type SupersetTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { withTheme, type SupersetTheme } from '@apache-superset/core/theme'; import { SortableContainer, SortableHandle, diff --git a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointOption.tsx b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointOption.tsx index afe467dda9b..fedee53bb83 100644 --- a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointOption.tsx +++ b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointOption.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { ColorBreakpointOptionProps } from './types'; import ColorBreakpointPopoverTrigger from './ColorBreakpointPopoverTrigger'; import { DragContainer } from '../OptionControls'; diff --git a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverControl.tsx b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverControl.tsx index fc6ef70c0b8..857f4c995c2 100644 --- a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverControl.tsx +++ b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/ColorBreakpointPopoverControl.tsx @@ -18,9 +18,9 @@ */ import { useState, useMemo } from 'react'; import { Button, Row, Col, InputNumber } from '@superset-ui/core/components'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNumber } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import ControlHeader from '../../ControlHeader'; import ColorPickerControl from '../ColorPickerControl'; import { diff --git a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/index.tsx b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/index.tsx index 8ef3cee64fd..ed49d3d4435 100644 --- a/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/ColorBreakpointsControl/index.tsx @@ -18,8 +18,8 @@ */ import { useState, useEffect } from 'react'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import DndSelectLabel from 'src/explore/components/controls/DndColumnSelectControl/DndSelectLabel'; import ColorBreakpointOption from './ColorBreakpointOption'; import { ColorBreakpointType, ColorBreakpointsControlProps } from './types'; diff --git a/superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeLabel.tsx b/superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeLabel.tsx index 46538f81817..60e0a190916 100644 --- a/superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeLabel.tsx +++ b/superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeLabel.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { css, SupersetTheme } from '@apache-superset/core/ui'; +import { css, SupersetTheme } from '@apache-superset/core/theme'; import { useRef, useState } from 'react'; import { Tooltip } from '@superset-ui/core/components'; diff --git a/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx b/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx index 06777530c72..529136f1702 100644 --- a/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx @@ -18,7 +18,7 @@ */ import { useMemo, ReactNode } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ColorScheme, ColorSchemeGroup, @@ -26,7 +26,7 @@ import { getLabelsColorMap, CategoricalColorNamespace, } from '@superset-ui/core'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { sortBy } from 'lodash'; import ControlHeader from 'src/explore/components/ControlHeader'; import { diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigControl.tsx b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigControl.tsx index 2fac42ba057..239deefaac7 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigControl.tsx +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigControl.tsx @@ -17,9 +17,9 @@ * under the License. */ import { useMemo, useState } from 'react'; -import { t } from '@apache-superset/core'; -import { useTheme } from '@apache-superset/core/ui'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { t } from '@apache-superset/core/translation'; +import { useTheme } from '@apache-superset/core/theme'; +import { GenericDataType } from '@apache-superset/core/common'; import { COLUMN_NAME_ALIASES, ControlComponentProps, diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigItem.tsx b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigItem.tsx index fac850c5cfd..1b4e6fa9955 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigItem.tsx +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigItem.tsx @@ -17,7 +17,7 @@ * under the License. */ import { memo } from 'react'; -import { css, useTheme } from '@apache-superset/core/ui'; +import { css, useTheme } from '@apache-superset/core/theme'; import { Popover } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; import { ColumnTypeLabel } from '@superset-ui/chart-controls'; diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigPopover.tsx b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigPopover.tsx index 6b3f9fe38f6..c004e9939d2 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigPopover.tsx +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigPopover.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import Tabs from '@superset-ui/core/components/Tabs'; import { SHARED_COLUMN_CONFIG_PROPS, diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/ControlFormItem.tsx b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/ControlFormItem.tsx index cd35882d5ed..3c9a5379f8e 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/ControlFormItem.tsx +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/ControlFormItem.tsx @@ -18,7 +18,7 @@ */ import { useState, FunctionComponentElement, ChangeEvent } from 'react'; import { JsonValue } from '@superset-ui/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import { ControlFormItemComponents } from './controls'; import ControlHeader, { ControlHeaderProps } from '../../../ControlHeader'; import { ControlFormItemDefaultSpec } from '../types'; diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/index.tsx b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/index.tsx index f8d60b375c7..2b05b70ceac 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/index.tsx +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/index.tsx @@ -23,7 +23,7 @@ import { useMemo, } from 'react'; import { JsonObject, JsonValue } from '@superset-ui/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import { Constants } from '@superset-ui/core/components'; import { debounce } from 'lodash'; import { ControlFormItemNode } from './ControlFormItem'; diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx b/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx index 088a06d8998..7668cf328c2 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { validateNumber } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ControlFormItemSpec, D3_FORMAT_DOCS, diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/types.ts b/superset-frontend/src/explore/components/controls/ColumnConfigControl/types.ts index e7bf6b42159..c77a7fe408a 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/types.ts +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/types.ts @@ -17,7 +17,7 @@ * under the License. */ import { JsonObject, StrictJsonValue } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ControlFormItemSpec } from '@superset-ui/chart-controls'; import { SHARED_COLUMN_CONFIG_PROPS, diff --git a/superset-frontend/src/explore/components/controls/ComparisonRangeLabel.tsx b/superset-frontend/src/explore/components/controls/ComparisonRangeLabel.tsx index aaa8d116bff..1273c1633ac 100644 --- a/superset-frontend/src/explore/components/controls/ComparisonRangeLabel.tsx +++ b/superset-frontend/src/explore/components/controls/ComparisonRangeLabel.tsx @@ -20,7 +20,7 @@ import { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; import { isEmpty, isEqual, noop } from 'lodash'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { BinaryAdhocFilter, ensureIsArray, @@ -29,7 +29,7 @@ import { parseDttmToDate, SimpleAdhocFilter, } from '@superset-ui/core'; -import { css } from '@apache-superset/core/ui'; +import { css } from '@apache-superset/core/theme'; import ControlHeader, { ControlHeaderProps, } from 'src/explore/components/ControlHeader'; diff --git a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx index 866e101699d..c476cc67772 100644 --- a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx +++ b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/ConditionalFormattingControl.tsx @@ -17,8 +17,8 @@ * under the License. */ import { useEffect, useState } from 'react'; -import { t } from '@apache-superset/core'; -import { styled, css } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, css } from '@apache-superset/core/theme'; import { Comparator } from '@superset-ui/chart-controls'; import { Icons } from '@superset-ui/core/components/Icons'; import ControlHeader from 'src/explore/components/ControlHeader'; diff --git a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.test.tsx b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.test.tsx index 4fd9ae9d82d..58804dd5069 100644 --- a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.test.tsx +++ b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.test.tsx @@ -23,7 +23,7 @@ import { waitFor, } from 'spec/helpers/testing-library'; import { Comparator, ColorSchemeEnum } from '@superset-ui/chart-controls'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { FormattingPopoverContent } from './FormattingPopoverContent'; const mockOnChange = vi.fn(); diff --git a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx index 7331cfbb9a4..f7926929e2d 100644 --- a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx +++ b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx @@ -17,9 +17,9 @@ * under the License. */ import { useMemo, useState, useEffect, useCallback } from 'react'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; +import { GenericDataType } from '@apache-superset/core/common'; import { Comparator, MultipleValueComparators, diff --git a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/constants.ts b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/constants.ts index 7365b147e2a..4bc6ce6a76b 100644 --- a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/constants.ts +++ b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/constants.ts @@ -17,7 +17,7 @@ * under the License. */ import { Comparator, ObjectFormattingEnum } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; export const operatorOptions = [ { value: Comparator.None, label: t('None') }, diff --git a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/types.ts b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/types.ts index 870a874c042..f2a58a162ed 100644 --- a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/types.ts +++ b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/types.ts @@ -24,7 +24,7 @@ import { ControlComponentProps, ObjectFormattingEnum, } from '@superset-ui/chart-controls'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; export type ConditionalFormattingConfig = { operator?: Comparator; diff --git a/superset-frontend/src/explore/components/controls/ContourControl/ContourOption.tsx b/superset-frontend/src/explore/components/controls/ContourControl/ContourOption.tsx index e4e623c49a9..6916c2f7095 100644 --- a/superset-frontend/src/explore/components/controls/ContourControl/ContourOption.tsx +++ b/superset-frontend/src/explore/components/controls/ContourControl/ContourOption.tsx @@ -17,8 +17,8 @@ * under the License. */ -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import { ContourOptionProps } from './types'; import ContourPopoverTrigger from './ContourPopoverTrigger'; import OptionWrapper from '../DndColumnSelectControl/OptionWrapper'; diff --git a/superset-frontend/src/explore/components/controls/ContourControl/ContourPopoverControl.tsx b/superset-frontend/src/explore/components/controls/ContourControl/ContourPopoverControl.tsx index ae734d21cb7..472716cdb2f 100644 --- a/superset-frontend/src/explore/components/controls/ContourControl/ContourPopoverControl.tsx +++ b/superset-frontend/src/explore/components/controls/ContourControl/ContourPopoverControl.tsx @@ -19,9 +19,9 @@ import { useState, useEffect } from 'react'; import { Button, Row, Col } from '@superset-ui/core/components'; import Tabs from '@superset-ui/core/components/Tabs'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { legacyValidateInteger } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import ControlHeader from '../../ControlHeader'; import TextControl from '../TextControl'; import ColorPickerControl from '../ColorPickerControl'; diff --git a/superset-frontend/src/explore/components/controls/ContourControl/index.tsx b/superset-frontend/src/explore/components/controls/ContourControl/index.tsx index c8148071c91..37f915eaecb 100644 --- a/superset-frontend/src/explore/components/controls/ContourControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/ContourControl/index.tsx @@ -18,8 +18,8 @@ */ import { useState, useEffect } from 'react'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import DndSelectLabel from 'src/explore/components/controls/DndColumnSelectControl/DndSelectLabel'; import ContourPopoverTrigger from './ContourPopoverTrigger'; import ContourOption from './ContourOption'; diff --git a/superset-frontend/src/explore/components/controls/CurrencyControl/CurrencyControl.tsx b/superset-frontend/src/explore/components/controls/CurrencyControl/CurrencyControl.tsx index 3da754330fd..c2a31de9ff7 100644 --- a/superset-frontend/src/explore/components/controls/CurrencyControl/CurrencyControl.tsx +++ b/superset-frontend/src/explore/components/controls/CurrencyControl/CurrencyControl.tsx @@ -18,9 +18,9 @@ */ import { useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Currency, ensureIsArray, getCurrencySymbol } from '@superset-ui/core'; -import { css, styled, useTheme } from '@apache-superset/core/ui'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import { CSSObject } from '@emotion/react'; import { Select, type SelectProps } from '@superset-ui/core/components'; import { ViewState } from 'src/views/types'; diff --git a/superset-frontend/src/explore/components/controls/CustomListItem/index.tsx b/superset-frontend/src/explore/components/controls/CustomListItem/index.tsx index a3c824aadbc..6c848cba55d 100644 --- a/superset-frontend/src/explore/components/controls/CustomListItem/index.tsx +++ b/superset-frontend/src/explore/components/controls/CustomListItem/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { useTheme } from '@apache-superset/core/ui'; +import { useTheme } from '@apache-superset/core/theme'; import { List, type ListItemProps } from '@superset-ui/core/components'; export interface CustomListItemProps extends ListItemProps { diff --git a/superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.tsx b/superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.tsx index 5d1602478c5..c64f1a08128 100644 --- a/superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.tsx +++ b/superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.tsx @@ -24,7 +24,6 @@ import { DatasourceType, JsonObject, SupersetClient } from '@superset-ui/core'; import { render, screen, - act, userEvent, waitFor, } from 'spec/helpers/testing-library'; @@ -32,7 +31,19 @@ import { fallbackExploreInitialData } from 'src/explore/fixtures'; import type { ColumnObject } from 'src/features/datasets/types'; import DatasourceControl from '.'; -const SupersetClientGet = vi.spyOn(SupersetClient, 'get'); +// Mock DatasourceEditor to avoid mounting the full 2,500+ line editor tree. +// The heavy editor (CollectionTable, FilterableTable, DatabaseSelector, etc.) +// causes OOM in CI when rendered repeatedly. These tests only need to verify +// DatasourceControl's callback wiring through the modal save flow. +// Editor internals are tested in DatasourceEditor.test.tsx. +vi.mock('src/components/Datasource/components/DatasourceEditor', () => ({ + default: () => + require('react').createElement( + 'div', + { 'data-test': 'mock-datasource-editor' }, + 'Mock Editor', + ), +})); let originalLocation: Location; @@ -42,8 +53,19 @@ beforeEach(() => { afterEach(() => { window.location = originalLocation; - fetchMock.clearHistory().removeRoutes(); - vi.clearAllMocks(); // Clears mock history but keeps spy in place + + try { + const unmatched = fetchMock.callHistory.calls('unmatched'); + if (unmatched.length > 0) { + const urls = unmatched.map(call => call.url).join(', '); + throw new Error( + `fetchMock: ${unmatched.length} unmatched call(s): ${urls}`, + ); + } + } finally { + fetchMock.clearHistory().removeRoutes(); + vi.restoreAllMocks(); + } }); interface TestDatasource { @@ -234,16 +256,16 @@ test('Should show SQL Lab for sql_lab role', async () => { test('Click on Swap dataset option', async () => { const props = createProps(); - SupersetClientGet.mockImplementationOnce( - async ({ endpoint }: { endpoint: string }) => { + jest + .spyOn(SupersetClient, 'get') + .mockImplementation(async ({ endpoint }: { endpoint: string }) => { if (endpoint.includes('_info')) { return { json: { permissions: ['can_read', 'can_write'] }, } as any; } return { json: { result: [] } } as any; - }, - ); + }); render(, { useRedux: true, @@ -251,9 +273,8 @@ test('Click on Swap dataset option', async () => { }); await userEvent.click(screen.getByTestId('datasource-menu-trigger')); - await act(async () => { - await userEvent.click(screen.getByText('Swap dataset')); - }); + await userEvent.click(screen.getByText('Swap dataset')); + expect( screen.getByText( 'Changing the dataset may break the chart if the chart relies on columns or metadata that does not exist in the target dataset', @@ -263,25 +284,18 @@ test('Click on Swap dataset option', async () => { test('Click on Edit dataset', async () => { const props = createProps(); - SupersetClientGet.mockImplementationOnce( - async () => ({ json: { result: [] } }) as any, - ); fetchMock.removeRoute(getDbWithQuery); fetchMock.get(getDbWithQuery, { result: [] }, { name: getDbWithQuery }); render(, { useRedux: true, useRouter: true, }); - userEvent.click(screen.getByTestId('datasource-menu-trigger')); + await userEvent.click(screen.getByTestId('datasource-menu-trigger')); - await act(async () => { - userEvent.click(screen.getByText('Edit dataset')); - }); + await userEvent.click(screen.getByText('Edit dataset')); expect( - screen.getByText( - 'Changing these settings will affect all charts using this dataset, including charts owned by other people.', - ), + await screen.findByTestId('mock-datasource-editor'), ).toBeInTheDocument(); }); @@ -289,9 +303,6 @@ test('Edit dataset should be disabled when user is not admin', async () => { const props = createProps(); props.user.roles = {}; props.datasource.owners = []; - SupersetClientGet.mockImplementationOnce( - async () => ({ json: { result: [] } }) as any, - ); render(, { useRedux: true, @@ -330,9 +341,7 @@ test('Click on View in SQL Lab', async () => { expect(queryByTestId('mock-sqllab-route')).not.toBeInTheDocument(); - await act(async () => { - await userEvent.click(screen.getByText('View in SQL Lab')); - }); + await userEvent.click(screen.getByText('View in SQL Lab')); expect(getByTestId('mock-sqllab-route')).toBeInTheDocument(); expect(JSON.parse(`${getByTestId('mock-sqllab-route').textContent}`)).toEqual( @@ -570,235 +579,87 @@ test('should show forbidden dataset state', () => { expect(screen.getByText(error.statusText)).toBeVisible(); }); -test('should allow creating new metrics in dataset editor', async () => { - const newMetricName = `test_metric_${Date.now()}`; - const mockDatasourceWithMetrics = { - ...mockDatasource, - metrics: [], - }; - +test('should fire onDatasourceSave when saving with new metrics', async () => { const props = createProps({ - datasource: mockDatasourceWithMetrics, + datasource: { ...mockDatasource, metrics: [] }, }); - // Mock API calls for dataset editor - fetchMock.get(getDbWithQuery, { response: { result: [] } }); - - fetchMock.get(getDatasetWithAll, { result: mockDatasourceWithMetrics }); - - fetchMock.put(putDatasetWithAll, { - result: { - ...mockDatasourceWithMetrics, - metrics: [{ id: 1, metric_name: newMetricName }], - }, - }); - - SupersetClientGet.mockImplementationOnce( - async () => ({ json: { result: [] } }) as any, - ); - render(, { useRedux: true, useRouter: true, }); - // Open datasource menu and click edit dataset - userEvent.click(screen.getByTestId('datasource-menu-trigger')); - userEvent.click(await screen.findByTestId('edit-dataset')); - - // Wait for modal to appear and navigate to Metrics tab - await waitFor(() => { - expect(screen.getByText('Metrics')).toBeInTheDocument(); + await openAndSaveChanges({ + ...mockDatasource, + metrics: [{ id: 1, metric_name: 'test_metric' }], }); - userEvent.click(screen.getByText('Metrics')); - - // Click add new metric button - const addButton = await screen.findByTestId('crud-add-table-item'); - userEvent.click(addButton); - - // Find and fill in the metric name - const nameInput = await screen.findByTestId('textarea-editable-title-input'); - userEvent.clear(nameInput); - userEvent.type(nameInput, newMetricName); - - // Save the modal - userEvent.click(screen.getByTestId('datasource-modal-save')); - - // Confirm the save - const okButton = await screen.findByText('OK'); - userEvent.click(okButton); - - // Verify the onDatasourceSave callback was called await waitFor(() => { - expect(props.onDatasourceSave).toHaveBeenCalled(); + expect(props.onDatasourceSave).toHaveBeenCalledWith( + expect.objectContaining({ + metrics: [{ id: 1, metric_name: 'test_metric' }], + }), + ); }); }); -test('should allow deleting metrics in dataset editor', async () => { - const existingMetricName = 'existing_metric'; - const mockDatasourceWithMetrics = { - ...mockDatasource, - metrics: [{ id: 1, metric_name: existingMetricName }], - }; - +test('should fire onDatasourceSave when saving with removed metrics', async () => { const props = createProps({ - datasource: mockDatasourceWithMetrics, + datasource: { + ...mockDatasource, + metrics: [{ id: 1, metric_name: 'existing_metric' }], + }, }); - // Mock API calls - fetchMock.get('glob:*/api/v1/database/?q=*', { result: [] }); - - fetchMock.get('glob:*/api/v1/dataset/*', { - result: mockDatasourceWithMetrics, - }); - - fetchMock.put('glob:*/api/v1/dataset/*', { - result: { ...mockDatasourceWithMetrics, metrics: [] }, - }); - - SupersetClientGet.mockImplementationOnce( - async () => ({ json: { result: [] } }) as any, - ); - render(, { useRedux: true, useRouter: true, }); - // Open edit dataset modal - await userEvent.click(screen.getByTestId('datasource-menu-trigger')); - await userEvent.click(await screen.findByTestId('edit-dataset')); + await openAndSaveChanges({ ...mockDatasource, metrics: [] }); - // Navigate to Metrics tab await waitFor(() => { - expect(screen.getByText('Metrics')).toBeInTheDocument(); - }); - await userEvent.click(screen.getByText('Metrics')); - - // Find existing metric and delete it - const metricRow = (await screen.findByText(existingMetricName)).closest('tr'); - expect(metricRow).toBeInTheDocument(); - - const deleteButton = metricRow?.querySelector( - '[data-test="crud-delete-icon"]', - ); - expect(deleteButton).toBeInTheDocument(); - await userEvent.click(deleteButton!); - - // Save the changes - await userEvent.click(screen.getByTestId('datasource-modal-save')); - - // Confirm the save - const okButton = await screen.findByText('OK'); - await userEvent.click(okButton); - - // Verify the onDatasourceSave callback was called - await waitFor(() => { - expect(props.onDatasourceSave).toHaveBeenCalled(); + expect(props.onDatasourceSave).toHaveBeenCalledWith( + expect.objectContaining({ metrics: [] }), + ); }); }); test('should handle metric save confirmation modal', async () => { const props = createProps(); - // Mock API calls for dataset editor - fetchMock.get('glob:*/api/v1/database/?q=*', { result: [] }); - - fetchMock.get('glob:*/api/v1/dataset/*', { result: mockDatasource }); - - fetchMock.put('glob:*/api/v1/dataset/*', { result: mockDatasource }); - - SupersetClientGet.mockImplementationOnce( - async () => ({ json: { result: [] } }) as any, - ); - render(, { useRedux: true, useRouter: true, }); - // Open edit dataset modal - await userEvent.click(screen.getByTestId('datasource-menu-trigger')); - await userEvent.click(await screen.findByTestId('edit-dataset')); + await openAndSaveChanges(mockDatasource); - // Save without making changes - const saveButton = await screen.findByTestId('datasource-modal-save'); - await userEvent.click(saveButton); - - // Verify confirmation modal appears - await waitFor(() => { - expect(screen.getByText('OK')).toBeInTheDocument(); - }); - - // Click OK to confirm - await userEvent.click(screen.getByText('OK')); - - // Verify the save was processed await waitFor(() => { expect(props.onDatasourceSave).toHaveBeenCalled(); }); }); -test('should verify real DatasourceControl callback fires on save', async () => { - // This test verifies that the REAL DatasourceControl component calls onDatasourceSave - // This is simpler than the full metric creation flow but tests the key integration - +test('should fire onDatasourceSave callback on save', async () => { const mockOnDatasourceSave = vi.fn(); const props = createProps({ datasource: mockDatasource, onDatasourceSave: mockOnDatasourceSave, }); - // Mock API calls with the same datasource (no changes needed for this test) - fetchMock.get('glob:*/api/v1/database/?q=*', { result: [] }); - - fetchMock.get('glob:*/api/v1/dataset/*', { result: mockDatasource }); - - fetchMock.put('glob:*/api/v1/dataset/*', { result: mockDatasource }); - - SupersetClientGet.mockImplementationOnce( - async () => ({ json: { result: [] } }) as any, - ); - - // Render the REAL DatasourceControl component render(, { useRedux: true, useRouter: true, }); - // Verify the real component rendered - expect(screen.getByTestId('datasource-control')).toBeInTheDocument(); + await openAndSaveChanges(mockDatasource); - // Open dataset editor - await userEvent.click(screen.getByTestId('datasource-menu-trigger')); - await userEvent.click(await screen.findByTestId('edit-dataset')); - - // Wait for modal to open await waitFor(() => { - expect(screen.getByText('Columns')).toBeInTheDocument(); + expect(mockOnDatasourceSave).toHaveBeenCalledWith( + expect.objectContaining({ + id: expect.any(Number), + name: expect.any(String), + }), + ); }); - - // Save without making changes (this should still trigger the callback) - await userEvent.click(screen.getByTestId('datasource-modal-save')); - const okButton = await screen.findByText('OK'); - await userEvent.click(okButton); - - // Verify the REAL component called the callback - // This tests that the integration point works (regardless of what data is passed) - await waitFor(() => { - expect(mockOnDatasourceSave).toHaveBeenCalled(); - }); - - // Verify it was called with a datasource object - expect(mockOnDatasourceSave).toHaveBeenCalledWith( - expect.objectContaining({ - id: expect.any(Number), - name: expect.any(String), - }), - ); }); - -// Note: Cross-component integration test removed due to complex Redux/user context setup -// The existing callback tests provide sufficient coverage for metric creation workflows -// Future enhancement could add MetricsControl integration when test infrastructure supports it diff --git a/superset-frontend/src/explore/components/controls/DatasourceControl/index.tsx b/superset-frontend/src/explore/components/controls/DatasourceControl/index.tsx index 968c00d20a4..76136b8b483 100644 --- a/superset-frontend/src/explore/components/controls/DatasourceControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/DatasourceControl/index.tsx @@ -20,13 +20,13 @@ import React, { PureComponent } from 'react'; import { DatasourceType, SupersetClient, Datasource } from '@superset-ui/core'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { css, styled, withTheme, type SupersetTheme, -} from '@apache-superset/core/ui'; +} from '@apache-superset/core/theme'; import { getTemporalColumns } from '@superset-ui/chart-controls'; import { getUrlParam } from 'src/utils/urlUtils'; import { diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx index b35530b0295..3aa6a1415d3 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx @@ -17,13 +17,18 @@ * under the License. */ import { ReactNode, useState, useEffect, useMemo } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { NO_TIME_RANGE, useCSSTextTruncation, fetchTimeRange, } from '@superset-ui/core'; -import { css, styled, useTheme, SupersetTheme } from '@apache-superset/core/ui'; +import { + css, + styled, + useTheme, + SupersetTheme, +} from '@apache-superset/core/theme'; import { Button, Constants, diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/components/AdvancedFrame.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/components/AdvancedFrame.tsx index e9f2b5aaf64..febdd725967 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/components/AdvancedFrame.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/components/AdvancedFrame.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SEPARATOR } from '@superset-ui/core'; import { Input, Icons, InfoTooltip } from '@superset-ui/core/components'; import { FrameComponentProps } from 'src/explore/components/controls/DateFilterControl/types'; diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/components/CalendarFrame.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/components/CalendarFrame.tsx index 505e3a0ea65..dba14caf2d8 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/components/CalendarFrame.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/components/CalendarFrame.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useEffect } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Radio } from '@superset-ui/core/components/Radio'; import { CALENDAR_RANGE_OPTIONS, diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/components/CommonFrame.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/components/CommonFrame.tsx index da14f0a9638..758f6d4cb9f 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/components/CommonFrame.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/components/CommonFrame.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Radio } from '@superset-ui/core/components/Radio'; import { COMMON_RANGE_OPTIONS, diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/components/CurrentCalendarFrame.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/components/CurrentCalendarFrame.tsx index 65d07c747d2..effc52860f9 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/components/CurrentCalendarFrame.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/components/CurrentCalendarFrame.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useEffect } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { Radio } from '@superset-ui/core/components/Radio'; import { CURRENT_RANGE_OPTIONS, diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/components/CustomFrame.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/components/CustomFrame.tsx index f7b8d932215..e2e0ccf61be 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/components/CustomFrame.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/components/CustomFrame.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { customTimeRangeDecode } from '@superset-ui/core'; import { InfoTooltip, diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateFunctionTooltip.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateFunctionTooltip.tsx index 94a867e8624..20289345032 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateFunctionTooltip.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateFunctionTooltip.tsx @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; -import { useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { useTheme } from '@apache-superset/core/theme'; import { Tooltip } from '@superset-ui/core/components'; import { ClassNames } from '@emotion/react'; diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateLabel.tsx b/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateLabel.tsx index 619c9624dc8..ee5d8a62ae3 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/components/DateLabel.tsx @@ -19,8 +19,8 @@ import { forwardRef, MouseEvent, ReactNode, RefObject } from 'react'; -import { t } from '@apache-superset/core'; -import { css, styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, styled } from '@apache-superset/core/theme'; import { Icons } from '@superset-ui/core/components/Icons'; export type DateLabelProps = { diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/utils/constants.ts b/superset-frontend/src/explore/components/controls/DateFilterControl/utils/constants.ts index 795e25cafc0..f1ad62b6ad4 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/utils/constants.ts +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/utils/constants.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { SelectOptionType, PreviousCalendarWeek, diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx index f68c81248a2..f61fafe8bcb 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx @@ -27,7 +27,8 @@ import { useState, } from 'react'; import { useSelector } from 'react-redux'; -import { t, editors } from '@apache-superset/core'; +import { editors } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AdhocColumn, isAdhocColumn, @@ -35,7 +36,7 @@ import { Metric, QueryFormMetric, } from '@superset-ui/core'; -import { styled, css } from '@apache-superset/core/ui'; +import { styled, css } from '@apache-superset/core/theme'; import { ColumnMeta, isSavedExpression } from '@superset-ui/chart-controls'; import Tabs from '@superset-ui/core/components/Tabs'; import { diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopoverTrigger.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopoverTrigger.tsx index 7a706967388..cde8a498ec8 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopoverTrigger.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopoverTrigger.tsx @@ -19,7 +19,7 @@ import { useCallback, useEffect, useMemo, useState, ReactNode } from 'react'; import { useSelector } from 'react-redux'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AdhocColumn, isAdhocColumn, diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndAdhocFilterOption.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndAdhocFilterOption.tsx index 5d4b4b206d6..857b098003b 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndAdhocFilterOption.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndAdhocFilterOption.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { DndItemType } from 'src/explore/components/DndItemType'; import AdhocFilterPopoverTrigger from 'src/explore/components/controls/FilterControl/AdhocFilterPopoverTrigger'; import AdhocFilter from 'src/explore/components/controls/FilterControl/AdhocFilter'; diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnMetricSelect.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnMetricSelect.tsx index b7b8bd3d67a..126d699ddff 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnMetricSelect.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnMetricSelect.tsx @@ -17,7 +17,7 @@ * under the License. */ import { useCallback, useMemo, useState } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AdhocColumn, isAdhocColumn, @@ -27,7 +27,7 @@ import { QueryFormMetric, QueryFormData, } from '@superset-ui/core'; -import { tn } from '@apache-superset/core'; +import { tn } from '@apache-superset/core/translation'; import { ColumnMeta, isColumnMeta } from '@superset-ui/chart-controls'; import { isString } from 'lodash'; import DndSelectLabel from 'src/explore/components/controls/DndColumnSelectControl/DndSelectLabel'; diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx index 6f560d1ff19..6e474e552cf 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx @@ -17,9 +17,9 @@ * under the License. */ import { useCallback, useMemo, useState } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AdhocColumn, QueryFormColumn, isAdhocColumn } from '@superset-ui/core'; -import { tn } from '@apache-superset/core'; +import { tn } from '@apache-superset/core/translation'; import { ColumnMeta, isColumnMeta } from '@superset-ui/chart-controls'; import { isEmpty } from 'lodash'; import DndSelectLabel from 'src/explore/components/controls/DndColumnSelectControl/DndSelectLabel'; diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectPopoverTitle.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectPopoverTitle.tsx index 8189668907b..e836e202e10 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectPopoverTitle.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectPopoverTitle.tsx @@ -17,8 +17,8 @@ * under the License. */ import { ChangeEvent, useCallback, useState } from 'react'; -import { t } from '@apache-superset/core'; -import { styled, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled, useTheme } from '@apache-superset/core/theme'; import { Input, Tooltip } from '@superset-ui/core/components'; import { Icons } from '@superset-ui/core/components/Icons'; diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx index b8c71b3604c..6cf802a0e9d 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx @@ -24,7 +24,7 @@ import { QueryFormData, QueryFormMetric, } from '@superset-ui/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { GenericDataType } from '@apache-superset/core/common'; import { ColumnMeta } from '@superset-ui/chart-controls'; import { fireEvent, diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.tsx index 9b1a9a371df..3f9c525e920 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.tsx @@ -17,7 +17,8 @@ * under the License. */ import { useCallback, useEffect, useMemo, useState } from 'react'; -import { t, logging } from '@apache-superset/core'; +import { logging } from '@apache-superset/core/utils'; +import { t } from '@apache-superset/core/translation'; import { Metric, QueryFormData, diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx index aefdc781cdf..0dd1074acec 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx @@ -19,7 +19,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react'; import { nanoid } from 'nanoid'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, isAdhocMetricSimple, @@ -27,8 +27,8 @@ import { Metric, QueryFormMetric, } from '@superset-ui/core'; -import { tn } from '@apache-superset/core'; -import { GenericDataType } from '@apache-superset/core/api/core'; +import { tn } from '@apache-superset/core/translation'; +import { GenericDataType } from '@apache-superset/core/common'; import { ColumnMeta } from '@superset-ui/chart-controls'; import AdhocMetric from 'src/explore/components/controls/MetricControl/AdhocMetric'; import AdhocMetricPopoverTrigger from 'src/explore/components/controls/MetricControl/AdhocMetricPopoverTrigger'; diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx index 153d97d6384..ba8ee28b9f0 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndSelectLabel.tsx @@ -18,7 +18,7 @@ */ import { ReactNode, useCallback, useContext, useEffect, useMemo } from 'react'; import { useDrop } from 'react-dnd'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import ControlHeader from 'src/explore/components/ControlHeader'; import { AddControlLabel, diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx index f00eb3f2e50..9e5a715464f 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/Option.tsx @@ -17,8 +17,8 @@ * under the License. */ import { useCallback } from 'react'; -import { t } from '@apache-superset/core'; -import { css, styled, useTheme } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { css, styled, useTheme } from '@apache-superset/core/theme'; import { Icons, InfoTooltip } from '@superset-ui/core/components'; import { CaretContainer, diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/OptionWrapper.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/OptionWrapper.tsx index a34046f9d5e..787638269cf 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/OptionWrapper.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/OptionWrapper.tsx @@ -31,7 +31,7 @@ import { import { Tooltip } from '@superset-ui/core/components'; import { StyledColumnOption } from 'src/explore/components/optionRenderers'; import { isAdhocColumn } from '@superset-ui/core'; -import { styled } from '@apache-superset/core/ui'; +import { styled } from '@apache-superset/core/theme'; import { ColumnMeta } from '@superset-ui/chart-controls'; import Option from './Option'; diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/useResizeButton.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/useResizeButton.tsx index 65f61ed5425..c32826a106e 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/useResizeButton.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/useResizeButton.tsx @@ -23,7 +23,7 @@ import { useState, MouseEvent as ReactMouseEvent, } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { throttle } from 'lodash'; import { POPOVER_INITIAL_HEIGHT, diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts index 574578983b8..d029d8b4851 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts @@ -17,7 +17,7 @@ * under the License. */ import { ColumnMeta, isColumnMeta } from '@superset-ui/chart-controls'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { AdhocColumn, ensureIsArray, diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.tsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.tsx index 97d3295bd1b..f51da2fdc13 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.tsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl/index.tsx @@ -18,9 +18,9 @@ */ import { Component, ReactNode } from 'react'; import { SupersetClient, ensureIsArray } from '@superset-ui/core'; -import { logging } from '@apache-superset/core'; -import { t } from '@apache-superset/core'; -import { withTheme, type SupersetTheme } from '@apache-superset/core/ui'; +import { logging } from '@apache-superset/core/utils'; +import { t } from '@apache-superset/core/translation'; +import { withTheme, type SupersetTheme } from '@apache-superset/core/theme'; import ControlHeader from 'src/explore/components/ControlHeader'; import AdhocMetric, { diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.tsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.tsx index 12d106a7319..97cb4bfb2f1 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.tsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.tsx @@ -18,12 +18,12 @@ */ import type React from 'react'; import { createRef, Component, type RefObject } from 'react'; -import type { SupersetTheme } from '@apache-superset/core/ui'; +import { type SupersetTheme } from '@apache-superset/core/theme'; import { Button, Icons, Select } from '@superset-ui/core/components'; import { ErrorBoundary } from 'src/components'; import { SupersetClient } from '@superset-ui/core'; -import { t } from '@apache-superset/core'; -import { styled } from '@apache-superset/core/ui'; +import { t } from '@apache-superset/core/translation'; +import { styled } from '@apache-superset/core/theme'; import Tabs from '@superset-ui/core/components/Tabs'; import AdhocFilter from 'src/explore/components/controls/FilterControl/AdhocFilter'; diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx index aff052566d4..ff9c4db9274 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx @@ -25,14 +25,14 @@ import { Tooltip, type SelectValue, } from '@superset-ui/core/components'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { isFeatureEnabled, FeatureFlag, isDefined, SupersetClient, } from '@superset-ui/core'; -import { styled, useTheme, css } from '@apache-superset/core/ui'; +import { styled, useTheme, css } from '@apache-superset/core/theme'; import { Operators, OPERATORS_OPTIONS, diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/useAdvancedDataTypes.ts b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/useAdvancedDataTypes.ts index 44b2a4f5185..185a01f1216 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/useAdvancedDataTypes.ts +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/useAdvancedDataTypes.ts @@ -17,7 +17,7 @@ * under the License. */ import { useCallback, useState } from 'react'; -import { t } from '@apache-superset/core'; +import { t } from '@apache-superset/core/translation'; import { ensureIsArray, SupersetClient } from '@superset-ui/core'; import { debounce } from 'lodash'; import rison from 'rison'; diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/AdhocFilterEditPopoverSqlTabContent.test.tsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/AdhocFilterEditPopoverSqlTabContent.test.tsx index 4d945a01f58..4c0a01212c5 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/AdhocFilterEditPopoverSqlTabContent.test.tsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/AdhocFilterEditPopoverSqlTabContent.test.tsx @@ -22,30 +22,52 @@ import { screen, selectOption, userEvent, + waitFor, } from 'spec/helpers/testing-library'; import AdhocFilter from '../AdhocFilter'; import { Clauses, ExpressionTypes } from '../types'; import AdhocFilterEditPopoverSqlTabContent from '.'; +// Track resize calls for testing +const mockResize = jest.fn(); + +// Mock EditorHost with ref support for resize +jest.mock('src/core/editors', () => { + const React = require('react'); + return { + EditorHost: React.forwardRef( + ( + { + value, + onChange, + }: { + value: string; + onChange: (v: string) => void; + }, + ref: React.Ref<{ resize: () => void }>, + ) => { + React.useImperativeHandle(ref, () => ({ + resize: mockResize, + })); + return ( +