Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
JhumanJ committed Dec 11, 2023
1 parent 6ee56ac commit 5c4dc2a
Show file tree
Hide file tree
Showing 34 changed files with 92 additions and 96 deletions.
2 changes: 1 addition & 1 deletion client/components/forms/FileInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
v-if="loading"
class="text-gray-600 dark:text-gray-400"
>
<loader class="mx-auto h-6 w-6" />
<Loader class="mx-auto h-6 w-6" />
<p class="mt-2 text-center text-sm text-gray-500">
Uploading your file...
</p>
Expand Down
2 changes: 1 addition & 1 deletion client/components/forms/FlatSelectInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<slot name="label" />
</template>

<loader v-if="loading" key="loader" class="h-6 w-6 text-nt-blue mx-auto" />
<Loader v-if="loading" key="loader" class="h-6 w-6 text-nt-blue mx-auto" />
<div v-for="(option, index) in options" v-else :key="option[optionKey]" role="button"
:class="[theme.default.input,'cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-900 flex',{ 'mb-2': index !== options.length,'!ring-red-500 !ring-2': hasValidation && form.errors.has(name), '!cursor-not-allowed !bg-gray-200':disabled }]"
@click="onSelect(option[optionKey])"
Expand Down
2 changes: 1 addition & 1 deletion client/components/forms/ImageInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
@drop.prevent="onUploadDropEvent($event)"
>
<div v-if="loading" class="text-gray-600 dark:text-gray-400">
<loader class="h-6 w-6 mx-auto m-10" />
<Loader class="h-6 w-6 mx-auto m-10" />
<p class="text-center mt-6">
Uploading your file...
</p>
Expand Down
4 changes: 2 additions & 2 deletions client/components/forms/components/VSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
>
<div :class="{'h-6': !multiple, 'min-h-8': multiple && !loading}">
<transition name="fade" mode="out-in">
<loader v-if="loading" key="loader" class="h-6 w-6 text-nt-blue mx-auto" />
<Loader v-if="loading" key="loader" class="h-6 w-6 text-nt-blue mx-auto" />
<div v-else-if="modelValue" key="value" class="flex" :class="{'min-h-8': multiple}">
<slot name="selected" :option="modelValue" />
</div>
Expand Down Expand Up @@ -45,7 +45,7 @@
/>
</div>
<div v-if="loading" class="w-full py-2 flex justify-center">
<loader class="h-6 w-6 text-nt-blue mx-auto" />
<Loader class="h-6 w-6 text-nt-blue mx-auto" />
</div>
<template v-if="filteredOptions.length > 0">
<li v-for="item in filteredOptions" :key="item[optionKey]" role="option" :style="optionStyle"
Expand Down
8 changes: 4 additions & 4 deletions client/components/global/Breadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<div class="px-4 mx-auto sm:px-6 lg:px-8 max-w-7xl">
<div class="flex items-center justify-center space-x-4">
<div v-if="displayHome" class="flex items-center">
<router-link class="text-gray-400 hover:text-gray-500" :to="{ name: (authenticated) ? 'home' : 'index' }">
<NuxtLink class="text-gray-400 hover:text-gray-500" :to="{ name: (authenticated) ? 'home' : 'index' }">
<svg class="flex-shrink-0 w-5 h-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M9.293 2.293a1 1 0 011.414 0l7 7A1 1 0 0117 11h-1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-3a1 1 0 00-1-1H9a1 1 0 00-1 1v3a1 1 0 01-1 1H5a1 1 0 01-1-1v-6H3a1 1 0 01-.707-1.707l7-7z"
clip-rule="evenodd"
/>
</svg>
<span class="sr-only">Home</span>
</router-link>
</NuxtLink>
<svg class="flex-shrink-0 w-5 h-5 text-gray-400 ml-4" viewBox="0 0 20 20" fill="currentColor"
aria-hidden="true"
>
Expand All @@ -26,11 +26,11 @@
</div>

