Commit graph

36 commits

Author SHA1 Message Date
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
Adam Moussa
7e971f8dcb Add PO and TT fields to work order form, make due date optional
- Remove required attribute from due date input
- Add Customer PO and TT text inputs in the Schedule & Priority section
2026-04-16 18:36:01 -04:00
Adam Moussa
049934478c Sort all activity tabs oldest-first with newest at bottom
- CommentTimeline and AuditTimeline both sort by date ascending
- Auto-scroll to bottom on all tabs for consistency
2026-04-16 18:33:37 -04:00
Adam Moussa
287839d089 Update audit log immediately after status change
- Append audit entry to local state after successful status update
- No page refresh needed to see the change in the Audit Log tab
2026-04-16 18:32:03 -04:00
Adam Moussa
24c83c6535 Render status dropdown via React portal to fix transparency
- Menu now renders on document.body via createPortal
- Positioned using getBoundingClientRect from the badge button
- Eliminates all parent stacking context / overflow issues
2026-04-16 18:30:45 -04:00
Adam Moussa
4c54d3499f Fix status dropdown transparency issue
- Set explicit white background on menu and option elements
- Increase z-index to 1000 to ensure it renders above all content
2026-04-16 18:28:19 -04:00
Adam Moussa
3b15a43879 Add interactive status dropdown on work order view page
- Click the status badge to open a dropdown with all status options
- Status change calls ChangeStatus API and updates locally
- Color-coded status dots in the dropdown menu
- Closes on outside click
- Also logged in audit trail via backend ChangeStatus endpoint
2026-04-16 18:27:00 -04:00
Adam Moussa
d3a4bcc984 Add comment input on Internal and Vendor tabs
- Add CommentInput component with textarea and send button
- Enter to send, Shift+Enter for new line
- New comments append to the list immediately without reload
- Fixed 400px height for tab content with scrollable overflow
- Comment input bar pinned at bottom of tab container
- Add addComment API function calling AddCommentJson endpoint
- Auto-scroll to newest comment
2026-04-16 18:22:34 -04:00
Adam Moussa
dc8c8b68f3 Map frontend form fields to backend DTO fields on work order edit
- Frontend uses workOrderNumber/title/assignedTo, backend expects
  WorkerOrderNumber/WorkerOrderTitle/AssignTo
- Prevents null overwrite of existing data on save
2026-04-16 18:12:44 -04:00
Adam Moussa
d979d5571a Add four-tab activity section: Customer, Vendor, Internal, Audit Log
- Filter comments by commentType field (customer, vendor, internal)
- Add AuditTimeline component showing field changes with old → new values
- Pass auditLog from API response to view page
2026-04-16 18:09:57 -04:00
Adam Moussa
1958973968 Split activity into customer and vendor comment tabs
- Extract CommentTimeline into reusable component
- Filter comments: customer (from ingest pipeline, has recordType/commenter)
  vs vendor (internal, has userName from ApplicationUser)
- Add tab UI to switch between streams with counts
- Format comment timestamps with formatDateTime
- Show "No comments yet" when a tab is empty
2026-04-16 18:01:25 -04:00
Adam Moussa
b0811aae65 Format created date on work order list page
- Add render function to createdDate column
- Same YYYY-MM-DD HH:MM TZ format as the view page
2026-04-16 17:59:05 -04:00
Adam Moussa
9bae91f281 Format created date as YYYY-MM-DD HH:MM TZ on view page
- Parse timestamp as UTC, display in user's local timezone
- 24-hour format with short timezone name (e.g. 2026-04-16 17:27 EDT)
2026-04-16 17:54:21 -04:00
Adam Moussa
9c2c8321de Remove estimated hours and sync priority options to Sev 1-5
- Remove estimatedHours from form state, API mapping, and form UI
- Replace Low/Medium/High/Urgent priority options with Sev 1 through Sev 5
- Adjust date row from 3 columns to 2 columns
2026-04-16 17:49:48 -04:00
Adam Moussa
a7391cb02b Fix undefined work order ID on edit save
- formData.id was undefined because id isn't in the initial form state
- Pass id from useParams explicitly when calling editWorkOrder
2026-04-16 17:47:21 -04:00
Adam Moussa
0ccf8bdbbc Populate location dropdown from API in work order form
- Fetch locations from /api/Contact/GetLocations on mount
- Replace hardcoded dropdown options with dynamic list
- Switch form field from location (string) to locationId (int)
- Include locationId in API response mapping
2026-04-16 17:45:19 -04:00
Adam Moussa
62d2b3103e Navigate back to view page from work order edit form
- Cancel and save now return to /workorders/:id when editing
- New work orders still navigate to the list
2026-04-16 17:42:47 -04:00
Adam Moussa
03b2572773 Add work order detail/view page
- Create WorkOrderViewPage with details grid, status badge, and activity timeline
- Add /workorders/:id route for view, keep /workorders/edit/:id for edit
- List page now navigates to view page instead of edit
- Include comments and commenter fields in API response mapping
2026-04-16 17:41:11 -04:00
Adam Moussa
cdf7477059 Map API response fields to form state in getWorkOrderById
- workerOrderNumber → workOrderNumber
- assignee → assignedTo
- Format dates for date input fields
- Default empty strings for null fields
2026-04-16 17:37:21 -04:00
Adam Moussa
fad2b7d661 Fix controlled input warning on all form pages
- Merge API response into form state instead of replacing it
- Null values from the API now fall back to the form's default values
- Prevents React controlled-to-uncontrolled input warning
2026-04-16 17:34:53 -04:00
Adam Moussa
9ae7c9b262 Add auth token to ApiService requests
- services/api.js was not sending Authorization header on any request
- Import getAccessToken and include it in all ApiService.request() calls
2026-04-16 17:12:38 -04:00
Adam Moussa
2dcb140d10 Consolidate duplicate form CSS into shared FormPage.css
- Create styles/FormPage.css from ContactFormPage.css
- Update contacts and accounts form pages to import shared CSS
- Delete 4 duplicate ContactFormPage.css copies
2026-04-16 16:54:03 -04:00
Adam Moussa
7db23a5597 Replace 11 duplicate hooks with single usePaginatedList
- Create shared hooks/usePaginatedList.js accepting a fetch function and optional extra params
- Update all 7 list pages to use the shared hook
- Delete 11 individual hook files (useItems, useEmployees, useLocations, etc.)
2026-04-16 16:53:52 -04:00
Adam Moussa
186fea820b Remove dead code: unused components and sample data
- Delete Contacts.js, ContactTable.js (never imported)
- Delete data/contacts.js (unused sample data)
- Delete App.css (not imported anywhere)
2026-04-16 16:53:39 -04:00
Adam Moussa
58c6ac6bcc Fix error swallowing in apiUtil and stale auth headers
- Restore error propagation in all fetch methods (was commented out)
- Change static header objects to functions so auth token is fresh per request
- Add missing return in putFormBody
- Properly throw on 401 unauthorized responses
2026-04-16 16:32:10 -04:00
Adam Moussa
e7fb682f71 Consolidate auth/token management into tokenUtility
- Make tokenUtility.js the single source of truth for localStorage
- Add getRawToken() and isAuthenticated() to tokenUtility
- Rewrite authService.js to delegate storage to tokenUtility
- Fix calendar api.js direct localStorage access
- Remove unused setToken import from apiUtil.js
2026-04-16 16:25:26 -04:00
Adam Moussa
ec8cca86d1 Configure frontend for local development
- Use relative API URLs instead of hardcoded production/localhost URLs
- Fix setupProxy.js for http-proxy-middleware v3 syntax
- Point proxy to backend HTTP port for dev compatibility
2026-04-16 16:25:19 -04:00
npalOmega
1ce41dda83 prod url flipped 2026-03-30 13:39:32 -05:00
npalOmega
65ec768e13 UI changes checking in 2026-03-30 07:53:42 -05:00
npalOmega
8417d708ac fix 2026-01-21 16:25:57 -06:00
npalOmega
933e93c845 fixed style, added new pages, refactored 2026-01-20 15:05:00 -06:00
npalOmega
3f3dcc70f6 fix 2026-01-13 12:03:46 -06:00
npalOmega
27d68b50e9 commiting changes 2026-01-11 17:35:46 -06:00
npalOmega
3461d3159e adding first commit 2026-01-11 17:35:33 -06:00
npalOmega
90a7556392 Initialize project using Create React App 2025-08-11 19:13:42 -05:00