Real-time SMS consent status update on customer record
When kiosk consent is completed, the staff-facing customer Details page now updates the SMS badge instantly via SignalR — no page refresh needed. Added customerId to the NewInAppNotification SignalR payload so the KioskConsent handler can match the current URL and swap the badge in place. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -173,6 +173,7 @@
|
||||
<i class="bi bi-envelope-slash me-1"></i>Email off
|
||||
</span>
|
||||
}
|
||||
<span id="sms-status-section">
|
||||
@if (Model.NotifyBySms)
|
||||
{
|
||||
<span class="badge bg-success bg-opacity-10 text-success border border-success border-opacity-25"
|
||||
@@ -200,6 +201,7 @@
|
||||
<i class="bi bi-x-circle me-1"></i>Cancel Consent
|
||||
</button>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1914,7 +1914,8 @@
|
||||
const icons = {
|
||||
QuoteApproved: { icon: 'bi-check-circle-fill', cls: 'success', title: 'Quote Approved' },
|
||||
QuoteDeclined: { icon: 'bi-x-circle-fill', cls: 'danger', title: 'Quote Declined' },
|
||||
InvoicePaid: { icon: 'bi-cash-coin', cls: 'primary', title: 'Payment Received' }
|
||||
InvoicePaid: { icon: 'bi-cash-coin', cls: 'primary', title: 'Payment Received' },
|
||||
KioskConsent: { icon: 'bi-chat-fill', cls: 'success', title: 'SMS Consent' }
|
||||
};
|
||||
const t = icons[data.notificationType] || { icon: 'bi-bell', cls: 'info', title: 'Notification' };
|
||||
toastr[t.cls === 'danger' ? 'warning' : t.cls === 'primary' ? 'info' : 'success'](
|
||||
@@ -1922,6 +1923,12 @@
|
||||
`<i class="bi ${t.icon} me-1"></i>${t.title}`,
|
||||
{ timeOut: 10000, extendedTimeOut: 3000, closeButton: true, enableHtml: true }
|
||||
);
|
||||
if (data.notificationType === 'KioskConsent' && data.customerId) {
|
||||
const path = window.location.pathname.toLowerCase();
|
||||
if (path === `/customers/details/${data.customerId}`) {
|
||||
window.updateCustomerSmsStatus?.();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
connection.start().catch(err => console.warn('SignalR connection failed:', err));
|
||||
|
||||
Reference in New Issue
Block a user