|
125 | 125 | :sections="sections.data"
|
126 | 126 | :addContact="addContact"
|
127 | 127 | doctype="CRM Deal"
|
128 |
| - v-slot="{ section }" |
129 | 128 | @update="updateField"
|
130 | 129 | @reload="sections.reload"
|
131 | 130 | >
|
132 |
| - <div v-if="section.name == 'contacts_section'" class="contacts-area"> |
133 |
| - <div |
134 |
| - v-if="dealContacts?.loading && dealContacts?.data?.length == 0" |
135 |
| - class="flex min-h-20 flex-1 items-center justify-center gap-3 text-base text-ink-gray-4" |
136 |
| - > |
137 |
| - <LoadingIndicator class="h-4 w-4" /> |
138 |
| - <span>{{ __('Loading...') }}</span> |
| 131 | + <template #actions="{ section }"> |
| 132 | + <div v-if="section.name == 'contacts_section'" class="pr-2"> |
| 133 | + <Link |
| 134 | + value="" |
| 135 | + doctype="Contact" |
| 136 | + @change="(e) => addContact(e)" |
| 137 | + :onCreate=" |
| 138 | + (value, close) => { |
| 139 | + _contact = { |
| 140 | + first_name: value, |
| 141 | + company_name: deal.data.organization, |
| 142 | + } |
| 143 | + showContactModal = true |
| 144 | + close() |
| 145 | + } |
| 146 | + " |
| 147 | + > |
| 148 | + <template #target="{ togglePopover }"> |
| 149 | + <Button |
| 150 | + class="h-7 px-3" |
| 151 | + variant="ghost" |
| 152 | + icon="plus" |
| 153 | + @click="togglePopover()" |
| 154 | + /> |
| 155 | + </template> |
| 156 | + </Link> |
139 | 157 | </div>
|
| 158 | + </template> |
| 159 | + <template #default="{ section }"> |
140 | 160 | <div
|
141 |
| - v-else-if="dealContacts?.data?.length" |
142 |
| - v-for="(contact, i) in dealContacts.data" |
143 |
| - :key="contact.name" |
| 161 | + v-if="section.name == 'contacts_section'" |
| 162 | + class="contacts-area" |
144 | 163 | >
|
145 |
| - <div class="px-2 pb-2.5" :class="[i == 0 ? 'pt-5' : 'pt-2.5']"> |
146 |
| - <Section :opened="contact.opened"> |
147 |
| - <template #header="{ opened, toggle }"> |
148 |
| - <div |
149 |
| - class="flex cursor-pointer items-center justify-between gap-2 pr-1 text-base leading-5 text-ink-gray-7" |
150 |
| - > |
| 164 | + <div |
| 165 | + v-if="dealContacts?.loading && dealContacts?.data?.length == 0" |
| 166 | + class="flex min-h-20 flex-1 items-center justify-center gap-3 text-base text-ink-gray-4" |
| 167 | + > |
| 168 | + <LoadingIndicator class="h-4 w-4" /> |
| 169 | + <span>{{ __('Loading...') }}</span> |
| 170 | + </div> |
| 171 | + <div |
| 172 | + v-else-if="dealContacts?.data?.length" |
| 173 | + v-for="(contact, i) in dealContacts.data" |
| 174 | + :key="contact.name" |
| 175 | + > |
| 176 | + <div class="px-2 pb-2.5" :class="[i == 0 ? 'pt-5' : 'pt-2.5']"> |
| 177 | + <Section :opened="contact.opened"> |
| 178 | + <template #header="{ opened, toggle }"> |
151 | 179 | <div
|
152 |
| - class="flex h-7 items-center gap-2 truncate" |
153 |
| - @click="toggle()" |
| 180 | + class="flex cursor-pointer items-center justify-between gap-2 pr-1 text-base leading-5 text-ink-gray-7" |
154 | 181 | >
|
155 |
| - <Avatar |
156 |
| - :label="contact.full_name" |
157 |
| - :image="contact.image" |
158 |
| - size="md" |
159 |
| - /> |
160 |
| - <div class="truncate"> |
161 |
| - {{ contact.full_name }} |
| 182 | + <div |
| 183 | + class="flex h-7 items-center gap-2 truncate" |
| 184 | + @click="toggle()" |
| 185 | + > |
| 186 | + <Avatar |
| 187 | + :label="contact.full_name" |
| 188 | + :image="contact.image" |
| 189 | + size="md" |
| 190 | + /> |
| 191 | + <div class="truncate"> |
| 192 | + {{ contact.full_name }} |
| 193 | + </div> |
| 194 | + <Badge |
| 195 | + v-if="contact.is_primary" |
| 196 | + class="ml-2" |
| 197 | + variant="outline" |
| 198 | + :label="__('Primary')" |
| 199 | + theme="green" |
| 200 | + /> |
162 | 201 | </div>
|
163 |
| - <Badge |
164 |
| - v-if="contact.is_primary" |
165 |
| - class="ml-2" |
166 |
| - variant="outline" |
167 |
| - :label="__('Primary')" |
168 |
| - theme="green" |
169 |
| - /> |
170 |
| - </div> |
171 |
| - <div class="flex items-center"> |
172 |
| - <Dropdown :options="contactOptions(contact)"> |
| 202 | + <div class="flex items-center"> |
| 203 | + <Dropdown :options="contactOptions(contact)"> |
| 204 | + <Button |
| 205 | + icon="more-horizontal" |
| 206 | + class="text-ink-gray-5" |
| 207 | + variant="ghost" |
| 208 | + /> |
| 209 | + </Dropdown> |
173 | 210 | <Button
|
174 |
| - icon="more-horizontal" |
175 |
| - class="text-ink-gray-5" |
176 | 211 | variant="ghost"
|
177 |
| - /> |
178 |
| - </Dropdown> |
179 |
| - <Button |
180 |
| - variant="ghost" |
181 |
| - @click=" |
182 |
| - router.push({ |
183 |
| - name: 'Contact', |
184 |
| - params: { contactId: contact.name }, |
185 |
| - }) |
186 |
| - " |
187 |
| - > |
188 |
| - <ArrowUpRightIcon class="h-4 w-4" /> |
189 |
| - </Button> |
190 |
| - <Button variant="ghost" @click="toggle()"> |
191 |
| - <FeatherIcon |
192 |
| - name="chevron-right" |
193 |
| - class="h-4 w-4 text-ink-gray-9 transition-all duration-300 ease-in-out" |
194 |
| - :class="{ 'rotate-90': opened }" |
195 |
| - /> |
196 |
| - </Button> |
| 212 | + @click=" |
| 213 | + router.push({ |
| 214 | + name: 'Contact', |
| 215 | + params: { contactId: contact.name }, |
| 216 | + }) |
| 217 | + " |
| 218 | + > |
| 219 | + <ArrowUpRightIcon class="h-4 w-4" /> |
| 220 | + </Button> |
| 221 | + <Button variant="ghost" @click="toggle()"> |
| 222 | + <FeatherIcon |
| 223 | + name="chevron-right" |
| 224 | + class="h-4 w-4 text-ink-gray-9 transition-all duration-300 ease-in-out" |
| 225 | + :class="{ 'rotate-90': opened }" |
| 226 | + /> |
| 227 | + </Button> |
| 228 | + </div> |
| 229 | + </div> |
| 230 | + </template> |
| 231 | + <div |
| 232 | + class="flex flex-col gap-1.5 text-base text-ink-gray-8" |
| 233 | + > |
| 234 | + <div class="flex items-center gap-3 pb-1.5 pl-1 pt-4"> |
| 235 | + <Email2Icon class="h-4 w-4" /> |
| 236 | + {{ contact.email }} |
| 237 | + </div> |
| 238 | + <div class="flex items-center gap-3 p-1 py-1.5"> |
| 239 | + <PhoneIcon class="h-4 w-4" /> |
| 240 | + {{ contact.mobile_no }} |
197 | 241 | </div>
|
198 | 242 | </div>
|
199 |
| - </template> |
200 |
| - <div class="flex flex-col gap-1.5 text-base text-ink-gray-8"> |
201 |
| - <div class="flex items-center gap-3 pb-1.5 pl-1 pt-4"> |
202 |
| - <Email2Icon class="h-4 w-4" /> |
203 |
| - {{ contact.email }} |
204 |
| - </div> |
205 |
| - <div class="flex items-center gap-3 p-1 py-1.5"> |
206 |
| - <PhoneIcon class="h-4 w-4" /> |
207 |
| - {{ contact.mobile_no }} |
208 |
| - </div> |
209 |
| - </div> |
210 |
| - </Section> |
| 243 | + </Section> |
| 244 | + </div> |
| 245 | + <div |
| 246 | + v-if="i != dealContacts.data.length - 1" |
| 247 | + class="mx-2 h-px border-t border-outline-gray-modals" |
| 248 | + /> |
211 | 249 | </div>
|
212 | 250 | <div
|
213 |
| - v-if="i != dealContacts.data.length - 1" |
214 |
| - class="mx-2 h-px border-t border-outline-gray-modals" |
215 |
| - /> |
216 |
| - </div> |
217 |
| - <div |
218 |
| - v-else |
219 |
| - class="flex h-20 items-center justify-center text-base text-ink-gray-5" |
220 |
| - > |
221 |
| - {{ __('No contacts added') }} |
| 251 | + v-else |
| 252 | + class="flex h-20 items-center justify-center text-base text-ink-gray-5" |
| 253 | + > |
| 254 | + {{ __('No contacts added') }} |
| 255 | + </div> |
222 | 256 | </div>
|
223 |
| - </div> |
| 257 | + </template> |
224 | 258 | </SidePanelLayout>
|
225 | 259 | </div>
|
226 | 260 | </Resizer>
|
@@ -278,6 +312,7 @@ import OrganizationModal from '@/components/Modals/OrganizationModal.vue'
|
278 | 312 | import AssignTo from '@/components/AssignTo.vue'
|
279 | 313 | import FilesUploader from '@/components/FilesUploader/FilesUploader.vue'
|
280 | 314 | import ContactModal from '@/components/Modals/ContactModal.vue'
|
| 315 | +import Link from '@/components/Controls/Link.vue' |
281 | 316 | import Section from '@/components/Section.vue'
|
282 | 317 | import SidePanelLayout from '@/components/SidePanelLayout.vue'
|
283 | 318 | import SLASection from '@/components/SLASection.vue'
|
|
0 commit comments