-
+
+
more...
diff --git a/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue b/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue
index de005cffeb..aa05726fc0 100644
--- a/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue
+++ b/packages/nc-gui-v2/components/virtual-cell/ManyToMany.vue
@@ -4,7 +4,7 @@ import type { Ref } from 'vue'
import ItemChip from './components/ItemChip.vue'
import ListChildItems from './components/ListChildItems.vue'
import ListItems from './components/ListItems.vue'
-import { inject, ref, useProvideLTARStore } from '#imports'
+import { computed, inject, ref, useProvideLTARStore } from '#imports'
import { CellValueInj, ColumnInj, ReloadViewDataHookInj, RowInj } from '~/context'
const column = inject(ColumnInj)!
@@ -26,23 +26,38 @@ const { loadRelatedTableMeta, relatedTablePrimaryValueProp, unlink } = useProvid
)
await loadRelatedTableMeta()
+
+const cells = computed(() =>
+ cellValue.value.reduce((acc: any[], curr: any) => {
+ if (!relatedTablePrimaryValueProp.value) return acc
+
+ const value = curr[relatedTablePrimaryValueProp.value]
+
+ if (!value) return acc
+
+ return [...acc, { value, item: curr }]
+ }, [] as any[]),
+)
diff --git a/packages/nc-gui-v2/components/virtual-cell/components/ListChildItems.vue b/packages/nc-gui-v2/components/virtual-cell/components/ListChildItems.vue
index 8d5a297026..7064741c0a 100644
--- a/packages/nc-gui-v2/components/virtual-cell/components/ListChildItems.vue
+++ b/packages/nc-gui-v2/components/virtual-cell/components/ListChildItems.vue
@@ -41,7 +41,8 @@ const unlinkRow = async (row: Record
) => {
-
+
+
Link to '{{ meta.title }}'
diff --git a/packages/nc-gui-v2/components/webhook/Editor.vue b/packages/nc-gui-v2/components/webhook/Editor.vue
index 1539e62a71..62501ede07 100644
--- a/packages/nc-gui-v2/components/webhook/Editor.vue
+++ b/packages/nc-gui-v2/components/webhook/Editor.vue
@@ -2,20 +2,8 @@
import { Form } from 'ant-design-vue'
import { useToast } from 'vue-toastification'
import { MetaInj } from '~/context'
-import MdiContentSaveIcon from '~icons/mdi/content-save'
-import MdiLinkIcon from '~icons/mdi/link'
-import MdiEmailIcon from '~icons/mdi/email'
-import MdiSlackIcon from '~icons/mdi/slack'
-import MdiMicrosoftTeamsIcon from '~icons/mdi/microsoft-teams'
-import MdiDiscordIcon from '~icons/mdi/discord'
-import MdiChatIcon from '~icons/mdi/chat'
-import MdiWhatsAppIcon from '~icons/mdi/whatsapp'
-import MdiCellPhoneMessageIcon from '~icons/mdi/cellphone-message'
-import MdiGestureDoubleTapIcon from '~icons/mdi/gesture-double-tap'
-import MdiInformationIcon from '~icons/mdi/information'
-import MdiArrowLeftBoldIcon from '~icons/mdi/arrow-left-bold'
-import { fieldRequiredValidator } from '~/utils/validation'
-import { extractSdkResponseErrorMsg } from '~/utils/errorUtils'
+import { extractSdkResponseErrorMsg, fieldRequiredValidator } from '~/utils'
+import { inject, reactive, useApi, useNuxtApp } from '#imports'
interface Option {
label: string
@@ -24,7 +12,9 @@ interface Option {
const emit = defineEmits(['backToList', 'editOrAdd'])
-const { $state, $api, $e } = useNuxtApp()
+const { $e } = useNuxtApp()
+
+const { api, isLoading: loading } = useApi()
const toast = useToast()
@@ -32,12 +22,12 @@ const meta = inject(MetaInj)
const useForm = Form.useForm
-const hook = reactive({
+const hook = reactive>({
id: '',
title: '',
event: '',
operation: '',
- eventOperation: undefined,
+ eventOperation: '',
notification: {
type: 'URL',
payload: {
@@ -45,7 +35,7 @@ const hook = reactive({
body: '{{ json data }}',
headers: [{}],
parameters: [{}],
- } as any,
+ },
},
condition: false,
})
@@ -64,8 +54,6 @@ const discordChannels = ref[]>([])
const mattermostChannels = ref[]>([])
-const loading = ref(false)
-
const filters = ref([])
const formInput = ref({
@@ -218,7 +206,7 @@ const validators = computed(() => {
}),
}
})
-const { resetFields, validate, validateInfos } = useForm(hook, validators)
+const { validate, validateInfos } = useForm(hook, validators)
function onNotTypeChange() {
hook.notification.payload = {} as any
@@ -258,7 +246,7 @@ function setHook(newHook: any) {
}
async function onEventChange() {
- const { notification: { payload = {}, type = {} } = {}, ...rest } = hook
+ const { notification: { payload = {}, type = {} } = {} } = hook
Object.assign(hook, {
...hook,
@@ -305,7 +293,7 @@ async function onEventChange() {
async function loadPluginList() {
try {
- const plugins = (await $api.plugin.list()).list as any
+ const plugins = (await api.plugin.list()).list as any
apps.value = plugins.reduce((o: Record[], p: Record) => {
p.tags = p.tags ? p.tags.split(',') : []
p.parsedInput = p.input && JSON.parse(p.input)
@@ -327,31 +315,30 @@ async function saveHooks() {
await validate()
} catch (_: any) {
toast.error('Invalid Form')
+
loading.value = false
+
return
}
try {
let res
if (hook.id) {
- res = await $api.dbTableWebhook.update(hook.id, {
+ res = await api.dbTableWebhook.update(hook.id, {
...hook,
notification: {
...hook.notification,
payload: hook.notification.payload,
},
- } as any)
+ })
} else {
- res = await $api.dbTableWebhook.create(
- meta?.value.id as string,
- {
- ...hook,
- notification: {
- ...hook.notification,
- payload: hook.notification.payload,
- },
- } as any,
- )
+ res = await api.dbTableWebhook.create(meta!.value.id!, {
+ ...hook,
+ notification: {
+ ...hook.notification,
+ payload: hook.notification.payload,
+ },
+ } as any)
}
if (!hook.id && res) {
@@ -371,6 +358,7 @@ async function saveHooks() {
} finally {
loading.value = false
}
+
$e('a:webhook:add', {
operation: hook.operation,
condition: hook.condition,
@@ -389,7 +377,9 @@ defineExpose({
watch(
() => hook.eventOperation,
- (v) => {
+ () => {
+ if (!hook.eventOperation) return
+
const [event, operation] = hook.eventOperation.split(' ')
hook.event = event
hook.operation = operation
@@ -405,21 +395,21 @@ onMounted(() => {
-
+
{{ meta.title }} : {{ hook.title || 'Webhooks' }}
-
+
Test Webhook
-
+
{{ $t('general.save') }}
@@ -456,14 +446,22 @@ onMounted(() => {
>
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ notificationOption.type }}
@@ -471,17 +469,20 @@ onMounted(() => {
+
{{ method.title }}
+
+
@@ -503,6 +504,7 @@ onMounted(() => {
+
@@ -516,6 +518,7 @@ onMounted(() => {
+
@@ -529,6 +532,7 @@ onMounted(() => {
+
@@ -542,6 +546,7 @@ onMounted(() => {
+
@@ -555,6 +560,7 @@ onMounted(() => {
+
@@ -565,6 +571,7 @@ onMounted(() => {
+
@@ -573,6 +580,7 @@ onMounted(() => {
+
@@ -582,7 +590,7 @@ onMounted(() => {
data : Row data
-
+