Skip to content

Beautiful Open-Source Form Builder

Update meta tags and improve component structure (#910)

Chirag Chhatrala0927665710b5
diff --git a/client/app.vue b/client/app.vue
index 2d6c91834..78b0c1349 100644
--- a/client/app.vue
+++ b/client/app.vue
@@ -52,7 +52,7 @@ useHead({
},
meta: [
{
- name: 'apple-mobile-web-app-capable',
+ name: 'mobile-web-app-capable',
content: 'yes'
},
{
diff --git a/client/components/app/ProTag.vue b/client/components/app/ProTag.vue
index d5514eb16..941f12125 100644
--- a/client/components/app/ProTag.vue
+++ b/client/components/app/ProTag.vue
@@ -4,18 +4,23 @@
:text="upgradeModalTitle??'You need a Pro plan to use this feature'"
class="inline normal-case"
>
- <div
- v-track.pro_tag_click="{title:upgradeModalTitle}"
- class="bg-blue-500 text-white px-2 text-xs uppercase inline rounded-full font-semibold cursor-pointer"
- @click.stop="onClick"
+ <TrackClick
+ name="pro_tag_click"
+ :properties="{ title: upgradeModalTitle }"
>
- PRO
- </div>
+ <div
+ class="bg-blue-500 text-white px-2 text-xs uppercase inline rounded-full font-semibold cursor-pointer"
+ @click.stop="onClick"
+ >
+ PRO
+ </div>
+ </TrackClick>
</UTooltip>
</template>
<script setup>
import { computed } from "vue"
+import TrackClick from "~/components/global/TrackClick.vue"
const props = defineProps({
upgradeModalTitle: {
diff --git a/client/components/open/forms/components/form-components/FormCustomization.vue b/client/components/open/forms/components/form-components/FormCustomization.vue
index 4dcf0b945..249761637 100644
--- a/client/components/open/forms/components/form-components/FormCustomization.vue
+++ b/client/components/open/forms/components/form-components/FormCustomization.vue
@@ -26,7 +26,7 @@
class="my-4"
>
<template #label>
- <InputLabel>Accent Color - <a
+ <InputLabel label="">Accent Color - <a
href="#" class="text-blue-500"
@click.prevent="form.color = DEFAULT_COLOR"
>Reset</a></InputLabel>
diff --git a/client/components/open/integrations/components/IntegrationListOption.vue b/client/components/open/integrations/components/IntegrationListOption.vue
index 3a29c5e65..af48cb292 100644
--- a/client/components/open/integrations/components/IntegrationListOption.vue
+++ b/client/components/open/integrations/components/IntegrationListOption.vue
@@ -3,16 +3,19 @@
:text="tooltipText"
:disabled="!unavailable || !tooltipText"
>
- <div
- v-track.new_integration_click="{ name: integration.id }"
- role="button"
- :class="{
- 'hover:bg-neutral-100 dark:hover:bg-neutral-800 group cursor-pointer': !unavailable,
- 'cursor-not-allowed opacity-50': unavailable,
- }"
- class="border rounded-lg p-4 flex flex-col items-center justify-center text-center transition-colors w-full h-full relative"
- @click="onClick"
+ <TrackClick
+ name="new_integration_click"
+ :properties="{ name: integration.id }"
>
+ <div
+ role="button"
+ :class="{
+ 'hover:bg-neutral-100 dark:hover:bg-neutral-800 group cursor-pointer': !unavailable,
+ 'cursor-not-allowed opacity-50': unavailable,
+ }"
+ class="border rounded-lg p-4 flex flex-col items-center justify-center text-center transition-colors w-full h-full relative"
+ @click="onClick"
+ >
<div class="flex-shrink-0">
<Icon
:name="integration.icon"
@@ -37,13 +40,15 @@
class="absolute bottom-2 right-2 h-4 w-4 text-neutral-400"
name="heroicons:arrow-top-right-on-square-20-solid"
/>
- </div>
+ </div>
+ </TrackClick>
</UTooltip>
</template>
<script setup>
import { computed } from 'vue'
import ProTag from "~/components/app/ProTag.vue"
+import TrackClick from "~/components/global/TrackClick.vue"
const emit = defineEmits(["select"])
const { openSubscriptionModal } = useAppModals()
diff --git a/client/components/pages/forms/create/CreateFormBaseModal.vue b/client/components/pages/forms/create/CreateFormBaseModal.vue
index dd8df47ea..cd760061a 100644
--- a/client/components/pages/forms/create/CreateFormBaseModal.vue
+++ b/client/components/pages/forms/create/CreateFormBaseModal.vue
@@ -10,12 +10,15 @@
v-if="state === 'default'"
class="grid grid-cols-1 sm:grid-cols-3 gap-4"
>
- <div
- v-track.select_form_base="{ base: 'contact-form' }"
- role="button"
- class="rounded-md border p-6 flex flex-col items-center cursor-pointer hover:bg-neutral-50"
- @click="$emit('close')"
+ <TrackClick
+ name="select_form_base"
+ :properties="{ base: 'contact-form' }"
>
+ <div
+ role="button"
+ class="rounded-md border p-6 flex flex-col items-center cursor-pointer hover:bg-neutral-50"
+ @click="$emit('close')"
+ >
<div class="p-4">
<UIcon
name="i-heroicons-envelope"
@@ -25,14 +28,18 @@
<p class="font-medium">
Simple contact form
</p>
- </div>
- <div
+ </div>
+ </TrackClick>
+ <TrackClick
v-if="useFeatureFlag('ai_features')"
- v-track.select_form_base="{ base: 'ai' }"
- class="rounded-md border p-6 flex flex-col items-center cursor-pointer hover:bg-neutral-50"
- role="button"
- @click="state = 'ai'"
+ name="select_form_base"
+ :properties="{ base: 'ai' }"
>
+ <div
+ class="rounded-md border p-6 flex flex-col items-center cursor-pointer hover:bg-neutral-50"
+ role="button"
+ @click="state = 'ai'"
+ >
<div class="p-4">
<UIcon
name="i-heroicons-bolt"
@@ -42,7 +49,8 @@
<p class="font-medium text-blue-700">
AI Form Generator
</p>
- </div>
+ </div>
+ </TrackClick>
<div
class="rounded-md border p-6 flex flex-col items-center cursor-pointer hover:bg-neutral-50 relative"
>
@@ -55,11 +63,15 @@
<p class="font-medium">
Browse templates <Icon name="heroicons:arrow-top-right-on-square-20-solid" class="w-3 h-3 text-neutral-500" />
</p>
- <NuxtLink
- v-track.select_form_base="{ base: 'template' }"
- :to="{ name: 'templates' }"
- class="absolute inset-0"
- />
+ <TrackClick
+ name="select_form_base"
+ :properties="{ base: 'template' }"
+ >
+ <NuxtLink
+ :to="{ name: 'templates' }"
+ class="absolute inset-0"
+ />
+ </TrackClick>
</div>
</div>
<div v-else-if="state === 'ai'">
@@ -104,6 +116,7 @@
<script setup>
import AIFormLoadingMessages from "~/components/open/forms/components/AIFormLoadingMessages.vue"
import { formsApi } from "~/api/forms"
+import TrackClick from "~/components/global/TrackClick.vue"
const props = defineProps({
show: { type: Boolean, required: true },
diff --git a/client/components/pages/pricing/PricingTable.vue b/client/components/pages/pricing/PricingTable.vue
index 22256e3c4..13a7d4286 100644
--- a/client/components/pages/pricing/PricingTable.vue
+++ b/client/components/pages/pricing/PricingTable.vue
@@ -174,7 +174,6 @@
</template>
<script>
-import { computed } from "vue"
import MonthlyYearlySelector from "./MonthlyYearlySelector.vue"
import CustomPlan from "./CustomPlan.vue"
import { useIsAuthenticated } from "~/composables/useAuthFlow"
@@ -195,12 +194,12 @@ export default {
setup() {
const { openSubscriptionModal } = useAppModals()
const { isAuthenticated: authenticated } = useIsAuthenticated()
- const auth = useAuth()
+ const { data: user } = useAuth().user()
return {
openSubscriptionModal,
authenticated,
- user: computed(() => auth.user().data.value),
+ user,
}
},
data: () => ({
diff --git a/client/components/pages/pricing/SubscriptionModal.vue b/client/components/pages/pricing/SubscriptionModal.vue
index 959970162..ea71464e8 100644
--- a/client/components/pages/pricing/SubscriptionModal.vue
+++ b/client/components/pages/pricing/SubscriptionModal.vue
@@ -2,6 +2,7 @@
<UModal
v-model:open="isOpen"
:ui="{ content: 'sm:max-w-5xl' }"
+ title=""
:close="false"
>
<template #body>
@@ -266,6 +267,7 @@
<div v-if="shouldShowUpsell">
<v-form size="sm">
<toggle-switch-input
+ name=""
v-model="isYearly"
label="20% off with the yearly plan"
size="sm"
diff --git a/client/components/pages/settings/SettingsModal.vue b/client/components/pages/settings/SettingsModal.vue
index db6767241..8e9406ee1 100644
--- a/client/components/pages/settings/SettingsModal.vue
+++ b/client/components/pages/settings/SettingsModal.vue
@@ -4,6 +4,7 @@
:ui="{
content: 'max-w-5xl h-[80vh] overflow-hidden',
}"
+ title=""
:content="{
onPointerDownOutside: (event) => { if (event.target?.closest('.crisp-client')) {return event.preventDefault()}}
}"
diff --git a/client/components/pages/templates/TemplatesList.vue b/client/components/pages/templates/TemplatesList.vue
index cd1a50930..0ca1615f3 100644
--- a/client/components/pages/templates/TemplatesList.vue
+++ b/client/components/pages/templates/TemplatesList.vue
@@ -185,6 +185,7 @@ import { useTemplateMeta } from "~/composables/data/useTemplateMeta"
const props = defineProps({
templates: {
type: Array,
+ default: () => [],
required: true,
},
loading: {
diff --git a/client/pages/forms/[slug]/index.vue b/client/pages/forms/[slug]/index.vue
index c7d12d9bf..5df60d645 100644
--- a/client/pages/forms/[slug]/index.vue
+++ b/client/pages/forms/[slug]/index.vue
@@ -282,7 +282,7 @@ useHead({
link: headLinks.value,
meta: pageMeta.value.page_favicon ? [
{
- name: 'apple-mobile-web-app-capable',
+ name: 'mobile-web-app-capable',
content: 'yes'
},
{
diff --git a/client/pages/home.vue b/client/pages/home.vue
index d2391aab9..9431e510b 100644
--- a/client/pages/home.vue
+++ b/client/pages/home.vue
@@ -1,12 +1,12 @@
<template>
<div v-if="workspace" class="flex flex-col h-full bg-white">
- <!-- Top Bar -->
+
<div class="sticky top-0 z-50 bg-white h-[49px] border-b border-neutral-200 p-2 sm:px-4">
<div class="max-w-4xl mx-auto flex items-center justify-between flex-shrink-0 gap-2 px-2 sm:px-0">
<VTransition name="fade">
<div v-if="(forms?.length > 0) || isFilteringForms" class="flex items-center gap-2">
- <!-- Search -->
+
<UInput
v-model="search"
placeholder="Search forms..."
@@ -14,7 +14,6 @@
/>
- <!-- Tags filter -->
<USelectMenu
v-if="allTags.length > 0"
v-model="selectedTags"
@@ -25,7 +24,6 @@
:ui="{ content: 'min-w-fit' }"
/>
- <!-- Clear button -->
<UButton
v-if="isFilteringForms"
label="Clear"
@@ -37,7 +35,6 @@
<div class="grow" v-else />
</VTransition>
- <!-- Create form button -->
<TrackClick name="home_top_bar_create_form_click">
<UButton
v-if="!workspace?.is_readonly"
@@ -49,78 +46,82 @@
</div>
</div>
- <!-- Main Content -->
<div class="flex-1 overflow-y-auto p-4">
<div class="max-w-4xl mx-auto">
- <VTransition name="fade">
- <div v-if="isFetched && !isFormsLoading && (forms?.length === 0)" class="text-center py-16 px-4">
- <UIcon name="i-heroicons-document-plus" class="h-12 w-12 text-neutral-400 mx-auto" />
- <h3 class="mt-4 text-lg font-semibold text-neutral-900">
- Create your first form
- </h3>
- <p class="mt-1 text-sm text-neutral-500">
- Get started by creating a new form to collect responses.
- </p>
- <UButton
- v-if="!workspace?.is_readonly"
- class="mt-6"
- icon="i-heroicons-plus"
- label="Create Form"
- :to="{ name: 'forms-create' }"
- />
- </div>
-
- <div v-if="isFetched && !isFormsLoading && (forms?.length > 0) && enrichedForms.length === 0" class="text-center py-16 px-4">
- <UIcon name="i-heroicons-magnifying-glass" class="h-12 w-12 text-neutral-400 mx-auto" />
- <h3 class="mt-4 text-lg font-semibold text-neutral-900">
- No forms found
- </h3>
- <p class="mt-1 text-sm text-neutral-500">
- Your search and filter criteria did not match any forms.
- </p>
- <UButton
- v-if="isFilteringForms"
- class="mt-6"
- label="Clear Filters"
- variant="soft"
- @click="clearFilters"
- />
- </div>
-
- <!-- Forms List -->
- <div v-if="enrichedForms.length > 0" class="mb-10">
- <div class="flex flex-col gap-2 lg:mt-6">
- <FormCard
- v-for="form in enrichedForms"
- :key="form.id"
- :form="form"
- />
- </div>
-
- <!-- Loading Skeletons -->
- <div v-if="isLoadingMore" class="flex flex-col gap-2 mt-2">
- <FormCardSkeleton />
- <FormCardSkeleton class="opacity-60" />
- <FormCardSkeleton class="opacity-30" />
- </div>
-
- <!-- Completion Indicator -->
- <div v-else-if="!isComplete && totalPages > 1" class="flex justify-center items-center py-4">
- <div class="text-sm text-neutral-500">
- Loaded {{ currentPage }} of {{ totalPages }} pages
+ <ClientOnly>
+ <VTransition name="fade">
+ <div v-if="isFetched && !isFormsLoading && (forms?.length === 0)" class="text-center py-16 px-4">
+ <UIcon name="i-heroicons-document-plus" class="h-12 w-12 text-neutral-400 mx-auto" />
+ <h3 class="mt-4 text-lg font-semibold text-neutral-900">
+ Create your first form
+ </h3>
+ <p class="mt-1 text-sm text-neutral-500">
+ Get started by creating a new form to collect responses.
+ </p>
+ <UButton
+ v-if="!workspace?.is_readonly"
+ class="mt-6"
+ icon="i-heroicons-plus"
+ label="Create Form"
+ :to="{ name: 'forms-create' }"
+ />
+ </div>
+
+ <div v-if="isFetched && !isFormsLoading && (forms?.length > 0) && enrichedForms.length === 0" class="text-center py-16 px-4">
+ <UIcon name="i-heroicons-magnifying-glass" class="h-12 w-12 text-neutral-400 mx-auto" />
+ <h3 class="mt-4 text-lg font-semibold text-neutral-900">
+ No forms found
+ </h3>
+ <p class="mt-1 text-sm text-neutral-500">
+ Your search and filter criteria did not match any forms.
+ </p>
+ <UButton
+ v-if="isFilteringForms"
+ class="mt-6"
+ label="Clear Filters"
+ variant="soft"
+ @click="clearFilters"
+ />
+ </div>
+
+ <div v-if="enrichedForms.length > 0" class="mb-10">
+ <div class="flex flex-col gap-2 lg:mt-6">
+ <FormCard
+ v-for="form in enrichedForms"
+ :key="form.id"
+ :form="form"
+ />
+ </div>
+
+ <div v-if="isLoadingMore" class="flex flex-col gap-2 mt-2">
+ <FormCardSkeleton />
+ <FormCardSkeleton class="opacity-60" />
+ <FormCardSkeleton class="opacity-30" />
+ </div>
+
+ <div v-else-if="!isComplete && totalPages > 1" class="flex justify-center items-center py-4">
+ <div class="text-sm text-neutral-500">
+ Loaded {{ currentPage }} of {{ totalPages }} pages
+ </div>
+ </div>
+
+ <UpgradeBanner v-if="enrichedForms.length >= 2" class="mt-2" />
+ </div>
+
+ <div v-if="isFormsLoading" class="flex flex-col gap-2">
+ <FormCardSkeleton />
+ <FormCardSkeleton />
+ <FormCardSkeleton />
+ </div>
+ </VTransition>
+ <template #fallback>
+ <div class="flex flex-col gap-2">
+ <FormCardSkeleton />
+ <FormCardSkeleton />
+ <FormCardSkeleton />
</div>
- </div>
-
- <UpgradeBanner v-if="enrichedForms.length >= 2" class="mt-2" />
- </div>
-
- <!-- Loading Skeletons -->
- <div v-if="isFormsLoading" class="flex flex-col gap-2">
- <FormCardSkeleton />
- <FormCardSkeleton />
- <FormCardSkeleton />
- </div>
- </VTransition>
+ </template>
+ </ClientOnly>
</div>
</div>
<div id="home-portals" class="z-20" />
diff --git a/client/pages/index.vue b/client/pages/index.vue
index 9e573c39d..977dfaec4 100644
--- a/client/pages/index.vue
+++ b/client/pages/index.vue
@@ -21,12 +21,14 @@
class="h-4 w-px bg-neutral-900/10"
aria-hidden="true"
/>
- <a
- v-track.welcome_github_click
- target="_blank"
- class="flex items-center gap-x-1 hover:no-underline"
- href="https://github.com/jhumanj/opnform"
+ <TrackClick
+ name="welcome_github_click"
>
+ <a
+ target="_blank"
+ class="flex items-center gap-x-1 hover:no-underline"
+ href="https://github.com/jhumanj/opnform"
+ >
<span
class="absolute inset-0"
aria-hidden="true"
@@ -47,7 +49,8 @@
d="M8.25 4.5l7.5 7.5-7.5 7.5"
/>
</svg>
- </a>
+ </a>
+ </TrackClick>
</div>
</div>
<div class="max-w-4xl mx-auto text-center">
@@ -254,12 +257,14 @@
/>
</svg>
</a>
- <a
- v-track.welcome_github_click
- target="_blank"
- :href="configLinks.github_url"
- class="mr-4"
+ <TrackClick
+ name="welcome_github_click"
>
+ <a
+ target="_blank"
+ :href="configLinks.github_url"
+ class="mr-4"
+ >
<svg
class="w-6 h-6 text-white"
viewBox="0 0 24 24"
@@ -273,7 +278,8 @@
fill="currentColor"
/>
</svg>
- </a>
+ </a>
+ </TrackClick>
</div>
<p class="mt-12 text-white text-lg">
diff --git a/client/pages/templates/my-templates.vue b/client/pages/templates/my-templates.vue
index cb1c3b07f..0250283cb 100644
--- a/client/pages/templates/my-templates.vue
+++ b/client/pages/templates/my-templates.vue
@@ -1,6 +1,5 @@
<template>
<div class="flex flex-col h-full bg-white">
- <!-- Top Bar -->
<div class="sticky top-0 z-50 bg-white border-b border-neutral-200 p-2 sm:px-4">
<div class="max-w-4xl mx-auto flex items-center justify-between flex-wrap flex-shrink-0 gap-2 px-2 sm:px-0">
<h1 class="text-lg font-semibold text-neutral-900">My Form Templates</h1>
@@ -22,11 +21,9 @@
</div>
</div>
- <!-- Main Content -->
<div class="flex-1 overflow-y-auto p-4">
<div class="max-w-4xl mx-auto">
<VTransition name="fade">
- <!-- Templates List -->
<templates-list
v-if="loading || templates?.length > 0"
@@ -62,7 +59,6 @@
<script setup>
import { useCrisp } from '~/composables/useCrisp'
-import { computed } from 'vue'
definePageMeta({
middleware: "auth",
@@ -79,8 +75,7 @@ const { list } = useTemplates()
const { openHelpdeskArticle } = useCrisp()
const { data: templates, isLoading: loading } = list({
- params: { onlymy: true },
- enabled: computed(() => import.meta.client)
+ params: { onlymy: true }
})
const openTemplateGuide = () => {