Skip to content

Commit

Permalink
Merge pull request #850 from Antonio-RiveroMartnez/feature_flag_pop_kpi
Browse files Browse the repository at this point in the history
chore(plugins): Add Feature Flag so experimental Plugins are only available when set to True
  • Loading branch information
eschutho authored Jan 30, 2024
2 parents d93f56e + a0b610c commit 4540b85
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions RESOURCES/FEATURE_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ These features are considered **unfinished** and should only be used on developm
- PRESTO_EXPAND_DATA
- SHARE_QUERIES_VIA_KV_STORE
- TAGGING_SYSTEM
- CHART_PLUGINS_EXPERIMENTAL

## In Testing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export enum FeatureFlag {
ALERT_REPORTS = 'ALERT_REPORTS',
ALLOW_FULL_CSV_EXPORT = 'ALLOW_FULL_CSV_EXPORT',
AVOID_COLORS_COLLISION = 'AVOID_COLORS_COLLISION',
CHART_PLUGINS_EXPERIMENTAL = 'CHART_PLUGINS_EXPERIMENTAL',
CONFIRM_DASHBOARD_DIFF = 'CONFIRM_DASHBOARD_DIFF',
/** @deprecated */
DASHBOARD_CROSS_FILTERS = 'DASHBOARD_CROSS_FILTERS',
Expand Down
10 changes: 8 additions & 2 deletions superset-frontend/src/visualizations/presets/MainPreset.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { Preset } from '@superset-ui/core';
import { isFeatureEnabled, FeatureFlag, Preset } from '@superset-ui/core';
import CalendarChartPlugin from '@superset-ui/legacy-plugin-chart-calendar';
import ChordChartPlugin from '@superset-ui/legacy-plugin-chart-chord';
import CountryMapChartPlugin from '@superset-ui/legacy-plugin-chart-country-map';
Expand Down Expand Up @@ -81,6 +81,12 @@ import TimeTableChartPlugin from '../TimeTable';

export default class MainPreset extends Preset {
constructor() {
const experimentalPlugins = isFeatureEnabled(
FeatureFlag.CHART_PLUGINS_EXPERIMENTAL,
)
? [new PopKPIPlugin().configure({ key: 'pop_kpi' })]
: [];

super({
name: 'Legacy charts',
presets: [new DeckGLChartPreset()],
Expand Down Expand Up @@ -156,7 +162,7 @@ export default class MainPreset extends Preset {
new EchartsSunburstChartPlugin().configure({ key: 'sunburst_v2' }),
new HandlebarsChartPlugin().configure({ key: 'handlebars' }),
new EchartsBubbleChartPlugin().configure({ key: 'bubble_v2' }),
new PopKPIPlugin().configure({ key: 'pop_kpi' }),
...experimentalPlugins,
],
});
}
Expand Down
2 changes: 2 additions & 0 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,8 @@ class D3Format(TypedDict, total=False):
# Unlike Selenium, Playwright reports support deck.gl visualizations
# Enabling this feature flag requires installing "playwright" pip package
"PLAYWRIGHT_REPORTS_AND_THUMBNAILS": False,
# Set to True to enable experimental chart plugins
"CHART_PLUGINS_EXPERIMENTAL": False,
}

# ------------------------------
Expand Down

0 comments on commit 4540b85

Please sign in to comment.