Update sales level styling and improve UI performance

- Standardize sales level color mapping across components
- Enhance delete button styling with flat variant and white text
- Improve stepper visualization with consistent color logic
- Optimize Safari scrolling performance with CSS transforms
- Add TypeScript casting for data operations
This commit is contained in:
Matt 2025-06-05 14:49:29 +02:00
parent afc709282f
commit ef091d7b29
2 changed files with 40 additions and 33 deletions

View File

@ -60,7 +60,7 @@
</v-btn> </v-btn>
<v-btn <v-btn
@click="confirmDelete" @click="confirmDelete"
variant="text" variant="flat"
color="error" color="error"
:loading="isDeleting" :loading="isDeleting"
:disabled=" :disabled="
@ -72,8 +72,8 @@
" "
class="ml-4" class="ml-4"
> >
<v-icon start>mdi-delete</v-icon> <v-icon start color="white">mdi-delete</v-icon>
Delete <span class="text-white">Delete</span>
</v-btn> </v-btn>
<v-btn <v-btn
variant="flat" variant="flat"
@ -109,7 +109,7 @@
:step="index" :step="index"
:complete="currentStep + 1 > index" :complete="currentStep + 1 > index"
:title="level" :title="level"
:color="currentStep === index ? 'primary' : 'grey'" :color="currentStep === index ? getSalesLevelColor(level) : (currentStep + 1 > index ? getSalesLevelColor(level) : 'grey')"
:icon="currentStep + 1 > index ? 'mdi-check' : undefined" :icon="currentStep + 1 > index ? 'mdi-check' : undefined"
/> />
<v-divider <v-divider
@ -381,6 +381,7 @@
<v-chip <v-chip
:color="getSalesLevelColor(item.value)" :color="getSalesLevelColor(item.value)"
size="small" size="small"
class="text-white"
> >
{{ item.value }} {{ item.value }}
</v-chip> </v-chip>
@ -388,21 +389,14 @@
<template v-slot:item="{ item, props }"> <template v-slot:item="{ item, props }">
<v-list-item <v-list-item
v-bind="props" v-bind="props"
:base-color="getSalesLevelColor(item.value)"
> >
<template v-slot:prepend> <template v-slot:prepend>
<v-icon :color="getSalesLevelColor(item.value)"> <v-icon :color="getSalesLevelColor(item.value)">
mdi-circle mdi-circle
</v-icon> </v-icon>
</template> </template>
<v-list-item-title> <v-list-item-title :style="{ color: getSalesLevelColor(item.value) }">
<v-chip
:color="getSalesLevelColor(item.value)"
size="small"
class="text-white"
>
{{ item.value }} {{ item.value }}
</v-chip>
</v-list-item-title> </v-list-item-title>
</v-list-item> </v-list-item>
</template> </template>
@ -729,8 +723,8 @@ const saveInterest = async () => {
try { try {
// Create a copy of the interest data without the Berths and Berth Recommendations fields // Create a copy of the interest data without the Berths and Berth Recommendations fields
const dataToSave = { ...interest.value }; const dataToSave = { ...interest.value };
delete dataToSave.Berths; delete (dataToSave as any).Berths;
delete dataToSave["Berth Recommendations"]; delete (dataToSave as any)["Berth Recommendations"];
// Call the update-interest API // Call the update-interest API
await $fetch("/api/update-interest", { await $fetch("/api/update-interest", {
@ -1036,24 +1030,20 @@ const formatDate = (dateString: string | null | undefined) => {
} }
}; };
// Get color for sales level // Get color for sales level - matching InterestSalesBadge.vue
const getSalesLevelColor = (level: string) => { const getSalesLevelColor = (level: string) => {
switch (level?.toLowerCase()) { const colorMapping = {
case "initial inquiry": "General Qualified Interest": "blue",
return "grey"; "Specific Qualified Interest": "green",
case "qualified interest": "LOI and NDA Sent": "orange",
return "blue"; "Signed LOI and NDA": "purple",
case "eoi sent": "Made Reservation": "pink",
return "orange"; "Contract Negotiation": "brown",
case "loi sent": "Contract Negotiations Finalized": "teal",
return "purple"; "Contract Signed": "indigo",
case "reservation agreement sent": };
return "green";
case "reserved": return colorMapping[level as keyof typeof colorMapping] || "grey";
return "success";
default:
return "grey";
}
}; };
// Confirm delete // Confirm delete

View File

@ -498,14 +498,31 @@ const getRelativeTime = (dateString: string) => {
opacity: 1; opacity: 1;
} }
/* Safari-specific fixes */ /* Safari-specific fixes and scrolling performance improvements */
.modern-table :deep(.v-table__wrapper) { .modern-table :deep(.v-table__wrapper) {
-webkit-transform: translateZ(0); -webkit-transform: translateZ(0);
transform: translateZ(0); transform: translateZ(0);
/* Improve scrolling performance */
will-change: scroll-position;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
} }
.modern-table :deep(.v-data-table__td) { .modern-table :deep(.v-data-table__td) {
min-width: 0; min-width: 0;
/* Optimize for better rendering */
contain: layout style paint;
}
/* Fix potential scrolling issues on desktop */
.modern-table :deep(.v-table) {
table-layout: fixed;
width: 100%;
}
.modern-table :deep(tbody tr) {
/* Prevent sub-pixel rendering issues */
transform: translateZ(0);
} }
/* Column width constraints */ /* Column width constraints */