diff --git a/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.js b/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.js index 4a43d9bd310150401e542e7666aed5a5f4dc3d37..1024c7f5c5896664394fdcca9e55b44318d3df06 100644 --- a/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.js +++ b/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.js @@ -6575,7 +6575,7 @@ return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(32 /* CommandResult.InvalidLabelRange */)); } onUpdateDataSetsHaveTitle(ev) { - this.props.updateChart({ + this.props.updateChart(this.props.figureId, { dataSetsHaveTitle: ev.target.checked, }); } @@ -6587,7 +6587,7 @@ this.dataSeriesRanges = ranges; } onDataSeriesConfirmed() { - this.state.datasetDispatchResult = this.props.updateChart({ + this.state.datasetDispatchResult = this.props.updateChart(this.props.figureId, { dataSets: this.dataSeriesRanges, }); } @@ -6599,7 +6599,7 @@ this.labelRange = ranges[0]; } onLabelRangeConfirmed() { - this.state.labelsDispatchResult = this.props.updateChart({ + this.state.labelsDispatchResult = this.props.updateChart(this.props.figureId, { labelRange: this.labelRange, }); } @@ -6609,7 +6609,7 @@ class BarConfigPanel extends LineBarPieConfigPanel { onUpdateStacked(ev) { - this.props.updateChart({ + this.props.updateChart(this.props.figureId, { stacked: ev.target.checked, }); } @@ -8357,6 +8357,18 @@ grid-template-columns: repeat(${ITEMS_PER_LINE}, 1fr); grid-gap: ${ITEM_HORIZONTAL_MARGIN * 2}px; } + .o-color-picker-toggler { + display: flex; + .o-color-picker-toggler-sign { + margin: auto auto; + width: 55%; + height: 55%; + .o-icon { + width: 100%; + height: 100%; + } + } + } .o-color-picker-line-item { width: ${ITEM_EDGE_LENGTH}px; height: ${ITEM_EDGE_LENGTH}px; @@ -8573,17 +8585,17 @@ this.state.fillColorTool = !this.state.fillColorTool; } updateBackgroundColor(color) { - this.props.updateChart({ + this.props.updateChart(this.props.figureId, { background: color, }); } updateTitle(ev) { - this.props.updateChart({ + this.props.updateChart(this.props.figureId, { title: ev.target.value, }); } updateSelect(attr, ev) { - this.props.updateChart({ + this.props.updateChart(this.props.figureId, { [attr]: ev.target.value, }); } @@ -8616,7 +8628,7 @@ this.dataRange = ranges[0]; } updateDataRange() { - this.state.dataRangeDispatchResult = this.props.updateChart({ + this.state.dataRangeDispatchResult = this.props.updateChart(this.props.figureId, { dataRange: this.dataRange, }); } @@ -8686,12 +8698,12 @@ } updateBackgroundColor(color) { this.state.openedMenu = undefined; - this.props.updateChart({ + this.props.updateChart(this.props.figureId, { background: color, }); } updateTitle(ev) { - this.props.updateChart({ + this.props.updateChart(this.props.figureId, { title: ev.target.value, }); } @@ -8760,7 +8772,7 @@ } } updateSectionRule(sectionRule) { - this.state.sectionRuleDispatchResult = this.props.updateChart({ + this.state.sectionRuleDispatchResult = this.props.updateChart(this.props.figureId, { sectionRule, }); } @@ -8780,12 +8792,12 @@ return false; } onUpdateLabelsAsText(ev) { - this.props.updateChart({ + this.props.updateChart(this.props.figureId, { labelsAsText: ev.target.checked, }); } onUpdateStacked(ev) { - this.props.updateChart({ + this.props.updateChart(this.props.figureId, { stacked: ev.target.checked, }); } @@ -8826,7 +8838,7 @@ this.keyValue = ranges[0]; } updateKeyValueRange() { - this.state.keyValueDispatchResult = this.props.updateChart({ + this.state.keyValueDispatchResult = this.props.updateChart(this.props.figureId, { keyValue: this.keyValue, }); } @@ -8834,12 +8846,12 @@ this.baseline = ranges[0]; } updateBaselineRange() { - this.state.baselineDispatchResult = this.props.updateChart({ + this.state.baselineDispatchResult = this.props.updateChart(this.props.figureId, { baseline: this.baseline, }); } updateBaselineMode(ev) { - this.props.updateChart({ baselineMode: ev.target.value }); + this.props.updateChart(this.props.figureId, { baselineMode: ev.target.value }); } } ScorecardChartConfigPanel.template = "o-spreadsheet-ScorecardChartConfigPanel"; @@ -8859,12 +8871,12 @@ owl.useExternalListener(window, "click", this.onClick); } updateTitle(ev) { - this.props.updateChart({ + this.props.updateChart(this.props.figureId, { title: ev.target.value, }); } updateBaselineDescr(ev) { - this.props.updateChart({ baselineDescr: ev.target.value }); + this.props.updateChart(this.props.figureId, { baselineDescr: ev.target.value }); } openColorPicker(colorPickerId) { this.state.openedColorPicker = colorPickerId; @@ -8872,13 +8884,13 @@ setColor(color, colorPickerId) { switch (colorPickerId) { case "backgroundColor": - this.props.updateChart({ background: color }); + this.props.updateChart(this.props.figureId, { background: color }); break; case "baselineColorDown": - this.props.updateChart({ baselineColorDown: color }); + this.props.updateChart(this.props.figureId, { baselineColorDown: color }); break; case "baselineColorUp": - this.props.updateChart({ baselineColorUp: color }); + this.props.updateChart(this.props.figureId, { baselineColorUp: color }); break; } this.state.openedColorPicker = undefined; @@ -8942,16 +8954,9 @@ } `; class ChartPanel extends owl.Component { - constructor() { - super(...arguments); - this.shouldUpdateChart = true; - } get figureId() { return this.state.figureId; } - get sheetId() { - return this.state.sheetId; - } setup() { const selectedFigureId = this.env.model.getters.getSelectedFigureId(); if (!selectedFigureId) { @@ -8960,17 +8965,11 @@ this.state = owl.useState({ panel: "configuration", figureId: selectedFigureId, - sheetId: this.env.model.getters.getActiveSheetId(), }); owl.onWillUpdateProps(() => { const selectedFigureId = this.env.model.getters.getSelectedFigureId(); if (selectedFigureId && selectedFigureId !== this.state.figureId) { this.state.figureId = selectedFigureId; - this.state.sheetId = this.env.model.getters.getActiveSheetId(); - this.shouldUpdateChart = false; - } - else { - this.shouldUpdateChart = true; } if (!this.env.model.getters.isChartDefined(this.figureId)) { this.props.onCloseSidePanel(); @@ -8978,8 +8977,8 @@ } }); } - updateChart(updateDefinition) { - if (!this.shouldUpdateChart) { + updateChart(figureId, updateDefinition) { + if (figureId !== this.figureId) { return; } const definition = { @@ -8988,8 +8987,8 @@ }; return this.env.model.dispatch("UPDATE_CHART", { definition, - id: this.figureId, - sheetId: this.sheetId, + id: figureId, + sheetId: this.env.model.getters.getFigureSheetId(figureId), }); } onTypeChange(type) { @@ -9001,7 +9000,7 @@ this.env.model.dispatch("UPDATE_CHART", { definition, id: this.figureId, - sheetId: this.sheetId, + sheetId: this.env.model.getters.getFigureSheetId(this.figureId), }); } get chartPanel() { @@ -42802,9 +42801,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A Object.defineProperty(exports, '__esModule', { value: true }); - __info__.version = '16.0.10'; - __info__.date = '2023-05-12T11:48:50.641Z'; - __info__.hash = '115eda7'; + __info__.version = '16.0.11'; + __info__.date = '2023-05-25T13:09:25.316Z'; + __info__.hash = 'd27e998'; })(this.o_spreadsheet = this.o_spreadsheet || {}, owl); diff --git a/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.xml b/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.xml index 87b8891aef6a0f57f30464db2f924f5da14f65e4..b24a61de17145ebf624d06eeb2b3b9a0b57dbcb6 100644 --- a/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.xml +++ b/addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.xml @@ -106,7 +106,9 @@ <div class="o-color-picker-toggler o-color-picker-line-item" t-on-click.stop="toggleColorPicker"> - <div align="center">+</div> + <div class="o-color-picker-toggler-sign"> + <t t-call="o-spreadsheet-Icon.PLUS"/> + </div> </div> <div t-foreach="env.model.getters.getCustomColors()" @@ -1176,11 +1178,8 @@ </t> <t t-name="o-spreadsheet-Icon.PLUS" owl="1"> - <svg class="o-icon"> - <path - fill="#000000" - d="M8,0 L10,0 L10,8 L18,8 L18,10 L10,10 L10,18 L8,18 L8,10 L0,10 L0,8 L8,8" - /> + <svg class="o-icon" viewBox="0 0 18 18"> + <path d="M8,0 L10,0 L10,8 L18,8 L18,10 L10,10 L10,18 L8,18 L8,10 L0,10 L0,8 L8,8"/> </svg> </t> <t t-name="o-spreadsheet-Icon.LIST" owl="1"> @@ -3249,7 +3248,7 @@ </t> </odoo> <!-- - __info__.version = '16.0.10'; - __info__.date = '2023-05-12T11:48:53.692Z'; - __info__.hash = '115eda7'; + __info__.version = '16.0.11'; + __info__.date = '2023-05-25T13:09:28.186Z'; + __info__.hash = 'd27e998'; -->