<div v-for="(item,index) in path" :key="index" class="flex items-center">
<router-link v-if="item.route" class="text-sm font-semibold text-gray-500 hover:text-gray-700 truncate"
<NuxtLink v-if="item.route" class="text-sm font-semibold text-gray-500 hover:text-gray-700 truncate"
:to="item.route"
>
{{ item.label }}
</router-link>
</NuxtLink>
<div v-else class="text-sm font-semibold sm:w-full w-36 text-blue-500 truncate">
{{ item.label }}
</div>
Expand Down
36 changes: 18 additions & 18 deletions client/components/global/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,43 @@
<div class="max-w-7xl mx-auto px-8">
<div class="flex items-center justify-between h-16">
<div class="flex items-center">
<router-link :to="{ name: user ? 'home' : 'index' }" class="flex-shrink-0 font-semibold hover:no-underline flex items-center">
<NuxtLink :to="{ name: user ? 'home' : 'index' }" class="flex-shrink-0 font-semibold hover:no-underline flex items-center">
<img src="/img/logo.svg" alt="notion tools logo" class="w-8 h-8">

<span
class="ml-2 text-md hidden sm:inline text-black dark:text-white"
>
OpnForm</span>
</router-link>
</NuxtLink>
<workspace-dropdown class="ml-6" />
</div>
<div v-if="showAuth" class="hidden md:block ml-auto relative">
<router-link v-if="$route.name !== 'templates'" :to="{name:'templates'}"
<NuxtLink v-if="$route.name !== 'templates'" :to="{name:'templates'}"
class="text-sm text-gray-600 dark:text-white hover:text-gray-800 cursor-pointer mt-1 mr-8"
>
Templates
</router-link>
<router-link v-if="$route.name !== 'ai-form-builder'" :to="{name:'ai-form-builder'}"
</NuxtLink>
<NuxtLink v-if="$route.name !== 'ai-form-builder'" :to="{name:'ai-form-builder'}"
class="text-sm text-gray-600 dark:text-white hidden lg:inline hover:text-gray-800 cursor-pointer mt-1 mr-8"
>
AI Form Builder
</router-link>
<router-link v-if="paidPlansEnabled && (user===null || (user && workspace && !workspace.is_pro)) && $route.name !== 'pricing'" :to="{name:'pricing'}"
</NuxtLink>
<NuxtLink v-if="paidPlansEnabled && (user===null || (user && workspace && !workspace.is_pro)) && $route.name !== 'pricing'" :to="{name:'pricing'}"
class="text-sm text-gray-600 dark:text-white hover:text-gray-800 cursor-pointer mt-1 mr-8"
>
<span v-if="user">Upgrade</span>
<span v-else>Pricing</span>
</router-link>
</NuxtLink>
<a v-if="hasCrisp" href="#"
class="text-sm text-gray-600 dark:text-white hover:text-gray-800 cursor-pointer mt-1" @click.prevent="openCrisp"
>
Help
</a>
<a v-else :href="helpUrl"
<NuxtLink v-else :href="helpUrl"
class="text-sm text-gray-600 dark:text-white hover:text-gray-800 cursor-pointer mt-1" target="_blank"
>
Help
</a>
</NuxtLink>
</div>
<div v-if="showAuth" class="hidden md:block pl-5 border-gray-300 border-r h-5" />
<div v-if="showAuth" class="block">
Expand All @@ -59,7 +59,7 @@
</button>
</template>

<router-link v-if="userOnboarded" :to="{ name: 'home' }"
<NuxtLink v-if="userOnboarded" :to="{ name: 'home' }"
class="block block px-4 py-2 text-md text-gray-700 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-100 dark:hover:text-white dark:hover:bg-gray-600 flex items-center"
>
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 mr-2" fill="none" viewBox="0 0 24 24"
Expand All @@ -70,18 +70,18 @@
/>
</svg>
My Forms
</router-link>
</NuxtLink>

<router-link v-if="userOnboarded" :to="{ name: 'my_templates' }"
<NuxtLink v-if="userOnboarded" :to="{ name: 'my_templates' }"
class="block block px-4 py-2 text-md text-gray-700 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-100 dark:hover:text-white dark:hover:bg-gray-600 flex items-center"
>
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 mr-2" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" />
</svg>
My Templates
</router-link>
</NuxtLink>

