Commit graph

85 commits

Author SHA1 Message Date
Adam Moussa
bbcd1eb4e1 Wire Follow Ups list and form to backend
Replaces the mock api with real endpoints, fixes list column mappings
to match the backend payload, and realigns the form to the FollowUps
model (Reason, ScheduleDate, ScheduleStartTime, EmployeeId, AccountId,
LocationId, WorkOrderId) with real lookup dropdowns for Employee,
Account, and Location. Also redesigns the list header to match the
Work Orders toolbar + chip filter look.
2026-04-20 13:49:58 -04:00
Adam Moussa
a349a58822 Group sidebar nav by purpose
Replaces the flat 16-item list with six sections (Overview, Operations,
Vendors, Customers & Sites, Internal, System) and adds section titles
that collapse into dividers when the sidebar is collapsed.
2026-04-20 13:49:52 -04:00
Adam Moussa
2a6fe6f35e Add NTE uplift UI, vendor PO pages, and portal POs tab
Vendors can now request NTE uplifts from the dispatch detail page and
dispatchers can approve or deny them (with tier-gated buttons) from
the work order view. Admin uplift queue page lists all requests with
status/tier filters. New Vendor POs section lists every PO with a
detail page showing vendor, linked WOs, uplift history, checklist,
signoffs, comments, and scoped audit log with print support. Vendor
portal gets a POs tab alongside Work so vendors can reconcile by PO
number.
2026-04-20 13:26:08 -04:00
Adam Moussa
c98a905d4d Merge feature/vendor-portal into dev 2026-04-20 12:45:09 -04:00
Adam Moussa
168fa69a87 Add vendor portal UI
- Separate route tree at /v/:token (no SHOC chrome); session resolved via
  X-Vendor-Token header
- Dashboard lists only the vendor's own dispatches with status filters
- Dispatch detail: accept + status transitions (Acknowledged -> In Progress ->
  Completed), request cancel, checklist toggles, customer signoff before vendor
  signoff, comments attributed by type (dispatcher / vendor / customer)
- SignaturePad component (mouse + touch canvas, drawn or typed)
- Admin vendor form: portal token panel to generate, copy, rotate, or revoke
  the portal link
