feat(sales): update opportunity product and overview flows
This commit is contained in:
@@ -34,6 +34,12 @@
|
||||
}
|
||||
onMount(() => {
|
||||
checkMobile();
|
||||
console.log("[OpportunityLoad] Description values:", {
|
||||
description: (opportunity as Record<string, unknown> | null)?.description,
|
||||
notes: opportunity?.notes ?? null,
|
||||
name: opportunity?.name ?? null,
|
||||
opportunityId,
|
||||
});
|
||||
window.addEventListener("resize", checkMobile);
|
||||
return () => window.removeEventListener("resize", checkMobile);
|
||||
});
|
||||
@@ -56,7 +62,9 @@
|
||||
function guardedSetTab(tab: Tab) {
|
||||
if (activeTab === tab) return;
|
||||
if (productsEditing) {
|
||||
if (!confirm('You have unsaved product changes. Discard and switch tabs?')) {
|
||||
if (
|
||||
!confirm("You have unsaved product changes. Discard and switch tabs?")
|
||||
) {
|
||||
return;
|
||||
}
|
||||
productsEditing = false;
|
||||
@@ -76,12 +84,18 @@
|
||||
localProductSequence = e.detail;
|
||||
}
|
||||
|
||||
function handleProductsChanged(e: CustomEvent<PageData["products"]>) {
|
||||
products = e.detail;
|
||||
}
|
||||
|
||||
// Mobile nav state
|
||||
let mobileActiveTab: Tab | null = null;
|
||||
|
||||
function selectMobileTab(tab: Tab) {
|
||||
if (productsEditing) {
|
||||
if (!confirm('You have unsaved product changes. Discard and switch tabs?')) {
|
||||
if (
|
||||
!confirm("You have unsaved product changes. Discard and switch tabs?")
|
||||
) {
|
||||
return;
|
||||
}
|
||||
productsEditing = false;
|
||||
@@ -92,7 +106,7 @@
|
||||
|
||||
function mobileBack() {
|
||||
if (productsEditing) {
|
||||
if (!confirm('You have unsaved product changes. Discard and go back?')) {
|
||||
if (!confirm("You have unsaved product changes. Discard and go back?")) {
|
||||
return;
|
||||
}
|
||||
productsEditing = false;
|
||||
@@ -277,6 +291,7 @@
|
||||
initialProductId={pendingProductId}
|
||||
bind:isEditing={productsEditing}
|
||||
on:sequenceSaved={handleSequenceSaved}
|
||||
on:productsChanged={handleProductsChanged}
|
||||
/>
|
||||
{:else if activeTab === "Notes"}
|
||||
<NotesTab
|
||||
|
||||
Reference in New Issue
Block a user