diff --git a/packages/nc-gui/components/smartsheet/expanded-form/Header.vue b/packages/nc-gui/components/smartsheet/expanded-form/Header.vue index 8519599e32..9e67e7fb98 100644 --- a/packages/nc-gui/components/smartsheet/expanded-form/Header.vue +++ b/packages/nc-gui/components/smartsheet/expanded-form/Header.vue @@ -25,6 +25,8 @@ const { isUIAllowed } = useUIPermission() const reloadTrigger = inject(ReloadRowDataHookInj, createEventHook()) +const saveRowAndStay = ref(0) + const save = async () => { if (isNew.value) { const data = await _save(state.value) @@ -34,6 +36,9 @@ const save = async () => { await _save() reloadTrigger?.trigger() } + if (!saveRowAndStay.value) { + emit('cancel') + } } // todo: accept as a prop / inject @@ -101,14 +106,39 @@ const copyRecordUrl = () => { - - {{ $t('general.cancel') }} +
+ + + {{ $t('general.cancel') }} +
- - - {{ $t('activity.saveRow') }} - + + +
+ + {{ $t('activity.saveAndExit') }} +
+
+ + {{ $t('activity.saveAndStay') }} +
+