From 8f5f71cbbbfb117fd83e2498cf55722675bae057 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Tue, 26 Jul 2022 22:07:23 +0800 Subject: [PATCH] feat(gui-v2): render webhook form input --- .../nc-gui-v2/components/webhook/Editor.vue | 143 +++++++++++++++++- 1 file changed, 136 insertions(+), 7 deletions(-) diff --git a/packages/nc-gui-v2/components/webhook/Editor.vue b/packages/nc-gui-v2/components/webhook/Editor.vue index 5ed73d8643..1af6f9e539 100644 --- a/packages/nc-gui-v2/components/webhook/Editor.vue +++ b/packages/nc-gui-v2/components/webhook/Editor.vue @@ -18,6 +18,104 @@ const formState = reactive({ method: 'GET', }) +const formInput = ref({ + 'Email': [ + { + key: 'to', + label: 'To Address', + placeholder: 'To Address', + type: 'SingleLineText', + required: true, + }, + { + key: 'subject', + label: 'Subject', + placeholder: 'Subject', + type: 'SingleLineText', + required: true, + }, + { + key: 'body', + label: 'Body', + placeholder: 'Body', + type: 'LongText', + required: true, + }, + ], + 'Slack': [ + { + key: 'body', + label: 'Body', + placeholder: 'Body', + type: 'LongText', + required: true, + }, + ], + 'Microsoft Teams': [ + { + key: 'body', + label: 'Body', + placeholder: 'Body', + type: 'LongText', + required: true, + }, + ], + 'Discord': [ + { + key: 'body', + label: 'Body', + placeholder: 'Body', + type: 'LongText', + required: true, + }, + ], + 'Mattermost': [ + { + key: 'body', + label: 'Body', + placeholder: 'Body', + type: 'LongText', + required: true, + }, + ], + 'Twilio': [ + { + key: 'body', + label: 'Body', + placeholder: 'Body', + type: 'LongText', + required: true, + }, + { + key: 'to', + label: 'Comma separated Mobile #', + placeholder: 'Comma separated Mobile #', + type: 'LongText', + required: true, + }, + ], + 'Whatsapp Twilio': [ + { + key: 'body', + label: 'Body', + placeholder: 'Body', + type: 'LongText', + required: true, + }, + { + key: 'to', + label: 'Comma separated Mobile #', + placeholder: 'Comma separated Mobile #', + type: 'LongText', + required: true, + }, + ], +}) +const notification = ref({ + method: 'POST', + body: '{{ json data }}', +}) + const eventList = ref([ { title: 'After Insert', @@ -63,6 +161,10 @@ const validators = computed(() => { }) const { resetFields, validate, validateInfos } = useForm(formState, validators) +function onNotTypeChange() { + // TODO +} + onMounted(() => { loadViews() }) @@ -94,7 +196,7 @@ onMounted(() => { - + @@ -104,9 +206,14 @@ onMounted(() => { - - {{ - notification.type + + {{ + notificationOption.type }} @@ -119,15 +226,37 @@ onMounted(() => { - + + + - TODO: Slack TODO: Microsoft Teams TODO: Discord TODO: Mattermost - + + + + + + + + + +