Migrating NVD3 Area's stacked_style config (#9454)

* Migrating NVD3 Area's stacked_style config

* test mods

* lint

* nonsense change

* undoing nonsense. Come on GitHub, WORK.
This commit is contained in:
Evan Rusackas 2020-04-03 12:50:28 -07:00 committed by GitHub
parent cd572334c9
commit 265a2feb29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 17 deletions

View File

@ -1174,7 +1174,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_ | |

View File

@ -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: '',
},
},
],
],
},
],
@ -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);
});

View File

@ -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'],
],

View File

@ -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'),