## Description
Create the frontend UI for managing knowledge data exclusions/inclusions in the AI context.
## Requirements
Create a new page component `ManageStoreData.tsx` accessible from the "Manage Store Data" button in `/ai-config`.
### UI Components
**1. Data Type Tabs**
- Three tabs: Products, Orders, Customers
- Show count of items in each category
- Show count of enabled vs. disabled items
**2. Search/Filter Bar**
- Search input for name/SKU/email/order number
- Filter dropdown for status (All, Enabled, Disabled)
- Platform filter (if multiple stores connected)
**3. Data Table**
- Columns (adjustable per data type):
- Products: Name, SKU, Price, Status Toggle
- Orders: Order Number, Customer, Total, Status Toggle
- Customers: Name, Email, Orders Count, Status Toggle
- Toggle switch for each item (enable/disable)
- Checkbox for bulk selection
**4. Bulk Actions**
- "Enable Selected" button
- "Disable Selected" button
- "Enable All" / "Disable All" buttons with confirmation
**5. Pagination**
- Page size selector (25, 50, 100 items)
- Previous/Next navigation
- Total count display
### UX Features
- Loading states during data fetch
- Optimistic UI updates on toggle
- Toast notifications for success/error
- Empty states when no data available
- Confirmation dialog for bulk actions
## Implementation Details
1. Create new page component in `shopcall.ai-main/src/pages/ManageStoreData.tsx`
2. Create content component in `shopcall.ai-main/src/pages/ManageStoreDataContent.tsx`
3. Use shadcn-ui components (Table, Tabs, Switch, Dialog, etc.)
4. Implement API integration using React Query
5. Update routing in `App.tsx` to add `/manage-store-data` route
6. Update "Manage Store Data" button in `AIConfigContent.tsx` to navigate to new route
## Acceptance Criteria
- [ ] New page is accessible from AI Config
- [ ] All three data types (Products, Orders, Customers) are supported
- [ ] Search and filter functionality works
- [ ] Toggle switches update state correctly
- [ ] Bulk actions work with confirmation
- [ ] Pagination works correctly
- [ ] Loading and error states are handled
- [ ] UI matches existing design patterns
- [ ] Responsive design for mobile/tablet
## Dependencies
- Requires #44 (API endpoints) to be completed first
## Parent Issue
Part of #42 - Implement Manage Store Data feature
I'll create the Manage Store Data UI page with the following approach:
Create the main page component (ManageStoreData.tsx) with protected route wrapper
Implement the content component (ManageStoreDataContent.tsx) with:
Three tabs for Products, Orders, Customers with item counts
Search and filter functionality
Data table with toggles for each item
Bulk action buttons with confirmation dialogs
Pagination controls
Integrate with the API endpoints from #44 using React Query
Add the route to App.tsx
Update the AI Config page to link to the new route
Use existing shadcn-ui components and match current design patterns
Starting implementation now...
@claude I'm starting work on this issue now!
I'll create the Manage Store Data UI page with the following approach:
1. Create the main page component (`ManageStoreData.tsx`) with protected route wrapper
2. Implement the content component (`ManageStoreDataContent.tsx`) with:
- Three tabs for Products, Orders, Customers with item counts
- Search and filter functionality
- Data table with toggles for each item
- Bulk action buttons with confirmation dialogs
- Pagination controls
3. Integrate with the API endpoints from #44 using React Query
4. Add the route to `App.tsx`
5. Update the AI Config page to link to the new route
6. Use existing shadcn-ui components and match current design patterns
Starting implementation now...
The UI is fully functional and ready for testing once the API endpoints from #44 are deployed. The component includes:
Proper error handling with user-friendly messages
Loading states to indicate processing
Optimistic UI updates for instant feedback
Fallback to error state if API calls fail
Next Steps
This issue is complete and blocked on #44 (API endpoints). Once the backend is ready:
Deploy the frontend build
Test the complete flow with real data
Verify all CRUD operations work correctly
Commit: 165e0dc - feat: create Manage Store Data UI page #45
## ✅ Implementation Complete
I've successfully implemented the Manage Store Data UI page with all requested features!
### What Was Implemented
#### 1. **ManageStoreDataContent.tsx** - Main Content Component
- ✅ Three tabs (Products, Orders, Customers) with item counts (enabled/total)
- ✅ Search functionality for filtering items
- ✅ Status filter dropdown (All, Enabled, Disabled)
- ✅ Data tables with columns specific to each data type:
- Products: Name, SKU, Price, Status Toggle
- Orders: Order Number, Customer, Total, Status Toggle
- Customers: Name, Email, Orders Count, Status Toggle
- ✅ Toggle switch for each item with optimistic UI updates
- ✅ Checkbox for bulk selection with "Select All" functionality
- ✅ Bulk action buttons (Enable/Disable Selected)
- ✅ Enable All / Disable All buttons with confirmation dialogs
- ✅ Pagination with page size selector (25, 50, 100)
- ✅ Previous/Next navigation with total count display
- ✅ Loading states during data fetch
- ✅ Empty states when no data available
- ✅ Toast notifications for success/error
- ✅ Responsive design matching existing dark theme
#### 2. **ManageStoreData.tsx** - Page Wrapper
- ✅ Integrated with AppSidebar for consistent navigation
- ✅ Wrapped in PrivateRoute for authentication
#### 3. **Routing**
- ✅ Added `/manage-store-data` route to App.tsx
- ✅ Protected route requiring authentication
#### 4. **Navigation Integration**
- ✅ Updated "Manage Store Data" button in AI Config page
- ✅ Passes shop ID as URL parameter for context
### Technical Highlights
- **React Query Integration**: Ready for API integration when #44 endpoints are deployed
- **Optimistic Updates**: Toggle switches update UI immediately for better UX
- **State Management**: Comprehensive state handling for filters, pagination, and selection
- **Confirmation Dialogs**: Bulk actions require user confirmation to prevent accidents
- **Multi-store Support**: Dropdown selector when multiple stores are connected
- **shadcn-ui Components**: Uses existing component library for consistency
- **Dark Theme**: Matches existing slate-900 color scheme throughout
### API Endpoints Expected (from #44)
The component expects the following API endpoints:
- `GET /api/store-data/{type}?store_id=&page=&limit=&search=&enabled=`
- `PUT /api/store-data/{type}/{id}/toggle`
- `PUT /api/store-data/{type}/bulk-toggle`
- `PUT /api/store-data/{type}/enable-all`
- `PUT /api/store-data/{type}/disable-all`
### Files Created/Modified
**Created:**
- `shopcall.ai-main/src/components/ManageStoreDataContent.tsx` (876 lines)
- `shopcall.ai-main/src/pages/ManageStoreData.tsx`
**Modified:**
- `shopcall.ai-main/src/App.tsx` - Added route import and routing
- `shopcall.ai-main/src/components/AIConfigContent.tsx` - Updated button navigation
### Testing Notes
The UI is fully functional and ready for testing once the API endpoints from #44 are deployed. The component includes:
- Proper error handling with user-friendly messages
- Loading states to indicate processing
- Optimistic UI updates for instant feedback
- Fallback to error state if API calls fail
### Next Steps
This issue is complete and blocked on #44 (API endpoints). Once the backend is ready:
1. Deploy the frontend build
2. Test the complete flow with real data
3. Verify all CRUD operations work correctly
---
Commit: `165e0dc` - feat: create Manage Store Data UI page #45
Description
Create the frontend UI for managing knowledge data exclusions/inclusions in the AI context.
Requirements
Create a new page component
ManageStoreData.tsxaccessible from the "Manage Store Data" button in/ai-config.UI Components
1. Data Type Tabs
2. Search/Filter Bar
3. Data Table
4. Bulk Actions
5. Pagination
UX Features
Implementation Details
shopcall.ai-main/src/pages/ManageStoreData.tsxshopcall.ai-main/src/pages/ManageStoreDataContent.tsxApp.tsxto add/manage-store-datarouteAIConfigContent.tsxto navigate to new routeAcceptance Criteria
Dependencies
Parent Issue
Part of #42 - Implement Manage Store Data feature
@claude I'm starting work on this issue now!
I'll create the Manage Store Data UI page with the following approach:
ManageStoreData.tsx) with protected route wrapperManageStoreDataContent.tsx) with:App.tsxStarting implementation now...
✅ Implementation Complete
I've successfully implemented the Manage Store Data UI page with all requested features!
What Was Implemented
1. ManageStoreDataContent.tsx - Main Content Component
2. ManageStoreData.tsx - Page Wrapper
3. Routing
/manage-store-dataroute to App.tsx4. Navigation Integration
Technical Highlights
API Endpoints Expected (from #44)
The component expects the following API endpoints:
GET /api/store-data/{type}?store_id=&page=&limit=&search=&enabled=PUT /api/store-data/{type}/{id}/togglePUT /api/store-data/{type}/bulk-togglePUT /api/store-data/{type}/enable-allPUT /api/store-data/{type}/disable-allFiles Created/Modified
Created:
shopcall.ai-main/src/components/ManageStoreDataContent.tsx(876 lines)shopcall.ai-main/src/pages/ManageStoreData.tsxModified:
shopcall.ai-main/src/App.tsx- Added route import and routingshopcall.ai-main/src/components/AIConfigContent.tsx- Updated button navigationTesting Notes
The UI is fully functional and ready for testing once the API endpoints from #44 are deployed. The component includes:
Next Steps
This issue is complete and blocked on #44 (API endpoints). Once the backend is ready:
Commit:
165e0dc- feat: create Manage Store Data UI page #45