fix: lead/deal details tab breaking in mobile view
This commit is contained in:
parent
3627f48cf4
commit
693c6a1eaf
@ -58,58 +58,23 @@
|
||||
@updateField="updateField"
|
||||
/>
|
||||
<div
|
||||
v-if="fieldsLayout.data"
|
||||
v-if="sections.data"
|
||||
class="flex flex-1 flex-col justify-between overflow-hidden"
|
||||
>
|
||||
<div class="flex flex-col overflow-y-auto">
|
||||
<div
|
||||
v-for="(section, i) in fieldsLayout.data"
|
||||
:key="section.name"
|
||||
class="flex flex-col px-2 py-3 sm:p-3"
|
||||
:class="{ 'border-b': i !== fieldsLayout.data.length - 1 }"
|
||||
>
|
||||
<Section :label="section.label" :opened="section.opened">
|
||||
<template #actions>
|
||||
<div v-if="section.contacts" class="pr-2">
|
||||
<Link
|
||||
value=""
|
||||
doctype="Contact"
|
||||
@change="(e) => addContact(e)"
|
||||
:onCreate="
|
||||
(value, close) => {
|
||||
_contact = {
|
||||
first_name: value,
|
||||
company_name: deal.data.organization,
|
||||
}
|
||||
showContactModal = true
|
||||
close()
|
||||
}
|
||||
"
|
||||
>
|
||||
<template #target="{ togglePopover }">
|
||||
<Button
|
||||
class="h-7 px-3"
|
||||
variant="ghost"
|
||||
icon="plus"
|
||||
@click="togglePopover()"
|
||||
/>
|
||||
</template>
|
||||
</Link>
|
||||
</div>
|
||||
</template>
|
||||
<SidePanelLayout
|
||||
v-if="section.columns?.[0].fields"
|
||||
:fields="section.columns[0].fields"
|
||||
:isLastSection="i == fieldsLayout.data.length - 1"
|
||||
doctype="CRM Deal"
|
||||
v-model="deal.data"
|
||||
:sections="sections.data"
|
||||
doctype="CRM Deal"
|
||||
v-slot="{ section }"
|
||||
@update="updateField"
|
||||
/>
|
||||
<div v-else>
|
||||
@reload="sections.reload"
|
||||
>
|
||||
<div
|
||||
v-if="
|
||||
dealContacts?.loading && dealContacts?.data?.length == 0
|
||||
"
|
||||
v-if="section.name == 'contacts_section'"
|
||||
class="contacts-area"
|
||||
>
|
||||
<div
|
||||
v-if="dealContacts?.loading && dealContacts?.data?.length == 0"
|
||||
class="flex min-h-20 flex-1 items-center justify-center gap-3 text-base text-ink-gray-4"
|
||||
>
|
||||
<LoadingIndicator class="h-4 w-4" />
|
||||
@ -120,10 +85,7 @@
|
||||
v-for="(contact, i) in section.contacts"
|
||||
:key="contact.name"
|
||||
>
|
||||
<div
|
||||
class="px-2 pb-2.5"
|
||||
:class="[i == 0 ? 'pt-5' : 'pt-2.5']"
|
||||
>
|
||||
<div class="px-2 pb-2.5" :class="[i == 0 ? 'pt-5' : 'pt-2.5']">
|
||||
<Section :opened="contact.opened">
|
||||
<template #header="{ opened, toggle }">
|
||||
<div
|
||||
@ -204,9 +166,7 @@
|
||||
{{ __('No contacts added') }}
|
||||
</div>
|
||||
</div>
|
||||
</Section>
|
||||
</div>
|
||||
</div>
|
||||
</SidePanelLayout>
|
||||
</div>
|
||||
</div>
|
||||
<Activities
|
||||
@ -257,7 +217,6 @@ import Activities from '@/components/Activities/Activities.vue'
|
||||
import OrganizationModal from '@/components/Modals/OrganizationModal.vue'
|
||||
import AssignTo from '@/components/AssignTo.vue'
|
||||
import ContactModal from '@/components/Modals/ContactModal.vue'
|
||||
import Link from '@/components/Controls/Link.vue'
|
||||
import Section from '@/components/Section.vue'
|
||||
import SidePanelLayout from '@/components/SidePanelLayout.vue'
|
||||
import SLASection from '@/components/SLASection.vue'
|
||||
@ -324,7 +283,7 @@ const deal = createResource({
|
||||
resource: {
|
||||
deal,
|
||||
dealContacts,
|
||||
fieldsLayout,
|
||||
sections,
|
||||
},
|
||||
call,
|
||||
}
|
||||
@ -490,7 +449,7 @@ const tabs = computed(() => {
|
||||
})
|
||||
const { tabIndex } = useActiveTabManager(tabs, 'lastDealTab')
|
||||
|
||||
const fieldsLayout = createResource({
|
||||
const sections = createResource({
|
||||
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_sidepanel_sections',
|
||||
cache: ['sidePanelSections', 'CRM Deal'],
|
||||
params: { doctype: 'CRM Deal' },
|
||||
@ -593,7 +552,7 @@ const dealContacts = createResource({
|
||||
cache: ['deal_contacts', props.dealId],
|
||||
auto: true,
|
||||
onSuccess: (data) => {
|
||||
let contactSection = fieldsLayout.data?.find(
|
||||
let contactSection = sections.data?.find(
|
||||
(section) => section.name == 'contacts_section',
|
||||
)
|
||||
if (!contactSection) return
|
||||
|
||||
@ -63,26 +63,16 @@
|
||||
@updateField="updateField"
|
||||
/>
|
||||
<div
|
||||
v-if="fieldsLayout.data"
|
||||
v-if="sections.data"
|
||||
class="flex flex-1 flex-col justify-between overflow-hidden"
|
||||
>
|
||||
<div class="flex flex-col overflow-y-auto">
|
||||
<div
|
||||
v-for="(section, i) in fieldsLayout.data"
|
||||
:key="section.name"
|
||||
class="flex flex-col px-2 py-3 sm:p-3"
|
||||
:class="{ 'border-b': i !== fieldsLayout.data.length - 1 }"
|
||||
>
|
||||
<Section :label="section.label" :opened="section.opened">
|
||||
<SidePanelLayout
|
||||
:fields="section.columns[0].fields"
|
||||
:isLastSection="i == fieldsLayout.data.length - 1"
|
||||
v-model="lead.data"
|
||||
:sections="sections.data"
|
||||
doctype="CRM Lead"
|
||||
@update="updateField"
|
||||
@reload="sections.reload"
|
||||
/>
|
||||
</Section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Activities
|
||||
@ -180,7 +170,6 @@ import LayoutHeader from '@/components/LayoutHeader.vue'
|
||||
import Activities from '@/components/Activities/Activities.vue'
|
||||
import AssignTo from '@/components/AssignTo.vue'
|
||||
import Link from '@/components/Controls/Link.vue'
|
||||
import Section from '@/components/Section.vue'
|
||||
import SidePanelLayout from '@/components/SidePanelLayout.vue'
|
||||
import SLASection from '@/components/SLASection.vue'
|
||||
import CustomActions from '@/components/CustomActions.vue'
|
||||
@ -240,7 +229,7 @@ const lead = createResource({
|
||||
deleteDoc: deleteLead,
|
||||
resource: {
|
||||
lead,
|
||||
fieldsLayout,
|
||||
sections,
|
||||
},
|
||||
call,
|
||||
}
|
||||
@ -410,7 +399,7 @@ watch(tabs, (value) => {
|
||||
}
|
||||
})
|
||||
|
||||
const fieldsLayout = createResource({
|
||||
const sections = createResource({
|
||||
url: 'crm.fcrm.doctype.crm_fields_layout.crm_fields_layout.get_sidepanel_sections',
|
||||
cache: ['sidePanelSections', 'CRM Lead'],
|
||||
params: { doctype: 'CRM Lead' },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user