openvibers/openvibe.live Commits
Home stats link every OpenVibe site's numbers (openvibe.network/stats), under the board and in the chart dialog (#410)
Changes
@@@ -462,6 +462,7 @@ function _renderHeroStats(stats) {<span class="hero-stat-kicker"><i class="fa-solid ${g.icon}"></i>${g.kicker}</span><div class="hero-stat-row">${g.rows.map(chip).join('')}</div></div>`).join('')}++ <a class="hero-stat-all-sites" href="https://openvibe.network/stats"><i class="fa-solid fa-chart-column" aria-hidden="true"></i><span>Stats for every OpenVibe site</span><i class="fa-solid fa-arrow-right" aria-hidden="true"></i></a></div>`;const btn = wrap.querySelector('#hero-stat-more');@@@ -168,7 +168,7 @@<div class="sn-table" hidden></div><div class="sn-tip" role="status" aria-live="polite" hidden></div></div>-- <footer class="sn-foot"><span class="sn-note"></span><span class="sn-swipe-hint">Swipe for more stats</span><button type="button" class="sn-csv"><i class="fa-solid fa-download"></i> CSV</button></footer>++ <footer class="sn-foot"><span class="sn-note"></span><span class="sn-swipe-hint">Swipe for more stats</span><a class="sn-all" href="https://openvibe.network/stats"><i class="fa-solid fa-chart-column" aria-hidden="true"></i> Every site</a><button type="button" class="sn-csv"><i class="fa-solid fa-download"></i> CSV</button></footer></div>`;document.body.appendChild(ov);state.overlay = ov;@@@ -44,6 +44,8 @@ const strip = src.slice(src.indexOf('const HEADLINE = ['), src.indexOf('];', srcconst stripMetrics = [...strip.matchAll(/metric: '([a-zA-Z]+)'/g)].map((m) => m[1]);assert.strictEqual(new Set(stripMetrics).size, stripMetrics.length, 'the strip shows each metric once');assert.strictEqual(stripMetrics.length, 9, 'nine chips: three rows of three on a phone');++// Every site's numbers (openvibe.network/stats, Network#359) under the board and in the chart dialog.++assert.ok(src.includes('<a class="hero-stat-all-sites" href="https://openvibe.network/stats">'), 'the board links every site\'s numbers');// The chart dialog: daily headcounts have no running total, and an error answer is never redrawn.const nerds = fs.readFileSync(path.join(__dirname, '..', 'public', 'js', 'stats-nerds.js'), 'utf8');@@@ -51,4 +53,5 @@ assert.ok(/const DISTINCT = new Set\(\['active', 'supporters'\]\)/.test(nerds));assert.ok(nerds.includes("DISTINCT.has(m.metric) ? [['daily', 'Per day']]"), 'a headcount offers only per day');assert.ok(nerds.includes('if (state.data?.points && !state.table) drawChart();'), 'a resize never redraws an error answer');assert.ok(nerds.includes('const asked = Number(chip?.dataset?.days);'), 'the 24-hour line opens its own 24 hours');++assert.ok(nerds.includes('<a class="sn-all" href="https://openvibe.network/stats">'), 'and the dialog links them too');console.log('home stat board: all checks passed');
@@ -462,6 +462,7 @@ function _renderHeroStats(stats) {
@@ -462,6 +462,7 @@ function _renderHeroStats(stats) {
<span class="hero-stat-kicker"><i class="fa-solid ${g.icon}"></i>${g.kicker}</span>
<span class="hero-stat-kicker"><i class="fa-solid ${g.icon}"></i>${g.kicker}</span>
<div class="hero-stat-row">${g.rows.map(chip).join('')}</div>
<div class="hero-stat-row">${g.rows.map(chip).join('')}</div>
</div>`).join('')}
</div>`).join('')}
+ <a class="hero-stat-all-sites" href="https://openvibe.network/stats"><i class="fa-solid fa-chart-column" aria-hidden="true"></i><span>Stats for every OpenVibe site</span><i class="fa-solid fa-arrow-right" aria-hidden="true"></i></a>
</div>`;
</div>`;
const btn = wrap.querySelector('#hero-stat-more');
const btn = wrap.querySelector('#hero-stat-more');
@@ -168,7 +168,7 @@
@@ -168,7 +168,7 @@
<div class="sn-table" hidden></div>
<div class="sn-table" hidden></div>
<div class="sn-tip" role="status" aria-live="polite" hidden></div>
<div class="sn-tip" role="status" aria-live="polite" hidden></div>
</div>
</div>
- <footer class="sn-foot"><span class="sn-note"></span><span class="sn-swipe-hint">Swipe for more stats</span><button type="button" class="sn-csv"><i class="fa-solid fa-download"></i> CSV</button></footer>
+ <footer class="sn-foot"><span class="sn-note"></span><span class="sn-swipe-hint">Swipe for more stats</span><a class="sn-all" href="https://openvibe.network/stats"><i class="fa-solid fa-chart-column" aria-hidden="true"></i> Every site</a><button type="button" class="sn-csv"><i class="fa-solid fa-download"></i> CSV</button></footer>
</div>`;
</div>`;
document.body.appendChild(ov);
document.body.appendChild(ov);
state.overlay = ov;
state.overlay = ov;
@@ -44,6 +44,8 @@ const strip = src.slice(src.indexOf('const HEADLINE = ['), src.indexOf('];', src
@@ -44,6 +44,8 @@ const strip = src.slice(src.indexOf('const HEADLINE = ['), src.indexOf('];', src
const stripMetrics = [...strip.matchAll(/metric: '([a-zA-Z]+)'/g)].map((m) => m[1]);
const stripMetrics = [...strip.matchAll(/metric: '([a-zA-Z]+)'/g)].map((m) => m[1]);
assert.strictEqual(new Set(stripMetrics).size, stripMetrics.length, 'the strip shows each metric once');
assert.strictEqual(new Set(stripMetrics).size, stripMetrics.length, 'the strip shows each metric once');
assert.strictEqual(stripMetrics.length, 9, 'nine chips: three rows of three on a phone');
assert.strictEqual(stripMetrics.length, 9, 'nine chips: three rows of three on a phone');
+// Every site's numbers (openvibe.network/stats, Network#359) under the board and in the chart dialog.
+assert.ok(src.includes('<a class="hero-stat-all-sites" href="https://openvibe.network/stats">'), 'the board links every site\'s numbers');
// The chart dialog: daily headcounts have no running total, and an error answer is never redrawn.
// The chart dialog: daily headcounts have no running total, and an error answer is never redrawn.
const nerds = fs.readFileSync(path.join(__dirname, '..', 'public', 'js', 'stats-nerds.js'), 'utf8');
const nerds = fs.readFileSync(path.join(__dirname, '..', 'public', 'js', 'stats-nerds.js'), 'utf8');
@@ -51,4 +53,5 @@ assert.ok(/const DISTINCT = new Set\(\['active', 'supporters'\]\)/.test(nerds));
@@ -51,4 +53,5 @@ assert.ok(/const DISTINCT = new Set\(\['active', 'supporters'\]\)/.test(nerds));
assert.ok(nerds.includes("DISTINCT.has(m.metric) ? [['daily', 'Per day']]"), 'a headcount offers only per day');
assert.ok(nerds.includes("DISTINCT.has(m.metric) ? [['daily', 'Per day']]"), 'a headcount offers only per day');
assert.ok(nerds.includes('if (state.data?.points && !state.table) drawChart();'), 'a resize never redraws an error answer');
assert.ok(nerds.includes('if (state.data?.points && !state.table) drawChart();'), 'a resize never redraws an error answer');
assert.ok(nerds.includes('const asked = Number(chip?.dataset?.days);'), 'the 24-hour line opens its own 24 hours');
assert.ok(nerds.includes('const asked = Number(chip?.dataset?.days);'), 'the 24-hour line opens its own 24 hours');
+assert.ok(nerds.includes('<a class="sn-all" href="https://openvibe.network/stats">'), 'and the dialog links them too');
console.log('home stat board: all checks passed');
console.log('home stat board: all checks passed');