fix(webui): drawer and page polish: at 390 the open agent sheet is the whole screen and the page under it no longer scrolls behind it, and Close puts the page back where it was; the drawer's Last activity is when the agent's current run took its role or conversation, from the claim time the workspace read already carries; the Dashboard's two columns line up with its tile row; the organization page's left column holds Autonomy and Starter packs; the workflows section() stub and its duplicate stopped panel are gone (#1873, lane sp18-drawer-polish)
This commit is contained in:
1 parent
56cc7b59dd
commit
fc558df31a
9 files changed
+121
-22
No files matched your search
@@ -1,4 +1,4 @@
|
||||
[data-packs],[data-workflows]{margin-top:16px}
|
||||
[data-packs]{margin-top:16px}
|
||||
.pack-list,.pack-hires{list-style:none;margin:8px 0;padding:0}
|
||||
.pack-row,.pack-hire{border-top:1px solid var(--border);padding:12px 0;overflow-wrap:anywhere}
|
||||
.pack-preview{border:1px solid var(--border);border-radius:var(--r);padding:12px;margin:12px 0;overflow-wrap:anywhere}
|
||||
|
||||
@@ -631,6 +631,14 @@ html[data-organizations] .ws-orgcard .at{grid-column:3;grid-row:1;font:500 11.5p
|
||||
html[data-organizations] .ws-orgcard .why{grid-column:1/-1;font-size:12px;color:var(--muted)}
|
||||
html[data-organizations] .ws-orgcard.off a{border-style:dashed}
|
||||
html[data-organizations] .ws-home-split{margin-top:4px}
|
||||
/* SP18: the Dashboard's columns line up with its tile row. Three equal tracks with the tiles' gap, the left
|
||||
column spanning two, end on a tile edge whether the row holds six tiles (after the fourth) or three
|
||||
(after the second). Below 760 px the split is one column. */
|
||||
html[data-organizations] .ws-home>.ws-tiles{gap:var(--gap)}
|
||||
@media (min-width:760px){
|
||||
html[data-organizations] .ws-home-split{grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--gap)}
|
||||
html[data-organizations] .ws-home-split>:first-child{grid-column:span 2}
|
||||
}
|
||||
html[data-organizations] .ws-trail{list-style:none;margin:0;padding:0;border:1px solid var(--line);border-radius:8px;background:var(--surface)}
|
||||
html[data-organizations] .ws-trail li{display:grid;grid-template-columns:48px 20px minmax(0,1fr);gap:10px;padding:7px 12px;border-bottom:1px solid color-mix(in srgb,var(--line) 60%,transparent);font-size:13px;align-items:center}
|
||||
html[data-organizations] .ws-trail li:last-child{border-bottom:0}
|
||||
@@ -770,6 +778,11 @@ html[data-organizations] .ws-drawer-acts .note{flex-basis:100%}
|
||||
@media (min-width:1200px){html[data-organizations] body:has(.ws-drawer) .content{padding-right:calc(420px + 22px)}}
|
||||
@media (max-width:700px){
|
||||
html[data-organizations] .ws-drawer{top:0;left:0;right:0;width:auto;border-left:0;box-shadow:none}
|
||||
/* SP18: the sheet covers the screen, so the page under it is held to one screen and does not scroll; it
|
||||
kept its own height before, and the sheet showed over a long blank area. workspace.js puts the page's
|
||||
place back on Close. */
|
||||
html[data-organizations]:has(#bus-view .ws-drawer){overflow:hidden}
|
||||
html[data-organizations]:has(#bus-view .ws-drawer) body{height:100dvh;overflow:hidden}
|
||||
}
|
||||
@media (max-width:1100px){
|
||||
html[data-organizations] .ws-tiles.six{grid-template-columns:repeat(3,minmax(0,1fr))}
|
||||
|
||||
@@ -823,7 +823,5 @@
|
||||
window.matchMedia(NARROW).addEventListener('change', () => {
|
||||
if (document.querySelector('[data-wfg-graph]')) document.dispatchEvent(new CustomEvent('mosaic-workspace-render'));
|
||||
});
|
||||
// section(): the organization page's old form editor is gone (SP17); workspace.js still asks for it.
|
||||
const section = () => '';
|
||||
window.MosaicWorkflows = { load, section, page, card, hasDraft, forget, landed };
|
||||
window.MosaicWorkflows = { load, page, card, hasDraft, forget, landed };
|
||||
})();
|
||||
@@ -367,21 +367,20 @@
|
||||
${orgTiles}
|
||||
${docrow}
|
||||
<div class="ws-split">
|
||||
<section aria-label="Sessions and workflows">
|
||||
<section aria-label="Sessions, workflows, autonomy and starter packs">
|
||||
${secH('Active agent sessions', live ? (noRuns ? 'running not read' : live.length ? `${live.length} running${tileAgents ? `, ${liveWorking} working` : ', working not read'}` : 'none running') : '', `<a href="#/agents?${oq}" data-focus-key="agents-all">This organization's agents</a>`)}
|
||||
${sessions}
|
||||
${window.MosaicWorkflows?.card?.(id, { stopped, label: label(org) }) ?? ''}
|
||||
<div class="ws-wide">
|
||||
${stopped ? stoppedPanel('data-autonomy', 'Autonomy') : window.MosaicAutonomy?.section(id) ?? ''}
|
||||
${stopped ? stoppedPanel('data-packs', 'Starter packs') : window.MosaicPacks?.section(id) ?? ''}
|
||||
</div>
|
||||
</section>
|
||||
<section aria-label="Settings">
|
||||
${secH('Settings', 'every setting, with where its value comes from')}
|
||||
${settingsList(org, { business, settings, instances, noRuns, orgCount: list ? list.length : null })}
|
||||
</section>
|
||||
</div>
|
||||
<div class="ws-wide">
|
||||
${stopped ? stoppedPanel('data-autonomy', 'Autonomy') : window.MosaicAutonomy?.section(id) ?? ''}
|
||||
${stopped ? stoppedPanel('data-packs', 'Starter packs') : window.MosaicPacks?.section(id) ?? ''}
|
||||
${stopped ? stoppedPanel('data-workflows', 'Workflows') : window.MosaicWorkflows?.section(id) ?? ''}
|
||||
</div>
|
||||
${await drawerRead}
|
||||
</article>`;
|
||||
}
|
||||
@@ -1348,6 +1347,14 @@
|
||||
const actions = chat || change
|
||||
? `<div class="ws-drawer-acts" data-drawer-actions>${acts.join(' ')}<p class="ws-drawer-status" id="ws-drawer-status" role="status" data-drawer-status>${esc(st?.text || '')}</p></div>`
|
||||
: `<p class="note" data-drawer-readonly>This Console only reads ${esc(orgName)}. It can not message or stop its agents.</p>`;
|
||||
// SP18: the agents read lists only roles a run holds now, and thread.claims only conversations a run
|
||||
// holds now; each row's time is when that run took the role or the conversation. So the latest of
|
||||
// them is when the agent's current run started. No read keeps when a run ended or when the agent last
|
||||
// sent a message (a thread's messages read pages from the oldest message), so neither is shown.
|
||||
const runAt = [a.s?.claimedAt, ...arr(body?.sessions).filter(x => x?.kind === 'thread' && x.org === org && x.instance === key).map(x => x.claimedAt)]
|
||||
.filter(v => msOf(v) !== null).sort((x, y) => msOf(y) - msOf(x))[0] ?? null;
|
||||
const activity = runAt ? `current run started <time datetime="${esc(runAt)}" title="${esc(new Date(msOf(runAt)).toLocaleString())}">${esc(ago(runAt))}</time>`
|
||||
: `<span class="muted">${(runWhy => runWhy ? `not read: ${esc(runWhy)}` : 'not recorded: no run holds it now, and no read keeps when its last run ended')(notRead(['agents', 'claims']))}</span>`;
|
||||
const fields = [
|
||||
field('org', 'Organization', orgChip(o, org)),
|
||||
// A pack hire's pack is named once, in Hired from; the Role row says only that it was hired.
|
||||
@@ -1358,11 +1365,7 @@
|
||||
model ? field('model', 'Model', `<span class="mono">${esc(model)}</span>`) : '',
|
||||
project ? field('project', 'Project', `<a href="${esc(`${orgHref(org)}/projects/${enc(project.id)}`)}">${esc(project.name || project.key || project.id)}</a>${project.from ? ` <span class="t2">${project.from}</span>` : ''}`) : '',
|
||||
task ? field('task', 'Task', `<a href="${esc(taskHref(task.ref))}">${esc(task.title || task.ref)}</a>${task.title ? ` <span class="t2 mono">${esc(task.ref)}</span>` : ''}`) : '',
|
||||
// SP16: no read the Console makes carries the time of a role agent's last message or run. The agents
|
||||
// read's time is when it took the role and `since` is when its present state began, so neither is shown.
|
||||
// An agent holding a conversation has its messages in that thread's messages read, but that read pages
|
||||
// from the oldest message, so its last message is a walk of every page away; the drawer does not make it.
|
||||
field('activity', 'Last activity', `<span class="muted">${thread?.thread ? 'not shown: reading it means reading the whole conversation' : 'not recorded'}</span>`),
|
||||
field('activity', 'Last activity', activity),
|
||||
].join('');
|
||||
return shell(a.name, `<dl class="ws-drawer-fields">${fields}</dl>
|
||||
<section class="ws-drawer-sec" data-drawer-tasks aria-label="Open tasks assigned to ${esc(a.name)}"><h3>Open tasks</h3>${tasksBody}${tasksAll}</section>
|
||||
@@ -1377,6 +1380,11 @@
|
||||
history.replaceState(unmarked(), '', sansAgent());
|
||||
document.dispatchEvent(new CustomEvent('mosaic-workspace-render'));
|
||||
}
|
||||
// SP18: below 701 px the open drawer is a sheet and shell.css holds the page under it to one screen, which
|
||||
// scrolls the page to the top. The page's place is kept while no drawer is open and put back on Close.
|
||||
const SHEET = window.matchMedia('(max-width:700px)');
|
||||
let pageY = 0;
|
||||
window.addEventListener('scroll', () => { if (!document.querySelector('#bus-view [data-ws-drawer]')) pageY = window.scrollY; }, { passive: true });
|
||||
// bus.js calls this after each paint: focus moves into a drawer a row opened, and back to the row
|
||||
// when the drawer has closed and focus was left nowhere.
|
||||
function afterPaint() {
|
||||
@@ -1386,6 +1394,7 @@
|
||||
drawerShown = now;
|
||||
if (d && drawerFocus) { drawerFocus = false; d.querySelector('h2')?.focus({ preventScroll: true }); return; }
|
||||
drawerFocus = false;
|
||||
if (!now && was && SHEET.matches && pageY) window.scrollTo(0, pageY);
|
||||
if (!now && was) {
|
||||
const a = document.activeElement;
|
||||
if (!a || a === document.body || !view?.contains(a)) view?.querySelector(`[data-focus-key="${CSS.escape(`agent:${was}`)}"]`)?.focus({ preventScroll: true });
|
||||
|
||||
@@ -185,9 +185,12 @@ test('the drawer shows each field from its read: name, organization, role and so
|
||||
// Decisions waiting on a human that it raised, each into the Inbox. Chief's is not its own.
|
||||
const decisions = await b.evaluate(`[...document.querySelectorAll('${d} [data-drawer-decisions] li a')].map(a => [a.textContent.trim(), a.getAttribute("href")])`);
|
||||
assert.deepEqual(decisions, [['Ship the hero copy?', '#/inbox?d=acme%3Adec-1']]);
|
||||
// SP16: no read gives the time of an agent's last activity. The agents read's time (when it took the
|
||||
// role) and `since` (when its present state began) are not that, so the drawer says not recorded.
|
||||
assert.equal(await text(`${d} [data-drawer-activity]`), 'not recorded');
|
||||
// SP18: the agents read lists only roles a run holds now, and its time is when that run took the role,
|
||||
// so Last activity is when the current run started, 40 minutes before the read, with the time itself.
|
||||
assert.match(await text(`${d} [data-drawer-activity]`), /^current run started 4[01] min ago$/);
|
||||
const started = await attr(`${d} [data-drawer-activity] time`, 'datetime');
|
||||
assert.ok(Math.abs(Date.now() - Date.parse(started) - 40 * 60000) < 90000, started);
|
||||
assert.match(await attr(`${d} [data-drawer-activity] time`, 'title'), /\d/);
|
||||
assert.equal(await b.evaluate(`document.querySelector('${d} [data-drawer-activity]').closest('.ws-drawer-f').querySelector('dt').textContent`), 'Last activity');
|
||||
// Not a pack hire: no packs read, and no Hired from line.
|
||||
assert.equal(await has(`${d} [data-drawer-hired]`), false);
|
||||
@@ -209,6 +212,9 @@ test('a hired agent shows where its role came from; a not-running agent says not
|
||||
assert.match(await text(`${d} [data-drawer-source]`), new RegExp(`hire decision ${HIRE}`));
|
||||
assert.match(await text(`${d} [data-drawer-state]`), /(^|\s)not running$/);
|
||||
assert.equal(await has(`${d} [data-drawer-model]`), false);
|
||||
// SP18: no run holds it, and no read keeps the time of a run that ended: one plain line, no time.
|
||||
assert.equal(await text(`${d} [data-drawer-activity]`), 'not recorded: no run holds it now, and no read keeps when its last run ended');
|
||||
assert.equal(await has(`${d} [data-drawer-activity] time`), false);
|
||||
});
|
||||
|
||||
test('SP16: a pack hire names its pack and the template the packs read gives; a refused read says so', async t => {
|
||||
@@ -501,8 +507,8 @@ test('Message opens the agent\'s thread in an Assistant pane; Stop asks first an
|
||||
assert.equal(await attr('[data-ws-drawer="acme:assistant"] [data-drawer-message]', 'href'), `#/assistant?add=acme%3A${THREAD}`);
|
||||
// SP16: Message is offered, so no line says why it is not.
|
||||
assert.equal(await has('[data-ws-drawer="acme:assistant"] [data-drawer-nomessage]'), false);
|
||||
// It holds a conversation, whose messages read pages from the oldest message: the drawer says it does not read it.
|
||||
assert.equal(await text('[data-ws-drawer="acme:assistant"] [data-drawer-activity]'), 'not shown: reading it means reading the whole conversation');
|
||||
// SP18: a conversation agent's run took its conversation 5 minutes before the read (thread.claims' time).
|
||||
assert.match(await text('[data-ws-drawer="acme:assistant"] [data-drawer-activity]'), /^current run started [56] min ago$/);
|
||||
// A role agent holds no thread to open, so it has no Message; it can still be stopped.
|
||||
await b.evaluate('location.hash = "#/agents?agent=acme%3Acoder"');
|
||||
await wait(`${open('acme:coder')} && document.querySelector('[data-ws-drawer="acme:coder"] [data-drawer-stop]')`);
|
||||
@@ -578,6 +584,40 @@ test('at 390 wide the drawer is a full-width sheet', async t => {
|
||||
assert.ok(box[3] <= box[2], `no horizontal page scroll: ${box[3]} > ${box[2]}`);
|
||||
});
|
||||
|
||||
// SP18: the sheet is fixed to the screen, but the page under it kept its own height, so the page still
|
||||
// scrolled behind the sheet and a full-page shot showed the sheet stretched down a long blank area. With the
|
||||
// sheet open the page is one screen tall; Close puts the page back where the reader left it.
|
||||
test('SP18: at 390 wide the open sheet is the whole screen, the page under it does not scroll, and Close keeps the place', async t => {
|
||||
const { b, wait } = await setup(t, { viewport: [390, 844], hash: '#/orgs/acme/organization' });
|
||||
const link = JSON.stringify(sessionLink('acme:coder'));
|
||||
await wait(`document.querySelector(${link}) && document.querySelectorAll("[data-org-settings] [data-org-setting]").length > 10`);
|
||||
await b.evaluate(`document.querySelector(${link}).scrollIntoView({ block: 'center' })`);
|
||||
const at = await b.evaluate('Math.round(scrollY)');
|
||||
assert.ok(at > 100, `the row is down the page: ${at}`);
|
||||
await b.evaluate(`document.querySelector(${link}).click()`);
|
||||
await wait(open('acme:coder'));
|
||||
await b.evaluate('new Promise(r => requestAnimationFrame(() => requestAnimationFrame(r)))');
|
||||
const m = await b.evaluate(`(() => { const r = ${drawer('acme:coder')}.getBoundingClientRect(), e = document.documentElement; return { top: Math.round(r.top), bottom: Math.round(r.bottom), left: Math.round(r.left), width: Math.round(r.width), vh: innerHeight, vw: e.clientWidth, docH: e.scrollHeight, bodyH: Math.round(document.body.getBoundingClientRect().height), sw: e.scrollWidth }; })()`);
|
||||
assert.equal(m.top, 0, JSON.stringify(m));
|
||||
assert.equal(m.bottom, m.vh, `the sheet ends at the screen's foot: ${JSON.stringify(m)}`);
|
||||
assert.equal(m.left, 0); assert.equal(m.width, m.vw);
|
||||
assert.ok(m.docH <= m.vh && m.bodyH <= m.vh, `the page under the sheet is one screen tall, nothing below to scroll to: ${JSON.stringify(m)}`);
|
||||
assert.ok(m.sw <= m.vw, 'no sideways scroll');
|
||||
// A scroll on the page does nothing while the sheet is open.
|
||||
await b.evaluate('window.scrollTo(0, 2000)');
|
||||
assert.equal(await b.evaluate('Math.round(scrollY)'), 0);
|
||||
await b.evaluate(`${drawer('acme:coder')}.querySelector("[data-drawer-close]").click()`);
|
||||
await wait(noDrawer);
|
||||
await b.evaluate('new Promise(r => requestAnimationFrame(() => requestAnimationFrame(r)))');
|
||||
assert.ok(Math.abs(await b.evaluate('Math.round(scrollY)') - at) <= 1, `Close puts the page back at ${at}: ${await b.evaluate('Math.round(scrollY)')}`);
|
||||
assert.ok(await b.evaluate('document.documentElement.scrollHeight') > 844, 'the page is its full height again');
|
||||
// At 1440 the drawer is a side panel: the page keeps its height and scrolls.
|
||||
await b.viewport(1440, 900);
|
||||
await b.evaluate(`document.querySelector(${link}).click()`);
|
||||
await wait(open('acme:coder'));
|
||||
assert.ok(await b.evaluate('document.documentElement.scrollHeight') > 900, 'at 1440 the page beside the drawer keeps its height');
|
||||
});
|
||||
|
||||
// #1873 triage-followups: the page focuses its heading when its first render ends. On load the page
|
||||
// starts a second render that reads GET /api/workspace again, so when the first render's read is slow
|
||||
// the second draws the rows first and a reader can open a drawer before the first render ends. Its late
|
||||
|
||||
@@ -279,3 +279,24 @@ test('At 390 wide the tiles sit two to a row with no sideways scroll, on the Das
|
||||
assert.equal(await cols('[data-org-tiles]'), 2);
|
||||
assert.equal(await b.evaluate('document.documentElement.scrollWidth <= document.documentElement.clientWidth'), true, 'organization page');
|
||||
});
|
||||
|
||||
test('SP18: at 1440 and 1024 the Dashboard\'s two columns line up with the tile row above them', async t => {
|
||||
const { b, wait } = await setup(t, { viewport: [1440, 1000] });
|
||||
await wait(homeReady);
|
||||
// The left column ends where a tile ends and the right column starts where the next tile starts: the fourth
|
||||
// and fifth of six at 1440, the second and third of three a row at 1024.
|
||||
const edges = () => b.evaluate(`(() => {
|
||||
const tiles = [...document.querySelectorAll('[data-ws-home] [data-ws-tile]')].map(e => e.getBoundingClientRect());
|
||||
const cols = [...document.querySelectorAll('[data-ws-home] .ws-home-split>*')].map(e => e.getBoundingClientRect());
|
||||
return { rights: tiles.map(r => Math.round(r.right)), lefts: tiles.map(r => Math.round(r.left)), left: cols[0] && [Math.round(cols[0].left), Math.round(cols[0].right)], right: cols[1] && [Math.round(cols[1].left), Math.round(cols[1].right)] };
|
||||
})()`);
|
||||
for (const [w, nth] of [[1440, 4], [1024, 2]]) {
|
||||
await b.viewport(w, 1000);
|
||||
await b.evaluate('new Promise(r => requestAnimationFrame(() => requestAnimationFrame(r)))');
|
||||
const e = await edges();
|
||||
assert.ok(e.left && e.right && e.right[0] > e.left[1], `two columns side by side at ${w}: ${JSON.stringify(e)}`);
|
||||
assert.ok(Math.abs(e.left[1] - e.rights[nth - 1]) <= 1, `at ${w} the left column ends with tile ${nth}: ${JSON.stringify(e)}`);
|
||||
assert.ok(Math.abs(e.right[0] - e.lefts[nth]) <= 1, `at ${w} the right column starts with tile ${nth + 1}: ${JSON.stringify(e)}`);
|
||||
assert.ok(Math.abs(e.right[1] - Math.max(...e.rights)) <= 1, `at ${w} the right column ends with the row`);
|
||||
}
|
||||
});
|
||||
@@ -180,6 +180,20 @@ test('the Settings card fits at 1440 with the drawer open, at 735 and 390 withou
|
||||
assert.deepEqual(cols[1].heads, ['Settings']);
|
||||
const gap = await b.evaluate(`(() => { const left = document.querySelector('#bus-view .ws-dash>.ws-split>section'), card = left.querySelector('[data-wfg-card]'), above = card.previousElementSibling; return Math.round(card.getBoundingClientRect().top - above.getBoundingClientRect().bottom); })()`);
|
||||
assert.ok(gap >= 0 && gap <= 40, `the Workflows card follows the sessions directly: ${gap}px`);
|
||||
// SP18: Autonomy and Starter packs follow the Workflows card in the left column, so the left column is not
|
||||
// empty beside the long Settings card and nothing runs full width below it.
|
||||
const left = await b.evaluate(`(() => { const s = [...document.querySelectorAll('#bus-view .ws-dash>.ws-split>section')]; return { autonomy: !!s[0].querySelector('[data-autonomy]'), packs: !!s[0].querySelector('[data-packs]'), after: !!document.querySelector('#bus-view .ws-dash>.ws-split ~ :is(div,section):not([data-ws-drawer])'), ends: s.map(x => Math.round(x.getBoundingClientRect().bottom)) }; })()`);
|
||||
assert.equal(left.autonomy && left.packs, true, `Autonomy and Starter packs are in the left column: ${JSON.stringify(left)}`);
|
||||
assert.equal(left.after, false, 'no full-width block under the split');
|
||||
// How near level the two end depends on the data: in this fixture Autonomy is a one-line refusal and no pack
|
||||
// is installed, so the Settings card is still the taller. The left column ends with Starter packs.
|
||||
assert.ok(await b.evaluate(`Math.abs(document.querySelector('#bus-view .ws-dash>.ws-split>section [data-packs]').getBoundingClientRect().bottom - document.querySelector('#bus-view .ws-dash>.ws-split>section').getBoundingClientRect().bottom) <= 1`), `the left column ends with Starter packs: ${JSON.stringify(left.ends)}`);
|
||||
// At 390 the page is one column: sessions, Workflows, Autonomy, Starter packs, then Settings.
|
||||
await b.viewport(390, 844);
|
||||
await b.evaluate('new Promise(r => requestAnimationFrame(() => requestAnimationFrame(r)))');
|
||||
const order = await b.evaluate(`[...document.querySelectorAll('#bus-view .ws-dash>.ws-split h2, #bus-view .ws-dash>.ws-split h3')].map(h => h.textContent.trim()).filter(x => ['Active agent sessions', 'Workflows', 'Autonomy', 'Starter packs', 'Settings'].includes(x))`);
|
||||
assert.deepEqual(order, ['Active agent sessions', 'Workflows', 'Autonomy', 'Starter packs', 'Settings']);
|
||||
assert.ok(await b.evaluate('document.documentElement.scrollWidth <= document.documentElement.clientWidth'), 'no sideways scroll at 390');
|
||||
});
|
||||
|
||||
test('the bare organization address with a query is the organization page, query kept; ?agent= opens the drawer', async t => {
|
||||
|
||||
@@ -302,8 +302,9 @@ test('keyboard focus follows visual order and survives a data refresh', async t
|
||||
await b.navigate(`http://127.0.0.1:${server.address().port}/#/orgs/ddigital/organization`);
|
||||
await wait('document.querySelectorAll("[data-org-dashboard] .ws-doc").length > 0 && document.querySelectorAll("#workspace-nav .ws-proj").length === 3');
|
||||
const wide = await tabStops(b, 'document.querySelector("#sections a")');
|
||||
// The left column holds the sessions and, below them, the Workflows card (SP16); the right holds Settings.
|
||||
const regions = ['nav', 'head', 'Sessions and workflows', 'Settings'];
|
||||
// The left column holds the sessions and, below them, the Workflows card (SP16), then Autonomy and Starter
|
||||
// packs (SP18); the right holds Settings.
|
||||
const regions = ['nav', 'head', 'Sessions, workflows, autonomy and starter packs', 'Settings'];
|
||||
assert.deepEqual([...new Set(wide.map(s => s.region))].filter(r => r !== 'other'), regions);
|
||||
assertVisualOrder(wide.filter(s => s.region !== 'other'), regions, '1440');
|
||||
const keys = wide.map(s => s.key);
|
||||
|
||||
@@ -312,6 +312,9 @@ test('a stopped organization is not read: the page and card say the bus is stopp
|
||||
await wait(`document.querySelector('[data-org-dashboard] [data-wfg-card][data-bus-stopped]')`, 'stopped card');
|
||||
assert.match(await b.evaluate(`document.querySelector('[data-wfg-card]').textContent`), /Not read: the bus is stopped\./);
|
||||
assert.equal(await b.evaluate(`document.querySelector('[data-wfg-card] [data-wfg-none]')`), null);
|
||||
// SP18: the card is the page's one Workflows block; the old stopped panel under it said the same thing twice.
|
||||
assert.equal(await b.evaluate(`[...document.querySelectorAll('[data-org-dashboard] h2, [data-org-dashboard] h3')].filter(h => h.textContent.trim() === 'Workflows').length`), 1, 'one Workflows heading on a stopped organization page');
|
||||
assert.equal(await b.evaluate(`document.querySelector('[data-workflows]')`), null);
|
||||
assert.equal(reads.filter(id => id === 'gamma').length, 0, 'a stopped organization is not read');
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user