Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating NVD3 Area's stacked_style config #9454

Merged
merged 5 commits into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@ Note the `y_axis_format` is defined under various section for some charts.
| `show_values` | _N/A_ | |
| `slice_name` | _N/A_ | |
| `spatial` | _N/A_ | |
| `stacked_style` | _N/A_ | |
| `start_spatial` | _N/A_ | |
| `stroke_color_picker` | _N/A_ | |
| `stroke_width` | _N/A_ | |
Expand Down
26 changes: 24 additions & 2 deletions superset-frontend/spec/javascripts/explore/controlUtils_spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@ describe('controlUtils', () => {
},
},
],
[
{
name: 'stacked_style',
config: {
type: 'SelectControl',
label: t('Stacked Style'),
renderTrigger: true,
choices: [
['stack', 'stack'],
['stream', 'stream'],
['expand', 'expand'],
],
default: 'stack',
description: '',
},
},
],
],
},
],
Expand Down Expand Up @@ -148,10 +165,15 @@ describe('controlUtils', () => {
});

it('removes missing/invalid choice', () => {
let control = getControlState('stacked_style', 'area', state, 'stack');
let control = getControlState(
'stacked_style',
'test-chart',
state,
'stack',
);
expect(control.value).toBe('stack');

control = getControlState('stacked_style', 'area', state, 'FOO');
control = getControlState('stacked_style', 'test-chart', state, 'FOO');
expect(control.value).toBe(null);
});

Expand Down
19 changes: 18 additions & 1 deletion superset-frontend/src/explore/controlPanels/Area.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,24 @@ export default {
expanded: true,
controlSetRows: [
['show_brush', 'show_legend'],
['line_interpolation', 'stacked_style'],
[
'line_interpolation',
{
name: 'stacked_style',
config: {
type: 'SelectControl',
label: t('Stacked Style'),
renderTrigger: true,
choices: [
['stack', 'stack'],
['stream', 'stream'],
['expand', 'expand'],
],
default: 'stack',
description: '',
},
},
],
['color_scheme', 'label_colors'],
['rich_tooltip', 'show_controls'],
],
Expand Down
13 changes: 0 additions & 13 deletions superset-frontend/src/explore/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,19 +338,6 @@ export const controls = {
description: t('Choose a metric for right axis'),
},

stacked_style: {
type: 'SelectControl',
label: t('Stacked Style'),
renderTrigger: true,
choices: [
['stack', 'stack'],
['stream', 'stream'],
['expand', 'expand'],
],
default: 'stack',
description: '',
},

linear_color_scheme: {
type: 'ColorSchemeControl',
label: t('Linear Color Scheme'),
Expand Down