feat: Complete Phase 4 to 100% - All forms now have consistent error handling
Some checks failed
ParentFlow CI/CD Pipeline / Backend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Frontend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Security Scanning (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-app/maternal-app-backend dockerfile:Dockerfile.production name:backend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-web dockerfile:Dockerfile.production name:frontend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Development (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled

Updated 4 additional pages to reach 100% Phase 4 completion:

1. Reset Password Page (auth/reset-password)
   - Added extractError() for password reset failures
   - Improved error messaging for expired tokens

2. Children Page (children/page)
   - Updated fetch, save, and delete operations
   - All 3 error handlers now use extractError()

3. Analytics Page (analytics/page)
   - Updated children loading, insights, and predictions
   - All 3 API calls now have consistent error handling

4. Advanced Analytics Page (analytics/advanced/page)
   - Updated 6 error handlers (children, circadian, anomalies, growth, correlations, trends)
   - Consistent error extraction across all analytics features

Phase 4 Status: 100% COMPLETE 
- Total forms updated: 21/21 (100%)
- Auth forms: 4/4 
- Family & child management: 3/3 
- Activity tracking: 6/6 
- Settings & onboarding: 2/2 
- Analytics & children pages: 4/4  (NEW)
- Other pages: 2/2  (PhotoUpload, components)

Error Improvement Plan: ~90% complete
- Phase 1-4: 100% 
- Phase 5-6: Backend improvements (pending)

All frontend forms now use centralized error handling with user-friendly,
multilingual error messages from the errorHandler utility.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Andrei
2025-10-10 12:46:38 +00:00
parent 28dd8852af
commit 1b09a7d901
4 changed files with 34 additions and 17 deletions

View File

@@ -27,6 +27,7 @@ import { motion } from 'framer-motion';
import { useTranslation } from '@/hooks/useTranslation';
import { useLocalizedDate } from '@/hooks/useLocalizedDate';
import { useSelectedFamily } from '@/hooks/useSelectedFamily';
import { extractError } from '@/lib/utils/errorHandler';
export default function ChildrenPage() {
const { t } = useTranslation('children');
@@ -66,7 +67,8 @@ export default function ChildrenPage() {
setChildren(data);
} catch (err: any) {
console.error('Failed to fetch children:', err);
setError(err.response?.data?.message || t('errors.loadFailed'));
const errorData = extractError(err);
setError(errorData.userMessage || errorData.message);
} finally {
setLoading(false);
}
@@ -103,7 +105,8 @@ export default function ChildrenPage() {
setDialogOpen(false);
} catch (err: any) {
console.error('Failed to save child:', err);
throw new Error(err.response?.data?.message || t('errors.saveFailed'));
const errorData = extractError(err);
throw new Error(errorData.userMessage || errorData.message);
} finally {
setActionLoading(false);
}
@@ -120,7 +123,8 @@ export default function ChildrenPage() {
setChildToDelete(null);
} catch (err: any) {
console.error('Failed to delete child:', err);
setError(err.response?.data?.message || t('errors.deleteFailed'));
const errorData = extractError(err);
setError(errorData.userMessage || errorData.message);
} finally {
setActionLoading(false);
}