openvibers/openvibe.help Commits

The catalog leaves out addresses a product manifest marks closed, moved or status: openvibe.website opens OpenVibe.Space, and the home page counted it as a site still coming (#68)

OP OpenVibers committed 25 days ago · 772581a902 · 2 files, +6 −3

Changes

ddiff --git a/server/catalog.js b/server/catalog.js
iindex d47720f..fbabb1f 100644
---- a/server/catalog.js
++++ b/server/catalog.js
@@@ -170,9 +170,10 @@ function buildSites() {
// The help centre is about products: a site is an apex domain (openvibe.live, openre.stream) or a live service's own
// site on a subdomain (ai.openvibe.services). The network's operational hosts (admin., auth., api., status., themes.,
-- // realtime. on openvibe.network) and moved addresses are not products and stay out of the catalog.
++ // realtime. on openvibe.network) and moved addresses are not products and stay out of the catalog. Neither is an
++ // address a product manifest marks closed, moved or status (openvibe.website opens OpenVibe.Space).
const serviceSites = new Set(services.filter((m) => m.site).map(siteDomain));
-- const isProduct = (e) => String(e.domain).split('.').length === 2 || (serviceSites.has(e.domain) && live.has(e.domain));
++ const isProduct = (e) => !e.kind && (String(e.domain).split('.').length === 2 || (serviceSites.has(e.domain) && live.has(e.domain)));
const sites = [...byDomain.values()].filter(isProduct).map((e) => {
const state = live.has(e.domain) ? 'live' : 'coming';
ddiff --git a/test/help-articles.test.js b/test/help-articles.test.js
iindex 6537d78..01c5078 100644
---- a/test/help-articles.test.js
++++ b/test/help-articles.test.js
@@@ -30,7 +30,9 @@ const WITH_FAQ = [
if (m.site && m.site.tld) live.add(siteDomain(m));
}
const product = (d) => d.split('.').length === 2 || (SERVICE_SITES.map(siteDomain).includes(d) && live.has(d));
-- const expected = new Set([...PRODUCTS.map((p) => p.domain), ...SERVICE_SITES.map(siteDomain)].filter(product));
++ // A closed, moved or status address (a product manifest's kind) is not a site of its own.
++ const elsewhere = new Set(PRODUCTS.filter((p) => p.kind).map((p) => p.domain));
++ const expected = new Set([...PRODUCTS.map((p) => p.domain), ...SERVICE_SITES.map(siteDomain)].filter((d) => product(d) && !elsewhere.has(d)));
for (const host of ['admin.openvibe.network', 'auth.openvibe.network', 'api.openvibe.network', 'status.openvibe.network', 'themes.openvibe.network']) {
assert.ok(!catalog.sites.some((s) => s.id === host), `${host} is an operational host, not a product`);
}