From c4cf3a1d2e5b91de6e0c6f7260dbd58a3cfd466c Mon Sep 17 00:00:00 2001 From: vickytechkey Date: Tue, 18 Aug 2026 12:22:31 +0530 Subject: [PATCH] feat: design alignment and full UI implementation of dashboard and product wizards --- src/App.test.tsx | 31 +- src/App.tsx | 1854 +++++++++++++++++++++++++++++---------------- tsconfig.app.json | 4 +- 3 files changed, 1213 insertions(+), 676 deletions(-) diff --git a/src/App.test.tsx b/src/App.test.tsx index 6b020bb..62f4944 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -206,8 +206,8 @@ describe('Supplier Portal Onboarding & Active Dashboard Tests', () => { fireEvent.click(finishBtn) // Redirects to Dashboard Page - expect(screen.getByText('Performance Analytics')).toBeInTheDocument() - expect(screen.getByText(/Total Sales Volume/i)).toBeInTheDocument() + expect(screen.getByText(/Welcome back, Artisan!/i)).toBeInTheDocument() + expect(screen.getByText(/Total Sales/i)).toBeInTheDocument() alertMock.mockRestore() }) @@ -228,33 +228,26 @@ describe('Supplier Portal Onboarding & Active Dashboard Tests', () => { fireEvent.click(submitBtn) // Check dashboard rendering - expect(await screen.findByText('Performance Analytics')).toBeInTheDocument() + expect(await screen.findByText(/Welcome back, Artisan!/i)).toBeInTheDocument() // Check Sidebar Tab click: Manage Products - const productsTabBtn = screen.getByText(/Manage Products/i) + const productsTabBtn = screen.getByText(/Products/i) fireEvent.click(productsTabBtn) - expect(screen.getByText(/Active Inventory/i)).toBeInTheDocument() - expect(screen.getByText(/Upload New Product/i)).toBeInTheDocument() + expect(screen.getAllByText(/Products/i).length).toBeGreaterThan(0) + expect(screen.getByText(/\+ Add New Product/i)).toBeInTheDocument() // Check Sidebar Tab click: Orders & Transit - const ordersTabBtn = screen.getByText(/Orders & Transit/i) + const ordersTabBtn = screen.getByText(/Orders/i) fireEvent.click(ordersTabBtn) - expect(screen.getByText(/Active Orders & Payout status/i)).toBeInTheDocument() + expect(screen.getByText(/Orders Management/i)).toBeInTheDocument() - // Check Sidebar Tab click: Returns Management - const returnsTabBtn = screen.getByText(/Returns Management/i) - fireEvent.click(returnsTabBtn) - - expect(screen.getByText(/Returns & Quality Assurance Center/i)).toBeInTheDocument() - expect(screen.getByText(/Items Requested for Return/i)).toBeInTheDocument() - - // Check Sidebar Tab click: Wallet & Payouts - const walletTabBtn = screen.getByText(/Wallet & Payouts/i) + // Check Sidebar Tab click: Payments + const walletTabBtn = screen.getByText(/Payments/i) fireEvent.click(walletTabBtn) - expect(screen.getByText(/Wallet & Payout Portal/i)).toBeInTheDocument() - expect(screen.getByText(/Outstanding Ready Balance/i)).toBeInTheDocument() + expect(screen.getByText(/Payments Overview/i)).toBeInTheDocument() + expect(screen.getByText(/Total Earned/i)).toBeInTheDocument() }) }) diff --git a/src/App.tsx b/src/App.tsx index d9f0f7c..4c15f11 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,7 +2,7 @@ import { useState, useEffect } from 'react' import { CONFIG, apiFetch } from './config' type Page = 'home' | 'about' | 'contact' | 'login' | 'signup' | 'profile-completion' | 'confirmation' | 'dashboard' | 'forgot-password' | 'login-otp' | 'welcome-tour' -type DashboardTab = 'overview' | 'products' | 'orders' | 'returns' | 'wallet' | 'settings' | 'barcode-generator' +type DashboardTab = 'overview' | 'products' | 'orders' | 'returns' | 'wallet' | 'settings' | 'barcode-generator' | 'analytics' type DateFilter = 'year' | 'week' | 'day' | 'custom' interface Product { @@ -132,6 +132,30 @@ export default function App() { }) const [isEditingProduct, setIsEditingProduct] = useState(false) + // New Heritage UI wizard states + const [productWizardStep, setProductWizardStep] = useState(0) // 0: Catalog list, 1-5: Product upload wizard steps + const [productFormDetails, setProductFormDetails] = useState({ + id: '', + name: '', + category: 'Textiles & Apparel', + description: '', + isGiTagged: false, + primaryImage: 'https://images.unsplash.com/photo-1544022613-e87ca75a784a?auto=format&fit=crop&q=80&w=300', + additionalViews: [] as string[], + videoUrl: '', + view360Url: '', + basePrice: '', + compareAtPrice: '', + trackInventory: true, + sku: '', + initialStock: '', + shippingProfile: 'Standard Fragile', + processingDays: 3, + packageWeight: 1.0 + }) + const [selectedOrderDetail, setSelectedOrderDetail] = useState(null) + const [orderNotes, setOrderNotes] = useState('') + // Payout outstanding states const [wallet, setWallet] = useState({ outstanding: 850.00, @@ -1892,133 +1916,231 @@ export default function App() {
{/* Sidebar */} -