<router-link :to="{ name: 'settings.profile' }"
<NuxtLink :to="{ name: 'settings.profile' }"
class="block block px-4 py-2 text-md text-gray-700 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-100 dark:hover:text-white dark:hover:bg-gray-600 flex items-center"
>
<svg class="w-4 h-4 mr-2" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
Expand All @@ -95,7 +95,7 @@
/>
</svg>
Settings
</router-link>
</NuxtLink>

<a href="#"
class="block block px-4 py-2 text-md text-gray-700 dark:text-white hover:bg-gray-100 hover:text-gray-900 dark:text-gray-100 dark:hover:text-white dark:hover:bg-gray-600 flex items-center"
Expand All @@ -112,12 +112,12 @@
</a>
</dropdown>
<div v-else class="flex gap-2">
<router-link v-if="$route.name !== 'login'" :to="{ name: 'login' }"
<NuxtLink v-if="$route.name !== 'login'" :to="{ name: 'login' }"
class="text-gray-600 dark:text-white hover:text-gray-800 dark:hover:text-white px-0 sm:px-3 py-2 rounded-md text-sm"
active-class="text-gray-800 dark:text-white"
>
Login
</router-link>
</NuxtLink>

<v-button v-track.nav_create_form_click size="small" :to="{ name: 'forms-create-guest' }" color="outline-blue" :arrow="true">
Create a form
Expand Down
10 changes: 5 additions & 5 deletions client/components/global/VButton.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<a v-if="href" :class="btnClasses" :href="href" :target="target">
<NuxtLink v-if="href" :class="btnClasses" :href="href" :target="target">
<slot />
</a>
</NuxtLink>
<button v-else-if="!to" :type="nativeType" :disabled="loading?true:null" :class="btnClasses"
@click="onClick($event)"
>
Expand All @@ -15,9 +15,9 @@
/>
</svg>
</template>
<loader v-else class="h-6 w-6 mx-auto" :class="`text-${colorShades['text']}`" />
<Loader v-else class="h-6 w-6 mx-auto" :class="`text-${colorShades['text']}`" />
</button>
<router-link v-else :class="btnClasses" :to="to" :target="target">
<NuxtLink v-else :class="btnClasses" :to="to" :target="target">
<span class="no-underline mx-auto">
<slot />
</span>
Expand All @@ -26,7 +26,7 @@
stroke-linejoin="round"
/>
</svg>
</router-link>
</NuxtLink>
</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion client/components/open/forms/OpenForm.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div v-if="isAutoSubmit">
<p class="text-center p-4">
<loader class="h-6 w-6 text-nt-blue mx-auto" />
<Loader class="h-6 w-6 text-nt-blue mx-auto" />
</p>
</div>
<form v-else-if="dataForm" @submit.prevent="">
Expand Down
2 changes: 1 addition & 1 deletion client/components/open/forms/OpenFormButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<template v-if="!loading">
<slot />
</template>
<loader v-else class="h-6 w-6 text-white mx-auto" />
<Loader v-else class="h-6 w-6 text-white mx-auto" />
</button>
</template>

Expand Down
2 changes: 1 addition & 1 deletion client/components/open/forms/components/FormEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</div>
</div>
<div v-else class="flex justify-center items-center">
<loader class="w-6 h-6" />
<Loader class="w-6 h-6" />
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion client/components/open/forms/components/FormStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
>

</div>
<loader v-else-if="isLoading" class="h-6 w-6 text-nt-blue mx-auto" />
<Loader v-else-if="isLoading" class="h-6 w-6 text-nt-blue mx-auto" />
<LineChart v-else
:options="chartOptions"
:data="chartData"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</div>
</modal>

<loader v-if="!form || !formInitDone" class="h-6 w-6 text-nt-blue mx-auto" />
<Loader v-if="!form || !formInitDone" class="h-6 w-6 text-nt-blue mx-auto" />
<div v-else>
<div v-if="form && tableData.length > 0" class="flex flex-wrap items-end">
<div class="flex-grow">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<span v-if="required" class="text-red-500 required-dot">*</span>
</label>

