You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ar...@apache.org on 2024/02/13 17:35:39 UTC

(superset) branch master updated: chore(plugins): Update dropdown control for BigNumber with Time Comparison range (#27090)

This is an automated email from the ASF dual-hosted git repository.

arivero pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new a912fafb6d chore(plugins): Update dropdown control for BigNumber with Time Comparison range (#27090)
a912fafb6d is described below

commit a912fafb6d592703c5b66f59be180220329ab9c4
Author: Antonio Rivero <38...@users.noreply.github.com>
AuthorDate: Tue Feb 13 18:35:31 2024 +0100

    chore(plugins): Update dropdown control for BigNumber with Time Comparison range (#27090)
---
 .../src/plugin/controlPanel.ts                               | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/superset-frontend/plugins/plugin-chart-period-over-period-kpi/src/plugin/controlPanel.ts b/superset-frontend/plugins/plugin-chart-period-over-period-kpi/src/plugin/controlPanel.ts
index 3d2504f639..8f16a2b8d4 100644
--- a/superset-frontend/plugins/plugin-chart-period-over-period-kpi/src/plugin/controlPanel.ts
+++ b/superset-frontend/plugins/plugin-chart-period-over-period-kpi/src/plugin/controlPanel.ts
@@ -61,15 +61,21 @@ const config: ControlPanelConfig = {
             config: {
               type: 'SelectControl',
               label: t('Range for Comparison'),
-              default: 'y',
+              default: 'r',
               choices: [
+                ['r', 'Inherit range from time filters'],
                 ['y', 'Year'],
-                ['w', 'Week'],
                 ['m', 'Month'],
-                ['r', 'Range'],
+                ['w', 'Week'],
                 ['c', 'Custom'],
               ],
               rerender: ['adhoc_custom'],
+              description: t(
+                'Set the time range that will be used for the comparison metrics. ' +
+                  'For example, "Year" will compare to the same dates one year earlier. ' +
+                  'Use "Inherit range from time filters" to shift the comparison time range' +
+                  'by the same length as your time range and use "Custom" to set a custom comparison range.',
+              ),
             },
           },
         ],