Browse Source

feat(gui-v2): add column filter to webhook & tooltip

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

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

@ -13,6 +13,8 @@ import MdiDiscordIcon from '~icons/mdi/discord'
import MdiChatIcon from '~icons/mdi/chat' import MdiChatIcon from '~icons/mdi/chat'
import MdiWhatsAppIcon from '~icons/mdi/whatsapp' 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 MdiInformationIcon from '~icons/mdi/information'
import { fieldRequiredValidator } from '~/utils/validation' import { fieldRequiredValidator } from '~/utils/validation'
interface Option { interface Option {
@ -211,7 +213,7 @@ onMounted(() => {
<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')">
<div class="flex items-center"> <div class="flex items-center">
<MdiContentSaveIcon class="mr-2" /> <MdiGestureDoubleTapIcon class="mr-2" />
<!-- TODO: i18n --> <!-- TODO: i18n -->
Test Webhook Test Webhook
</div> </div>
@ -333,7 +335,7 @@ onMounted(() => {
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row v-if="formInput[formState.notification.type] && notification" class="mb-5" type="flex"> <a-row v-if="formInput[formState.notification.type] && notification" type="flex">
<a-col v-for="(input, i) in formInput[formState.notification.type]" :key="i" :span="24"> <a-col v-for="(input, i) in formInput[formState.notification.type]" :key="i" :span="24">
<a-form-item v-if="input.type === 'LongText'"> <a-form-item v-if="input.type === 'LongText'">
<!-- TODO: add validator --> <!-- TODO: add validator -->
@ -345,25 +347,34 @@ onMounted(() => {
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<!-- TODO: handle column filter --> <a-row class="mb-5" type="flex">
<div> <a-col :span="24">
<span class="caption grey--text"> <a-checkbox v-model:checked="formState.condition">On Condition</a-checkbox>
<SmartsheetToolbarColumnFilter v-if="formState.condition" />
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<div class="text-gray-600">
<em>Available context variables are <strong>data and user</strong></em> <em>Available context variables are <strong>data and user</strong></em>
<v-tooltip top>
<template #activator="{ on }"> <a-tooltip bottom>
<v-icon small color="grey" class="ml-2" v-on="on">mdi-information</v-icon> <template #title>
</template> <span>
<span class="caption">
<strong>data</strong> : Row data <br /> <strong>data</strong> : Row data <br />
<strong>user</strong> : User information<br /> <strong>user</strong> : User information<br />
</span> </span>
</v-tooltip> </template>
<br /> <MdiInformationIcon class="ml-2" />
</a-tooltip>
<div class="mt-3">
<a href="https://docs.nocodb.com/developer-resources/webhooks/" target="_blank"> <a href="https://docs.nocodb.com/developer-resources/webhooks/" target="_blank">
<!-- Document Reference --> <!-- Document Reference -->
{{ $t('labels.docReference') }} {{ $t('labels.docReference') }}
</a> </a>
</span> </div>
</div>
<WebhookTest <WebhookTest
:hook="{ :hook="{
...formState, ...formState,
@ -374,7 +385,8 @@ onMounted(() => {
}, },
}" }"
/> />
</div> </a-col>
</a-row>
</a-form-item> </a-form-item>
</a-form> </a-form>
</template> </template>

Loading…
Cancel
Save