feat(simplify): first-time guidance welcome card
Show a welcome card on the dashboard when no sync runs exist yet. Guides new users: 1. Check Settings → 2. Start Sync → 3. Map SKUs. Card auto-hides after first successful sync. Cache-bust: dashboard.js?v=31, style.css?v=24 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,7 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
loadDashOrders();
|
||||
startSyncPolling();
|
||||
wireFilterBar();
|
||||
checkFirstTime();
|
||||
});
|
||||
|
||||
async function initPollInterval() {
|
||||
@@ -124,6 +125,28 @@ function updateSyncPanel(data) {
|
||||
}
|
||||
}
|
||||
|
||||
async function checkFirstTime() {
|
||||
const welcomeEl = document.getElementById('welcomeCard');
|
||||
if (!welcomeEl) return;
|
||||
try {
|
||||
const data = await fetchJSON('/api/sync/status');
|
||||
if (!data.last_run) {
|
||||
welcomeEl.innerHTML = `<div class="welcome-card">
|
||||
<h5 style="font-family:var(--font-display);margin:0 0 8px">Bine ai venit!</h5>
|
||||
<p class="text-muted mb-2" style="font-size:0.875rem">Configureaza si ruleaza primul sync:</p>
|
||||
<div class="welcome-steps">
|
||||
<span class="welcome-step"><b>1.</b> <a href="${window.ROOT_PATH||''}/settings">Verifica Settings</a></span>
|
||||
<span class="welcome-step"><b>2.</b> Apasa "Start Sync"</span>
|
||||
<span class="welcome-step"><b>3.</b> <a href="${window.ROOT_PATH||''}/missing-skus">Mapeaza SKU-urile lipsa</a></span>
|
||||
</div>
|
||||
</div>`;
|
||||
welcomeEl.style.display = '';
|
||||
} else {
|
||||
welcomeEl.style.display = 'none';
|
||||
}
|
||||
} catch(e) { welcomeEl.style.display = 'none'; }
|
||||
}
|
||||
|
||||
// Wire last-sync-row click → journal (use current running sync if active)
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
document.getElementById('lastSyncRow')?.addEventListener('click', () => {
|
||||
|
||||
Reference in New Issue
Block a user