Skip to content
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
05217ab
saving chart state
alexandrusoare Sep 26, 2025
c0f6bd6
Merge branch 'master' of https://github.com/apache/superset into alex…
alexandrusoare Sep 30, 2025
182ab20
Merge branch 'master' of https://github.com/apache/superset into alex…
alexandrusoare Oct 2, 2025
33bd850
fixing(types): fixing CIs
alexandrusoare Oct 2, 2025
bc7e7f6
Merge branch 'master' of https://github.com/apache/superset into alex…
alexandrusoare Oct 3, 2025
c068cd5
feat(fixes): state update fixes
alexandrusoare Oct 3, 2025
90fb3d6
fix(functionality): fixes
alexandrusoare Oct 7, 2025
36d5c4e
refactor(code): refactoring the code a bit
alexandrusoare Oct 7, 2025
3efcc5c
refactor(code): refactoring the code a bit
alexandrusoare Oct 7, 2025
bf5c9bc
fix(types): changing any types
alexandrusoare Oct 8, 2025
7e3b5bd
Merge branch 'master' of https://github.com/apache/superset into alex…
alexandrusoare Oct 8, 2025
8c6885a
refactor(PR): refactoring by PR reviews
alexandrusoare Oct 9, 2025
bee0129
fix(order): fixed orderBy bug
alexandrusoare Oct 16, 2025
b125d80
adding test file
alexandrusoare Oct 16, 2025
7d7dd87
Merge branch 'master' into alexandrusoare/feat/chart-state-save
alexandrusoare Oct 16, 2025
63db6a6
refactor(logic): refactoring hardcoded logic
alexandrusoare Oct 23, 2025
f0a87d8
merging
alexandrusoare Oct 23, 2025
d948da9
Merge branch 'alexandrusoare/feat/chart-state-save' of https://github…
alexandrusoare Oct 23, 2025
5cf0a5f
refactor(backend): refactor hardcoded logic
alexandrusoare Oct 23, 2025
4fd19ea
refactor(chart): big refactor
alexandrusoare Oct 27, 2025
588688c
fix(CI): fixing CI issue
alexandrusoare Oct 27, 2025
7237eae
fix(CI): fix another CI issue
alexandrusoare Oct 27, 2025
0dd8561
fix(CI): fixing CIs
alexandrusoare Oct 28, 2025
2cae894
Merge branch 'master' of https://github.com/apache/superset into alex…
alexandrusoare Oct 28, 2025
7e9fb00
fix(chart): fix sorting when server pagination is on
alexandrusoare Oct 28, 2025
bc1a717
refactor(embedding): refactoring embedding
alexandrusoare Oct 29, 2025
c59b946
refactor(package): removing package-lock.json
alexandrusoare Oct 29, 2025
705dd8c
small refactor
alexandrusoare Oct 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion superset-embedded-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ export type EmbeddedDashboard = {
observeDataMask: (
callbackFn: ObserveDataMaskCallbackFn,
) => void;
getDataMask: () => Record<string, any>;
getDataMask: () => Promise<Record<string, any>>;
getChartStates: () => Promise<Record<string, any>>;
setThemeConfig: (themeConfig: Record<string, any>) => void;
};

Expand Down Expand Up @@ -244,6 +245,7 @@ export async function embedDashboard({
ourPort.get<string>('getDashboardPermalink', { anchor });
const getActiveTabs = () => ourPort.get<string[]>('getActiveTabs');
const getDataMask = () => ourPort.get<Record<string, any>>('getDataMask');
const getChartStates = () => ourPort.get<Record<string, any>>('getChartStates');
const observeDataMask = (
callbackFn: ObserveDataMaskCallbackFn,
) => {
Expand All @@ -270,6 +272,7 @@ export async function embedDashboard({
getActiveTabs,
observeDataMask,
getDataMask,
getChartStates,
setThemeConfig
};
}
38 changes: 10 additions & 28 deletions superset-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,44 @@ export type SetDataMaskHook = {
({ filterState, extraFormData, ownState }: DataMask): void;
};

/**
* Backend-compatible filter clause for query execution
*/
export interface QueryFilterClause {
col: string;
op: string;
val: string | number | string[] | number[];
}

/**
* Backend-compatible sort specification
*/
export interface QuerySortBy {
id: string;
key: string;
desc: boolean;
}

/**
* Backend-compatible own state that will be sent to the chart data API.
* This represents the standardized format that the backend expects.
*/
export interface BackendOwnState {
sortBy?: QuerySortBy[];
columnOrder?: string[];
filters?: QueryFilterClause[];
[key: string]: unknown; // Allow additional properties for chart-specific needs
}

/**
* Converter function that transforms chart-specific state to backend format.
* Each chart plugin can implement this to convert its internal state representation
* to the standardized backend format.
*/
export type ChartStateConverter<TChartState = JsonObject> = (
chartState: TChartState,
) => Partial<BackendOwnState>;

export interface PlainObject {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export type { CustomCellRendererProps } from 'ag-grid-react';
export type {
ColDef,
Column,
ColumnState,
GridOptions,
GridState,
GridReadyEvent,
Expand Down
82 changes: 82 additions & 0 deletions superset-frontend/packages/superset-ui-core/src/types/AgGrid.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import type { ColumnState, SortModelItem } from 'ag-grid-community';

// AG Grid filter type enums
export enum AgGridFilterType {
Text = 'text',
Number = 'number',
Date = 'date',
Set = 'set',
}

export enum AgGridTextFilterOperator {
Equals = 'equals',
NotEqual = 'notEqual',
Contains = 'contains',
NotContains = 'notContains',
StartsWith = 'startsWith',
EndsWith = 'endsWith',
Blank = 'blank',
NotBlank = 'notBlank',
}

export enum AgGridNumberFilterOperator {
Equals = 'equals',
NotEqual = 'notEqual',
LessThan = 'lessThan',
LessThanOrEqual = 'lessThanOrEqual',
GreaterThan = 'greaterThan',
GreaterThanOrEqual = 'greaterThanOrEqual',
InRange = 'inRange',
Blank = 'blank',
NotBlank = 'notBlank',
}

export interface AgGridSortModel extends SortModelItem {
sortIndex?: number;
}

export interface AgGridFilter {
filterType?: string;
type?: string;
filter?: string | number;
filterTo?: number;
values?: string[];
dateFrom?: string;
dateTo?: string;
operator?: 'AND' | 'OR';
condition1?: AgGridFilter;
condition2?: AgGridFilter;
conditions?: AgGridFilter[];
}

export interface AgGridFilterModel {
[colId: string]: AgGridFilter;
}

export interface AgGridChartState {
columnState: ColumnState[];
sortModel: AgGridSortModel[];
filterModel: AgGridFilterModel;
columnOrder?: string[];
pageSize?: number;
currentPage?: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { NumberFormatter } from '../number-format';
import { CurrencyFormatter } from '../currency-format';

export * from '../query/types';
export * from './AgGrid';

export type Maybe<T> = T | null;

Expand Down
Loading
Loading