From ff2f475ae4ce84ad06ac376ea77e14269ce0b5f7 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Sun, 28 Dec 2025 09:13:16 +0100 Subject: [PATCH] fix: improve onboarding UX and fix order sync error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove redundant 1/4 progress counter from header - Make step indicators mobile-friendly (smaller circles, hidden labels) - Add CSV URL help text pointing to Letzshop Admin > API > Export Products - Fix AttributeError in order sync progress (use correct model attributes) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- app/services/onboarding_service.py | 27 ++++++++------ app/templates/vendor/onboarding.html | 56 +++++++++++++--------------- static/vendor/js/onboarding.js | 6 +-- 3 files changed, 43 insertions(+), 46 deletions(-) diff --git a/app/services/onboarding_service.py b/app/services/onboarding_service.py index fd9c6e4f..083d4c69 100644 --- a/app/services/onboarding_service.py +++ b/app/services/onboarding_service.py @@ -541,28 +541,31 @@ class OnboardingService: elif job.status == "failed": progress = 0 elif job.status == "processing": - if job.total_shipments and job.total_shipments > 0: - progress = int((job.processed_shipments or 0) / job.total_shipments * 100) + # Use orders_processed and shipments_fetched for progress + total = job.shipments_fetched or 0 + processed = job.orders_processed or 0 + if total > 0: + progress = int(processed / total * 100) else: progress = 50 # Indeterminate + elif job.status == "fetching": + # Show partial progress during fetch phase + if job.total_pages and job.total_pages > 0: + progress = int((job.current_page or 0) / job.total_pages * 50) + else: + progress = 25 # Indeterminate # Determine current phase - current_phase = None - if job.status == "fetching": - current_phase = "fetching" - elif job.status == "processing": - current_phase = "orders" - elif job.status == "completed": - current_phase = "complete" + current_phase = job.current_phase or job.status return { "job_id": job.id, "status": job.status, "progress_percentage": progress, "current_phase": current_phase, - "orders_imported": job.processed_shipments or 0, - "orders_total": job.total_shipments, - "products_imported": 0, # TODO: Track this + "orders_imported": job.orders_imported or 0, + "orders_total": job.shipments_fetched, + "products_imported": job.products_matched or 0, "started_at": job.started_at, "completed_at": job.completed_at, "estimated_remaining_seconds": None, # TODO: Calculate diff --git a/app/templates/vendor/onboarding.html b/app/templates/vendor/onboarding.html index 8153a15d..e866cc0c 100644 --- a/app/templates/vendor/onboarding.html +++ b/app/templates/vendor/onboarding.html @@ -23,51 +23,45 @@ Wizamart -
- -
- -
- -
-
- -
- / 4 + +
+ +
+
-
+
-