Fix notification bell, SMS consent kiosk flow, and button alignment
Notification bell:
- Bell now polls /InAppNotifications/Recent every 60s as a SignalR fallback
- Bell dropdown refresh on open so count is always current when staff looks at it
SMS consent → kiosk flow:
- Staff clicks "Get SMS Consent" on Customer Details → AJAX POST to
/Kiosk/PushSmsConsent stores customer in IMemoryCache (10 min TTL)
- Kiosk PollSession returns smsConsentPending + customerId so tablet navigates
to /Kiosk/SmsConsent/{customerId} automatically
- Customer reads TCPA consent on tablet, taps I Agree or No Thanks
- On agree: NotifyBySms/SmsConsentedAt/SmsConsentMethod set; in-app notification
fires; cache cleared; tablet returns to Welcome
- Removed Customers/SmsConsent (staff-browser version); moved view to Kiosk/
Button alignment:
- kiosk.css: added display:flex + align-items:center + justify-content:center to
all kiosk body buttons so content is centred vertically in tall button outlines
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -185,11 +185,13 @@
|
||||
<span class="badge bg-secondary bg-opacity-10 text-secondary border border-secondary border-opacity-25">
|
||||
<i class="bi bi-chat-slash me-1"></i>SMS off
|
||||
</span>
|
||||
<a href="/Customers/SmsConsent/@Model.Id"
|
||||
class="badge bg-primary bg-opacity-10 text-primary border border-primary border-opacity-25 text-decoration-none"
|
||||
title="Present SMS consent form to customer">
|
||||
<button type="button"
|
||||
class="badge bg-primary bg-opacity-10 text-primary border border-primary border-opacity-25 border-0"
|
||||
style="cursor:pointer;"
|
||||
title="Send SMS consent form to the front-desk kiosk tablet"
|
||||
onclick="pushSmsConsent(@Model.Id)">
|
||||
<i class="bi bi-chat-dots me-1"></i>Get SMS Consent
|
||||
</a>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -549,3 +551,8 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@section Scripts {
|
||||
<script src="~/js/customer-details.js" asp-append-version="true"></script>
|
||||
}
|
||||
|
||||
|
||||
+10
-2
@@ -9,7 +9,7 @@
|
||||
<h2 class="fw-bold mb-1" style="font-size:1.6rem;">SMS Notifications</h2>
|
||||
<p class="text-muted mb-4">Please read the following and tap <strong>I Agree</strong> to opt in.</p>
|
||||
|
||||
<form method="post" action="/Customers/SmsConsent/@Model">
|
||||
<form method="post" action="/Kiosk/SmsConsent/@Model">
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" name="agreed" value="true" />
|
||||
|
||||
@@ -33,7 +33,9 @@
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-3">
|
||||
<a href="/Customers/Details/@Model" class="btn btn-outline-secondary"
|
||||
<a href="/Kiosk/SmsConsent/@Model?agreed=false"
|
||||
onclick="event.preventDefault(); document.getElementById('declineForm').submit();"
|
||||
class="btn btn-outline-secondary"
|
||||
style="min-height:64px;border-radius:12px;font-size:1.1rem;flex:0 0 auto;padding:0 2rem;">
|
||||
<i class="bi bi-x-lg me-1"></i> No Thanks
|
||||
</a>
|
||||
@@ -42,4 +44,10 @@
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@* Separate form for decline so "No Thanks" can POST with agreed=false *@
|
||||
<form id="declineForm" method="post" action="/Kiosk/SmsConsent/@Model" style="display:none;">
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" name="agreed" value="false" />
|
||||
</form>
|
||||
</div>
|
||||
@@ -2101,8 +2101,14 @@
|
||||
});
|
||||
});
|
||||
|
||||
// Load on page ready
|
||||
document.addEventListener('DOMContentLoaded', load);
|
||||
// Load on page ready and refresh when dropdown is opened
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
load();
|
||||
btn?.addEventListener('show.bs.dropdown', load);
|
||||
});
|
||||
|
||||
// Fallback poll every 60 s in case SignalR misses a push
|
||||
setInterval(load, 60_000);
|
||||
|
||||
return { addItem, incrementBadge, markAllRead, openDetail, markRead };
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user