Browse Source

wip(gui-v2): submit callback issue

pull/3030/head
Wing-Kam Wong 2 years ago
parent
commit
8fc1863b11
  1. 4
      packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue
  2. 4
      packages/nc-gui-v2/components/smartsheet/Form.vue

4
packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue

@ -45,12 +45,12 @@ const reloadMeta = async () => {
} }
async function handleSubmit() { async function handleSubmit() {
// FIXME: emit only works when putting before addOrUpdate
await addOrUpdate(async () => { await addOrUpdate(async () => {
await reloadMeta() await reloadMeta()
// FIXME: emit not working
await emit('submit')
advancedOptions.value = false advancedOptions.value = false
}) })
emit('submit')
} }
// create column meta if it's a new column // create column meta if it's a new column

4
packages/nc-gui-v2/components/smartsheet/Form.vue

@ -279,6 +279,7 @@ function onEmailChange() {
} }
async function submitCallback() { async function submitCallback() {
console.log("submitCallback")
await loadFormView() await loadFormView()
setFormData() setFormData()
showColumnDropdown.value = false showColumnDropdown.value = false
@ -408,12 +409,9 @@ onMounted(async () => {
{{ $t('activity.addField') }} {{ $t('activity.addField') }}
</div> </div>
</a-button> </a-button>
<!-- TODO #1: make the component out of sidebar -->
<!-- TODO #2: reload view -->
<SmartsheetColumnEditOrAdd <SmartsheetColumnEditOrAdd
v-if="showColumnDropdown" v-if="showColumnDropdown"
ref="editOrAddRef" ref="editOrAddRef"
@click.stop
@submit="submitCallback" @submit="submitCallback"
@cancel="showColumnDropdown = false" @cancel="showColumnDropdown = false"
/> />

Loading…
Cancel
Save