openvibers/openvibe.network Commits
A remote job's place says remote once (#643)
Changes
@@@ -156,7 +156,10 @@ function jobs(body) {const f = d.facets || {};const where = clip(f.location || d.summary || '', 48);const board = d.provenance && d.provenance[0] && d.provenance[0].label ? clip(d.provenance[0].label, 30) : '';-- return { title: clip(d.title, 90), url: onHost(d.canonical_url, 'openvibe.work'), where: f.remote ? (where ? `Remote · ${where}` : 'Remote') : where, board };++ // A remote job whose location already says so ("remote", "Remote (US)") is not "Remote · remote" (11-07 text lint).++ const saysRemote = /^\s*remote\b/i.test(where);++ const place = f.remote ? (saysRemote ? where.replace(/^\s*remote/i, 'Remote') : where ? `Remote · ${where}` : 'Remote') : where;++ return { title: clip(d.title, 90), url: onHost(d.canonical_url, 'openvibe.work'), where: place, board };}).slice(0, 4);}@@@ -49,6 +49,10 @@ assert.deepStrictEqual(recs.map((r) => r.url), ['https://openvibe.video/v/9', 'hassert.strictEqual(recs[0].length, '1h 6m');assert.strictEqual(recs[1].thumb, null, 'a thumbnail only from openvibe.media');assert.strictEqual(activity.runtime(1805), '30 min');++// A remote job's place: "Remote · Berlin", but never "Remote · remote" (11-07).++const remoteJob = (location, remote) => ({ visibility: 'public', title: 'Nurse', canonical_url: 'https://openvibe.work/jobs/1', facets: { location, remote } });++assert.deepStrictEqual(activity.jobs({ results: [remoteJob('remote', true), remoteJob('Remote (US)', true), remoteJob('Berlin', true), remoteJob('Berlin', false), remoteJob('', true)] }).map((j) => j.where),++ ['Remote', 'Remote (US)', 'Remote · Berlin', 'Berlin'], 'the place says remote once');// The front door features no adult items and repeats no AI words about a person's looks.const flagged = activity.publicPastes({ pastes: [
@@ -156,7 +156,10 @@ function jobs(body) {
@@ -156,7 +156,10 @@ function jobs(body) {
const f = d.facets || {};
const f = d.facets || {};
const where = clip(f.location || d.summary || '', 48);
const where = clip(f.location || d.summary || '', 48);
const board = d.provenance && d.provenance[0] && d.provenance[0].label ? clip(d.provenance[0].label, 30) : '';
const board = d.provenance && d.provenance[0] && d.provenance[0].label ? clip(d.provenance[0].label, 30) : '';
- return { title: clip(d.title, 90), url: onHost(d.canonical_url, 'openvibe.work'), where: f.remote ? (where ? `Remote · ${where}` : 'Remote') : where, board };
+ // A remote job whose location already says so ("remote", "Remote (US)") is not "Remote · remote" (11-07 text lint).
+ const saysRemote = /^\s*remote\b/i.test(where);
+ const place = f.remote ? (saysRemote ? where.replace(/^\s*remote/i, 'Remote') : where ? `Remote · ${where}` : 'Remote') : where;
+ return { title: clip(d.title, 90), url: onHost(d.canonical_url, 'openvibe.work'), where: place, board };
})
})
.slice(0, 4);
.slice(0, 4);
}
}
@@ -49,6 +49,10 @@ assert.deepStrictEqual(recs.map((r) => r.url), ['https://openvibe.video/v/9', 'h
@@ -49,6 +49,10 @@ assert.deepStrictEqual(recs.map((r) => r.url), ['https://openvibe.video/v/9', 'h
assert.strictEqual(recs[0].length, '1h 6m');
assert.strictEqual(recs[0].length, '1h 6m');
assert.strictEqual(recs[1].thumb, null, 'a thumbnail only from openvibe.media');
assert.strictEqual(recs[1].thumb, null, 'a thumbnail only from openvibe.media');
assert.strictEqual(activity.runtime(1805), '30 min');
assert.strictEqual(activity.runtime(1805), '30 min');
+// A remote job's place: "Remote · Berlin", but never "Remote · remote" (11-07).
+const remoteJob = (location, remote) => ({ visibility: 'public', title: 'Nurse', canonical_url: 'https://openvibe.work/jobs/1', facets: { location, remote } });
+assert.deepStrictEqual(activity.jobs({ results: [remoteJob('remote', true), remoteJob('Remote (US)', true), remoteJob('Berlin', true), remoteJob('Berlin', false), remoteJob('', true)] }).map((j) => j.where),
+ ['Remote', 'Remote (US)', 'Remote · Berlin', 'Berlin'], 'the place says remote once');
// The front door features no adult items and repeats no AI words about a person's looks.
// The front door features no adult items and repeats no AI words about a person's looks.
const flagged = activity.publicPastes({ pastes: [
const flagged = activity.publicPastes({ pastes: [