More front-end bug fixes

This commit is contained in:
Julien Nahum 2024-02-10 12:46:17 +01:00
parent 91911bc6e5
commit e5dc3f1bd4
8 changed files with 10 additions and 9 deletions

View File

@ -138,7 +138,7 @@ export default {
if(this.compVal === null){ if(this.compVal === null){
return; return;
} }
if (!this.compVal.startsWith('+')) { if (!this.compVal?.startsWith('+')) {
this.selectedCountryCode = this.getCountryBy(this.compVal.substring(2, 0)) this.selectedCountryCode = this.getCountryBy(this.compVal.substring(2, 0))
} }

View File

@ -32,7 +32,7 @@
<template v-if="multiple"> <template v-if="multiple">
<div class="flex items-center truncate mr-6"> <div class="flex items-center truncate mr-6">
<span class="truncate"> <span class="truncate">
{{ selectedValues.join(', ') }} {{ selectedValues?.join(', ') }}
</span> </span>
</div> </div>
</template> </template>
@ -122,6 +122,7 @@ export default {
return null return null
}, },
updateModelValue(newValues){ updateModelValue(newValues){
if (newValues === null) newValues = []
this.selectedValues = newValues this.selectedValues = newValues
}, },
updateOptions (newItem) { updateOptions (newItem) {

View File

@ -53,7 +53,7 @@ export default {
if (this.disabled) { if (this.disabled) {
this.$refs.signaturePad.clearSignature() this.$refs.signaturePad.clearSignature()
} else { } else {
const { isEmpty, data } = this.$refs.signaturePad.saveSignature() const { isEmpty, data } = this.$refs.signaturePad?.saveSignature()
this.form[this.name] = (!isEmpty && data) ? data : null this.form[this.name] = (!isEmpty && data) ? data : null
} }
} }

View File

@ -23,7 +23,7 @@
<template v-for="worksp in workspaces" :key="worksp.id"> <template v-for="worksp in workspaces" :key="worksp.id">
<a href="#" <a href="#"
class="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" class="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"
:class="{'bg-blue-100 dark:bg-blue-900':workspace.id === worksp.id}" @click.prevent="switchWorkspace(worksp)" :class="{'bg-blue-100 dark:bg-blue-900':workspace?.id === worksp?.id}" @click.prevent="switchWorkspace(worksp)"
> >
<div class="rounded-full h-8 w-8 flex-shrink-0" role="button"> <div class="rounded-full h-8 w-8 flex-shrink-0" role="button">
<img v-if="isUrl(worksp.icon)" <img v-if="isUrl(worksp.icon)"

View File

@ -47,7 +47,7 @@
</open-form-button> </open-form-button>
<slot v-if="isLastPage" name="submit-btn" :submitForm="submitForm" /> <slot v-if="isLastPage" name="submit-btn" :submitForm="submitForm" />
<open-form-button v-else native-type="button" :color="form.color" :theme="theme" class="mt-2 px-8 mx-1" <open-form-button v-else-if="currentFieldsPageBreak" native-type="button" :color="form.color" :theme="theme" class="mt-2 px-8 mx-1"
@click.stop="nextPage" @click.stop="nextPage"
> >
{{ currentFieldsPageBreak.next_btn_text }} {{ currentFieldsPageBreak.next_btn_text }}

View File

@ -56,7 +56,7 @@ function initUpdatedForm() {
// Create a form.id watcher that updates working form // Create a form.id watcher that updates working form
watch(form, (form) => { watch(form, (form) => {
if (form.value) { if (form?.value) {
initUpdatedForm() initUpdatedForm()
} }
}) })

View File

@ -157,7 +157,7 @@ const editForm = (form) => {
showEditFormModal.value = true showEditFormModal.value = true
} }
const onTagClick = (tag) => { const onTagClick = (tag) => {
if (selectedTags.value.has(tag)) { if (selectedTags?.value?.has(tag)) {
selectedTags.value.remove(tag) selectedTags.value.remove(tag)
} else { } else {
selectedTags.value.add(tag) selectedTags.value.add(tag)

View File

@ -159,7 +159,7 @@ const saveChanges = () => {
// Update the workspace custom domain // Update the workspace custom domain
customDomainsForm.put('/open/workspaces/' + workspace.value.id + '/custom-domains', { customDomainsForm.put('/open/workspaces/' + workspace.value.id + '/custom-domains', {
data: { data: {
custom_domains: customDomainsForm.custom_domains.split('\n') custom_domains: customDomainsForm?.custom_domains?.split('\n')
.map(domain => domain ? domain.trim() : null) .map(domain => domain ? domain.trim() : null)
.filter(domain => domain && domain.length > 0) .filter(domain => domain && domain.length > 0)
} }
@ -175,7 +175,7 @@ const saveChanges = () => {
const initCustomDomains = () => { const initCustomDomains = () => {
if (!workspace || !workspace.value.custom_domains) return if (!workspace || !workspace.value.custom_domains) return
customDomainsForm.custom_domains = workspace.value.custom_domains.join('\n') customDomainsForm.custom_domains = workspace.value?.custom_domains.join('\n')
} }
const deleteWorkspace = (workspaceId) => { const deleteWorkspace = (workspaceId) => {