bito-code-review[bot] commented on code in PR #42941:
URL: https://github.com/apache/superset/pull/42941#discussion_r3745422997
##########
superset-frontend/plugins/plugin-chart-country-map/src/controlPanel.ts:
##########
@@ -71,6 +72,36 @@ const config: ControlPanelConfig = {
],
['currency_format'],
['linear_color_scheme'],
+ [
+ {
+ name: 'conditional_formatting',
+ config: {
+ type: 'ConditionalFormattingControl',
+ renderTrigger: true,
+ label: t('Custom conditional formatting'),
+ description: t(
+ 'Apply conditional color formatting to numeric columns',
+ ),
+ shouldMapStateToProps() {
+ return true;
+ },
+ mapStateToProps(_, chart) {
+ const chartStatus = chart?.chartStatus;
+ const columnOptions = [
+ {
+ value: 'metric',
+ label: 'metric',
+ dataType: GenericDataType.Numeric,
+ },
+ ];
+ return {
+ removeIrrelevantConditions: chartStatus === 'success',
+ columnOptions,
+ };
+ },
+ },
+ },
+ ],
Review Comment:
<!-- Bito Reply -->
The suggestion is valid because `ConditionalFormattingControl` explicitly
requires `verboseMap` as a prop. Even if the component handles the absence of
`verboseMap` internally, providing it ensures the control functions as expected
and avoids potential runtime errors or unexpected behavior in the plugin's
configuration.
--
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]