From 2f7e965837f709de8d8e942b8b5890fd83f50a5c Mon Sep 17 00:00:00 2001
From: Petr Stribny <petr@stribny.name>
Date: Wed, 12 Mar 2025 03:50:00 +0100
Subject: [PATCH] Don't reset grouped aggregate form if the selected table is
 the same one

---
 .../GroupedAggregateRowsDataSourceForm.vue     | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/enterprise/web-frontend/modules/baserow_enterprise/dashboard/components/data_source/GroupedAggregateRowsDataSourceForm.vue b/enterprise/web-frontend/modules/baserow_enterprise/dashboard/components/data_source/GroupedAggregateRowsDataSourceForm.vue
index 8bad8fe41..8f35f6e91 100644
--- a/enterprise/web-frontend/modules/baserow_enterprise/dashboard/components/data_source/GroupedAggregateRowsDataSourceForm.vue
+++ b/enterprise/web-frontend/modules/baserow_enterprise/dashboard/components/data_source/GroupedAggregateRowsDataSourceForm.vue
@@ -323,14 +323,16 @@ export default {
       return aggType.getName()
     },
     changeTableId(tableId) {
-      this.values.table_id = tableId
-      this.values.view_id = null
-      this.values.aggregation_series = [
-        { field_id: null, aggregation_type: '' },
-      ]
-      this.values.aggregation_group_bys = []
-      this.values.aggregation_sorts = []
-      this.v$.values.table_id.$touch()
+      if (this.values.table_id !== tableId) {
+        this.values.table_id = tableId
+        this.values.view_id = null
+        this.values.aggregation_series = [
+          { field_id: null, aggregation_type: '' },
+        ]
+        this.values.aggregation_group_bys = []
+        this.values.aggregation_sorts = []
+        this.v$.values.table_id.$touch()
+      }
     },
     async addSeries() {
       this.setEmitValues(false)