Merge pull request 'Empty states say what to do next' (#78) from empty-state-hints into main
CI / UI screenshots (before/after) (push) Skipped
CI / Test (jest) (push) Successful in 35s
CI / Lint (eslint) (push) Successful in 37s
CI / Security (npm audit) (push) Successful in 15s
CI / Scan (secrets, workflows, shell) (push) Successful in 1m49s
CI / Integration (api) (push) Successful in 2m39s
CI / UI (playwright) (push) Successful in 2m36s
CI / Deploy (push) Successful in 22s
CI / Deploy worker (push) Successful in 11s
CI / Notify (push) Successful in 3s
CI / UI screenshots (before/after) (push) Skipped
CI / Test (jest) (push) Successful in 35s
CI / Lint (eslint) (push) Successful in 37s
CI / Security (npm audit) (push) Successful in 15s
CI / Scan (secrets, workflows, shell) (push) Successful in 1m49s
CI / Integration (api) (push) Successful in 2m39s
CI / UI (playwright) (push) Successful in 2m36s
CI / Deploy (push) Successful in 22s
CI / Deploy worker (push) Successful in 11s
CI / Notify (push) Successful in 3s
This commit was merged in pull request #78.
This commit is contained in:
commit
09a9d69102
5 files changed
+37
-4
No files matched your search
@@ -78,7 +78,8 @@
|
||||
const wrap = document.getElementById('qc-worker-list');
|
||||
if (!wrap) return;
|
||||
if (workers.length === 0) {
|
||||
wrap.innerHTML = '<div class="lt-empty-state lt-empty-state--sm"><div class="lt-empty-state-title">No workers available</div></div>';
|
||||
wrap.innerHTML = '<div class="lt-empty-state lt-empty-state--sm"><div class="lt-empty-state-title">No workers available</div>' +
|
||||
'<div class="lt-empty-state-body">Connect one first: see <a href="/workers">Workers</a>.</div></div>';
|
||||
return;
|
||||
}
|
||||
const keep = preserveIds || new Set();
|
||||
|
||||
@@ -94,7 +94,13 @@
|
||||
const wrap = document.getElementById('sc-wrap');
|
||||
if (!wrap) return;
|
||||
if (_schedules.length === 0) {
|
||||
wrap.innerHTML = '<div class="lt-empty-state"><div class="lt-empty-state-title">No scheduled commands yet</div></div>';
|
||||
wrap.innerHTML =
|
||||
'<div class="lt-empty-state">' +
|
||||
'<div class="lt-empty-state-title">No scheduled commands yet</div>' +
|
||||
'<div class="lt-empty-state-body">A schedule runs a command on the workers you pick, repeatedly. ' +
|
||||
'Try the command in <a href="/quick">Quick Command</a> first, then schedule it here.</div>' +
|
||||
'<button type="button" class="lt-btn lt-btn-primary" data-action="sc:create-open">+ New Schedule</button>' +
|
||||
'</div>';
|
||||
return;
|
||||
}
|
||||
wrap.innerHTML =
|
||||
@@ -128,7 +134,8 @@
|
||||
const wrap = document.getElementById('sc-worker-list');
|
||||
if (!wrap) return;
|
||||
if (_workers.length === 0) {
|
||||
wrap.innerHTML = '<div class="lt-empty-state lt-empty-state--sm"><div class="lt-empty-state-title">No workers available</div></div>';
|
||||
wrap.innerHTML = '<div class="lt-empty-state lt-empty-state--sm"><div class="lt-empty-state-title">No workers available</div>' +
|
||||
'<div class="lt-empty-state-body">Connect one first: see <a href="/workers">Workers</a>.</div></div>';
|
||||
return;
|
||||
}
|
||||
wrap.innerHTML = _workers.map(w =>
|
||||
|
||||
@@ -178,7 +178,10 @@
|
||||
'<div class="lt-empty-state">' +
|
||||
'<div class="lt-empty-state-icon">⚙</div>' +
|
||||
'<div class="lt-empty-state-title">No workers connected</div>' +
|
||||
'<div class="lt-empty-state-body">Workers appear here once they connect and send a heartbeat.</div>' +
|
||||
'<div class="lt-empty-state-body">A worker is a small agent that runs commands on its host. Install it there, ' +
|
||||
'set <code>WORKER_NAME</code>, <code>PULSE_SERVER</code>, <code>PULSE_WS</code> and <code>WORKER_API_KEY</code> ' +
|
||||
'(the server\'s key), and start it: it shows up here within a few seconds.</div>' +
|
||||
'<a class="lt-btn lt-btn-secondary" href="https://code.lotusguild.org/LotusGuild/pulse#pulse-worker-setup" target="_blank" rel="noopener">Worker setup guide</a>' +
|
||||
'</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@
|
||||
'<div class="lt-empty-state-title">No workflows yet</div>' +
|
||||
'<div class="lt-empty-state-body">Workflows let you run multi-step jobs across one or more workers.</div>' +
|
||||
'<button type="button" class="lt-btn lt-btn-primary" data-action="wf:create-open">Create your first workflow</button>' +
|
||||
'<div class="lt-empty-state-body"><a href="https://code.lotusguild.org/LotusGuild/pulse#workflows" target="_blank" rel="noopener">Step types and examples</a>' +
|
||||
' · or try a single command in <a href="/quick">Quick Command</a></div>' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -74,3 +74,23 @@ test.describe('first visit in a session', () => {
|
||||
await expect(page.locator('#lt-boot-text')).toContainText('ALL SYSTEMS NOMINAL: PULSE', { timeout: 15_000 });
|
||||
});
|
||||
});
|
||||
|
||||
test('empty states say what to do next (#33)', async ({ page }) => {
|
||||
for (const path of ['/api/workers', '/api/scheduled-commands', '/api/workflows']) {
|
||||
await page.route(u => u.pathname === path, r => r.fulfill({ json: [] }));
|
||||
}
|
||||
await page.goto('/workers');
|
||||
await expect(page.locator('#wk-grid')).toContainText('WORKER_API_KEY');
|
||||
await expect(page.getByRole('link', { name: 'Worker setup guide' })).toHaveAttribute('href', /#pulse-worker-setup$/);
|
||||
|
||||
await page.goto('/scheduler');
|
||||
await page.locator('#sc-wrap').getByRole('button', { name: '+ New Schedule' }).click();
|
||||
await expect(page.locator('#sc-create-modal')).toBeVisible();
|
||||
await page.keyboard.press('Escape');
|
||||
|
||||
await page.goto('/quick');
|
||||
await expect(page.locator('#qc-worker-list').getByRole('link', { name: 'Workers' })).toHaveAttribute('href', '/workers');
|
||||
|
||||
await page.goto('/workflows');
|
||||
await expect(page.getByRole('link', { name: 'Step types and examples' })).toHaveAttribute('href', /#workflows$/);
|
||||
});
|
||||
Reference in new issue
Block a user