diff --git a/packages/nc-gui/components/project/spreadsheet/components/editColumn.vue b/packages/nc-gui/components/project/spreadsheet/components/editColumn.vue
index 640b4faa40..496ac6904e 100644
--- a/packages/nc-gui/components/project/spreadsheet/components/editColumn.vue
+++ b/packages/nc-gui/components/project/spreadsheet/components/editColumn.vue
@@ -567,7 +567,7 @@ export default {
await this.$refs.relation.saveRelation()
}
- this.$emit('saved', this.newColumn._cn)
+ this.$emit('saved', this.newColumn._cn, this.editColumn ? this.meta.columns[this.columnIndex]._cn : null)
} catch (e) {
console.log(e)
}
diff --git a/packages/nc-gui/components/project/spreadsheet/components/editVirtualColumn.vue b/packages/nc-gui/components/project/spreadsheet/components/editVirtualColumn.vue
index fa1dc5bec4..fc5f4f4fa7 100644
--- a/packages/nc-gui/components/project/spreadsheet/components/editVirtualColumn.vue
+++ b/packages/nc-gui/components/project/spreadsheet/components/editVirtualColumn.vue
@@ -106,7 +106,7 @@ export default {
console.log(e)
this.$toast.error('Failed to update column alias').goAway(3000)
}
- this.$emit('saved', this.newColumn._cn)
+ this.$emit('saved', this.newColumn._cn, this.column._cn)
this.$emit('input', false)
},
diff --git a/packages/nc-gui/components/project/spreadsheet/components/headerCell.vue b/packages/nc-gui/components/project/spreadsheet/components/headerCell.vue
index 408fc76684..2b0eb40521 100644
--- a/packages/nc-gui/components/project/spreadsheet/components/headerCell.vue
+++ b/packages/nc-gui/components/project/spreadsheet/components/headerCell.vue
@@ -98,7 +98,7 @@
:column="column"
:column-index="columnIndex"
@onRelationDelete="$emit('onRelationDelete')"
- @saved="$emit('saved')"
+ @saved="(_cn,_cno) => $emit('saved',_cn,_cno)"
@close="editColumnMenu = false"
/>
diff --git a/packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue b/packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue
index b1c5608eea..31c78e1391 100644
--- a/packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue
+++ b/packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue
@@ -623,6 +623,14 @@ export default {
this.$store.commit('windows/MutMiniSponsorCard', Date.now())
},
openCreateViewDlg(type) {
+ const mainView = this.viewsList.find(v => v.type === 'table' || v.type === 'view')
+ try {
+ this.copyViewRef = this.copyViewRef || {
+ query_params: JSON.stringify({
+ fieldsOrder: JSON.parse(mainView.query_params).fieldsOrder
+ })
+ }
+ } catch {}
this.createViewType = type
this.showCreateView = true
},
diff --git a/packages/nc-gui/components/project/spreadsheet/components/virtualHeaderCell.vue b/packages/nc-gui/components/project/spreadsheet/components/virtualHeaderCell.vue
index e8b856a8cf..fd85ad175c 100644
--- a/packages/nc-gui/components/project/spreadsheet/components/virtualHeaderCell.vue
+++ b/packages/nc-gui/components/project/spreadsheet/components/virtualHeaderCell.vue
@@ -46,7 +46,7 @@
({
columnDeleteDialog: false,
editColumnMenu: false,
diff --git a/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue b/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue
index d760716938..d9699da03c 100644
--- a/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue
+++ b/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue
@@ -223,10 +223,10 @@
:style="{height:isForm ? '100%' : 'calc(100% - 36px)'}"
style="overflow: auto;width:100%"
>
-
+
Create Automations or API Webhooks
-
+
-
-1) {
+ this.$set(this.fieldsOrder, i, col)
+ }
+ }
+
+ // load latest table meta
const tableMeta = await this.$store.dispatch('meta/ActLoadMeta', {
env: this.nodes.env,
dbAlias: this.nodes.dbAlias,
tn: this.table,
force: true
})
- this.loadingMeta = false
+
+ // update column visibility
if (updateShowFields) {
try {
const qp = JSON.parse(tableMeta.query_params)
@@ -1082,8 +1092,8 @@ export default {
this.selectedExpandRowIndex = row
this.selectedExpandRowMeta = rowMeta
},
- async onNewColCreation(col) {
- await this.loadMeta(true, col)
+ async onNewColCreation(col, oldCol) {
+ await this.loadMeta(true, col, oldCol)
this.$nextTick(async() => {
await this.loadTableData()
// this.mapFieldsAndShowFields();
diff --git a/packages/nc-gui/components/project/spreadsheet/views/xcGridView.vue b/packages/nc-gui/components/project/spreadsheet/views/xcGridView.vue
index e3f147d46b..1a82dd747f 100644
--- a/packages/nc-gui/components/project/spreadsheet/views/xcGridView.vue
+++ b/packages/nc-gui/components/project/spreadsheet/views/xcGridView.vue
@@ -37,6 +37,7 @@
:sql-ui="sqlUi"
:is-public-view="isPublicView"
:is-locked="isLocked"
+ :is-virtual="isVirtual"
@saved="onNewColCreation"
/>
@@ -464,10 +465,10 @@ export default {
this.selected.col = null
this.selected.row = null
},
- onNewColCreation(col) {
+ onNewColCreation(col, oldCol) {
this.addNewColMenu = false
this.addNewColModal = false
- this.$emit('onNewColCreation', col)
+ this.$emit('onNewColCreation', col, oldCol)
},
expandRow(...args) {
this.$emit('expandRow', ...args)