mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
refactor(word-cloud): convert rotation and color controls to React components (POC) (#36275)
Co-authored-by: BrandanBurgess <brandanbb13@gmail.com>
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
import memoizeOne from 'memoize-one';
|
||||
import React from 'react';
|
||||
import { isControlPanelSectionConfig } from '@superset-ui/chart-controls';
|
||||
import { getChartControlPanelRegistry, JsonObject } from '@superset-ui/core';
|
||||
import type { ControlMap } from 'src/components/AlteredSliceTag/types';
|
||||
@@ -56,6 +57,17 @@ const memoizedControls = memoizeOne(
|
||||
config: JsonObject;
|
||||
};
|
||||
controlsMap[controlObj.name] = controlObj.config;
|
||||
} else if (React.isValidElement(control)) {
|
||||
const { name } = control.props as { name: string };
|
||||
if (name) {
|
||||
const ComponentType = control.type as React.ComponentType;
|
||||
controlsMap[name] = {
|
||||
type:
|
||||
ComponentType.displayName ||
|
||||
ComponentType.name ||
|
||||
'CustomControl',
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user