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:
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { ReactNode } from 'react';
|
||||
import React, { ReactNode } from 'react';
|
||||
import {
|
||||
DatasourceType,
|
||||
ensureIsArray,
|
||||
@@ -182,6 +182,14 @@ export function getAllControlsState(
|
||||
state,
|
||||
formData[name],
|
||||
);
|
||||
} else if (React.isValidElement(field)) {
|
||||
const props = field.props as { name: string; [key: string]: any };
|
||||
const { name, ...configProps } = props;
|
||||
controlsState[name] = getControlStateFromControlConfig(
|
||||
configProps as ControlConfig<any>,
|
||||
state,
|
||||
formData[name],
|
||||
);
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user