2026-04-20 12:02:00 -04:00
Adam Moussa
3b3086d873 Update TODO with completed items and vendor portal next steps 2026-04-17 16:33:18 -04:00
Adam Moussa
da51d4a5be Add Cancel Dispatch button to dispatch detail modal
- Red outlined button on the left side of actions row
- Confirmation prompt before cancelling
- Hidden when dispatch is already cancelled or verified
- Updates status to Cancelled and refreshes
2026-04-17 16:31:48 -04:00
Adam Moussa
913d75802c Polish dispatch workflow — custom items, name input, read-only after verify
- Custom checklist items in dispatch modal (type + Enter, removable chips)
- Add checklist item input in dispatch detail modal
- SignatureCapture now has proper Full Name field instead of prompt()
- Verified dispatches are read-only: edit hidden, checkboxes disabled, signoff buttons disabled
- Custom items sent as CustomChecklistItems in dispatch payload
2026-04-17 16:26:22 -04:00
Adam Moussa
dc81078df7 Add multi-WO selection to dispatch modal
- Current WO shown as non-removable chip
- Dropdown shows all WOs at same site, filtered by locationId server-side
- Search bar filters the dropdown list
- Click to add, X to remove additional WOs
- Header shows count when multiple WOs selected
- All selected WO IDs sent to backend
2026-04-17 16:13:18 -04:00
Adam Moussa
199715d5b6 Add Verify & Close button and verified banner to dispatch detail
- Verify & Close button at bottom of dispatch modal
- Disabled with tooltip showing missing items (checklist, signoffs)
- Green verified banner after verification with verifier name + timestamp
- Verified status badge (dark green)
- Added Verified to DISPATCH_STATUSES constant
- verifyDispatch API function
2026-04-17 16:03:34 -04:00
Adam Moussa
5c24b9249d Add sign-off UI with signature capture component
- SignatureCapture component: canvas drawing pad + typed mode with cursive preview
- Two sign-off slots in dispatch detail modal: Customer and Vendor
- Collect Signature button opens capture modal, prompts for name
- Signed slots show signature thumbnail, name, and timestamp
- Green "All Signed" badge when both complete
- addDispatchSignoff API function
2026-04-17 15:51:20 -04:00
Adam Moussa
31479029e3 Add time tracking to dispatch workflow
- timeSince utility: relative time display (2h ago, 3d ago)
- timeBetween utility: duration between two timestamps
- waitTimeColor utility: green (<4h), yellow (4-24h), red (>24h)
- Dispatch detail modal shows accepted time with duration
- Awaiting acceptance shows elapsed time with color coding
- Dispatches table shows Wait column with color-coded time for Sent dispatches
2026-04-17 15:41:51 -04:00
Adam Moussa
5dcfc9d303 Show acceptance status in dispatch detail modal
- Accepted field shows green timestamp when acknowledged
- Shows "Awaiting acceptance" in yellow when status is Sent
2026-04-17 15:39:50 -04:00
Adam Moussa
62bc2f058c Add checklist UI to dispatch workflow
- Task List Template picker in dispatch modal
- Checklist section in dispatch detail modal with toggleable items
- Shows completion count, completed by user name + timestamp
- Strikethrough styling on completed items
- fetchTaskTemplates, updateChecklistItem, addChecklistItem API functions
2026-04-17 15:28:52 -04:00
Adam Moussa
714376c61b Update dispatch for multi-WO support
- Pass WorkOrderIds array in dispatch API call
- DispatchDetailModal shows WO list from junction table in header
- dispatchToVendor API simplified to pass full payload
2026-04-17 15:16:28 -04:00
Adam Moussa
4de6c54fc0 Add Task Templates settings page with shared settings nav
- Task Templates page: create/edit templates with checklist items
- Add/remove/reorder items, save template with name + description
- SettingsNav component with tab links between Dropdown Options and Task Templates
- taskTemplateApi in services/api.js
- Route at /settings/task-templates
2026-04-17 14:57:18 -04:00
Adam Moussa
27fb70724b Remove Vendor tab from Activity section
- Vendor communication now lives in the dispatch detail modal
- Activity tabs: Customer, Internal, Audit Log
- Comment input only shows on Internal tab
2026-04-17 14:03:41 -04:00
Adam Moussa
2a23febcec Add dispatch detail modal with vendor communication thread
- Click dispatch row to open detail modal
- View/edit dispatch status, NTE, scheduled/completed dates, description
- Vendor Communication thread with message input
- Send email toggle — messages optionally email the vendor
- Modal sized for long email threads with scrollable communication area
- Dispatch table shows dispatch number, clickable rows
2026-04-17 14:01:13 -04:00
Adam Moussa
7428a6d5e3 Add project TODO tracking deferred work items 2026-04-17 13:08:19 -04:00
Adam Moussa
0d847896db Move status and assignee filters to server-side
- Pass status and assignee as API query parameters
- Filters applied in SQL for accurate counts across all pages
- Remove client-side row filtering
- Pagination and total count now reflect filtered results
2026-04-17 12:57:37 -04:00
Adam Moussa
ddbe1ae375 Update total count to reflect active filters
- Toolbar shows "X of Y" when status or assignee filter is active
- Pagination bar totalCount reflects filtered row count
- Extracted filter logic into filteredRows variable for reuse
2026-04-17 12:52:59 -04:00
Adam Moussa
e2fc183636 Move sorting to server-side for full dataset ordering
- usePaginatedList now manages sortBy/sortDir state
- Sort params passed to fetch function and sent to API
- SharedTable receives sort state as props instead of managing internally
- Clicking column headers triggers API refetch with new sort
- Removes client-side sorting that only worked on current page
2026-04-17 12:50:23 -04:00
Adam Moussa
79f7b4782a Add assigned to filter on work order list
- Dropdown filter next to status chips with All Assignees, Unassigned, and user list
- Filters combine with status filter
- Styled as rounded select matching filter bar aesthetic
2026-04-17 12:45:29 -04:00
Adam Moussa
1ae58e56c3 Add column sorting, reorder, and show/hide to SharedTable
- Click any column header to sort (toggle asc/desc)
- Default sort by Last Updated descending
- Sort indicator arrow on active column
- Gear icon in pagination bar opens column config panel
- Drag to reorder columns in the config panel
- Checkbox to show/hide individual columns
- Column resize still works (stopPropagation on handle)
2026-04-17 12:40:41 -04:00
Adam Moussa
4b44237b61 Add Last Updated column to work order list
- Maps lastUpdated from API response
- Formatted as YYYY-MM-DD HH:MM TZ, shows dash when never updated
2026-04-17 12:33:30 -04:00
Adam Moussa
7b544d26db Move pagination bar above the table 2026-04-17 12:28:13 -04:00
Adam Moussa
b26fde454d Redesign pagination bar with button group page size selector
- Records per page as a button group (12/24/48/96) with active highlight
- First/prev/next/last navigation buttons
- Current page number as blue badge
- Showing X-Y of Z range display
- Resets to page 1 when changing page size
2026-04-17 12:26:11 -04:00
Adam Moussa
0455fdf2ec Change dispatch to single vendor select per dispatch
- Switch from checkbox multi-select to radio button single select
- One vendor per dispatch, can dispatch multiple times for multiple vendors
- Selected vendor shown as chip below the list
2026-04-17 12:22:37 -04:00
Adam Moussa
766ad20774 Fix vendor item layout — checkbox left, distance right
- Switch from label to div to avoid global label CSS overriding flex layout
- Checkbox, vendor info, and distance badge now on the same row
2026-04-17 12:19:09 -04:00
Adam Moussa
7bb5133523 Redesign vendor item layout in dispatch modal
- Checkbox on the left, vendor info in the middle, distance badge on the right
- Distance shown as large blue number with "miles" label in a rounded badge
- Vendor address on its own line below trades
2026-04-17 12:16:38 -04:00
Adam Moussa
2769dc23ba Swap trade and address order in dispatch vendor list
- Trade shown directly under company name in blue
- Address and distance shown on the bottom line
2026-04-17 11:59:34 -04:00
Adam Moussa
c09ac4460b Show vendor address and distance in dispatch modal
- Pass locationZip to vendor dropdown API for distance calculation
- Display vendor address and distance in miles (blue, bold)
- Vendors sorted by proximity when site has a zip code
- Include locationZip in WO API response mapping
2026-04-17 11:56:15 -04:00
Adam Moussa
2a4cd5da75 Add searchable vendor picker and scheduled date to dispatch modal
- Vendor list now has search input to filter by name or trade
- Selected vendors shown as removable chips below the list
- NTE and Vendor Scheduled Date side-by-side in the modal
- Sends ScheduledDate with dispatch request
2026-04-17 11:47:19 -04:00
Adam Moussa
0167a1aa75 Add vendor pages and dispatch UI
- Vendor CRUD: list page with search, create/edit form with trade specialty chips
- Vendor routes, sidebar nav item with truck icon
- vendorApi in services/api.js
- Dispatch button on WO view page opens DispatchModal
- DispatchModal: vendor multi-select filtered by trade, NTE field, description
- Dispatches CollapsibleSection with PO table on WO view page
- fetchVendorsDropdown and dispatchToVendor API functions
- dispatches included in getWorkOrderById response mapping
2026-04-17 11:37:49 -04:00
Adam Moussa
feacb72337 Add WO fields, collapsible sections, assign dropdown, settings page
- New Classification section: Problem, Trade, SubTrade dropdowns (SubTrade filters by Trade)
- New Schedule fields: Scheduled, Completed dates
- New Financial section: Vendor NTE, Customer NTE placeholder
- All sections below Details default collapsed with toggle arrows
- Assigned To on view page is now a clickable dropdown like status
- TT moved to Details section
- Dropdown options settings page at /settings/dropdowns with add/edit/delete
- Settings link in sidebar and user dropdown
2026-04-17 10:40:55 -04:00
Adam Moussa
46bf66a35d Show internal WO number in list WO # column
- Prioritize internalWONumber over workOrderNumber in row mapping
2026-04-16 19:32:52 -04:00
Adam Moussa
fb5bed9647 Revert actions column to original grid layout 2026-04-16 19:31:30 -04:00
Adam Moussa
5aa194c7be Wire up dashboard tiles with live data, keep tables
- Fetch stats from /api/Dashboard/Stats endpoint
- KPI tiles show real counts and navigate on click
- Restore Priority Analysis and Invoice Analysis tables (placeholder data)
2026-04-16 19:25:42 -04:00
Adam Moussa
2477bcf5a6 Add user dropdown menu and notification panel to topbar
- Click user section to open dropdown with profile, settings, password, sign out
- Shows user avatar, name, and email in dropdown header
- Click notification bell to open panel showing empty state
- Both use portal-rendered dropdowns, close on outside click
- Removed standalone logout button, moved into user dropdown
2026-04-16 19:21:26 -04:00
Adam Moussa
11e3d3d31f Redesign top header bar
- Remove search box from topbar (search is now on list pages)
- Clean notification bell icon
- User avatar with initials, name, and role displayed
- Divider between notifications and user section
- Logout as subtle icon button instead of red inline-styled button
- Remove inline styles, all styling via CSS classes
2026-04-16 19:18:27 -04:00
Adam Moussa
3a13d94b71 Add 600ms debounce to search in usePaginatedList
- Typing updates the input immediately but delays the API call
- Table keeps showing current results until the search settles
- Resets to page 1 when search changes
- Applies to all list pages using the shared hook
2026-04-16 19:16:04 -04:00
Adam Moussa
9dec7cb448 Redesign work order list toolbar with inline search and filter chips
- Replace ActionBar dropdown and search section with clean toolbar
- Prominent "+ New Work Order" button on the right
- Inline search input in the toolbar
- Status filter chips (All, Open, In Progress, On Hold, Done, Cancelled)
- Show total count next to title
- Remove unused ActionBar import and viewMode state
2026-04-16 19:13:30 -04:00
Adam Moussa
0d473b97db Replace field-specific search with global search input
- Remove dropdown selector and search button
- Use standalone woSearchInput class to avoid inherited border issues
- Single text input searches across all fields as you type
2026-04-16 19:10:54 -04:00
Adam Moussa
fe62f5fb0a Add vertical borders between grid columns for visual separation
- Light borders between body cells, slightly darker between headers
- No border on the last column
2026-04-16 19:05:57 -04:00
Adam Moussa
29fe1173d2 Add interactive status and assigned to dropdowns on work order list
- Status column shows colored badge with dropdown to change status
- Assigned To column shows dropdown to reassign work orders
- Both use portal-rendered menus and update rows locally
- Fix grid cell vertical alignment to center content
- Both changes logged in audit trail
2026-04-16 19:04:59 -04:00
Adam Moussa
168383b0ee Clamp column resize so neither column goes below 50px
- Limit drag diff so both the dragged and neighbor column stay >= 50px
- Prevents columns from collapsing or going negative
2026-04-16 18:59:24 -04:00
Adam Moussa
33431ae449 Fix description textarea width — add missing col-sm-12 CSS rule
- col-sm-12 had no width defined, causing textarea to collapse
- Set description to 10 rows with no resize
2026-04-16 18:49:20 -04:00
Adam Moussa
ac34a1a5d3 Disable textarea resize on description field 2026-04-16 18:45:03 -04:00
Adam Moussa
b9e7d4f45e Add missing fields to form initial state
- Add internalWONumber, po, tt to initial formData
- Fixes "Edit Work Order undefined" header and null PO/TT inputs
2026-04-16 18:44:03 -04:00
Adam Moussa
9c83713971 Add internal 8-digit WO number, rename existing to Customer WO
- Pass internalWONumber through API mapping
- Edit page header shows "Edit Work Order XXXXXXXX"
- Rename "Work Order Number" field to "Customer WO" (not required)
- View page shows both Internal WO and Customer WO in details
- Breadcrumb uses internal WO number
- List WO # column shows internal number
2026-04-16 18:42:58 -04:00