Browse Source

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

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

76
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,36 +347,46 @@ 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>
<em>Available context variables are <strong>data and user</strong></em> <SmartsheetToolbarColumnFilter v-if="formState.condition" />
<v-tooltip top> </a-col>
<template #activator="{ on }"> </a-row>
<v-icon small color="grey" class="ml-2" v-on="on">mdi-information</v-icon> <a-row>
</template> <a-col :span="24">
<span class="caption"> <div class="text-gray-600">
<strong>data</strong> : Row data <br /> <em>Available context variables are <strong>data and user</strong></em>
<strong>user</strong> : User information<br />
</span> <a-tooltip bottom>
</v-tooltip> <template #title>
<br /> <span>
<a href="https://docs.nocodb.com/developer-resources/webhooks/" target="_blank"> <strong>data</strong> : Row data <br />
<!-- Document Reference --> <strong>user</strong> : User information<br />
{{ $t('labels.docReference') }} </span>
</a> </template>
</span> <MdiInformationIcon class="ml-2" />
<WebhookTest </a-tooltip>
:hook="{
...formState, <div class="mt-3">
filters, <a href="https://docs.nocodb.com/developer-resources/webhooks/" target="_blank">
notification: { <!-- Document Reference -->
...formState.notification, {{ $t('labels.docReference') }}
payload: notification, </a>
}, </div>
}" </div>
/> <WebhookTest
</div> :hook="{
...formState,
filters,
notification: {
...formState.notification,
payload: notification,
},
}"
/>
</a-col>
</a-row>
</a-form-item> </a-form-item>
</a-form> </a-form>
</template> </template>

Loading…
Cancel
Save