openvibers/openvibe.quest Commits
Quest: the home says quests pay OpenCoins now that they do (#48)
Changes
@@@ -54,7 +54,7 @@ function createPageRoutes(ctx) {eyebrow: `${SITE_NAME} · ${TAGLINE}`,title: 'Quests across OpenVibe.',accent: 'Badges for what you really do.',-- lede: `${SITE_NAME} is the network's shared quest log: one place that knows what you have really done on the OpenVibe sites it follows, and rewards it with badges (and OpenCoins, once they are switched on). Quest runs no activities of its own — it listens to what the sites already report, and nothing else.`,++ lede: `${SITE_NAME} is the network's shared quest log: one place that knows what you have really done on the OpenVibe sites it follows, and rewards it with badges${coinsUi.coinsEnabled ? ' and OpenCoins' : ' (and OpenCoins, once they are switched on)'}. Quest runs no activities of its own — it listens to what the sites already report, and nothing else.`,actions: signedIn(req)? [{ label: 'Your quest log', href: '/me', primary: true }, { label: 'How it works', href: '/how-it-works' }]: [{ label: 'Sign in to start', href: '/auth/login?next=%2Fme', primary: true }, { label: 'How it works', href: '/how-it-works' }],@@@ -71,7 +71,7 @@ ${raw(showcase.features({lede: 'One quest log across eight OpenVibe sites (Live, the Network, Community, Chat, the Wiki, Games, Tools and Space), built on what the sites already tell the network.',items: [{ icon: 'ov:page', title: 'One log, many sites', text: 'A stream on OpenVibe.Live, a thread on OpenVibe.Community, a message in OpenVibe.Chat: the same log, grouped by the site the event came from.' },-- { icon: 'ov:account', title: 'Rewards are badges', text: 'A quest pays a badge that shows on your profile across the network and, once they are switched on, OpenCoins.' },++ { icon: 'ov:account', title: 'Rewards are badges', text: coinsUi.coinsEnabled ? 'A quest pays a badge that shows on your profile across the network, and OpenCoins into your OpenVibe.Network wallet.' : 'A quest pays a badge that shows on your profile across the network and, once they are switched on, OpenCoins.' },{ icon: 'ov:tools', title: 'OpenCoins, not Vibes', text: 'OpenCoins are loyalty points credited through OpenVibe.Network\'s wallet. They are never money, they are not Vibes, and Vibes are never touched here.' },{ icon: 'ov:games', title: 'Made by communities next', text: 'Quests a streamer or a community writes themselves need moderation, which this release does not have yet. The tables and the API already key everything by quest id.' },],@@@ -4,7 +4,7 @@* Quest's quest pages in OpenVibe.Search (openvibe-publishing/search-feed): one search.index-document@1 per quest* (/quests/<id>), sent as quest.index_document.upserted|deleted through this service's events outbox. The document is* what the page says: the quest's title, why it is worth doing, its steps, the site it happens on and the badge (and-- * item) it gives. Not the OpenCoins: they are off until the reward economics are decided (QUEST_COINS), and Search++ * item) it gives. Not the OpenCoins: whether they move is a setting (QUEST_COINS) and their amounts may change, and Search* should never promise them.** Quests are this service's own catalog (server/quests/catalog.js), so a sweep a minute after boot and every six@@@ -177,5 +177,23 @@ const { render } = require('../server/render/html');assert.ok(!page.text.includes('<script>alert(1)'), 'the requested path is never echoed as markup');});} finally { await t.close(); }++++ // The home's OpenCoins wording follows QUEST_COINS: "once they are switched on" only while they are off.++ const on = await boot({ env: { QUEST_COINS: 'on' } });++ try {++ await check('with QUEST_COINS=on the home says quests pay OpenCoins, not that they will', async () => {++ const home = await on.get('/');++ assert.strictEqual(home.status, 200);++ assert.ok(!home.text.includes('once they are switched on'), 'no promise of something already on');++ assert.ok(home.text.includes('rewards it with badges and OpenCoins'));++ assert.ok(home.text.includes('OpenCoins into your OpenVibe.Network wallet'));++ });++ } finally { await on.close(); }++ const off = await boot();++ try {++ await check('with QUEST_COINS off the home still says they come later', async () => {++ assert.ok((await off.get('/')).text.includes('once they are switched on'));++ });++ } finally { await off.close(); }done();})().catch((err) => { console.error(err); process.exit(1); });
@@ -54,7 +54,7 @@ function createPageRoutes(ctx) {
@@ -54,7 +54,7 @@ function createPageRoutes(ctx) {
eyebrow: `${SITE_NAME} · ${TAGLINE}`,
eyebrow: `${SITE_NAME} · ${TAGLINE}`,
title: 'Quests across OpenVibe.',
title: 'Quests across OpenVibe.',
accent: 'Badges for what you really do.',
accent: 'Badges for what you really do.',
- lede: `${SITE_NAME} is the network's shared quest log: one place that knows what you have really done on the OpenVibe sites it follows, and rewards it with badges (and OpenCoins, once they are switched on). Quest runs no activities of its own — it listens to what the sites already report, and nothing else.`,
+ lede: `${SITE_NAME} is the network's shared quest log: one place that knows what you have really done on the OpenVibe sites it follows, and rewards it with badges${coinsUi.coinsEnabled ? ' and OpenCoins' : ' (and OpenCoins, once they are switched on)'}. Quest runs no activities of its own — it listens to what the sites already report, and nothing else.`,
actions: signedIn(req)
actions: signedIn(req)
? [{ label: 'Your quest log', href: '/me', primary: true }, { label: 'How it works', href: '/how-it-works' }]
? [{ label: 'Your quest log', href: '/me', primary: true }, { label: 'How it works', href: '/how-it-works' }]
: [{ label: 'Sign in to start', href: '/auth/login?next=%2Fme', primary: true }, { label: 'How it works', href: '/how-it-works' }],
: [{ label: 'Sign in to start', href: '/auth/login?next=%2Fme', primary: true }, { label: 'How it works', href: '/how-it-works' }],
@@ -71,7 +71,7 @@ ${raw(showcase.features({
@@ -71,7 +71,7 @@ ${raw(showcase.features({
lede: 'One quest log across eight OpenVibe sites (Live, the Network, Community, Chat, the Wiki, Games, Tools and Space), built on what the sites already tell the network.',
lede: 'One quest log across eight OpenVibe sites (Live, the Network, Community, Chat, the Wiki, Games, Tools and Space), built on what the sites already tell the network.',
items: [
items: [
{ icon: 'ov:page', title: 'One log, many sites', text: 'A stream on OpenVibe.Live, a thread on OpenVibe.Community, a message in OpenVibe.Chat: the same log, grouped by the site the event came from.' },
{ icon: 'ov:page', title: 'One log, many sites', text: 'A stream on OpenVibe.Live, a thread on OpenVibe.Community, a message in OpenVibe.Chat: the same log, grouped by the site the event came from.' },
- { icon: 'ov:account', title: 'Rewards are badges', text: 'A quest pays a badge that shows on your profile across the network and, once they are switched on, OpenCoins.' },
+ { icon: 'ov:account', title: 'Rewards are badges', text: coinsUi.coinsEnabled ? 'A quest pays a badge that shows on your profile across the network, and OpenCoins into your OpenVibe.Network wallet.' : 'A quest pays a badge that shows on your profile across the network and, once they are switched on, OpenCoins.' },
{ icon: 'ov:tools', title: 'OpenCoins, not Vibes', text: 'OpenCoins are loyalty points credited through OpenVibe.Network\'s wallet. They are never money, they are not Vibes, and Vibes are never touched here.' },
{ icon: 'ov:tools', title: 'OpenCoins, not Vibes', text: 'OpenCoins are loyalty points credited through OpenVibe.Network\'s wallet. They are never money, they are not Vibes, and Vibes are never touched here.' },
{ icon: 'ov:games', title: 'Made by communities next', text: 'Quests a streamer or a community writes themselves need moderation, which this release does not have yet. The tables and the API already key everything by quest id.' },
{ icon: 'ov:games', title: 'Made by communities next', text: 'Quests a streamer or a community writes themselves need moderation, which this release does not have yet. The tables and the API already key everything by quest id.' },
],
],
@@ -4,7 +4,7 @@
@@ -4,7 +4,7 @@
* Quest's quest pages in OpenVibe.Search (openvibe-publishing/search-feed): one search.index-document@1 per quest
* Quest's quest pages in OpenVibe.Search (openvibe-publishing/search-feed): one search.index-document@1 per quest
* (/quests/<id>), sent as quest.index_document.upserted|deleted through this service's events outbox. The document is
* (/quests/<id>), sent as quest.index_document.upserted|deleted through this service's events outbox. The document is
* what the page says: the quest's title, why it is worth doing, its steps, the site it happens on and the badge (and
* what the page says: the quest's title, why it is worth doing, its steps, the site it happens on and the badge (and
- * item) it gives. Not the OpenCoins: they are off until the reward economics are decided (QUEST_COINS), and Search
+ * item) it gives. Not the OpenCoins: whether they move is a setting (QUEST_COINS) and their amounts may change, and Search
* should never promise them.
* should never promise them.
*
*
* Quests are this service's own catalog (server/quests/catalog.js), so a sweep a minute after boot and every six
* Quests are this service's own catalog (server/quests/catalog.js), so a sweep a minute after boot and every six
@@ -177,5 +177,23 @@ const { render } = require('../server/render/html');
@@ -177,5 +177,23 @@ const { render } = require('../server/render/html');
assert.ok(!page.text.includes('<script>alert(1)'), 'the requested path is never echoed as markup');
assert.ok(!page.text.includes('<script>alert(1)'), 'the requested path is never echoed as markup');
});
});
} finally { await t.close(); }
} finally { await t.close(); }
+
+ // The home's OpenCoins wording follows QUEST_COINS: "once they are switched on" only while they are off.
+ const on = await boot({ env: { QUEST_COINS: 'on' } });
+ try {
+ await check('with QUEST_COINS=on the home says quests pay OpenCoins, not that they will', async () => {
+ const home = await on.get('/');
+ assert.strictEqual(home.status, 200);
+ assert.ok(!home.text.includes('once they are switched on'), 'no promise of something already on');
+ assert.ok(home.text.includes('rewards it with badges and OpenCoins'));
+ assert.ok(home.text.includes('OpenCoins into your OpenVibe.Network wallet'));
+ });
+ } finally { await on.close(); }
+ const off = await boot();
+ try {
+ await check('with QUEST_COINS off the home still says they come later', async () => {
+ assert.ok((await off.get('/')).text.includes('once they are switched on'));
+ });
+ } finally { await off.close(); }
done();
done();
})().catch((err) => { console.error(err); process.exit(1); });
})().catch((err) => { console.error(err); process.exit(1); });