<loader v-if="loading" key="loader" class="h-6 w-6 text-nt-blue mx-auto" />
<Loader v-if="loading" key="loader" class="h-6 w-6 text-nt-blue mx-auto" />
<div v-else class="my-3">
<div v-for="(questionForm, quesKey) in allQuestions" :key="quesKey" class="bg-gray-100 p-2 mb-4">
<v-button color="red" size="small" class="mb-2" @click.prevent="onRemove(quesKey)">
Expand Down Expand Up @@ -64,7 +64,7 @@ export default {
watch: { },
computed: { },
methods: {
onAdd() {
this.allQuestions.push(this.newQuestion)
Expand Down
4 changes: 2 additions & 2 deletions client/components/open/tables/OpenTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@
</tr>
<tr v-if="loading" class="n-table-row border-t bg-gray-50 dark:bg-gray-900">
<td :colspan="form.properties.length" class="p-8 w-full">
<loader class="w-4 h-4 mx-auto" />
<Loader class="w-4 h-4 mx-auto" />
</td>
</tr>
</tbody>
<tbody v-else key="body-content" class="n-table-body">
<tr class="n-table-row loader w-full">
<td :colspan="form.properties.length" class="n-table-cell w-full p-8">
<loader v-if="loading" class="w-4 h-4 mx-auto" />
<Loader v-if="loading" class="w-4 h-4 mx-auto" />
<p v-else class="text-gray-500 text-center">
No data found.
</p>
Expand Down
12 changes: 6 additions & 6 deletions client/components/pages/OpenFormFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
</p>
</div>
<div class="flex justify-center mt-5 md:mt-0">
<router-link :to="{ name: user ? 'home' : 'index' }" class="flex-shrink-0 font-semibold flex items-center">
<NuxtLink :to="{ name: user ? 'home' : 'index' }" class="flex-shrink-0 font-semibold flex items-center">
<img src="/img/logo.svg" alt="notion tools logo" class="w-10 h-10">

<span class="ml-2 text-xl text-black dark:text-white">
OpnForm
</span>
</router-link>
</NuxtLink>
</div>
<ul class="flex justify-center mt-5 md:mt-1">
<li class="mr-10">
<router-link :to="{name:'privacy-policy'}" class="text-gray-600 dark:text-gray-400 transition-colors duration-300 hover:text-nt-blue">
<NuxtLink :to="{name:'privacy-policy'}" class="text-gray-600 dark:text-gray-400 transition-colors duration-300 hover:text-nt-blue">
Privacy Policy
</router-link>
</NuxtLink>
</li>
<li class="list-disc pl-3">
<router-link :to="{name:'terms-conditions'}" class="text-gray-600 dark:text-gray-400 transition-colors duration-300 hover:text-nt-blue">
<NuxtLink :to="{name:'terms-conditions'}" class="text-gray-600 dark:text-gray-400 transition-colors duration-300 hover:text-nt-blue">
Terms & Conditions
</router-link>
</NuxtLink>
</li>
</ul>
</div>
Expand Down
11 changes: 4 additions & 7 deletions client/components/pages/auth/components/RegisterForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@
</template>

<script>
import { computed } from 'vue'
import Form from 'vform'
import { useAuthStore } from '../../../../stores/auth.js'
import { initCrisp } from '../../../middleware/check-auth.js'
export default {
name: 'RegisterForm',
Expand All @@ -66,8 +63,10 @@ export default {
setup () {
const authStore = useAuthStore()
const amplitude = useAmplitude()
return {
authStore
authStore,
logEvent: amplitude.logEvent
}
},
Expand Down Expand Up @@ -127,10 +126,8 @@ export default {
await this.authStore.updateUser(data)
// Track event
this.$logEvent('register', { source: this.form.hear_about_us })
initCrisp(data)
this.$crisp.push(['set', 'session:event', [[['register', {}, 'blue']]]])
logEvent('register', { source: this.form.hear_about_us })
// AppSumo License
if (data.appsumo_license === false) {
Expand Down
2 changes: 1 addition & 1 deletion client/components/pages/forms/show/ExtraMenu.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<div v-if="loadingDuplicate || loadingDelete" class="pr-4 pt-2">
<loader class="h-6 w-6 mx-auto" />
<Loader class="h-6 w-6 mx-auto" />
</div>
<dropdown v-else class="inline" dusk="nav-dropdown">
<template #trigger="{toggle}">
Expand Down
Loading

0 comments on commit 5c4dc2a

Please sign in to comment.