diff --git a/js/modules/Dashboard/Dashboard.js b/js/modules/Dashboard/Dashboard.js index fb96edf1e4b..80fff5f542d 100644 --- a/js/modules/Dashboard/Dashboard.js +++ b/js/modules/Dashboard/Dashboard.js @@ -566,8 +566,10 @@ class GLPIDashboard { // prepare options form_data.card_options.color = form_data.color || null; form_data.card_options.widgettype = form_data.widgettype || null; + form_data.card_options.palette = form_data.palette || null; form_data.card_options.use_gradient = form_data.use_gradient || 0; form_data.card_options.point_labels = form_data.point_labels || 0; + form_data.card_options.legend = form_data.legend || 0; form_data.card_options.limit = form_data.limit || 7; // specific case for markdown diff --git a/tests/js/modules/Dashboard/Dashboard.test.js b/tests/js/modules/Dashboard/Dashboard.test.js index 0e4136c1094..690c63c06bb 100644 --- a/tests/js/modules/Dashboard/Dashboard.test.js +++ b/tests/js/modules/Dashboard/Dashboard.test.js @@ -155,8 +155,10 @@ describe('Dashboard', () => { card_options: { color: null, widgettype: null, + palette: null, use_gradient: 0, point_labels: 0, + legend: 0, limit: 7, card_id: undefined, gridstack_id: 'undefined_12345678-1234-1234-1234-123456789012', @@ -193,8 +195,10 @@ describe('Dashboard', () => { return [ {name: 'color', value: '#ff00ff'}, {name: 'widgettype', value: 'testWidget'}, + {name: 'palette', value: 'testPalette'}, {name: 'use_gradient', value: 1}, {name: 'point_labels', value: 1}, + {name: 'legend', value: 1}, {name: 'limit', value: 10}, {name: 'card_id', value: 'mycard'}, ]; @@ -207,8 +211,10 @@ describe('Dashboard', () => { card_id: 'mycard', color: '#ff00ff', widgettype: 'testWidget', + palette: 'testPalette', use_gradient: 1, point_labels: 1, + legend: 1, limit: 10, gridstack_id: 'mycard_12345678-1234-1234-1234-123456789012', force: true, @@ -217,8 +223,10 @@ describe('Dashboard', () => { // TODO These duplicated values probably shouldn't be here color: '#ff00ff', widgettype: 'testWidget', + palette: 'testPalette', use_gradient: 1, point_labels: 1, + legend: 1, limit: 10, gridstack_id: 'mycard_12345678-1234-1234-1234-123456789012', }); @@ -336,8 +344,10 @@ describe('Dashboard', () => { args: { color: null, widgettype: null, + palette: null, use_gradient: 0, point_labels: 0, + legend: 0, limit: 7, card_id: undefined, gridstack_id: 'undefined_12345678-1234-1234-1234-123456789012',