openvibers/openvibe.today Commits

Guide the calendar scheduling step (#163)

OP OpenVibers committed 2 days ago · 5e2681ad98 · 2 files, +2 −1

Changes

ddiff --git a/server/views/index.js b/server/views/index.js
iindex a63aa45..cd370e4 100644
---- a/server/views/index.js
++++ b/server/views/index.js
@@@ -466,7 +466,7 @@ ${problem ? `<p class="td-note is-bad" role="alert">${esc(problem)}</p>` : ''}
<label class="td-field"><span>Time zone</span><select name="tz" data-tz>${zones.map((z) => `<option value="${esc(z)}"${z === v.tz ? ' selected' : ''}>${esc(z.replace(/_/g, ' '))}</option>`).join('')}</select><small>The time above is read in this zone. Everyone sees it in their own.</small></label>
<label class="td-field"><span>Description <i>optional</i></span><textarea name="description" rows="3" maxlength="1000" placeholder="What you are doing, who is joining">${esc(v.description || '')}</textarea></label>
<fieldset class="td-opts"><legend>Who can see it?</legend>${radio('visibility', 'public', 'Everyone', 'Here, on your channel and in feeds')}${radio('visibility', 'followers', 'Followers', 'Only people who follow you')}</fieldset>
--<div class="td-acts"><button class="ovk-btn ovk-btn--primary" type="submit">Schedule it</button><a class="ovk-btn ovk-btn--quiet" href="/me">Back to your agenda</a></div>
++<div class="td-acts"><button class="ovk-btn ovk-btn--primary" type="submit" data-ov-guide="today.schedule">Schedule it</button><a class="ovk-btn ovk-btn--quiet" href="/me">Back to your agenda</a></div>
</form></div>`;
}
ddiff --git a/test/pages.test.js b/test/pages.test.js
iindex fe5c301..08c4cc4 100644
---- a/test/pages.test.js
++++ b/test/pages.test.js
@@@ -135,6 +135,7 @@ function jsonLd(html) {
assert.strictEqual(form.status, 200);
assert.ok(form.text.includes('id="td-schedule-form"'));
assert.ok(form.text.includes('method="post" action="/schedule"'));
++ assert.ok(form.text.includes('data-ov-guide="today.schedule"'), 'the schedule form has the Quest guide target');
const local = new Date(Date.now() + 3 * 60 * 60_000).toISOString().slice(0, 16);
const r = await t.get('/schedule', { as: alice, form: { kind: 'stream', title: 'From the form', starts_at: local, tz: 'Europe/Berlin', description: 'Form text', visibility: 'public' } });
assert.strictEqual(r.status, 303, r.text.slice(0, 300));