diff --git a/packages/nc-gui/components/webhook/Editor.vue b/packages/nc-gui/components/webhook/Editor.vue index c79cf2e85f..27b7c2dc8a 100644 --- a/packages/nc-gui/components/webhook/Editor.vue +++ b/packages/nc-gui/components/webhook/Editor.vue @@ -79,7 +79,7 @@ let hookRef = reactive< const isBodyShownEasterEgg = ref(false) const isBodyShown = ref(hookRef.version === 'v1' || isEeUI) -const urlTabKey = ref(isBodyShownEasterEgg.value && isBodyShown.value ? 'body' : 'params') +const urlTabKey = ref<'params' | 'headers' | 'body'>('params') const apps: Record = ref() @@ -321,14 +321,6 @@ function setHook(newHook: HookType) { payload: notification.payload, }, }) - if (hookRef.version === 'v1' || isEeUI) { - urlTabKey.value = 'body' - eventList.value = [ - { text: ['After', 'Insert'], value: ['after', 'insert'] }, - { text: ['After', 'Update'], value: ['after', 'update'] }, - { text: ['After', 'Delete'], value: ['after', 'delete'] }, - ] - } } function onEventChange() { @@ -486,6 +478,13 @@ const getDefaultHookName = (hooks: HookType[]) => { return extractNextDefaultName([...hooks.map((el) => el?.title || '')], defaultHookName) } +const handleToggleEasterEgg = () => { + isBodyShownEasterEgg.value = !isBodyShownEasterEgg.value + if (!(isBodyShown.value && isBodyShownEasterEgg.value) && urlTabKey.value === 'body') { + urlTabKey.value = 'params' + } +} + watch( () => hookRef.eventOperation, () => { @@ -592,7 +591,13 @@ onMounted(async () => { class="nc-text-field-hook-event capitalize" dropdown-class-name="nc-dropdown-webhook-event" > - +
{{ event.text.join(' ') }}
{ size="large" class="nc-select-hook-url-method" dropdown-class-name="nc-dropdown-hook-notification-url-method" - @dblclick="isBodyShownEasterEgg = !isBodyShownEasterEgg" + @dblclick="handleToggleEasterEgg" >
@@ -687,6 +692,14 @@ onMounted(async () => { + + + + + + + + { /> - - - - - - - -