Skip to main content

JavaScript Integration & Widget Interop

A Ctrl+K shortcut that focuses the global search from anywhere, and a server-confirmed clipboard copy of the selected work order's link. The browser focuses and copies; the server validates, decides and records.

Run it

cd "LearnWisej-Samples/Production Architecture Deep Dive\Module 9\TicketOps"
dotnet run -f net10.0 --urls http://localhost:5109

Then open http://localhost:5109 (or open TicketOps.slnx in Visual Studio and press F5). localhost counts as a secure context, so navigator.clipboard is available.

The screen

  • Search (searchBox, a GlobalSearchBox) with the Ctrl + K hint: Ctrl+K focuses it from anywhere, Esc clears it, ? shows the shortcut list.
  • Work-order grid, the selected work order, and Copy link.
  • LINK: the last link the server built, also the manual fallback when the browser refuses the copy.
  • AUDIT LOG: the server-side record, written only after the browser confirmed the copy.

Where things live

TicketOps/
├─ Views/WorkOrdersView the screen + the JavaScript extender
├─ Controls/GlobalSearchBox.cs TextBox + [WebMethod] ReportShortcut
├─ Controls/StatusBanner status line + banner
├─ Platform/ticketops.interop.js the client script
├─ Services/ TicketLinkService, AuditLogService, WorkOrderService
├─ Domain/ WorkOrder (CanShareLink), SessionUser, TicketLink, AuditEntry, OperationResult
├─ Data/ IWorkOrderRepository + in-memory implementation
├─ Infrastructure/ BrowserApi, SessionContext, ILog/ActivityLog, AppComposition
├─ Resources/Strings.cs user-facing messages
└─ docs/ the deliverables