Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
mcking65 committed May 6, 2024
2 parents ccd5b24 + 2a4ee4b commit d209e89
Show file tree
Hide file tree
Showing 142 changed files with 2,554 additions and 2,005 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
"ecmaVersion": 6
},
"rules": {
"jsdoc/check-line-alignment": 0,
"jsdoc/no-undefined-types": 0,
"jsdoc/require-jsdoc": 0,
"jsdoc/require-param-description": 0,
"jsdoc/require-param-type": 0,
"jsdoc/require-returns-description": 0,
"jsdoc/tag-lines": ["warn", "any", { "startLines": 1 }],
"strict": [2, "global"],
"no-console": "error"
},
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.pull_request.number }}/head

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: npm

Expand All @@ -33,7 +33,7 @@ jobs:
node test/util/report.js >> coverage.log || true
- name: Comment on PR
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down
28 changes: 26 additions & 2 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,26 @@ on:
- ".github/workflows/examples.yml"
- "content/**/examples/**"
- "scripts/reference-tables.*"
- "scripts/coverage-report.*"
- "content/about/coverage-and-quality/**"
pull_request:
paths:
- "package*.json"
- ".github/workflows/examples.yml"
- "content/**/examples/**"
- "scripts/reference-tables.*"
- "scripts/coverage-report.*"
- "content/about/coverage-and-quality/**"

jobs:
examples:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: npm

Expand All @@ -36,3 +40,23 @@ jobs:

- name: Ensure no git changes
run: git diff --exit-code

coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
cache: npm

- name: Install dependencies
run: npm ci

- name: Generate coverage files
run: npm run coverage-report

- name: Ensure no git changes
run: git diff --exit-code
4 changes: 2 additions & 2 deletions .github/workflows/link-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: npm

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-css.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: npm

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: npm

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# setup-node task is used without a particular version in order to load
# the ESLint problem matchers
- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: npm

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
CI_NODE_INDEX: [0, 1, 2, 3, 4]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: npm

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: npm

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/wai-trigger-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
if: ${{ github.event_name == 'delete' && github.event.ref_type == 'branch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: npm

Expand All @@ -36,10 +36,10 @@ jobs:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: npm

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wai-trigger-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
deploy-wai:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Trigger wai-aria-practices update
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wai-trigger-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.pull_request.number }}/head

- name: Trigger wai-aria-practices PR update
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
APG_BRANCH: ${{ github.head_ref }}
APG_SHA: ${{ github.event.pull_request.head.sha }}
Expand Down
52 changes: 50 additions & 2 deletions .link-checker.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
const HTMLParser = require('node-html-parser');

// Checks object for attribute and returns value.
// If not found on first pass, recursively checks
// nested objects and arrays of nested object(s)
// until attribute is found. If not found,
// returns undefined.
const getAttributeValue = (obj, attribute) => {
if (typeof obj !== 'object' || obj === null) return undefined;
if (obj.hasOwnProperty(attribute)) return obj[attribute];

if (Array.isArray(obj)) {
for (const element of obj) {
const attributeValue = getAttributeValue(element, attribute);
if (attributeValue !== undefined) return attributeValue;
}
} else {
for (const key in obj) {
const attributeValue = getAttributeValue(obj[key], attribute);
if (attributeValue !== undefined) return attributeValue;
}
}

return undefined;
};

