diff --git a/packages/webui/src/public/bus.js b/packages/webui/src/public/bus.js index 4cfd881f3..c7c0e066c 100644 --- a/packages/webui/src/public/bus.js +++ b/packages/webui/src/public/bus.js @@ -709,7 +709,7 @@ : '

Authority comes from the system config with the business file. This Console could not read the system config, so it shows none.

'; const refused = instances.filter(i => i.refused).map(i => `
  • ${txt(i.instance)}: ${txt(i.refused)}
  • `).join(''); const credRows = creds.map(c => `${txt(c.service)}${txt(c.account) || 'not named in the business file'}${txt(c.role)}${txt(c.dateKind === 'expires' ? 'expires' : 'rotate by')} ${badge(c.state, CRED[c.state] || 'muted')}`).join(''); - return settingsShell('business', `

    Business

    Human
    ${txt(b.human) || none}
    Arbiters
    ${arbiterRefs(b.arbiters)}
    Projects
    ${names(b.projects)}
    Launcher
    ${txt(launch.by) || none}
    May launch
    ${names(launch.instances)}
    At most
    ${Object.entries(launch.limits?.models || {}).flatMap(([p, ms]) => Object.entries(ms).map(([m, c]) => `${txt(c)} ${txt(p)} / ${txt(m)}`)).join(', ') || none}
    + return settingsShell('business', `

    Business file

    Human
    ${txt(b.human) || none}
    Arbiters
    ${arbiterRefs(b.arbiters)}
    Projects
    ${names(b.projects)}
    Launcher
    ${txt(launch.by) || none}
    May launch
    ${names(launch.instances)}
    At most
    ${Object.entries(launch.limits?.models || {}).flatMap(([p, ms]) => Object.entries(ms).map(([m, c]) => `${txt(c)} ${txt(p)} / ${txt(m)}`)).join(', ') || none}

    Vars

    ${kvRows(b.vars, 'No vars Console shows are set.')}

    Role instances ${instances.length}

    ${instances.length ? `
    ${['Instance', 'Definition', 'Holder', 'Harness'].map(h => ``).join('')}${roleRows}
    ${h}
    ` : empty('This business has no role instances.', 'An instance shows here when the business file names one under roles.')}
    ${instances.length ? `

    Authority

    Within the role, cross-role (needs the other role), or gated (needs the human), as the business package classifies each action.

    ${matrix}${refused ? `` : ''}
    ` : ''} diff --git a/packages/webui/src/public/shell.css b/packages/webui/src/public/shell.css index 9809b2087..5a64000ef 100644 --- a/packages/webui/src/public/shell.css +++ b/packages/webui/src/public/shell.css @@ -240,6 +240,7 @@ button:disabled,[aria-disabled=true]{cursor:not-allowed} .settings-helper{font-size:14px;color:var(--muted);margin:0 0 16px} .settings-content .panel{margin:0 0 16px;padding:16px} .settings-content .panel h3{font-size:16px;margin:0;color:var(--strong)} +.settings-content.settings-business .panel h3{margin:14px 0 6px} .settings-content .panel>p{margin:4px 0 12px;color:var(--muted);font-size:14px} .settings-content input:not([type=radio]):not([type=checkbox]),.settings-content select,.settings-content textarea{min-height:44px;max-width:100%;border:1px solid var(--border);border-radius:var(--r);background:var(--canvas);color:var(--text);font:inherit;padding:8px 12px} .settings-content input:disabled,.settings-content select:disabled,.settings-content textarea:disabled{background:var(--raised);border-color:var(--line);color:var(--muted)} diff --git a/packages/webui/tests/s16-business-settings-browser.test.mjs b/packages/webui/tests/s16-business-settings-browser.test.mjs index 55edf639a..21fd16d94 100644 --- a/packages/webui/tests/s16-business-settings-browser.test.mjs +++ b/packages/webui/tests/s16-business-settings-browser.test.mjs @@ -28,6 +28,8 @@ test('legacy Business bookmark replaces its history entry and retains its data', assert.deepEqual(await b.evaluate('[...document.querySelectorAll("[aria-labelledby=bz-about] dt")].map(e=>[e.textContent,e.nextElementSibling.textContent])'),[['Human','jason'],['Arbiters','pm (delivery)'],['Projects','stack'],['Launcher','pm'],['May launch','pm'],['At most','1 fixture / opus'],['region','north']]); const content=await b.evaluate('document.querySelector(".settings-business").textContent'); for(const field of ['jason','pm (delivery)','stack','manager','sage','pi','opus','role.launch','within','gitea','bot-acme','2099-01-01']) assert.ok(content.includes(field),field); + assert.equal(await b.evaluate('document.querySelector("#bz-about").textContent'),'Business file'); + assert.equal(await b.evaluate('getComputedStyle(document.querySelector("[aria-labelledby=bz-about] h3")).marginTop'),'14px'); assert.equal(await b.evaluate('document.title'),'Settings · Business · Mosaic Console'); assert.deepEqual(await b.evaluate('[...document.querySelectorAll("#breadcrumbs a, #breadcrumbs [aria-current]")].map(e=>e.textContent)'),['Settings','Business']); await b.evaluate('history.back()'); await wait('location.hash==="#/settings/appearance"');