From 5bdc76ecd66eee5eff897f8eb3049675e31ab77b Mon Sep 17 00:00:00 2001 From: formsdev <136701234+formsdev@users.noreply.github.com> Date: Wed, 31 Jan 2024 22:18:43 +0530 Subject: [PATCH 1/6] crisp migration (#302) Co-authored-by: Julien Nahum --- client/components/global/ProTag.vue | 3 +-- .../forms/components/form-components/FormAboutSubmission.vue | 5 +++-- client/components/pages/forms/show/FormCleanings.vue | 3 +-- client/components/pages/pricing/CustomPlan.vue | 4 +--- client/pages/pricing.vue | 3 +-- client/pages/subscriptions/success.vue | 5 +++-- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/client/components/global/ProTag.vue b/client/components/global/ProTag.vue index 841aed9..0aac4d7 100644 --- a/client/components/global/ProTag.vue +++ b/client/components/global/ProTag.vue @@ -77,8 +77,7 @@ export default { methods: { openChat() { - window.$crisp.push(['do', 'chat:show']) - window.$crisp.push(['do', 'chat:open']) + useCrisp().openAndShowChat() }, } } diff --git a/client/components/open/forms/components/form-components/FormAboutSubmission.vue b/client/components/open/forms/components/form-components/FormAboutSubmission.vue index b1230b7..829974f 100644 --- a/client/components/open/forms/components/form-components/FormAboutSubmission.vue +++ b/client/components/open/forms/components/form-components/FormAboutSubmission.vue @@ -67,7 +67,7 @@ If the submission has the same value(s) as a previous one for the selected column(s), we will update it, instead of creating a new one. More info here. @@ -142,7 +142,8 @@ export default { const {content: form} = storeToRefs(workingFormStore) return { form, - workingFormStore + workingFormStore, + crisp: useCrisp() } }, data () { diff --git a/client/components/pages/forms/show/FormCleanings.vue b/client/components/pages/forms/show/FormCleanings.vue index 29def81..fe174e1 100644 --- a/client/components/pages/forms/show/FormCleanings.vue +++ b/client/components/pages/forms/show/FormCleanings.vue @@ -99,8 +99,7 @@ export default { }, methods: { openCrisp () { - this.$crisp.push(['do', 'chat:show']) - this.$crisp.push(['do', 'chat:open']) + useCrisp().openAndShowChat() } } } diff --git a/client/components/pages/pricing/CustomPlan.vue b/client/components/pages/pricing/CustomPlan.vue index c4f1704..29fc2f4 100644 --- a/client/components/pages/pricing/CustomPlan.vue +++ b/client/components/pages/pricing/CustomPlan.vue @@ -32,9 +32,7 @@ export default { methods: { customPlanClick () { - window.$crisp.push(['do', 'chat:show']) - window.$crisp.push(['do', 'chat:open']) - window.$crisp.push(['do', 'message:send', ['text', 'Hi, I would like to discuss about a custom plan']]) + useCrisp().sendTextMessage('Hi, I would like to discuss about a custom plan') } } } diff --git a/client/pages/pricing.vue b/client/pages/pricing.vue index a0a7f4b..f3ae5f1 100644 --- a/client/pages/pricing.vue +++ b/client/pages/pricing.vue @@ -271,8 +271,7 @@ export default { methods: { contactUs() { - window.$crisp.push(['do', 'chat:show']) - window.$crisp.push(['do', 'chat:open']) + useCrisp().openAndShowChat() } } } diff --git a/client/pages/subscriptions/success.vue b/client/pages/subscriptions/success.vue index df63c75..83e7db3 100644 --- a/client/pages/subscriptions/success.vue +++ b/client/pages/subscriptions/success.vue @@ -32,7 +32,8 @@ export default { return { authStore, authenticated : computed(() => authStore.check), - user : computed(() => authStore.user) + user : computed(() => authStore.user), + crisp: useCrisp() } }, @@ -58,7 +59,7 @@ export default { redirectIfSubscribed () { if (this.user.is_subscribed) { useAmplitude().logEvent('subscribed', { plan: this.user.has_enterprise_subscription ? 'enterprise' : 'pro' }) - this.$crisp.push(['set', 'session:event', [[['subscribed', { plan: this.user.has_enterprise_subscription ? 'enterprise' : 'pro' }, 'blue']]]]) + this.crisp.pushEvent('subscribed', { plan: this.user.has_enterprise_subscription ? 'enterprise' : 'pro' }) this.$router.push({ name: 'home' }) if (this.user.has_enterprise_subscription) { From 0da9b9270f703ac46e44550e7107faf5a86cc0a6 Mon Sep 17 00:00:00 2001 From: formsdev <136701234+formsdev@users.noreply.github.com> Date: Thu, 1 Feb 2024 17:44:30 +0530 Subject: [PATCH 2/6] fix console error (#304) --- client/pages/forms/[slug]/index.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/client/pages/forms/[slug]/index.vue b/client/pages/forms/[slug]/index.vue index 25fe79b..15e0286 100644 --- a/client/pages/forms/[slug]/index.vue +++ b/client/pages/forms/[slug]/index.vue @@ -82,7 +82,6 @@ const passwordEntered = function (password) { openCompleteForm.value.addPasswordError('Invalid password.') } }) - openCompleteForm.value.submit() }) } From cfac87ff7317bbd7f3e4d07192c4b44fbaf9f85d Mon Sep 17 00:00:00 2001 From: Favour Olayinka Date: Thu, 1 Feb 2024 14:37:20 +0100 Subject: [PATCH 3/6] fix: dark mode issues on form preview (#301) * fix: dark mode issues on form preview * Fix darkmode issues --------- Co-authored-by: Julien Nahum --- client/components/open/forms/OpenFormField.vue | 2 +- client/tailwind.config.js | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/client/components/open/forms/OpenFormField.vue b/client/components/open/forms/OpenFormField.vue index e0a28ea..d9738cb 100644 --- a/client/components/open/forms/OpenFormField.vue +++ b/client/components/open/forms/OpenFormField.vue @@ -230,7 +230,7 @@ export default { classes += '-mx-4 px-4 -my-1 py-1 group/nffield relative transition-colors' if (this.beingEdited) { - classes += ' bg-blue-50 rounded-md' + classes += ' bg-blue-50 dark:bg-gray-800 rounded-md' } } return classes diff --git a/client/tailwind.config.js b/client/tailwind.config.js index ae0d3b5..236a8ea 100644 --- a/client/tailwind.config.js +++ b/client/tailwind.config.js @@ -12,9 +12,10 @@ module.exports = { ], safelist: [ { - pattern: /.*bg-(blue|gray|red|yellow|green).*/, + pattern: /.*bg-(blue|gray|red|yellow|green).*/, }, - ...['green', 'red', 'blue', 'yellow'].map((color) => ['bg-' + color + '-100', 'border-' + color + '-500']).flat() // Alerts + ...['green', 'red', 'blue', 'yellow'].map((color) => ['bg-' + color + '-100', 'border-' + color + '-500']).flat(), // Alerts + ...['dark:hover:bg-notion-dark-light'] ], darkMode: 'class', // or 'media' or 'class' theme: { @@ -26,8 +27,8 @@ module.exports = { '16%': {transform: 'translateY(+10%)'} }, 'infinite-scroll': { - from: { transform: 'translateX(0)' }, - to: { transform: 'translateX(-100%)' }, + from: {transform: 'translateX(0)'}, + to: {transform: 'translateX(-100%)'}, } }, animation: { @@ -84,7 +85,7 @@ module.exports = { }, plugins: [ require('@tailwindcss/aspect-ratio'), - plugin(function({ addVariant }) { + plugin(function ({addVariant}) { addVariant('between', '&:not(:first-child):not(:last-child)') addVariant('hocus', ['&:hover', '&:focus']) }) From b7555f9ee7367f21fa4b7d6040a1712d76f5abde Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Thu, 1 Feb 2024 18:40:12 +0100 Subject: [PATCH 4/6] Remove useless iframe attributes --- client/components/pages/forms/show/EmbedCode.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/pages/forms/show/EmbedCode.vue b/client/components/pages/forms/show/EmbedCode.vue index 24bf4a3..d16ef80 100644 --- a/client/components/pages/forms/show/EmbedCode.vue +++ b/client/components/pages/forms/show/EmbedCode.vue @@ -42,7 +42,7 @@ export default { }, iframeCode() { const share_url = (this.extraQueryParam) ? this.form.share_url + "?" + this.extraQueryParam : this.form.share_url + this.extraQueryParam - return '' + return '' }, iframeId() { return 'form-' + this.form.slug From fcb9999ed6699edd0460bf4737c217f971f8c78d Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Thu, 1 Feb 2024 18:40:12 +0100 Subject: [PATCH 5/6] Remove useless iframe attributes --- client/components/pages/forms/show/EmbedCode.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/pages/forms/show/EmbedCode.vue b/client/components/pages/forms/show/EmbedCode.vue index 24bf4a3..d16ef80 100644 --- a/client/components/pages/forms/show/EmbedCode.vue +++ b/client/components/pages/forms/show/EmbedCode.vue @@ -42,7 +42,7 @@ export default { }, iframeCode() { const share_url = (this.extraQueryParam) ? this.form.share_url + "?" + this.extraQueryParam : this.form.share_url + this.extraQueryParam - return '' + return '' }, iframeId() { return 'form-' + this.form.slug From 5dd3bafb4f40e0012eb6dc7325d9ac83da2c5131 Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Thu, 1 Feb 2024 18:53:55 +0100 Subject: [PATCH 6/6] Fix resize for all forms --- client/pages/forms/[slug]/index.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client/pages/forms/[slug]/index.vue b/client/pages/forms/[slug]/index.vue index d9b9800..0637b42 100644 --- a/client/pages/forms/[slug]/index.vue +++ b/client/pages/forms/[slug]/index.vue @@ -166,8 +166,6 @@ useHead({ } return titleChunk ? `${titleChunk} - OpnForm` : 'OpnForm'; }, - ... form.value.custom_code ? { - script: [ { src: '/widgets/iframeResizer.contentWindow.min.js' } ] - } : {} + script: [ { src: '/widgets/iframeResizer.contentWindow.min.js' } ] })