2023-12-09 15:47:03 +01:00
|
|
|
<template>
|
|
|
|
|
<v-transition>
|
2024-04-15 19:39:03 +02:00
|
|
|
<div
|
|
|
|
|
v-if="hasCleanings && !hideWarning"
|
|
|
|
|
class="border border-gray-300 dark:border-gray-600 rounded-md bg-white p-2"
|
|
|
|
|
:class="{
|
|
|
|
|
'hover:bg-yellow-50 dark:hover:bg-yellow-900': !collapseOpened,
|
|
|
|
|
}"
|
2023-12-09 15:47:03 +01:00
|
|
|
>
|
|
|
|
|
<collapse v-model="collapseOpened">
|
|
|
|
|
<template #title>
|
2024-04-15 19:39:03 +02:00
|
|
|
<p
|
|
|
|
|
class="text-yellow-500 dark:text-yellow-400 font-semibold text-sm p-1 pr-4"
|
|
|
|
|
>
|
|
|
|
|
<svg
|
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
|
fill="none"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
stroke-width="1.5"
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
class="w-6 h-6 inline"
|
2023-12-09 15:47:03 +01:00
|
|
|
>
|
2024-04-15 19:39:03 +02:00
|
|
|
<path
|
|
|
|
|
stroke-linecap="round"
|
|
|
|
|
stroke-linejoin="round"
|
|
|
|
|
d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"
|
2023-12-09 15:47:03 +01:00
|
|
|
/>
|
|
|
|
|
</svg>
|
2024-04-15 19:39:03 +02:00
|
|
|
Some features that are included in our
|
|
|
|
|
{{ form.is_pro ? "Enterprise" : "Pro" }} plan are disabled when
|
|
|
|
|
publicly sharing this form<span v-if="specifyFormOwner">
|
|
|
|
|
(only owners of this form can see this)</span>.
|
2023-12-09 15:47:03 +01:00
|
|
|
</p>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<div class="border-t mt-1 p-4 pb-2 -mx-2">
|
2024-04-15 19:39:03 +02:00
|
|
|
<p
|
|
|
|
|
class="text-gray-500 text-sm"
|
|
|
|
|
v-html="cleaningContent"
|
|
|
|
|
/>
|
2023-12-09 15:47:03 +01:00
|
|
|
<p class="text-gray-500 text-sm mb-4 font-semibold">
|
2024-04-15 19:39:03 +02:00
|
|
|
<NuxtLink :to="{ name: 'pricing' }">
|
|
|
|
|
{{
|
|
|
|
|
form.is_pro
|
|
|
|
|
? "Upgrade your OpnForms plan today"
|
|
|
|
|
: "Start your free OpnForms trial"
|
|
|
|
|
}}
|
2023-12-22 10:24:51 +01:00
|
|
|
</NuxtLink>
|
2023-12-09 15:47:03 +01:00
|
|
|
to unlock all of our features and build powerful forms.
|
|
|
|
|
</p>
|
|
|
|
|
<div class="flex flex-wrap items-end w-full">
|
|
|
|
|
<div class="flex-grow flex pr-2">
|
2024-04-15 19:39:03 +02:00
|
|
|
<v-button
|
|
|
|
|
v-track.upgrade_from_form_cleanings_click
|
|
|
|
|
size="small"
|
|
|
|
|
class="inline-block"
|
|
|
|
|
:to="{ name: 'pricing' }"
|
|
|
|
|
>
|
|
|
|
|
{{ form.is_pro ? "Upgrade plan" : "Start free trial" }}
|
|
|
|
|
<svg
|
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
|
fill="none"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
stroke-width="1.5"
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
class="w-4 h-4 inline -mt-[2px]"
|
2023-12-09 15:47:03 +01:00
|
|
|
>
|
2024-04-15 19:39:03 +02:00
|
|
|
<path
|
|
|
|
|
stroke-linecap="round"
|
|
|
|
|
stroke-linejoin="round"
|
|
|
|
|
d="M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3"
|
|
|
|
|
/>
|
2023-12-09 15:47:03 +01:00
|
|
|
</svg>
|
|
|
|
|
</v-button>
|
2024-04-15 19:39:03 +02:00
|
|
|
<v-button
|
|
|
|
|
color="white"
|
|
|
|
|
size="small"
|
|
|
|
|
class="ml-2"
|
|
|
|
|
@click.prevent="openCrisp"
|
|
|
|
|
>
|
2023-12-09 15:47:03 +01:00
|
|
|
Contact us
|
|
|
|
|
</v-button>
|
|
|
|
|
</div>
|
2024-04-15 19:39:03 +02:00
|
|
|
<v-button
|
|
|
|
|
v-if="hideable"
|
|
|
|
|
color="white"
|
|
|
|
|
size="small"
|
|
|
|
|
class="mt-2"
|
|
|
|
|
@click.prevent="hideWarning = true"
|
|
|
|
|
>
|
2023-12-09 15:47:03 +01:00
|
|
|
Hide warning
|
|
|
|
|
</v-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</collapse>
|
|
|
|
|
</div>
|
|
|
|
|
</v-transition>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
2024-04-15 19:39:03 +02:00
|
|
|
import Collapse from "~/components/global/Collapse.vue"
|
|
|
|
|
import VButton from "~/components/global/VButton.vue"
|
|
|
|
|
import VTransition from "~/components/global/transitions/VTransition.vue"
|
2023-12-09 15:47:03 +01:00
|
|
|
|
|
|
|
|
export default {
|
2024-04-15 19:39:03 +02:00
|
|
|
name: "FormCleanings",
|
2023-12-09 15:47:03 +01:00
|
|
|
components: { VTransition, VButton, Collapse },
|
|
|
|
|
props: {
|
|
|
|
|
form: { type: Object, required: true },
|
|
|
|
|
specifyFormOwner: { type: Boolean, default: false },
|
2024-04-15 19:39:03 +02:00
|
|
|
hideable: { type: Boolean, default: false },
|
2023-12-09 15:47:03 +01:00
|
|
|
},
|
2024-04-15 19:39:03 +02:00
|
|
|
data() {
|
2023-12-09 15:47:03 +01:00
|
|
|
return {
|
|
|
|
|
collapseOpened: false,
|
2024-04-15 19:39:03 +02:00
|
|
|
hideWarning: false,
|
2023-12-09 15:47:03 +01:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
2024-04-15 19:39:03 +02:00
|
|
|
hasCleanings() {
|
2023-12-09 15:47:03 +01:00
|
|
|
return this.form.cleanings && Object.keys(this.form.cleanings).length > 0
|
|
|
|
|
},
|
2024-04-15 19:39:03 +02:00
|
|
|
cleanings() {
|
2023-12-09 15:47:03 +01:00
|
|
|
return this.form.cleanings
|
|
|
|
|
},
|
2024-04-15 19:39:03 +02:00
|
|
|
cleaningContent() {
|
|
|
|
|
let message = ""
|
2023-12-09 15:47:03 +01:00
|
|
|
Object.keys(this.cleanings).forEach((key) => {
|
|
|
|
|
let fieldName = key.charAt(0).toUpperCase() + key.slice(1)
|
2024-04-15 19:39:03 +02:00
|
|
|
if (fieldName !== "Form") {
|
2023-12-09 15:47:03 +01:00
|
|
|
fieldName = '"' + fieldName + '" field'
|
|
|
|
|
}
|
2024-04-15 19:39:03 +02:00
|
|
|
let fieldInfo =
|
|
|
|
|
'<span class="font-semibold">' +
|
|
|
|
|
fieldName +
|
|
|
|
|
"</span><br/><ul class='list-disc list-inside'>"
|
2023-12-09 15:47:03 +01:00
|
|
|
this.cleanings[key].forEach((msg) => {
|
2024-04-15 19:39:03 +02:00
|
|
|
fieldInfo = fieldInfo + "<li>" + msg + "</li>"
|
2023-12-09 15:47:03 +01:00
|
|
|
})
|
|
|
|
|
if (fieldInfo) {
|
2024-04-15 19:39:03 +02:00
|
|
|
message = message + fieldInfo + "<ul/><br/>"
|
2023-12-09 15:47:03 +01:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
return message
|
2024-04-15 19:39:03 +02:00
|
|
|
},
|
2023-12-09 15:47:03 +01:00
|
|
|
},
|
|
|
|
|
watch: {},
|
2024-04-15 19:39:03 +02:00
|
|
|
mounted() {},
|
2023-12-09 15:47:03 +01:00
|
|
|
methods: {
|
2024-04-15 19:39:03 +02:00
|
|
|
openCrisp() {
|
2024-01-31 17:48:43 +01:00
|
|
|
useCrisp().openAndShowChat()
|
2024-04-15 19:39:03 +02:00
|
|
|
},
|
|
|
|
|
},
|
2023-12-09 15:47:03 +01:00
|
|
|
}
|
|
|
|
|
</script>
|