feat: add OWL product mapping UI with live AJAX search

- AjaxSearch component: debounced 300ms, calls /woo/search/* endpoints via rpc()
- ProductMapping client action: 3 tabs (Mapped, Unmatched, Conflicts)
  - Mapped tab: live search, bulk unmap/sync, per-row price/inventory sync toggles
  - Unmatched tab: split Odoo|WC panels, click-to-select, Map/Create/Ignore actions
  - Conflicts tab: Use Odoo / Use WC per-row and bulk resolve
- Top bar: instance selector, Fetch Products, Sync Now, live stats
- woo_dashboard.xml updated with ir.actions.client records
- woo_menus.xml pointed at new client action
- CSS: full layout styles, badges, split view, progress bar, buttons

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-03-31 20:53:43 -04:00
parent 1f86a7c497
commit de14a28112
7 changed files with 1225 additions and 10 deletions

View File

@@ -1 +1,372 @@
/* Fusion WooCommerce — custom styles */
/* ============================================================
Fusion WooCommerce — Custom Styles
============================================================ */
/* ----------------------------------------------------------
Status badges
---------------------------------------------------------- */
.woo-badge {
display: inline-block;
padding: 2px 10px;
border-radius: 12px;
font-size: 0.78rem;
font-weight: 600;
letter-spacing: 0.02em;
}
.woo-badge-mapped { background: #d1fae5; color: #065f46; }
.woo-badge-unmapped { background: #f3f4f6; color: #4b5563; }
.woo-badge-conflict { background: #fef3c7; color: #92400e; }
.woo-badge-error { background: #fee2e2; color: #991b1b; }
.woo-badge-success { background: #d1fae5; color: #065f46; }
.woo-badge-failed { background: #fee2e2; color: #991b1b; }
/* ----------------------------------------------------------
Tab navigation
---------------------------------------------------------- */
.woo-tabs {
display: flex;
gap: 4px;
border-bottom: 2px solid #e5e7eb;
margin-bottom: 16px;
}
.woo-tab {
padding: 8px 20px;
cursor: pointer;
font-weight: 500;
color: #6b7280;
border-bottom: 2px solid transparent;
margin-bottom: -2px;
background: none;
border-top: none;
border-left: none;
border-right: none;
transition: color 0.15s, border-color 0.15s;
}
.woo-tab:hover { color: #374151; }
.woo-tab.active {
color: #7c3aed;
border-bottom-color: #7c3aed;
}
/* ----------------------------------------------------------
Top bar / stats
---------------------------------------------------------- */
.woo-topbar {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
background: #f9fafb;
border-bottom: 1px solid #e5e7eb;
flex-wrap: wrap;
}
.woo-topbar select,
.woo-topbar input {
border: 1px solid #d1d5db;
border-radius: 6px;
padding: 6px 10px;
font-size: 0.875rem;
}
.woo-stat {
display: flex;
flex-direction: column;
align-items: center;
padding: 4px 14px;
border-left: 1px solid #e5e7eb;
}
.woo-stat-value {
font-size: 1.25rem;
font-weight: 700;
color: #111827;
}
.woo-stat-label {
font-size: 0.7rem;
color: #6b7280;
text-transform: uppercase;
letter-spacing: 0.04em;
}
/* ----------------------------------------------------------
Search bar
---------------------------------------------------------- */
.woo-search-wrap {
position: relative;
display: inline-flex;
align-items: center;
}
.woo-search-wrap .woo-search-icon {
position: absolute;
left: 10px;
color: #9ca3af;
font-size: 14px;
pointer-events: none;
}
.woo-search-input {
padding: 6px 10px 6px 32px;
border: 1px solid #d1d5db;
border-radius: 6px;
font-size: 0.875rem;
width: 240px;
transition: border-color 0.15s;
}
.woo-search-input:focus {
outline: none;
border-color: #7c3aed;
box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}
/* ----------------------------------------------------------
Tables
---------------------------------------------------------- */
.woo-table-wrap {
overflow-x: auto;
}
.woo-table {
width: 100%;
border-collapse: collapse;
font-size: 0.875rem;
}
.woo-table th {
background: #f3f4f6;
padding: 10px 12px;
text-align: left;
font-weight: 600;
color: #374151;
border-bottom: 2px solid #e5e7eb;
white-space: nowrap;
}
.woo-table td {
padding: 9px 12px;
border-bottom: 1px solid #f3f4f6;
color: #374151;
vertical-align: middle;
}
.woo-table tr:hover td { background: #f9fafb; }
.woo-table tr.selected td { background: #ede9fe; }
/* ----------------------------------------------------------
Split view (unmatched tab)
---------------------------------------------------------- */
.woo-split {
display: grid;
grid-template-columns: 1fr 40px 1fr;
gap: 0;
align-items: start;
}
.woo-split-panel {
border: 1px solid #e5e7eb;
border-radius: 8px;
overflow: hidden;
}
.woo-split-panel-header {
background: #f3f4f6;
padding: 10px 14px;
font-weight: 600;
color: #374151;
border-bottom: 1px solid #e5e7eb;
display: flex;
justify-content: space-between;
align-items: center;
}
.woo-split-divider {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 60px;
gap: 8px;
color: #9ca3af;
font-size: 1.2rem;
}
.woo-split-list {
max-height: 480px;
overflow-y: auto;
}
.woo-split-item {
padding: 10px 14px;
cursor: pointer;
border-bottom: 1px solid #f3f4f6;
transition: background 0.1s;
}
.woo-split-item:hover { background: #f9fafb; }
.woo-split-item.selected { background: #ede9fe; }
.woo-split-item-name { font-weight: 500; color: #111827; }
.woo-split-item-sub { font-size: 0.75rem; color: #6b7280; margin-top: 1px; }
/* ----------------------------------------------------------
Map actions bar
---------------------------------------------------------- */
.woo-map-actions {
display: flex;
gap: 8px;
padding: 10px 0 14px;
flex-wrap: wrap;
}
/* ----------------------------------------------------------
Buttons
---------------------------------------------------------- */
.woo-btn {
padding: 6px 14px;
border-radius: 6px;
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
border: 1px solid transparent;
transition: background 0.15s, border-color 0.15s;
}
.woo-btn-primary { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.woo-btn-primary:hover { background: #6d28d9; }
.woo-btn-success { background: #059669; color: #fff; border-color: #059669; }
.woo-btn-success:hover { background: #047857; }
.woo-btn-warning { background: #d97706; color: #fff; border-color: #d97706; }
.woo-btn-warning:hover { background: #b45309; }
.woo-btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.woo-btn-danger:hover { background: #b91c1c; }
.woo-btn-secondary { background: #fff; color: #374151; border-color: #d1d5db; }
.woo-btn-secondary:hover { background: #f3f4f6; }
.woo-btn-sm { padding: 3px 10px; font-size: 0.8rem; }
.woo-btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* ----------------------------------------------------------
Dashboard cards
---------------------------------------------------------- */
.woo-dashboard {
padding: 20px;
}
.woo-dashboard-title {
font-size: 1.4rem;
font-weight: 700;
color: #111827;
margin-bottom: 4px;
}
.woo-dashboard-subtitle {
font-size: 0.875rem;
color: #6b7280;
margin-bottom: 24px;
}
.woo-cards {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 16px;
margin-bottom: 24px;
}
.woo-card {
background: #fff;
border: 1px solid #e5e7eb;
border-radius: 10px;
padding: 20px;
display: flex;
flex-direction: column;
gap: 6px;
box-shadow: 0 1px 3px rgba(0,0,0,0.06);
transition: box-shadow 0.15s;
}
.woo-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.woo-card-clickable { cursor: pointer; }
.woo-card-icon {
font-size: 1.6rem;
margin-bottom: 4px;
}
.woo-card-value {
font-size: 2rem;
font-weight: 700;
color: #111827;
line-height: 1;
}
.woo-card-label {
font-size: 0.8rem;
color: #6b7280;
text-transform: uppercase;
letter-spacing: 0.04em;
}
.woo-card-sub {
font-size: 0.78rem;
color: #9ca3af;
margin-top: 2px;
}
.woo-card-pending { border-left: 4px solid #f59e0b; }
.woo-card-errors { border-left: 4px solid #ef4444; }
.woo-card-mapped { border-left: 4px solid #10b981; }
.woo-card-sync { border-left: 4px solid #6366f1; }
/* ----------------------------------------------------------
Progress bar
---------------------------------------------------------- */
.woo-progress-wrap {
background: #e5e7eb;
border-radius: 6px;
height: 8px;
overflow: hidden;
margin-top: 6px;
}
.woo-progress-bar {
height: 100%;
background: linear-gradient(90deg, #10b981, #059669);
border-radius: 6px;
transition: width 0.4s ease;
}
/* ----------------------------------------------------------
Loading spinner
---------------------------------------------------------- */
.woo-loading {
display: flex;
align-items: center;
justify-content: center;
padding: 40px;
color: #6b7280;
gap: 10px;
font-size: 0.9rem;
}
.woo-spinner {
width: 20px;
height: 20px;
border: 2px solid #e5e7eb;
border-top-color: #7c3aed;
border-radius: 50%;
animation: woo-spin 0.7s linear infinite;
}
@keyframes woo-spin { to { transform: rotate(360deg); } }
/* ----------------------------------------------------------
Empty states
---------------------------------------------------------- */
.woo-empty {
text-align: center;
padding: 48px 20px;
color: #9ca3af;
}
.woo-empty-icon { font-size: 2.5rem; margin-bottom: 10px; }
.woo-empty-text { font-size: 0.9rem; }
/* ----------------------------------------------------------
Quick actions
---------------------------------------------------------- */
.woo-quick-actions {
display: flex;
gap: 10px;
flex-wrap: wrap;
margin-top: 8px;
}
/* ----------------------------------------------------------
Section header
---------------------------------------------------------- */
.woo-section-title {
font-size: 1rem;
font-weight: 600;
color: #374151;
margin-bottom: 12px;
padding-bottom: 8px;
border-bottom: 1px solid #f3f4f6;
}
/* ----------------------------------------------------------
Checkbox column
---------------------------------------------------------- */
.woo-table th.woo-check-col,
.woo-table td.woo-check-col {
width: 36px;
text-align: center;
}