mirror of
https://github.com/apache/superset.git
synced 2026-05-09 18:05:52 +00:00
feat(matrixify): implement matrix of any charts as core Superset feature (#34526)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
6969f2cf7a
commit
e6c8343fd0
@@ -16,6 +16,8 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
// Mock isMatrixifyEnabled before loading any modules
|
||||
import fetchMock from 'fetch-mock';
|
||||
import {
|
||||
getChartControlPanelRegistry,
|
||||
@@ -33,6 +35,12 @@ import {
|
||||
} from 'spec/helpers/testing-library';
|
||||
import ExploreViewContainer from '.';
|
||||
|
||||
jest.doMock('@superset-ui/core', () => ({
|
||||
__esModule: true,
|
||||
...jest.requireActual('@superset-ui/core'),
|
||||
isMatrixifyEnabled: jest.fn(() => false),
|
||||
}));
|
||||
|
||||
const reduxState = {
|
||||
explore: {
|
||||
controls: {
|
||||
|
||||
@@ -30,6 +30,7 @@ import {
|
||||
useChangeEffect,
|
||||
useComponentDidMount,
|
||||
usePrevious,
|
||||
isMatrixifyEnabled,
|
||||
} from '@superset-ui/core';
|
||||
import { debounce, isEqual, isObjectLike, omit, pick } from 'lodash';
|
||||
import { Resizable } from 're-resizable';
|
||||
@@ -323,10 +324,30 @@ function ExploreViewContainer(props) {
|
||||
|
||||
const onQuery = useCallback(() => {
|
||||
props.actions.setForceQuery(false);
|
||||
|
||||
// Skip main query if Matrixify is enabled
|
||||
if (isMatrixifyEnabled(props.form_data)) {
|
||||
// Set chart to success state since Matrixify will handle its own queries
|
||||
props.actions.chartUpdateSucceeded([], props.chart.id);
|
||||
props.actions.chartRenderingSucceeded(props.chart.id);
|
||||
|
||||
// Update history and controls
|
||||
addHistory();
|
||||
setLastQueriedControls(props.controls);
|
||||
return;
|
||||
}
|
||||
|
||||
// Normal behavior for non-Matrixify
|
||||
props.actions.triggerQuery(true, props.chart.id);
|
||||
addHistory();
|
||||
setLastQueriedControls(props.controls);
|
||||
}, [props.controls, addHistory, props.actions, props.chart.id]);
|
||||
}, [
|
||||
props.controls,
|
||||
addHistory,
|
||||
props.actions,
|
||||
props.chart.id,
|
||||
props.form_data,
|
||||
]);
|
||||
|
||||
const handleKeydown = useCallback(
|
||||
event => {
|
||||
|
||||
Reference in New Issue
Block a user