Simplify syntax of InputHelp

This commit is contained in:
Julien Nahum 2024-05-27 11:27:46 +02:00
parent 53f2e99ec3
commit ca159804f9
3 changed files with 26 additions and 30 deletions

View File

@ -7,7 +7,7 @@
:class="helpClasses" :class="helpClasses"
class="grow flex" class="grow flex"
> >
<slot name="help"> <slot>
<span <span
v-if="help" v-if="help"
class="field-help" class="field-help"
@ -29,6 +29,6 @@ const props = defineProps({
}) })
const shouldRender = computed(() => { const shouldRender = computed(() => {
return props.help || !!slots.help || !!slots['after-help'] return props.help || !!slots.default || !!slots['after-help']
}) })
</script> </script>

View File

@ -13,18 +13,16 @@
> >
<template #help> <template #help>
<InputHelp> <InputHelp>
<template #help> <span>
<span> Receive a discord message on each form submission.
Receive a discord message on each form submission. <a
<a href="https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks"
href="https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks" target="_blank"
target="_blank" >
> Click here
Click here </a>
</a> to learn how to get a discord webhook url.
to learn how to get a discord webhook url. </span>
</span>
</template>
</InputHelp> </InputHelp>
</template> </template>
</text-input> </text-input>
@ -40,9 +38,9 @@ import IntegrationWrapper from "./components/IntegrationWrapper.vue"
import NotificationsMessageActions from "./components/NotificationsMessageActions.vue" import NotificationsMessageActions from "./components/NotificationsMessageActions.vue"
const props = defineProps({ const props = defineProps({
integration: { type: Object, required: true }, integration: {type: Object, required: true},
form: { type: Object, required: true }, form: {type: Object, required: true},
integrationData: { type: Object, required: true }, integrationData: {type: Object, required: true},
formIntegrationId: { type: Number, required: false, default: null }, formIntegrationId: {type: Number, required: false, default: null},
}) })
</script> </script>

View File

@ -13,18 +13,16 @@
> >
<template #help> <template #help>
<InputHelp> <InputHelp>
<template #help> <span>
<span> Receive slack message on each form submission.
Receive slack message on each form submission. <a
<a href="https://api.slack.com/messaging/webhooks"
href="https://api.slack.com/messaging/webhooks" target="_blank"
target="_blank" >
> Click here
Click here </a>
</a> to learn how to get a slack webhook url
to learn how to get a slack webhook url </span>
</span>
</template>
</InputHelp> </InputHelp>
</template> </template>
</text-input> </text-input>