hainenber commented on code in PR #31979:
URL: https://github.com/apache/superset/pull/31979#discussion_r1933256502
##########
superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.jsx:
##########
@@ -17,60 +17,37 @@
* under the License.
*/
/* eslint-env browser */
-import PropTypes from 'prop-types';
-import { PureComponent } from 'react';
import { getCategoricalSchemeRegistry, t } from '@superset-ui/core';
-
import ColorSchemeControl from
'src/explore/components/controls/ColorSchemeControl';
-const propTypes = {
- onChange: PropTypes.func,
- labelMargin: PropTypes.number,
- colorScheme: PropTypes.string,
- hasCustomLabelsColor: PropTypes.bool,
-};
-
-const defaultProps = {
- hasCustomLabelsColor: false,
- colorScheme: undefined,
- onChange: () => {},
+const ColorSchemeControlWrapper = ({
+ colorScheme,
+ labelMargin = 0,
+ hasCustomLabelsColor = false,
+ hovered = false,
+ onChange = () => {},
+}) => {
+ // Registry initialization
+ const categoricalSchemeRegistry = getCategoricalSchemeRegistry();
+ const choices = categoricalSchemeRegistry.keys().map(s => [s, s]);
+ const schemes = categoricalSchemeRegistry.getMap();
Review Comment:
Encapsulated in `useEffect` hook per your suggestion in [this
commit](https://github.com/apache/superset/pull/31979/commits/39d2014cf842a4df2ecf8da4b230155b7a9618f1)
:D
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]