1
0
forked from test/crm

fix: preview of side panel modal

This commit is contained in:
Shariq Ansari 2025-01-02 15:03:42 +05:30
parent 3cdd594da9
commit e4c8e2727f
2 changed files with 19 additions and 22 deletions

View File

@ -37,26 +37,20 @@
:doctype="_doctype"
/>
<div v-if="preview" class="flex flex-1 flex-col border rounded">
<div
v-for="(section, i) in tabs.data[0].sections"
:key="section.name"
class="flex flex-col py-1.5 px-1"
:class="{
'border-b': i !== tabs.data[0].sections?.length - 1,
}"
<SidePanelLayout
:sections="{ data: tabs.data[0].sections }"
:doctype="_doctype"
v-model="data"
:preview="true"
v-slot="{ section }"
>
<Section
labelClass="p-2"
:label="section.label"
:opened="section.opened"
<div
v-if="section.name == 'contacts_section'"
class="flex h-16 items-center justify-center text-base text-ink-gray-5"
>
<SidePanelLayout
:fields="section.columns?.[0].fields || []"
:isLastSection="i == tabs.data[0].sections?.length - 1"
v-model="data"
/>
</Section>
</div>
{{ __('No contacts added') }}
</div>
</SidePanelLayout>
</div>
<div
v-else
@ -70,7 +64,6 @@
</Dialog>
</template>
<script setup>
import Section from '@/components/Section.vue'
import SidePanelLayout from '@/components/SidePanelLayout.vue'
import SidePanelLayoutEditor from '@/components/SidePanelLayoutEditor.vue'
import { useDebounceFn } from '@vueuse/core'

View File

@ -12,7 +12,7 @@
:label="section.label"
:opened="section.opened"
>
<template #actions>
<template v-if="!preview" #actions>
<div v-if="section.contacts" class="pr-2">
<Link
value=""
@ -371,6 +371,10 @@ const props = defineProps({
type: String,
default: 'CRM Lead',
},
preview: {
type: Boolean,
default: false,
},
})
const { getFormattedPercent, getFormattedFloat, getFormattedCurrency } =
@ -408,8 +412,8 @@ const _sections = computed(() => {
})
}
section.visible =
section.isContactsSection ||
section.columns[0].fields.filter((f) => f.visible).length
section.name == 'contacts_section' ||
section.columns?.[0].fields.filter((f) => f.visible).length
return section
})
})