diff --git a/lib/l10n-en_GB.js b/lib/l10n-en_GB.js index 353c8d755..40810ac17 100644 --- a/lib/l10n-en_GB.js +++ b/lib/l10n-en_GB.js @@ -100,6 +100,9 @@ export const messages = { 'headers.dl.editor-not-found': 'Cannot find any editors for this document.', 'headers.dl.editor-missing-id': 'Missing `data-editor-id` attribute for editor(s): ${names}.', + // headers/editor-participation + 'headers.editor-participation.not-participating': + 'The user with id ${id} is not participating in the group producing this document.', // headers/errata 'headers.errata.no-errata': '"Errata:" not found in the headers (<div class="head">) of the document.', diff --git a/lib/profiles/base.js b/lib/profiles/base.js index f7fcbc2a4..253d9dcb6 100644 --- a/lib/profiles/base.js +++ b/lib/profiles/base.js @@ -2,6 +2,7 @@ import * as detailsSummary from '../rules/headers/details-summary.js'; import * as divHead from '../rules/headers/div-head.js'; import * as dl from '../rules/headers/dl.js'; +import * as editorParticipation from '../rules/headers/editor-participation.js'; import * as shortname from '../rules/headers/shortname.js'; import * as h1Title from '../rules/headers/h1-title.js'; import * as h2Toc from '../rules/headers/h2-toc.js'; @@ -38,6 +39,7 @@ export const rules = [ h1Title, detailsSummary, dl, + editorParticipation, shortname, w3cState, h2Toc, diff --git a/lib/rules.json b/lib/rules.json index 7b0a96586..15149df9d 100644 --- a/lib/rules.json +++ b/lib/rules.json @@ -1584,7 +1584,7 @@ "docIDDate": "The title page date and the date at the end of the \"This Version\" URI must match.", "docIDLatestVersion": "The syntax of a “latest version” URI must be https://www.w3.org/TR/shortname/.", "docIDHistory": "The syntax of a “history” URI must be https://www.w3.org/standards/history/shortname/, and consistent with the shortname mentioned in 'Latest Version'. Note: If there's a shortname change it must be specified using the following data attribute data-previous-shortname='previous-shortname' on the <a> element.", - "editorSection": "The editors'/authors' names must be listed, with attribute data-editor-id=\"@@\". Affiliations and email addresses are optional; email addresses are not recommended. If an editor/author is acknowledged in an earlier version of this document and the individual's affiliation has since changed, list the individual using the notation \"<name>, <affiliation> (until DD Month YYYY)\". If the list of authors is very long (e.g., the entire Working Group), identify the authors in the acknowledgments section, linked from the head of the document. Distinguish any contributors from authors in the acknowledgments section.", + "editorSection": "The editors'/authors' names must be listed, with attribute data-editor-id=\"@@\". Affiliations and email addresses are optional; email addresses are not recommended. If an editor/author is acknowledged in an earlier version of this document and the individual's affiliation has since changed, list the individual using the notation \"<name>, <affiliation> (until DD Month YYYY)\". If the list of authors is very long (e.g., the entire Working Group), identify the authors in the acknowledgments section, linked from the head of the document. Distinguish any contributors from authors in the acknowledgments section.
Note: Editors must be participating in the group producing the document at the time of its publication.", "altRepresentations": "Authors may provide links to alternative (non-normative) representations or packages for the document. For instance:

<p>This document is also available in these non-normative formats: <a href=\"@{param1}-shortname-20180101.html\">single HTML file</a>, <a href=\"@{param1}-shortname-20180101.tgz\">gzipped tar file of HTML</a>.</p>

", "implReport": "It must include either: ", "copyright": "Starting from 01 February 2023, the copyright must follow the following markup (fill in with the appropriate year, years, or year range). The type of license the document is using can be found in the group's charter.
  1. For documents using W3C Document License:
    Copyright © @{year} World Wide Web Consortium. W3C® liability, trademark and document use rules apply.
    Include this source code:
    <p class="copyright"><a href="https://www.w3.org/policies/#copyright">Copyright</a> © @{year} <a href="https://www.w3.org/">World Wide Web Consortium</a>. <abbr title="World Wide Web Consortium">W3C</abbr><sup>®</sup> <a href="https://www.w3.org/policies/#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/policies/#W3C_Trademarks">trademark</a> and <a href=\"https://www.w3.org/copyright/document-license/\">document use</a> rules apply.</p>
  2. For documents using W3C Software and Document License:
    Copyright © @{year} World Wide Web Consortium. W3C® liability, trademark and permissive document license rules apply.
    Include this source code:
    <p class="copyright"><a href="https://www.w3.org/policies/#copyright">Copyright</a> © @{year} <a href="https://www.w3.org/">World Wide Web Consortium</a>. <abbr title="World Wide Web Consortium">W3C</abbr><sup>®</sup> <a href="https://www.w3.org/policies/#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/policies/#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/copyright/software-license/">permissive document license</a> rules apply.</p>

Note: Exceptions are listed in this json file.", diff --git a/lib/rules/headers/editor-participation.js b/lib/rules/headers/editor-participation.js new file mode 100644 index 000000000..d3c7c3b73 --- /dev/null +++ b/lib/rules/headers/editor-participation.js @@ -0,0 +1,38 @@ +/* eslint-disable */ +import w3cApi from 'node-w3capi'; + +const self = { + name: 'headers.editor-participation', + section: 'front-matter', + rule: 'editorSection', +}; +export const name = self.name; + +export async function check(sr, done) { + const groups = await sr.getDelivererIDs(); + const editors = await sr.getEditorIDs(); + + const groupUsersPromises = []; + groups.forEach(id => { + groupUsersPromises.push( + new Promise(resolve => + w3cApi + .group(id) + .users() + .fetch({ embed: true }, (err, data) => { + resolve(data.map(user => user.id)); + }) + ) + ); + }); + + const userIds = (await Promise.all(groupUsersPromises)).flat(); + + editors.forEach(id => { + if (!userIds.includes(id)) { + sr.error(self, 'not-participating', { id }); + } + }); + + done(); +} diff --git a/test/data/TR/TRBase.js b/test/data/TR/TRBase.js index 3b9ddd35a..e7f0a53eb 100644 --- a/test/data/TR/TRBase.js +++ b/test/data/TR/TRBase.js @@ -35,6 +35,12 @@ export const rules = { errors: ['headers.copyright.exception-no-html'], }, ], + 'editor-participation': [ + { + data: 'noEditorParticipation', + errors: ['headers.editor-participation.not-participating'], + }, + ], }, style: { ...baseRules.style, diff --git a/test/doc-views/layout/spec.handlebars b/test/doc-views/layout/spec.handlebars index 2eecd90c5..0ac55a6df 100644 --- a/test/doc-views/layout/spec.handlebars +++ b/test/doc-views/layout/spec.handlebars @@ -101,6 +101,10 @@

{{dl.editorText}}:
George Herald (WebFoo)
+ {{#if dl.editor2.show}} +
John Doe (WebFoo) +
+ {{/if}} {{/if}} {{#config.isRescinded}} diff --git a/test/doc-views/specBase.js b/test/doc-views/specBase.js index 292b46858..5df40bd9a 100644 --- a/test/doc-views/specBase.js +++ b/test/doc-views/specBase.js @@ -69,7 +69,10 @@ export const data = { }, editor: { show: true, - id: '56102', + id: '3439', + }, + editor2: { + show: false, }, history: { show: true, @@ -609,6 +612,18 @@ export function buildCommonViewData(base) { }, }, }, + 'editor-participation': { + noEditorParticipation: { + ...base, + dl: { + ...base.dl, + editor2: { + show: true, + id: '3440', + }, + }, + }, + }, shortname: { shortnameLowercaseFP: { ...base, diff --git a/test/docs/2021-cr.html b/test/docs/2021-cr.html index b6eff2a3f..8c06b7fde 100644 --- a/test/docs/2021-cr.html +++ b/test/docs/2021-cr.html @@ -36,7 +36,7 @@

High Resolution Time

Editor:
-
George Herald +
George Herald (WebFoo)
diff --git a/test/docs/2021-crd.html b/test/docs/2021-crd.html index 8cdabbaca..900141fe0 100644 --- a/test/docs/2021-crd.html +++ b/test/docs/2021-crd.html @@ -48,7 +48,7 @@

High Resolution Time

Editor:
-
George Herald +
George Herald (WebFoo)
diff --git a/test/docs/2021-disc.html b/test/docs/2021-disc.html index 7bbac9bb5..92d059e86 100644 --- a/test/docs/2021-disc.html +++ b/test/docs/2021-disc.html @@ -44,7 +44,7 @@

Foo Time

Editor:
-
George Herald +
George Herald (WebFoo)
diff --git a/test/docs/2021-fpwd.html b/test/docs/2021-fpwd.html index 83bd67d18..dcdc95671 100644 --- a/test/docs/2021-fpwd.html +++ b/test/docs/2021-fpwd.html @@ -44,7 +44,7 @@

Foo Time

Editor:
-
George Herald +
George Herald (WebFoo)
diff --git a/test/docs/2021-pr.html b/test/docs/2021-pr.html index 5c8a4dec2..bcc5e0db9 100644 --- a/test/docs/2021-pr.html +++ b/test/docs/2021-pr.html @@ -50,7 +50,7 @@

High Resolution Time

Editor:
-
George Herald +
George Herald (WebFoo)
diff --git a/test/docs/2021-wd-shortname-change.html b/test/docs/2021-wd-shortname-change.html index 2a87d5809..77c188c2b 100644 --- a/test/docs/2021-wd-shortname-change.html +++ b/test/docs/2021-wd-shortname-change.html @@ -45,7 +45,7 @@

Foo Time

Editor:
-
George Herald +
George Herald (WebFoo)
diff --git a/test/docs/2021-wd.html b/test/docs/2021-wd.html index 625b084b3..0c2c80691 100644 --- a/test/docs/2021-wd.html +++ b/test/docs/2021-wd.html @@ -44,7 +44,7 @@

Foo Time

Editor:
-
George Herald +
George Herald (WebFoo)
diff --git a/test/samples.js b/test/samples.js index 63d8ef57e..78c9739c3 100644 --- a/test/samples.js +++ b/test/samples.js @@ -4,7 +4,7 @@ export const samples = [ profile: 'FPWD', title: 'Foo Time', docDate: '2021-11-4', - editorIDs: [56102], + editorIDs: [3439], editorNames: ['George Herald'], informative: false, process: 'https://www.w3.org/2023/Process-20231103/', @@ -23,7 +23,7 @@ export const samples = [ profile: 'WD', title: 'Foo Time', docDate: '2021-11-4', - editorIDs: [56102], + editorIDs: [3439], editorNames: ['George Herald'], informative: false, process: 'https://www.w3.org/2023/Process-20231103/', @@ -43,7 +43,7 @@ export const samples = [ rectrack: 'Recommendation', title: 'Foo Time', docDate: '2021-11-4', - editorIDs: [56102], + editorIDs: [3439], editorNames: ['George Herald'], informative: false, process: 'https://www.w3.org/2023/Process-20231103/', @@ -64,7 +64,7 @@ export const samples = [ implementationReport: 'https://wpt.fyi/hr-time/', title: 'High Resolution Time', docDate: '2021-11-4', - editorIDs: [56102], + editorIDs: [3439], editorNames: ['George Herald'], informative: false, process: 'https://www.w3.org/2023/Process-20231103/', @@ -84,7 +84,7 @@ export const samples = [ implementationReport: 'https://wpt.fyi/hr-time/', title: 'High Resolution Time', docDate: '2021-11-4', - editorIDs: [56102], + editorIDs: [3439], editorNames: ['George Herald'], informative: false, process: 'https://www.w3.org/2023/Process-20231103/', @@ -105,7 +105,7 @@ export const samples = [ implementationReport: 'https://wpt.fyi/hr-time/', title: 'High Resolution Time', docDate: '2021-11-4', - editorIDs: [56102], + editorIDs: [3439], editorNames: ['George Herald'], informative: false, process: 'https://www.w3.org/2023/Process-20231103/',