eschutho commented on code in PR #34526:
URL: https://github.com/apache/superset/pull/34526#discussion_r2268364830


##########
superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx:
##########
@@ -473,3 +473,218 @@ export default {
   sort_by_metric,
   order_by_cols,
 };
+
+// dynamically add matrixify controls
+['columns', 'rows'].forEach(axisParam => {
+  const axis = axisParam; // Capture the value in a local variable
+  sharedControls[`matrixify_mode_${axis}`] = {
+    type: 'RadioButtonControl',
+    label: t(`Metrics / Dimensions`),
+    default: 'metrics',
+    options: [
+      ['metrics', t('Metrics')],
+      ['dimensions', t('Dimension Members')],
+    ],
+    renderTrigger: true,
+  };
+
+  sharedControls[`matrixify_${axis}`] = {
+    ...dndAdhocMetricControl,
+    label: t(`Metrics`),
+    multi: true,
+    validators: [], // Not required
+    // description: t(`Select metrics for ${axis}`),
+    renderTrigger: true,
+    visibility: ({ controls }) =>
+      controls?.[`matrixify_mode_${axis}`]?.value === 'metrics',
+  };
+
+  // Combined dimension and values control
+  sharedControls[`matrixify_dimension_${axis}`] = {
+    type: 'MatrixifyDimensionControl',
+    label: t(`Dimension Selection`),

Review Comment:
   Should we use sentence cas e here?



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