mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Fix out of sync GROUP DATA and X Axis options when table change
Summary: Fix this issue: When using “Change Widget” for a chart of a summary table, if I change group-by columns, the X-Axis dropdown becomes empty, and lists values from previous summary (not the actual summary table that’s now shown in the chart). Need to close and reopen creator panel to fix it. Test Plan: Include nbrowser test Reviewers: georgegevoian Differential Revision: https://phab.getgrist.com/D3284
This commit is contained in:
parent
3445ecb64c
commit
c2070877b6
@ -470,11 +470,13 @@ export class ChartConfig extends GrainJSDisposable {
|
|||||||
})
|
})
|
||||||
.onWrite((colId) => this._setXAxis(colId));
|
.onWrite((colId) => this._setXAxis(colId));
|
||||||
|
|
||||||
|
private _columns = Computed.create(this, (use) => use(use(use(this._section.table).columns).getObservable()));
|
||||||
|
|
||||||
// The list of available columns for the group data picker. Picking the actual x-axis is not
|
// The list of available columns for the group data picker. Picking the actual x-axis is not
|
||||||
// permitted.
|
// permitted.
|
||||||
private _groupDataOptions = Computed.create<Array<IOption<number>>>(this, (use) => [
|
private _groupDataOptions = Computed.create<Array<IOption<number>>>(this, (use) => [
|
||||||
{value: -1, label: 'Pick a column'},
|
{value: -1, label: 'Pick a column'},
|
||||||
...this._section.table().columns().peek()
|
...use(this._columns)
|
||||||
// filter out hidden column (ie: manualsort ...) and the one selected for x axis
|
// filter out hidden column (ie: manualsort ...) and the one selected for x axis
|
||||||
.filter((col) => !col.isHiddenCol.peek() && (col.getRowId() !== use(this._xAxis)))
|
.filter((col) => !col.isHiddenCol.peek() && (col.getRowId() !== use(this._xAxis)))
|
||||||
.map((col) => ({
|
.map((col) => ({
|
||||||
@ -600,11 +602,11 @@ export class ChartConfig extends GrainJSDisposable {
|
|||||||
cssLabel(dom.text(this._firstFieldLabel), testId('first-field-label')),
|
cssLabel(dom.text(this._firstFieldLabel), testId('first-field-label')),
|
||||||
cssRow(
|
cssRow(
|
||||||
select(
|
select(
|
||||||
this._xAxis, this._section.table().columns().peek()
|
this._xAxis, Computed.create(this, (use) => use(this._columns)
|
||||||
.filter((col) => !col.isHiddenCol.peek())
|
.filter((col) => !col.isHiddenCol.peek())
|
||||||
.map((col) => ({
|
.map((col) => ({
|
||||||
value: col.getRowId(), label: col.label.peek(), icon: 'FieldColumn',
|
value: col.getRowId(), label: col.label.peek(), icon: 'FieldColumn',
|
||||||
}))
|
})))
|
||||||
),
|
),
|
||||||
testId('x-axis'),
|
testId('x-axis'),
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user