rusackas commented on code in PR #42910:
URL: https://github.com/apache/superset/pull/42910#discussion_r4151734208


##########
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/controlPanel.ts:
##########
@@ -100,21 +125,24 @@ const config: ControlPanelConfig = {
         ],
         [
           {
-            name: 'comparison_color_scheme',
+            name: 'increase_color',

Review Comment:
   Good catch, fixed by migrating comparison_color_scheme into 
increase_color/decrease_color in handleDeprecatedControls so it survives the 
first save instead of vanishing.



##########
superset-frontend/plugins/plugin-chart-echarts/src/Gauge/controlPanel.tsx:
##########
@@ -278,15 +279,26 @@ const config: ControlPanelConfig = {
         ],
         [
           {
-            name: 'interval_color_indices',
+            name: 'interval_colors',
             config: {
-              type: 'TextControl',
+              type: 'IntervalColorsControl',
               label: t('Interval colors'),
               description: t(
-                'Comma-separated color picks for the intervals, e.g. 1,2,4. 
Integers denote colors from the chosen color scheme and are 1-indexed. Length 
must be matching that of interval bounds.',
+                'Pick a color for each interval band defined above by its 
upper bound. Charts saved with the legacy 1-indexed "Interval colors" text 
field are automatically resolved against the chosen color scheme the first time 
this panel is opened.',
               ),
               renderTrigger: true,
-              default: DEFAULT_FORM_DATA.intervalColorIndices,
+              default: DEFAULT_FORM_DATA.intervalColors,
+              shouldMapStateToProps: () => true,
+              mapStateToProps: (state: ControlPanelState) => ({
+                intervals: state?.controls?.intervals?.value as string,
+                // `interval_color_indices` is no longer a registered control
+                // (replaced by this one), so it never appears under
+                // `state.controls`. Read it from the raw persisted

Review Comment:
   Same fix pattern here, migrated interval_color_indices into interval_colors 
in handleDeprecatedControls so it's not just a display-only fallback anymore.



-- 
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]

Reply via email to