feat(directory) : open detail page on row click, drop inline address from drawers

This commit is contained in:
Matthieu
2026-06-22 13:46:05 +02:00
parent fb8cc790d7
commit 21eeb36766
5 changed files with 2 additions and 77 deletions
@@ -21,21 +21,6 @@
label="Téléphone"
input-class="w-full"
/>
<MalioInputText
v-model="form.street"
label="Rue"
input-class="w-full"
/>
<MalioInputText
v-model="form.city"
label="Ville"
input-class="w-full"
/>
<MalioInputText
v-model="form.postalCode"
label="Code Postal"
input-class="w-full"
/>
<div class="mt-6 flex justify-end">
<MalioButton
@@ -75,9 +60,6 @@ const form = reactive({
name: '',
email: '',
phone: '',
street: '',
city: '',
postalCode: '',
})
const touched = reactive({
@@ -91,16 +73,10 @@ watch(() => props.modelValue, (open) => {
form.name = props.client.name ?? ''
form.email = props.client.email ?? ''
form.phone = props.client.phone ?? ''
form.street = props.client.street ?? ''
form.city = props.client.city ?? ''
form.postalCode = props.client.postalCode ?? ''
} else {
form.name = ''
form.email = ''
form.phone = ''
form.street = ''
form.city = ''
form.postalCode = ''
}
touched.name = false
touched.email = false
@@ -119,9 +95,6 @@ async function handleSubmit() {
name: form.name.trim(),
email: form.email.trim() || null,
phone: form.phone.trim() || null,
street: form.street.trim() || null,
city: form.city.trim() || null,
postalCode: form.postalCode.trim() || null,
}
if (isEditing.value && props.client) {
@@ -26,21 +26,6 @@
:label="$t('prospects.fields.phone')"
input-class="w-full"
/>
<MalioInputText
v-model="form.street"
:label="$t('prospects.fields.street')"
input-class="w-full"
/>
<MalioInputText
v-model="form.city"
:label="$t('prospects.fields.city')"
input-class="w-full"
/>
<MalioInputText
v-model="form.postalCode"
:label="$t('prospects.fields.postalCode')"
input-class="w-full"
/>
<MalioSelect
v-model="form.status"
:label="$t('prospects.fields.status')"
@@ -121,9 +106,6 @@ const form = reactive<{
company: string
email: string
phone: string
street: string
city: string
postalCode: string
status: ProspectStatus
source: string
notes: string
@@ -132,9 +114,6 @@ const form = reactive<{
company: '',
email: '',
phone: '',
street: '',
city: '',
postalCode: '',
status: 'new',
source: '',
notes: '',
@@ -151,9 +130,6 @@ watch(() => props.modelValue, (open) => {
form.company = props.prospect.company ?? ''
form.email = props.prospect.email ?? ''
form.phone = props.prospect.phone ?? ''
form.street = props.prospect.street ?? ''
form.city = props.prospect.city ?? ''
form.postalCode = props.prospect.postalCode ?? ''
form.status = props.prospect.status ?? 'new'
form.source = props.prospect.source ?? ''
form.notes = props.prospect.notes ?? ''
@@ -162,9 +138,6 @@ watch(() => props.modelValue, (open) => {
form.company = ''
form.email = ''
form.phone = ''
form.street = ''
form.city = ''
form.postalCode = ''
form.status = 'new'
form.source = ''
form.notes = ''
@@ -186,9 +159,6 @@ async function handleSubmit() {
company: form.company.trim() || null,
email: form.email.trim() || null,
phone: form.phone.trim() || null,
street: form.street.trim() || null,
city: form.city.trim() || null,
postalCode: form.postalCode.trim() || null,
status: form.status,
source: form.source.trim() || null,
notes: form.notes.trim() || null,
@@ -31,9 +31,6 @@
<template #cell-phone="{ item }">
{{ (item as Client).phone ?? '—' }}
</template>
<template #cell-city="{ item }">
{{ (item as Client).city ?? '—' }}
</template>
</MalioDataTable>
</div>
</template>
@@ -142,7 +139,6 @@ const clientColumns = [
{ key: 'name', label: t('prospects.fields.name') },
{ key: 'email', label: t('prospects.fields.email') },
{ key: 'phone', label: t('prospects.fields.phone') },
{ key: 'city', label: t('prospects.fields.city') },
]
async function loadClients() {
@@ -155,8 +151,7 @@ function openCreateClient() {
}
function openEditClient(item: Record<string, unknown>) {
selectedClient.value = item as Client
clientDrawerOpen.value = true
navigateTo(`/directory/clients/${(item as Client).id}`)
}
// --- Prospects ---
@@ -215,8 +210,7 @@ function openCreateProspect() {
}
function openEditProspect(item: Record<string, unknown>) {
selectedProspect.value = item as Prospect
prospectDrawerOpen.value = true
navigateTo(`/directory/prospects/${(item as Prospect).id}`)
}
async function convertProspect(row: ProspectRow) {
@@ -4,16 +4,10 @@ export type Client = {
name: string
email: string | null
phone: string | null
street: string | null
city: string | null
postalCode: string | null
}
export type ClientWrite = {
name: string
email: string | null
phone: string | null
street: string | null
city: string | null
postalCode: string | null
}
@@ -9,9 +9,6 @@ export type Prospect = {
company: string | null
email: string | null
phone: string | null
street: string | null
city: string | null
postalCode: string | null
status: ProspectStatus
source: string | null
notes: string | null
@@ -25,9 +22,6 @@ export type ProspectWrite = {
company: string | null
email: string | null
phone: string | null
street: string | null
city: string | null
postalCode: string | null
status: ProspectStatus
source: string | null
notes: string | null