openvibers/openvibe.help Commits

Help: a site not serving yet says 'What it will do', and has no What shipped link (#42)

OP OpenVibers committed 29 days ago · 4aad513db0 · 2 files, +6 −2

A site page on OpenVibe.Help no longer presents a site that is not serving yet as if its features worked.

- **Heading:** a coming site's pillars are titled "What it will do". Live sites keep "What you can do".
- **What shipped link:** shown only for a live site. A coming site's address does not serve, so its `/updates` link went to a parked domain.

This pairs with Contracts 0.184.0 (#144), which makes live sites' pillars say what they do today and stops calling openvibe.pics live. Once Help pins it, Pics shows as coming.

`test/help-articles.test.js` checks both on every site page.

Changes

ddiff --git a/server/http/pages.js b/server/http/pages.js
iindex 11fd519..fb5cb82 100644
---- a/server/http/pages.js
++++ b/server/http/pages.js
@@@ -162,10 +162,10 @@ ${site.description ? textBlock(site.description) : ''}
<p class="site-links">${site.state === 'live'
? html`<a class="sc-btn sc-primary" href="${site.url}" rel="noopener nofollow">Open ${site.domain}</a>`
: html`<span class="muted">Not serving yet — ${site.url} is its address.</span>`}
--<a class="sc-btn" href="${site.updatesUrl}" rel="noopener nofollow">What shipped on ${site.name}</a></p>
++${site.state === 'live' ? html`<a class="sc-btn" href="${site.updatesUrl}" rel="noopener nofollow">What shipped on ${site.name}</a>` : ''}</p>
${provenance(site.provenance)}
--${site.pillars.length ? html`<section class="sc-sec" aria-labelledby="h-pillars"><h2 id="h-pillars">What you can do</h2>
++${site.pillars.length ? html`<section class="sc-sec" aria-labelledby="h-pillars"><h2 id="h-pillars">${site.state === 'live' ? 'What you can do' : 'What it will do'}</h2>
<ul class="pillars">${site.pillars.map((p) => html`<li><b>${p.title}</b>${p.text ? html` <span class="muted">${p.text}</span>` : ''}</li>`)}</ul></section>` : ''}
<section class="sc-sec" aria-labelledby="h-faq"><h2 id="h-faq">Questions</h2>
ddiff --git a/test/help-articles.test.js b/test/help-articles.test.js
iindex 090ad3d..f67ac8a 100644
---- a/test/help-articles.test.js
++++ b/test/help-articles.test.js
@@@ -62,6 +62,10 @@ const WITH_FAQ = [
assert.ok(r.text.includes(site.name), `${site.id}: the name is not on the page`);
if (site.oneLine) assert.ok(r.text.includes(esc(site.oneLine.slice(0, 40))), `${site.id}: the one line is not on the page`);
assert.ok(r.text.includes('OpenVibe.Contracts'), `${site.id}: no provenance`);
++ // A site not serving yet promises nothing as working: its pillars are what it will do, and there is no
++ // "What shipped" link to an address that does not serve.
++ if (site.pillars.length) assert.ok(r.text.includes(site.state === 'live' ? 'What you can do' : 'What it will do'), `${site.id}: pillars heading`);
++ assert.strictEqual(r.text.includes(`What shipped on ${esc(site.name)}`), site.state === 'live', `${site.id}: What shipped link only when live`);
}
});