Bug fixes & UI polish 💅

This commit is contained in:
Julien Nahum 2023-10-13 12:29:34 +02:00
parent f0939f3992
commit aebe5f5738
4 changed files with 21 additions and 10 deletions

View File

@ -3,10 +3,6 @@
class="my-4 w-full mx-auto"> class="my-4 w-full mx-auto">
<h3 class="font-semibold mb-4 text-xl"> <h3 class="font-semibold mb-4 text-xl">
Form Submissions Form Submissions
<span v-if="form && !isLoading && tableData.length > 0" class="text-right text-xs uppercase mb-2"> - <a
:href="exportUrl" target="_blank">Export as CSV</a></span>
<span v-if="form && !isLoading && formInitDone" class="float-right text-xs uppercase mb-2"> <a
href="javascript:void(0);" @click="showColumnsModal=true">Display columns</a></span>
</h3> </h3>
<!-- Table columns modal --> <!-- Table columns modal -->
@ -41,8 +37,16 @@
<loader v-if="!form || isLoading" class="h-6 w-6 text-nt-blue mx-auto"/> <loader v-if="!form || isLoading" class="h-6 w-6 text-nt-blue mx-auto"/>
<div v-else> <div v-else>
<div class="m-auto w-64"> <div class="flex flex-wrap items-end">
<text-input :form="searchForm" name="search" placeholder="Search..." /> <div class="flex-grow">
<text-input class="w-64" :form="searchForm" name="search" placeholder="Search..." />
</div>
<div class="font-semibold flex gap-4">
<p v-if="form && !isLoading && formInitDone" class="float-right text-xs uppercase mb-2"> <a
href="javascript:void(0);" class="text-gray-500" @click="showColumnsModal=true">Display columns</a></p>
<p v-if="form && !isLoading && tableData.length > 0" class="text-right text-xs uppercase"><a
:href="exportUrl" target="_blank">Export as CSV</a></p>
</div>
</div> </div>
<scroll-shadow <scroll-shadow

View File

@ -84,6 +84,7 @@ export default {
} }
}, },
emailSubmissionConfirmationField () { emailSubmissionConfirmationField () {
if (!this.form.properties || !Array.isArray(this.form.properties)) return null
const emailFields = this.form.properties.filter((field) => { const emailFields = this.form.properties.filter((field) => {
return field.type === 'email' && !field.hidden return field.type === 'email' && !field.hidden
}) })

View File

@ -1,5 +1,5 @@
<template> <template>
<div> <div class="flex">
<v-button <v-button
class="w-full" class="w-full"
color="light-gray" color="light-gray"
@ -27,7 +27,7 @@
<span>Url Form Prefill</span> <span>Url Form Prefill</span>
</template> </template>
<div class="p-4"> <div class="p-4" ref="content">
<p> <p>
Create dynamic links when sharing your form (whether it's embedded or not), that allows you to prefill Create dynamic links when sharing your form (whether it's embedded or not), that allows you to prefill
your form fields. You can use this to personalize the form when sending it to multiple contacts for instance. your form fields. You can use this to personalize the form when sending it to multiple contacts for instance.
@ -89,7 +89,9 @@ export default {
generateUrl (formData, onFailure) { generateUrl (formData, onFailure) {
this.prefillFormData = formData this.prefillFormData = formData
this.$nextTick().then(() => { this.$nextTick().then(() => {
this.$refs.content.parentElement.parentElement.parentElement.scrollTop = (this.$refs.content.offsetHeight - this.$refs.content.parentElement.parentElement.parentElement.offsetHeight + 50) if (this.$refs.content) {
this.$refs.content.parentElement.parentElement.parentElement.scrollTop = this.$refs.content.offsetHeight
}
}) })
} }
} }

View File

@ -4,6 +4,10 @@ import * as Sentry from '@sentry/vue'
export function initCrisp (user) { export function initCrisp (user) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const intervalId = window.setInterval(function () { const intervalId = window.setInterval(function () {
if (!user) {
resolve()
return
}
if (window.$crisp) { if (window.$crisp) {
window.$crisp.push(['set', 'user:email', user.email]) window.$crisp.push(['set', 'user:email', user.email])
window.$crisp.push(['set', 'user:nickname', user.name]) window.$crisp.push(['set', 'user:nickname', user.name])
@ -19,7 +23,7 @@ export function initCrisp (user) {
} }
export function initSentry (user) { export function initSentry (user) {
if (!window.config.sentry_dsn) { if (!window.config.sentry_dsn || !user) {
return return
} }
Sentry.configureScope((scope) => { Sentry.configureScope((scope) => {