feat: allow modifying custom sync

This commit is contained in:
mertmit
2025-07-29 06:41:04 +00:00
committed by Fendy Heryanto
parent b7501e295a
commit 6c0b4faa0c
7 changed files with 129 additions and 49 deletions

View File

@@ -2,6 +2,7 @@
const {
formState,
syncConfigForm,
syncConfigEditForm,
selectedIntegrationIndex,
deleteSync,
changeIntegration,
@@ -13,6 +14,17 @@ const {
const { t } = useI18n()
const destinationSchemaModalVisible = ref(false)
const onUpdateSync = async () => {
if (syncConfigEditForm.value?.sync_category === 'custom') {
destinationSchemaModalVisible.value = true
return
}
await updateSync()
}
const onDeleteSync = async () => {
Modal.confirm({
title: 'Do you want to delete this integration?',
@@ -53,9 +65,29 @@ const onDeleteSync = async () => {
<NcButton class="!px-4" type="danger" size="small" disabled> Delete Integration </NcButton>
</NcTooltip>
<NcButton v-else class="!px-4" type="danger" size="small" @click="onDeleteSync"> Delete Integration </NcButton>
<NcButton class="!px-4" type="primary" size="small" :disabled="!editModeModified" @click="updateSync">
<NcButton
v-if="syncConfigEditForm?.sync_category === 'custom'"
class="!px-4"
type="primary"
size="small"
@click="onUpdateSync"
>
Table Mapping
</NcButton>
<NcButton v-else class="!px-4" type="primary" size="small" :disabled="!editModeModified" @click="onUpdateSync">
Update Integration
</NcButton>
</div>
<GeneralModal
v-if="destinationSchemaModalVisible"
v-model:visible="destinationSchemaModalVisible"
size="large"
:mask-closable="false"
closable
>
<div class="h-[80vh] overflow-y-auto">
<DashboardSettingsSyncDestinationSchema @update:sync="destinationSchemaModalVisible = false" />
</div>
</GeneralModal>
</div>
</template>