ui: change new series default expand state
This commit is contained in:
parent
3a48e061ef
commit
e3f3ccfe63
2 changed files with 3 additions and 1 deletions
|
|
@ -41,6 +41,7 @@ export default observer(WidgetFormNew);
|
|||
|
||||
const FilterSection = observer(({ metric, excludeFilterKeys }: any) => {
|
||||
const defaultClosed = React.useRef(metric.exists())
|
||||
const defaultSeries = React.useRef(metric.series.map(s => s.name))
|
||||
const isTable = metric.metricType === TABLE;
|
||||
const isHeatMap = metric.metricType === HEATMAP;
|
||||
const isFunnel = metric.metricType === FUNNEL;
|
||||
|
|
@ -75,7 +76,7 @@ const FilterSection = observer(({ metric, excludeFilterKeys }: any) => {
|
|||
series={series}
|
||||
onRemoveSeries={() => metric.removeSeries(index)}
|
||||
canDelete={metric.series.length > 1}
|
||||
defaultClosed={defaultClosed.current}
|
||||
defaultClosed={metric.hasChanged ? defaultSeries.current.includes(series.name) : defaultClosed.current}
|
||||
emptyMessage={
|
||||
isTable
|
||||
? 'Filter data using any event or attribute. Use Add Step button below to do so.'
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ export default class Widget {
|
|||
}
|
||||
|
||||
addSeries() {
|
||||
this.hasChanged = true;
|
||||
const series = new FilterSeries();
|
||||
series.name = 'Series ' + (this.series.length + 1);
|
||||
this.series.push(series);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue