- Add MOCK_ACCOUNTS with admin/123456 and worker/123456 as fallback
when real backend is unavailable
- apiLogin tries real backend first; falls through to mock only on failure
- Supports real JWT token flow when backend (port 3201) is available
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add LogsPage.tsx re-export alias pointing to LogListPage
- Add src/tests/log-ui-model.test.ts with 26 targeted tests for log
UI-model and helper semantics (getLogStatusMeta, findTodayLog
integration, format helpers, equipment labels, truncate,
getTodayDateString, WEATHER_OPTIONS)
- Refactor LogFormPage to use ADM Form/Form.Item/Form.Header for
section layout, ADM Input for text fields, ADM Stepper for worker
count; remove hand-rolled FieldLabel and RequiredMark helpers
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Make date field editable (initialized to today)
- Rename remark → note to match legacy h5/log.html semantics
- Add photo upload field to LogFormPage
- Move weather to optional (was incorrectly required)
- LogDetailPage: render note, photo gallery, author+created_at footer
- Weather block is now conditional (not forced)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix upload-token API: backend returns { uploadUrl, objectKey } directly
(camelCase, no ApiResponse wrapper); update UploadTokenResult interface
and remove incorrect res.data access
- Fix confirm API: backend returns { fileId, objectKey } directly (no url,
no ApiResponse wrapper); update ConfirmResult interface accordingly
- uploadPhoto now returns { url: blobUrl, extra: { objectKey } } so the
ImageUploader can show a local preview while HazardReportPage submits
the confirmed objectKey (via extra) rather than the ephemeral blob URL
- Fix geolocation: getCurrentPosition returns void, not a watch ID;
remove the incorrect cast and clearWatch cleanup call; drop unused gpsWatchId ref
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- vite.config.ts: use loadEnv() to read VITE_BASE (base path) and
DEV_API_TARGET (proxy target) from .env; falls back to '/' and
http://127.0.0.1:3201 so local dev is unchanged
- App.tsx: pass basename={import.meta.env.BASE_URL} to BrowserRouter
so router paths align with the Vite base at runtime
- global.css: change #root overflow from hidden to auto so page
content is scrollable
- .env: document VITE_BASE, VITE_API_BASE, DEV_API_TARGET defaults
- src/config.ts: expose apiBase helper for runtime API prefix
- tsconfig.json: add vite/client types so import.meta.env is typed
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>