Hide form title via URL param (#89)

* Hide form title via URL param

* FormUrlPrefill smal fixes
This commit is contained in:
Chirag Chhatrala
2023-02-22 21:09:13 +05:30
committed by GitHub
parent b101a5daba
commit 47964ec565
8 changed files with 110 additions and 15 deletions

View File

@@ -23,7 +23,8 @@ export default {
name: 'EmbedCode',
components: { CopyContent },
props: {
form: { type: Object, required: true }
form: { type: Object, required: true },
extraQueryParam: { type: String, default: '' }
},
data: () => ({
@@ -32,11 +33,12 @@ export default {
computed: {
embedCode() {
return '<iframe style="border:none;width:100%;" height="' + this.formHeight + 'px" src="' + this.form.share_url + '"></iframe>'
const share_url = (this.extraQueryParam) ? this.form.share_url + "?" + this.extraQueryParam : this.form.share_url + this.extraQueryParam
return '<iframe style="border:none;width:100%;" height="' + this.formHeight + 'px" src="' + share_url + '"></iframe>'
},
formHeight() {
let height = 200
if (!this.form.hide_title) {
if (!this.form.hide_title && !this.extraQueryParam) {
height += 60
}
height += this.form.properties.filter((property) => {

View File

@@ -3,7 +3,7 @@
<h3 class="font-semibold text-xl">Share Link</h3>
<p>Your form is now published and ready to be shared with the world! Copy this link to share your form
on social media, messaging apps or via email.</p>
<copy-content :content="form.share_url">
<copy-content :content="share_url">
<template #icon>
<svg class="h-4 w-4 -mt-1 text-blue-600 inline mr-1" viewBox="0 0 20 10" fill="none"
xmlns="http://www.w3.org/2000/svg">
@@ -24,14 +24,19 @@ export default {
name: 'ShareLink',
components: { CopyContent },
props: {
form: { type: Object, required: true }
form: { type: Object, required: true },
extraQueryParam: { type: String, default: '' }
},
data: () => ({
}),
computed: {},
computed: {
share_url () {
return (this.extraQueryParam) ? this.form.share_url + '?' + this.extraQueryParam : this.form.share_url + this.extraQueryParam
}
},
methods: {}
}

View File

@@ -57,7 +57,7 @@
<h3 class="mt-6 text-xl font-semibold mb-4 pt-6">
Your Prefill url
</h3>
<form-url-prefill :form="form" :form-data="prefillFormData" />
<form-url-prefill :form="form" :form-data="prefillFormData" :extra-query-param="extraQueryParam" />
</template>
</div>
@@ -75,7 +75,8 @@ export default {
name: 'UrlFormPrefill',
components: { FormUrlPrefill, ProTag, OpenForm },
props: {
form: { type: Object, required: true }
form: { type: Object, required: true },
extraQueryParam: { type: String, default: '' }
},
data: () => ({