Browse Source

feat(gui-v2): add backToList emits in Webhook Editor

pull/2838/head
Wing-Kam Wong 2 years ago
parent
commit
48f41d6515
  1. 17
      packages/nc-gui-v2/components/webhook/Editor.vue

17
packages/nc-gui-v2/components/webhook/Editor.vue

@ -14,6 +14,7 @@ import MdiWhatsAppIcon from '~icons/mdi/whatsapp'
import MdiCellPhoneMessageIcon from '~icons/mdi/cellphone-message' import MdiCellPhoneMessageIcon from '~icons/mdi/cellphone-message'
import MdiGestureDoubleTapIcon from '~icons/mdi/gesture-double-tap' import MdiGestureDoubleTapIcon from '~icons/mdi/gesture-double-tap'
import MdiInformationIcon from '~icons/mdi/information' import MdiInformationIcon from '~icons/mdi/information'
import MdiArrowLeftBoldIcon from '~icons/mdi/arrow-left-bold'
import { fieldRequiredValidator } from '~/utils/validation' import { fieldRequiredValidator } from '~/utils/validation'
import { extractSdkResponseErrorMsg } from '~/utils/errorUtils' import { extractSdkResponseErrorMsg } from '~/utils/errorUtils'
@ -22,6 +23,8 @@ interface Option {
value: string value: string
} }
const emit = defineEmits(['backToList', 'editOrAdd'])
const { $state, $api, $e } = useNuxtApp() const { $state, $api, $e } = useNuxtApp()
const toast = useToast() const toast = useToast()
@ -273,8 +276,12 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="float-left pt-3"> <div class="mb-4">
<a-typography-title class="inline" :level="4">{{ meta.title }} : Webhooks </a-typography-title> <div class="float-left mt-2">
<div class="flex items-center">
<MdiArrowLeftBoldIcon class="mr-3 text-xl cursor-pointer" @click="emit('backToList')" />
<span class="inline text-xl font-bold">{{ meta.title }} : {{ hook.title || 'Webhooks' }} </span>
</div>
</div> </div>
<div class="float-right mb-5"> <div class="float-right mb-5">
<a-button class="mr-3" type="primary" size="large" @click="emit('editOrAdd')"> <a-button class="mr-3" type="primary" size="large" @click="emit('editOrAdd')">
@ -284,14 +291,14 @@ onMounted(() => {
Test Webhook Test Webhook
</div> </div>
</a-button> </a-button>
<a-button class="mt-2" type="primary" size="large" @click="emit('editOrAdd')"> <a-button type="primary" size="large" @click="emit('editOrAdd')">
<div class="flex items-center"> <div class="flex items-center">
<MdiContentSaveIcon class="mr-2" /> <MdiContentSaveIcon class="mr-2" />
<!-- TODO: i18n --> {{ $t('general.save') }}
Save
</div> </div>
</a-button> </a-button>
</div> </div>
</div>
<a-divider /> <a-divider />
<a-form :model="hook" name="create-or-edit-webhook"> <a-form :model="hook" name="create-or-edit-webhook">
<a-form-item> <a-form-item>

Loading…
Cancel
Save