module.exports = {
filesToIgnore: [
// For example:
Expand All @@ -18,8 +44,30 @@ module.exports = {
{
name: 'github',
pattern: /^https:\/\/github\.com\/.*/,
matchHash: (ids, hash) =>
ids.includes(hash) || ids.includes(`user-content-${hash}`),
matchHash: (ids, hash, { reactPartial }) => {
if (reactPartial) {
// This is where the react-partial keeps data about READMEs and other *.md files
const richText = getAttributeValue(reactPartial, 'richText');
if (richText !== undefined) {
const html = HTMLParser.parse(richText);
const githubIds = html
.querySelectorAll('[id]')
.map((idElement) => idElement.getAttribute('id'));
return githubIds.includes(`user-content-${hash}`);
}
}
return ids.includes(hash) || ids.includes(`user-content-${hash}`);
},
getPartial: (html) => {
return html
.querySelectorAll('react-partial')
.filter(
(partialElement) =>
partialElement.getAttribute('partial-name') === 'repos-overview' // This is the partial that handles the READMEs
)
.flatMap((element) => element.getElementsByTagName('script'))
.map((element) => JSON.parse(element.innerHTML))[0];
},
},
],
ignoreHashesOnExternalPagesMatchingRegex: [
Expand Down
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"singleQuote": true,
"trailingComma": "es5",
"overrides": [
{
"files": ["**/*.css"],
Expand Down
81 changes: 81 additions & 0 deletions common/script/participants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
function getParticipants() {
// Define the W3C's group ID
const GROUP_ID = "83726";

// Define the base URL for the API, using the group ID
const BASE_URL = `https://api.w3.org/groups/${GROUP_ID}`;

// Define the ID of the list element where the user information will be inserted
const LIST_ID = "ack_group";

/**
* Fetches users and their affiliations from the API and returns an array of user information.
* Each element in the array is an object containing the user's title and affiliation.
*
* @async
* @function getUsersInfo
* @returns {Promise<Array<{title: string, affiliation: string}>>} - A promise that resolves to an array of user information.
*/
async function getUsersInfo() {
// Send a GET request to the users endpoint
const response = await fetch(`${BASE_URL}/users`);
// Fetch the JSON data from the response
const data = await response.json();
// Extract the list of users
const users = data._links.users;

// Initialize an empty array to store user information
let usersInfo = [];
// Iterate over each user
for (const user of users) {
// Fetch the affiliation of the current user
const affiliation = await getAffiliation(user);
// Push an object containing the user's title and affiliation to the usersInfo array
usersInfo.push({ title: user.title, affiliation: affiliation });
}
// Return the array containing information of all users
return usersInfo;
}

/**
* Fetches the affiliation of a given user from the API.
*
* @async
* @function getAffiliation
* @param {Object} user - The user object.
* @returns {Promise<string>} - A promise that resolves to the title of the user's affiliation.
*/
async function getAffiliation(user) {
// Send a GET request to the affiliations endpoint of the user
const response = await fetch(user.href + "/affiliations/");

// Fetch the JSON data from the response
const affiliations = await response.json();

// Extract the title of the first affiliation
const affiliation = affiliations._links.affiliations[0].title;

// Return the title of the affiliation
return affiliation;
}

/**
* Fetches users and their affiliations, creates a list item for each user with their title and affiliation,
* and appends these list items to a specified list in the document.
*
* @async
* @function insertUsersInfoIntoDocument
*/
async function insertUsersInfoIntoDocument() {
const usersInfo = await getUsersInfo();
const usersList = document.querySelector(`#${LIST_ID} ul`);

for (const user of usersInfo) {
const li = document.createElement("li");
li.textContent = `${user.title} (${user.affiliation})`;
usersList.appendChild(li);
}
}

insertUsersInfoIntoDocument();
}
2 changes: 1 addition & 1 deletion common/terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<dd>
<p>The action taken when an <a>event</a>, typically initiated by users through an input device, causes an element to fulfill a defined role. The role may be defined for that element by the host language, or by author-defined variables, or both. The role for any given element may be a generic action, or may be unique to that element. For example, the activation behavior of an <abbr title="Hypertext Markup Language">HTML</abbr> or <abbr title="Scalable Vector Graphics">SVG</abbr> <code>&lt;a&gt;</code> element shall be to cause the user agent to traverse the link specified in the <code>href</code> attribute, with the further optional parameter of specifying the browsing context for the traversal (such as the current window or tab, a named window, or a new window); the activation behavior of an <abbr title="Hypertext Markup Language">HTML</abbr> <code>&lt;input&gt;</code> element with the <code>type</code> attribute value <code>submit</code> shall be to send the values of the form elements to an author-defined <abbr title="Internationalized Resource Identifiers">IRI</abbr> by the author-defined <abbr title="Hypertext Transfer Protocol">HTTP</abbr> method.</p>
</dd>
<dt><dfn data-lt="assistive technology">Assistive Technologies</dfn></dt>
<dt><dfn data-lt="assistive technologies|assistive technology">Assistive Technologies</dfn></dt>
<dd><p>Hardware and/or software that:</p>
<ul>
<li>relies on services provided by a <a>user agent</a> to retrieve and render Web content </li>
Expand Down
2 changes: 1 addition & 1 deletion content/about/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<link rel="stylesheet" href="../shared/css/core.css">
<script src="../shared/js/highlight.pack.js"></script>
<script src="../shared/js/app.js"></script>
<script src="../shared/js/skipto.js"></script>
<script data-skipto="colorTheme:aria; displayOption:popup; containerElement:div" src="../shared/js/skipto.js"></script>
</head>
<body>
<main>
Expand Down
Loading

0 comments on commit d209e89

Please sign in to comment.