Compare commits

...

46 Commits

Author SHA1 Message Date
dependabot[bot]
e6375d3216 Bump ws from 7.5.9 to 7.5.10
Bumps [ws](https://github.com/websockets/ws) from 7.5.9 to 7.5.10.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.5.9...7.5.10)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-20 08:58:22 +00:00
dependabot[bot]
0428086371 Bump express from 4.17.3 to 4.19.2 (#324) 2024-04-08 06:11:07 +00:00
Danyal Aytekin
7af3fd7802 Reformat test file to placate linter about line length 100 (#323) 2024-03-18 18:49:26 +00:00
dependabot[bot]
21118711c4 Bump semver from 5.7.1 to 5.7.2
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-13 05:59:12 +00:00
dependabot[bot]
ef4732377a Bump qs from 6.5.2 to 6.5.3
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-13 05:56:03 +00:00
Danyal Aytekin
e76dccef77 Fix tests, test more, support Node 16-20 (#318)
* Add `.nvmrc` → 14

* Fix package.json's URLs

* Update to Pa11y CI's version (`https` etc)

* Add Node 16 to matrix, and make linter run each time

* Standardise `.editorconfig`

* Upgrade to `actions/checkout@4` and `actions/setup-node@3`

* Replace `npm install` with `npm ci`

* Replace `wait-action` with `sleep 10s`

* Rewrite to detach config, use promises, and replace `request` with `fetch` (adding `node-fetch` until Node 18)

* Delete small single-use helper

* Bump to `pa11y-webservice@4.1` and use caret from here (we control the dep)

* Return to `this.last`, fix syntax errors

* Update copyright to 2023 and remove unused ref

* Fix troubleshooting link

* Remove symbols, since they could become outdated

* Remove missing link

* Replace emoji note with GitHub Markdown note

* Fix setup link

* Replace br with double space

* Replace `sh` with `console` for terminal output

* Rename Mongo DB used in integration tests to avoid clash locally

* Remove JSCS and references to other unused tools

* Remove tooling tasks update

* Compress definitions and layout where it makes sense or brings clarity

* Rename db used in tests to `pa11y-dashboard-integration-test`, to avoid clash with `pa11y-webservice`'s own test DB

* Use briefer syntax

* Fix integration test setup & config

* Reverse function order to return early

* Update to `pa11y-lint-config@3`, update `ecmaVersion` to 2020, remove some rule overrides

* Fix linting errors, remove cruft

* Move linting and broken integration test command into npm scripts (it remains broken)

* Revert `node-fetch` to `^2.7.0` (can't do ESM right now)

* Upgrade to `pa11y-webservice@^4.2` from `^4.1`

* Upgrade to `mocha@^9.2` from `^8.4` (can't do `10` yet because it drops Node 12)

* Use backticks for property names

* Fix anchor link for 'installing MongoDB'

* Reorganise test workflow and add Node `18` and `20` to test matrix

* Fix `lockfile-version` to `2`

* Apply support policy

* Replace Travis badge with one for Actions

* Define some more links, separate code blocks

* Reflect greater confidence in support for recent versions of MongoDB

* Test against MongoDB versions 3-7

* Remove Make tasks `all`, `ci`, `clean`, `install`, `node_modules`, `lint`

* Fix integration test command in workflow

* Restore shallow Mocha command for now

* Move linting into own step `lint` to avoid duplicated warnings

* Give the `test` workflow a better name now that it uses a bigger matrix

* Drop back to ES2019 from ES2020 for Node 12, remove use of `?.`

* Reduce `--slow` to `4000`

* Remove a `describe.only` 👀

* Fix broken test for add new item → standard

* Rename availability check function

* Fix task count check when testing task creation

* Return fully to the original `new` logic

* Use `127.0.0.1` consistently to fix (possible) IPV6 issue

* Fix Cheerio call in failing test

* Add MongoDB 2, and tweak other final versions

* Lower case and shorten test name, to sit well alongside lint job

* Replace `underscore(.groupBy)` with `lodash/groupby`

* Capitalise Puppeteer

* Say we test against MongoDB 2 as well

* Document two replacements of Make with npm scripts

* Revise requirements, permitting Node 16+ and describing Ubuntu issue

* Support Node 16, 18, 20

* Install `lodash.keys` and fix Lodash mistakes

* Fix rebase autoresolution error affecting `index.js` 👀

* This is Pa11y Dashboard not Webservice

* Fix MongoDB link

* Remove unused link def for Puppeteer

* Shush markdown linter

* Actually use `pa11y-webservice@4.3`

* Improve support table

* Don't `fail-fast`

* Remove dependency `underscore`

* Fix dashboard's port definition for integration test

* Set `NODE_ENV=test` for integration tests

* Use `mocha@10`

* Extend the sleep to rule out the service not starting in time

* Wait on port `4000` instead of sleeping

* Fix `wait-on-action` to `v1.1.0`

* Fix includes of `lodash.groupby` and `lodash.keys`

* Label the port waiting action

* Fix to `pa11y-webservice@4.2.0` until dep issue resolved

* Set waiter action to start after 1s, time out after 30s, and log

* Upgrade to `pa11y-webservice@^4.3.1` from `~4.2.0`

* Remove comment about recent versions of MongoDB, since we test with them now
2024-03-13 05:48:58 +00:00
Sangita Mane
8145069fe9 Improve the console messaging on starting the app to avoid confusion. (#292)
* Improve the console messaging on starting the app to avoid confusion.

* Revise logging to present intended URI alongside actual

---------

Co-authored-by: Danyal Aytekin <danyal@alienpaper.com>
2023-11-15 09:26:25 +00:00
dependabot[bot]
13134f67de Bump json-schema and jsprim (#317) 2023-11-14 10:45:07 +00:00
dependabot[bot]
d8d19f4305 Bump ansi-regex from 3.0.0 to 3.0.1 (#316)
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 21:16:38 +00:00
dependabot[bot]
2af4663f22 Bump moment-timezone from 0.5.33 to 0.5.43 (#314)
Bumps [moment-timezone](https://github.com/moment/moment-timezone) from 0.5.33 to 0.5.43.
- [Release notes](https://github.com/moment/moment-timezone/releases)
- [Changelog](https://github.com/moment/moment-timezone/blob/develop/changelog.md)
- [Commits](https://github.com/moment/moment-timezone/compare/0.5.33...0.5.43)

---
updated-dependencies:
- dependency-name: moment-timezone
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 21:13:06 +00:00
dependabot[bot]
77f61b1e10 Bump minimist from 1.2.5 to 1.2.8 (#313)
Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.5 to 1.2.8.
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v1.2.5...v1.2.8)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 21:00:02 +00:00
dependabot[bot]
3cfe075bb5 Bump qs from 6.5.2 to 6.5.3 (#311)
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 20:56:12 +00:00
dependabot[bot]
c72f0f6f04 Bump semver from 5.7.1 to 5.7.2 (#310)
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 20:42:12 +00:00
dependabot[bot]
8e31c40269 Bump moment from 2.29.1 to 2.29.4 (#312)
Bumps [moment](https://github.com/moment/moment) from 2.29.1 to 2.29.4.
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.1...2.29.4)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-12 16:11:02 +00:00
Danyal Aytekin
e55cae4786 In workflow, update default branch to main, use ubuntu-20.04 (#315)
* Update default branch name to `main`

* Use `ubuntu-20.04` for build, until this project upgrades to `pa11y-webservice@5`
2023-11-12 15:52:09 +00:00
Sangita Mane
5202f59008 A11y fixes for pa11y dashboard pages. (#306)
* First draft of a11y fixes.

* Amended results title

* Amended results title (again)

* Back to top keyboard operation

Removed the 'data-role="top"' attribute, which implemented a cool animation to scroll to top but prevented the default behaviour, resulting in the keyboard focus not going back to top.

* Options Button

Fix to have a working options button, but using the mouse only. This is not a good solution because it cannot be operated via the keyboard.

* Fixed options menu css.

* Results view layout changes

* Undoing layout changes

* Graph layout fixes.

* Skip Rules Link

Added a link to skip the list of rules, which can get very long and annoying for any keyboard user not interested in selecting a rule. Most probably, implementing a collapsible list of rules would be a better solution here.

Co-authored-by: Carlos Muncharaz <carlos@muncharaz.eu>
2022-10-11 14:17:43 +02:00
Jose Bolos
b9b049ec2b Address all eslint warnings
Address all eslint warnings that were still present by:

* Extracting code to a new function in order to reduce complexity
* Renamed error variables and use shorthand notation for objects
* Disabling eslint warnings where addressing the issue would require too much refactoring
2022-04-11 17:27:15 +02:00
Jose Bolos
0e7849dd07 Add issue template 2022-04-08 14:29:44 +01:00
Jose Bolos
3b76433cf3 Version 4.2.0 2022-03-30 17:19:08 +01:00
Jose Bolos
f3462f0c1e Bump webservice, deps, and linter configuration
* Bump webservice to require the latest 4.0.1 version
* Bump other dependencies
* Update linter conf to v2 which avoids the "Unsupported engine" warning when using node 12
* Keep all other devdependencies as they are so they stay consistent with the other repos
2022-03-30 18:16:25 +02:00
Jose Bolos
9dbee59746 Add request logging using morgan
This commit adds request logging to the app using morgan.

Every request will now be logged not one but twice: one when the request is received, and a second time when the response is sent.

The response logging also prints out the time elapsed in processing the request, which will be useful to debug performance issues (calls to the dashboard home are currently taking 4 - 15s on a populated database).

The new code uses a tiny middleware that uses nanoid to generate a random request id that can be used to match requests in the logs.

This logging will help us determine which requests are successful, which requests are slow, and establish what requests may have contributed to causing an application crash, making future debugging easier.
2022-03-08 11:19:15 +01:00
Jose Bolos
321d7bb6ba Split initApp in different functions
This makes the function easier to understand and fixes eslint complaints
about the function having too many statements.
2022-03-07 15:55:34 +01:00
Jose Bolos
4fd73bcf2f Make .editorconfig consistent between repos 2022-03-03 13:59:11 +00:00
Jose Bolos
0072fe8965 Version 4.1.0 2021-11-26 16:25:06 +00:00
Jose Bolos
30c1ff171d Update troubleshooting guide and move to README 2021-11-26 16:24:09 +00:00
Sangita Mane
a0b3fa843f Updated rulesets list to add WCAG 2.1 options 2021-11-26 17:05:50 +01:00
Jose Bolos
a424cfade7 Version 4.0.0 2021-11-26 15:34:37 +00:00
Jose Bolos
cbc9da2d93 update test matrix 2021-11-26 15:26:54 +00:00
Jose Bolos
19f4d32bf0 Fix linter errors 2021-11-26 15:22:28 +00:00
Jose Bolos
ff87055cc4 Update dependencies and devDependencies 2021-11-26 15:20:52 +00:00
Sangita Mane
4c0bd924ab Fixed the a11y errors on Pa11y dashboard results and add new url page (#285)
* Fixed the a11y errors on Pa11y dashboard results page and add new url page.

* Removed few more unnecessary roles along with Holli's suggestions implemented.

* Added close button ARIA label

Co-authored-by: Hollie Kay <1948361+hollsk@users.noreply.github.com>

Co-authored-by: Hollie Kay <1948361+hollsk@users.noreply.github.com>
2021-05-26 16:38:38 +02:00
Jose Bolos
6d4b8c9676 Add mongo version to brew start command 2021-05-18 14:32:35 +01:00
Jose Bolos
0654790289 Improve installation instructions
* Clarify the requirements for running Pa11y Dashboard, and specifically the versions of MongoDB supported
* Split the installation process in sections so it's easy to follow
* Instead of trying to cover the MongoDB installation on the Readme, refer to the MongoDB docs, but still including a macOS example for easy reference
* Clarify the use of the config files and how they relate to the NODE_ENV variable
* Use a slightly less informal language in a few places
2021-05-18 14:32:35 +01:00
Jose Bolos
1d931671ff Version 3.3.0 2021-04-27 15:03:22 +01:00
Jose Bolos
9d95c79625 Version 3.2.1 2021-04-27 15:53:29 +02:00
Jose Bolos
b8029c56f7 Fix security vuln by bumping express-hbs
Also bumps pa11y-webservice to the latest version.
2021-04-27 15:53:29 +02:00
Sangita Mane
9a23b79d89 #165 - Added list view option for the dashboard. (#279)
* Added list view & grid view buttons on the dashboard, on click of which switches the view and avoids truncation of title of the page.

* Indentation fixed.
2021-04-20 09:58:33 +02:00
Jose Bolos
b7d45c0913 Reorder the routes to avoid MongoDB ObjectID error
When trying to add a new URL, the Node.js MongoDB driver complains with the following error:
```
ObjectID generation failed. Argument passed in must be a single String of 12 bytes or a string of 24 hex characters
```

This is because the `/new` url gets captured by the `/:id` route defined in `/route/task/index.js`. It's another instance of #244 that I missed when fixing it.
2021-04-09 11:30:35 +02:00
Jose Bolos
9ae73dc446 Replace Travis with GH actions 2021-04-09 11:04:12 +02:00
Jose Bolos
ff8142b4e4 Version 3.2.0 (#270) 2020-10-05 17:35:43 +01:00
Jose Bolos
2f7e8ae451 Update dependencies (#269) 2020-10-05 17:04:12 +01:00
Sam Clulow
a2cc2c7942 Replace Chalk with Kleur (#264)
- Remove Chalk
- Add Kleur
- Update index.js
- Update copyright in README

Fixes #256
2020-06-29 16:27:44 +01:00
Jose Bolos
59f657b422 Update all devdependencies to the latest versions (#258) 2020-04-28 12:33:36 +01:00
Jose Bolos
ea3183791c Version 3.1.0 (#246)
* Version 3.1.0

Also minor bump to pa11y-webservice

* Bump webservice so it includes data fixtures
2019-09-27 11:44:24 +01:00
Jose Bolos
102a237d2e Bump webservice version and other deps (#245) 2019-09-20 15:59:21 +01:00
Jose Bolos
7c77467dcf Fix incorrect values being passed to ObjectID (#244)
Due to the routes being defined in the wrong order, certain urls (e.g. `/tasks/:taskid:/edit`) are being captured by the results route instead (e.g. `/tasks/:taskid:/:resultid:`). This is causing the wrong method to being called with parts of the path like `edit`, `run`, etc. being passed as an argument to ObjectID(). As these are not valid MongoDB IDs, the method displays instead an error message:

> Argument passed in must be a single String of 12 bytes or a string of 24 hex characters

Also change the path to the favicon image to be not relative, as this is causing a `favicon.png` string to be sent as an argument to ObjectID() when visiting certain pages due to the previous issue.
2019-09-20 14:57:15 +01:00
76 changed files with 10768 additions and 1643 deletions

View File

@@ -1,13 +1,21 @@
# http://editorconfig.org
root = true root = true
[*] [*]
charset = utf-8 charset = utf-8
end_of_line = lf end_of_line = lf
insert_final_newline = true indent_size = 4
indent_style = tab indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
[*.md] [*.md]
indent_style = space
trim_trailing_whitespace = false trim_trailing_whitespace = false
[*.yml]
indent_style = space
indent_size = 2
[package.json]
indent_style = space
indent_size = 2

View File

@@ -1,3 +1,12 @@
'use strict'; 'use strict';
module.exports = require('pa11y-lint-config/eslint/es2017'); const pa11yConfig = require('pa11y-lint-config/eslint/es2017');
const config = {
...pa11yConfig,
parserOptions: {
ecmaVersion: 2019
}
};
module.exports = config;

20
.github/issue_template.md vendored Normal file
View File

@@ -0,0 +1,20 @@
**This repository's issues are reserved for feature requests, bug reports, and other issues with Pa11y Dashboard itself.**
If you need help using Pa11y Dashboard, we recommend using [Stack Overflow](https://stackoverflow.com/questions/tagged/pa11y).
For a bug report, please use the template below. To keep the backlog clean and actionable, issues may be immediately closed if they do not follow one this template.
---
## Expected behaviour
## Actual behaviour
## Steps to reproduce
## Environment
_Please specify the versions of Pa11y Dashboard, MongoDB, and Node.js that can be sued to reproduce this issue._

58
.github/workflows/tests.yml vendored Normal file
View File

@@ -0,0 +1,58 @@
on:
push:
branches:
- main
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 12
- run: npm ci
- run: npm run lint
test:
name: test (node ${{ matrix.node }}, mongodb ${{ matrix.mongo }})
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
node: [12, 14, 16, 18, 20]
mongo: [latest]
include:
- { node: 12, mongo: 6.0.11 }
- { node: 12, mongo: 5.0.22 }
- { node: 12, mongo: 4.4.25 }
- { node: 12, mongo: 3.6.23 }
- { node: 12, mongo: 2.6.12 }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm ci
- name: Supply MongoDB ${{ matrix.mongo }}
uses: supercharge/mongodb-github-action@1.5.0
with:
mongodb-version: ${{ matrix.mongo }}
- name: Supply integration test configuration file
run: cp config/test.sample.json config/test.json
- name: Make dashboard available to be integration-tested
run: NODE_ENV=test node index.js &
- name: Wait for dashboard to respond
uses: iFaxity/wait-on-action@v1.1.0
with:
resource: http://localhost:4000
delay: 1000
timeout: 30000
log: true
- run: NODE_ENV=test npm test

3
.gitignore vendored
View File

@@ -1,4 +1,3 @@
# Config files # Config files
config/development.json config/development.json
config/production.json config/production.json
@@ -8,5 +7,5 @@ config/test.json
node_modules node_modules
npm-debug.log npm-debug.log
# JetBrains IDE # Editors
.idea .idea

1
.npmrc Normal file
View File

@@ -0,0 +1 @@
lockfile-version=2

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
14

View File

@@ -1,24 +0,0 @@
# Language/versions
language: node_js
matrix:
include:
- node_js: '8'
- node_js: '10'
- node_js: '12'
# Build only master (and pull-requests)
branches:
only:
- master
# Services setup
services:
- mongodb
# Build script
before_script:
- cp config/test.sample.json config/test.json
- NODE_ENV=test node index.js &
- sleep 5 # give server time to start
script: 'make ci'

View File

@@ -1,273 +1,308 @@
# Changelog # Changelog
## 4.2.0 (2022-03-30)
* Add request logging for easier debugging
* Dependencies update
## 4.1.0 (2021-11-26)
* Add support for new WCAG 2.1 rules and remove all references to Section 508.
* Move troubleshooting guide to the README.
## 4.0.0 (2021-11-26)
* Update pa11y to version 6.
* Drop support for versions of Node.js older than 12.
* Update MongoDB Node driver from v2 to v3, which adds support for MongoDB v4 databases.
## 3.3.0 (2021-04-27)
* Add new list view to the dashboard (thanks @sangitamane)
* Upgrade express-hbs to the latest version in order to address several potential vulnerabilities
* Fixes a MongoDB "ObjectID generation failed" error.
* Update pa11y-webservice to version 3.2.1 and pa11y to version 5.3.1
## 3.2.0 (2020-10-05)
* Update pa11y to version 5.3.0, which means better compatibility with sites using AMD modules
* Update pa11y-webservice to version 3.2.0, which adds the ability to configure the number of workers running pa11y tests
* Update several dependencies
* Replace chalk with kleur
## 3.1.0 (2019-09-27)
* Display the task ID before each line of output, so it's clear to which task a line of output belongs to when they run in parallel.
* Bump pa11y-webservice version, which fixes an issue with some pages failing to run.
* Fix incorrect routes passing an invalid value to Mongo's ObjectID.
## 3.0.0 (2019-07-16) ## 3.0.0 (2019-07-16)
* Update pa11y to v5, which replaces Phantomjs with Headless Chrome * Update pa11y to v5, which replaces Phantomjs with Headless Chrome
* Update dependencies * Update dependencies
* Several bug fixes and documentation updates * Several bug fixes and documentation updates
* See the [migration guide](https://github.com/pa11y/pa11y-dashboard/blob/master/MIGRATION.md#migrating-from-20-to-30) for details of the breaking changes in this release * See the [migration guide](https://github.com/pa11y/pa11y-dashboard/blob/master/MIGRATION.md#migrating-from-20-to-30) for details of the breaking changes in this release
## 2.4.2 (2018-06-21) ## 2.4.2 (2018-06-21)
* Update dependencies * Update dependencies
* body-parser: ~1.17.1 to ^1.18.3 * body-parser: ~1.17.1 to ^1.18.3
* compression: ~1.6 to ^1.7.2 * compression: ~1.6 to ^1.7.2
* express: ~4.15.2 to ^4.16.3 * express: ~4.15.2 to ^4.16.3
* moment: ~2.15.2 to ^2.22.2 * moment: ~2.15.2 to ^2.22.2
## 2.4.1 (2017-11-28) ## 2.4.1 (2017-11-28)
* Update dependencies * Update dependencies
* pa11y-webservice: ^2.3.0 to ^2.3.1 * pa11y-webservice: ^2.3.0 to ^2.3.1
## 2.4.0 (2017-11-23) ## 2.4.0 (2017-11-23)
* Add the ability to export the results graph as a PNG, see #197 for more information * Add the ability to export the results graph as a PNG, see #197 for more information
## 2.3.0 (2017-10-31) ## 2.3.0 (2017-10-31)
* Large overhaul of the results page, see #196 for more information * Large overhaul of the results page, see #196 for more information
## 2.2.2 (2017-03-23) ## 2.2.2 (2017-03-23)
* Upgrades `body-parser` and `express`. Fixes a vulnerability in `qs`: https://snyk.io/vuln/npm:qs:20170213 * Upgrades `body-parser` and `express`. Fixes a vulnerability in `qs`: https://snyk.io/vuln/npm:qs:20170213
## 2.2.1 (2017-02-07) ## 2.2.1 (2017-02-07)
* Fix task editing when no actions are specified * Fix task editing when no actions are specified
## 2.2.0 (2017-01-27) ## 2.2.0 (2017-01-27)
* Add support for Pa11y actions * Add support for Pa11y actions
* Update dependencies * Update dependencies
* pa11y-webservice: ~2.1.2 to ^2.3.0 * pa11y-webservice: ~2.1.2 to ^2.3.0
## 2.1.2 (2016-12-12) ## 2.1.2 (2016-12-12)
* Hide the "add" button in readonly mode * Hide the "add" button in readonly mode
* Add a contributing guide * Add a contributing guide
## 2.1.1 (2016-11-20) ## 2.1.1 (2016-11-20)
* Use arrows instead of plus and minus for collapsibles/expanders * Use arrows instead of plus and minus for collapsibles/expanders
* Supply more detailed 500 messages * Supply more detailed 500 messages
## 2.1.0 (2016-11-07) ## 2.1.0 (2016-11-07)
* Allow for configuration files to be JavaScript rather than JSON * Allow for configuration files to be JavaScript rather than JSON
* Allow setting of HTTP headers for task runs * Allow setting of HTTP headers for task runs
* Allow hiding/ignoring elements for task runs * Allow hiding/ignoring elements for task runs
* Update dependencies and devDependencies * Update dependencies and devDependencies
* pa11y-webservice: ~2.0.1 to ^2.1.2 * pa11y-webservice: ~2.0.1 to ^2.1.2
* mocha: ^3 to ^2 (temporary tests weren't running) * mocha: ^3 to ^2 (temporary tests weren't running)
## 2.0.1 (2016-09-12) ## 2.0.1 (2016-09-12)
* Update dependencies and devDependencies * Update dependencies and devDependencies
* express: ~4.13 to ~4.14 * express: ~4.13 to ~4.14
* pa11y-webservice: ~2.0 to ^2.0.1 * pa11y-webservice: ~2.0 to ^2.0.1
* request: ^2 to ^2.74 * request: ^2 to ^2.74
* mocha: ^2 to ^3 * mocha: ^2 to ^3
* pa11y-webservice-client-node: ~1.2 to ^1.2.1 * pa11y-webservice-client-node: ~1.2 to ^1.2.1
This fixes the following vulnerabilities: This fixes the following vulnerabilities:
* https://nodesecurity.io/advisories/45 * https://nodesecurity.io/advisories/45
* https://nodesecurity.io/advisories/63 * https://nodesecurity.io/advisories/63
* https://nodesecurity.io/advisories/65 * https://nodesecurity.io/advisories/65
* https://nodesecurity.io/advisories/106 * https://nodesecurity.io/advisories/106
* https://nodesecurity.io/advisories/121 * https://nodesecurity.io/advisories/121
* https://nodesecurity.io/advisories/130 * https://nodesecurity.io/advisories/130
## 2.0.0 (2016-06-05) ## 2.0.0 (2016-06-05)
* Drop Node.js 0.100.12 support * Drop Node.js 0.100.12 support
* Update dependencies * Update dependencies
* pa11y-webservice: ~1.11 to ~2.0 * pa11y-webservice: ~1.11 to ~2.0
* See the [migration guide](https://github.com/pa11y/dashboard/blob/master/MIGRATION.md#migrating-from-10-to-20) for details * See the [migration guide](https://github.com/pa11y/dashboard/blob/master/MIGRATION.md#migrating-from-10-to-20) for details
## 1.12.1 (2016-06-05) ## 1.12.1 (2016-06-05)
* Update references/links after a repo rename * Update references/links after a repo rename
## 1.12.0 (2016-05-26) ## 1.12.0 (2016-05-26)
* Update Node.js version support to 0.106.0 * Update Node.js version support to 0.106.0
* Update dependencies * Update dependencies
* body-parser: added at ~1.15 * body-parser: added at ~1.15
* chalk: ~0.2 to ~1.1 * chalk: ~0.2 to ~1.1
* compression: added at ~1.6 * compression: added at ~1.6
* express: ~3.4 to ~4.13 * express: ~3.4 to ~4.13
* express-hbs: ~0.2 to ~1.0 * express-hbs: ~0.2 to ~1.0
* moment: ~2.2 to ~2.13 * moment: ~2.2 to ~2.13
* pa11y-webservice: ~1.10 to ~1.11 * pa11y-webservice: ~1.10 to ~1.11
* pa11y-webservice-client-node: ~1.1 to ~1.2 * pa11y-webservice-client-node: ~1.1 to ~1.2
* bower: ~1.2 to ~1.7 * bower: ~1.2 to ~1.7
* cheerio: added at ~0.20 * cheerio: added at ~0.20
* jsdom: removed * jsdom: removed
* request: ~2.27 to ^2 * request: ~2.27 to ^2
* uglify-js: ~2.4 to ~2.6 * uglify-js: ~2.4 to ~2.6
## 1.11.0 (2016-05-23) ## 1.11.0 (2016-05-23)
* Add the ability to configure task wait times * Add the ability to configure task wait times
* Allow configuration by environment variables * Allow configuration by environment variables
* Update repository references to the new Pa11y organisation * Update repository references to the new Pa11y organisation
* Add a changelog * Add a changelog
## 1.10.0 (2016-05-18) ## 1.10.0 (2016-05-18)
* Automatically focus on the filter input box when you select the filter * Automatically focus on the filter input box when you select the filter
* Make a task URL clickable * Make a task URL clickable
* Tweak the documentation to make it more usable * Tweak the documentation to make it more usable
* Add a resources section to the README * Add a resources section to the README
## 1.9.0 (2016-04-25) ## 1.9.0 (2016-04-25)
* Show errors' context and selector on the results page * Show errors' context and selector on the results page
* Add context and selector to CSV output * Add context and selector to CSV output
* Fix lint errors * Fix lint errors
* Switch from Grunt to Make * Switch from Grunt to Make
* Add a `SIGINT` handler * Add a `SIGINT` handler
* Update dependencies * Update dependencies
* pa11y-webservice: ~1.6 to ~1.8 * pa11y-webservice: ~1.6 to ~1.8
## 1.8.2 (2016-02-10) ## 1.8.2 (2016-02-10)
* Update the license in the footer * Update the license in the footer
## 1.8.1 (2016-02-10) ## 1.8.1 (2016-02-10)
* Update repository references to springernature * Update repository references to springernature
## 1.8.0 (2016-02-04) ## 1.8.0 (2016-02-04)
* Make the graph more accessible to color-blind users * Make the graph more accessible to color-blind users
* Fix lint errors * Fix lint errors
## 1.7.0 (2016-01-29) ## 1.7.0 (2016-01-29)
* Hide the date list from individual result pages * Hide the date list from individual result pages
* Make the date selector properly keyboard accessible * Make the date selector properly keyboard accessible
* Change the options button into a more accessible list * Change the options button into a more accessible list
* Make the errors/warnings/notices lists keyboard accessible * Make the errors/warnings/notices lists keyboard accessible
## 1.6.1 (2016-01-26) ## 1.6.1 (2016-01-26)
* Add keyboard access for filters * Add keyboard access for filters
* Fix lint errors * Fix lint errors
## 1.6.0 (2015-08-20) ## 1.6.0 (2015-08-20)
* Hide all graph data except for errors by default * Hide all graph data except for errors by default
## 1.5.0 (2015-07-06) ## 1.5.0 (2015-07-06)
* Add the ability to use HTTP basic auth with task URLs * Add the ability to use HTTP basic auth with task URLs
* Update dependencies * Update dependencies
* pa11y-webservice: ~1.5 to ~1.6 * pa11y-webservice: ~1.5 to ~1.6
## 1.4.0 (2015-07-02) ## 1.4.0 (2015-07-02)
* Add the ability to set a per-task timeout * Add the ability to set a per-task timeout
## 1.3.2 (2015-01-17) ## 1.3.2 (2015-01-17)
* Update dependencies * Update dependencies
* pa11y-webservice: ~1.3 to ~1.4 * pa11y-webservice: ~1.3 to ~1.4
## 1.3.1 (2014-03-05) ## 1.3.1 (2014-03-05)
* Fix the URL filter position when in demo mode * Fix the URL filter position when in demo mode
## 1.3.0 (2014-03-04) ## 1.3.0 (2014-03-04)
* Add filtering of tasks on the home page * Add filtering of tasks on the home page
* Add the ability to ignore certain rules * Add the ability to ignore certain rules
* Add the ability to ignore a rule from the result page * Add the ability to ignore a rule from the result page
* Tweak the display of task cards * Tweak the display of task cards
## 1.2.3 (2014-01-13) ## 1.2.3 (2014-01-13)
* Fix CSV export for the OS X version of Excel * Fix CSV export for the OS X version of Excel
## 1.2.2 (2014-01-09) ## 1.2.2 (2014-01-09)
* Fix spacing issues when the graph is not visible * Fix spacing issues when the graph is not visible
* Add notes on publishing a release * Add notes on publishing a release
## 1.2.1 (2014-01-08) ## 1.2.1 (2014-01-08)
* Fix dropdown positioning in Internet Explorer 7 and 8 * Fix dropdown positioning in Internet Explorer 7 and 8
## 1.2.0 (2013-12-12) ## 1.2.0 (2013-12-12)
* Add HTML Codesniffer links on the results page * Add HTML Codesniffer links on the results page
* Display the ignore rules for results on the results page * Display the ignore rules for results on the results page
* Link the breadcrumbs on task sub-pages * Link the breadcrumbs on task sub-pages
* Fix an issue with saving empty ignore rules * Fix an issue with saving empty ignore rules
* Cache-bust the CSS and JavaScript * Cache-bust the CSS and JavaScript
* Add the ability to edit tasks * Add the ability to edit tasks
* Fix lint errors * Fix lint errors
* Tweaks to the display of the graphs * Tweaks to the display of the graphs
* Update dependencies * Update dependencies
* pa11y-webservice: ~1.1 to ~1.2 * pa11y-webservice: ~1.1 to ~1.2
* pa11y-webservice-client-node: ~1.0 to ~1.1 * pa11y-webservice-client-node: ~1.0 to ~1.1
## 1.1.0 (2013-11-22) ## 1.1.0 (2013-11-22)
* Add a functional test suite * Add a functional test suite
* Allow the webservice to run automatically * Allow the webservice to run automatically
* Documentation improvements * Documentation improvements
* Add a Travis config * Add a Travis config
* Fix lint errors * Fix lint errors
## 1.0.0 (2013-11-19) ## 1.0.0 (2013-11-19)
* Initial stable release * Initial stable release
* Add the ability to set a site-wide message * Add the ability to set a site-wide message
* Add a demo mode for demo/public-facing sites * Add a demo mode for demo/public-facing sites
* Disable search engine indexing by default * Disable search engine indexing by default
* Tweak the task header at smaller screen sizes * Tweak the task header at smaller screen sizes
* Make checkboxes on the graph WCAG2AA compliant * Make checkboxes on the graph WCAG2AA compliant
* Make checkbox inputs and labels WCAG2AA compliant on new URL page * Make checkbox inputs and labels WCAG2AA compliant on new URL page
* Colour changes to ensure there are no contrast issues * Colour changes to ensure there are no contrast issues
* Make the copy more consistent * Make the copy more consistent
* Update screenshots * Update screenshots
* Update dependencies * Update dependencies
* pa11y-webservice-client-node: 1.0.0-beta.7 to ~1.0 * pa11y-webservice-client-node: 1.0.0-beta.7 to ~1.0
## 1.0.0-beta.3 pre-release (2013-11-12) ## 1.0.0-beta.3 pre-release (2013-11-12)
* Fix lint errors * Fix lint errors
* Add descriptive labels to tasks * Add descriptive labels to tasks
* Add a name field to "New URL" form * Add a name field to "New URL" form
* Add a WCAG 2.0 link to the footer * Add a WCAG 2.0 link to the footer
* Tweak the layout at smaller screen sizes * Tweak the layout at smaller screen sizes
* Notify users when there are no ignored rules * Notify users when there are no ignored rules
* Fix the expires headers for front end assets * Fix the expires headers for front end assets
* Move from Make to Grunt * Move from Make to Grunt
* Compress static files * Compress static files
* Minify the site JavaScript * Minify the site JavaScript
* Compile LESS files with grunt * Compile LESS files with grunt
* Add a watch task to recompile assets on change * Add a watch task to recompile assets on change
* Commit compiled front-end code to the repo * Commit compiled front-end code to the repo
* Add development instructions * Add development instructions
* Update screenshots * Update screenshots
* Update dependencies * Update dependencies
* pa11y-webservice-client-node: 1.0.0-beta.4 to 1.0.0-beta.7 * pa11y-webservice-client-node: 1.0.0-beta.4 to 1.0.0-beta.7
## 1.0.0-beta.2 pre-release (2013-10-04) ## 1.0.0-beta.2 pre-release (2013-10-04)
* Add screenshots to the README * Add screenshots to the README
* Fix margins * Fix margins
* Add bower package management * Add bower package management
* Stop the graph from appearing if there's only one result * Stop the graph from appearing if there's only one result
* Add the ability to run tasks ad-hoc * Add the ability to run tasks ad-hoc
* Add more useful information to the footer * Add more useful information to the footer
* General copy edits * General copy edits
* Update dependencies * Update dependencies
* pa11y-webservice-client-node: 1.0.0-beta.3 to 1.0.0-beta.4 * pa11y-webservice-client-node: 1.0.0-beta.3 to 1.0.0-beta.4
## 1.0.0-beta.1 pre-release (2013-09-27) ## 1.0.0-beta.1 pre-release (2013-09-27)
* Initial release * Initial release

View File

@@ -1,6 +1,4 @@
# Contributing Guide
Contributing Guide
==================
Thanks for getting involved :tada: Thanks for getting involved :tada:
@@ -14,8 +12,8 @@ Our website outlines the many ways that you can contribute to Pa11y:
[code-of-conduct]: http://pa11y.org/contributing/code-of-conduct/ [code-of-conduct]: https://pa11y.org/contributing/code-of-conduct/
[communications]: http://pa11y.org/contributing/communications/ [communications]: https://pa11y.org/contributing/communications/
[companies]: http://pa11y.org/contributing/companies/ [companies]: https://pa11y.org/contributing/companies/
[designers]: http://pa11y.org/contributing/designers/ [designers]: https://pa11y.org/contributing/designers/
[developers]: http://pa11y.org/contributing/developers/ [developers]: https://pa11y.org/contributing/developers/

View File

@@ -2,12 +2,22 @@
Pa11y Dashboard's API changes between major versions. This is a guide to help you make the switch when this happens. Pa11y Dashboard's API changes between major versions. This is a guide to help you make the switch when this happens.
## Table of Contents ## Table of contents
- [Migrating from 2.0 to 3.0](#migrating-from-20-to-30) * [Table of contents](#table-of-contents)
- [Migrating from 1.0 to 2.0](#migrating-from-10-to-20) * [Migrating from 3.0 to 4.0](#migrating-from-30-to-40)
* [Migrating from 2.0 to 3.0](#migrating-from-20-to-30)
* [PhantomJS to Headless Chrome](#phantomjs-to-headless-chrome)
* [Node.js Support](#nodejs-support)
* [Miscellaneous](#miscellaneous)
* [Migrating from 1.0 to 2.0](#migrating-from-10-to-20)
* [Node.js Support](#nodejs-support-1)
## Migrating from 2.0 to 3.0 ## Migrating from 3.0 to 4.0
Pa11y Dashboard requires Node.js version 12 or greater. Versions 8 and 10 are not supported any more.
## Migrating from 2.0 to 3.0
### PhantomJS to Headless Chrome ### PhantomJS to Headless Chrome
@@ -17,13 +27,13 @@ As a result of this change, [Pa11y Dashboard's requirements](../README.md#requir
### Node.js Support ### Node.js Support
Pa11y Webservice 3 requires Node.js version 8 or greater. Versions 4 and 6 are not supported any more. Pa11y Dashboard 3 requires Node.js version 8 or greater. Versions 4 and 6 are not supported any more.
### Miscellaneous ### Miscellaneous
The default viewport dimensions for Pa11y have been changed from `1024x768` to `1280x1024`. This could make pa11y report a different number of errors if different content appears on the page based on its width, so results obtained with v2 and v3 may not be comparable. The default viewport dimensions for Pa11y have been changed from `1024x768` to `1280x1024`. This could make pa11y report a different number of errors if different content appears on the page based on its width, so results obtained with v2 and v3 may not be comparable.
## Migrating from 1.0 to 2.0 ## Migrating from 1.0 to 2.0
### Node.js Support ### Node.js Support

View File

@@ -1,25 +1,10 @@
include Makefile.node
# We need to run integration tests recursively
export INTEGRATION_FLAGS := --recursive
# Verify tasks
# ------------
# Lint alias for backwards compatibility
lint: verify
# Client-side asset tasks # Client-side asset tasks
# ----------------------- # -----------------------
# Compile LESS
less: less:
@lessc -x ./public/less/main.less ./public/css/site.min.css @lessc -x ./public/less/main.less ./public/css/site.min.css
@$(TASK_DONE) @$(TASK_DONE)
# Compile client-side JavaScript
uglify: uglify:
@uglifyjs \ @uglifyjs \
public/js/vendor/jquery/jquery.min.js \ public/js/vendor/jquery/jquery.min.js \

View File

@@ -1,125 +0,0 @@
#
# Node.js Makefile
# ================
#
# Do not update this file manually it's maintained separately on GitHub:
# https://github.com/rowanmanning/makefiles/blob/master/Makefile.node
#
# To update to the latest version, run `make update-makefile`.
#
# Meta tasks
# ----------
.PHONY: test
# Useful variables
# ----------------
NPM_BIN = ./node_modules/.bin
export PATH := $(NPM_BIN):$(PATH)
export EXPECTED_COVERAGE := 90
export INTEGRATION_TIMEOUT := 10000
export INTEGRATION_SLOW := 4000
# Output helpers
# --------------
TASK_DONE = echo "$@ done"
# Group tasks
# -----------
all: install ci
ci: verify test
# Install tasks
# -------------
clean:
@git clean -fxd
@$(TASK_DONE)
install: node_modules
@$(TASK_DONE)
node_modules: package.json
@npm prune --production=false
@npm install
@$(TASK_DONE)
# Verify tasks
# ------------
verify: verify-javascript verify-dust verify-spaces
@$(TASK_DONE)
verify-javascript: verify-eslint verify-jshint verify-jscs
@$(TASK_DONE)
verify-dust:
@if [ -e .dustmiterc* ]; then dustmite --path ./view && $(TASK_DONE); fi
verify-eslint:
@if [ -e .eslintrc* ]; then eslint . && $(TASK_DONE); fi
verify-jshint:
@if [ -e .jshintrc* ]; then jshint . && $(TASK_DONE); fi
verify-jscs:
@if [ -e .jscsrc* ]; then jscs . && $(TASK_DONE); fi
verify-spaces:
@if [ -e .editorconfig* ] && [ -x $(NPM_BIN)/lintspaces ]; then \
git ls-files | xargs lintspaces -e .editorconfig && $(TASK_DONE); \
fi
verify-coverage:
@if [ -d coverage ]; then \
if [ -x $(NPM_BIN)/nyc ]; then \
nyc check-coverage --lines $(EXPECTED_COVERAGE) --functions $(EXPECTED_COVERAGE) --branches $(EXPECTED_COVERAGE) && $(TASK_DONE); \
else \
if [ -x $(NPM_BIN)/istanbul ]; then \
istanbul check-coverage --statement $(EXPECTED_COVERAGE) --branch $(EXPECTED_COVERAGE) --function $(EXPECTED_COVERAGE) && $(TASK_DONE); \
fi \
fi \
fi
# Test tasks
# ----------
test: test-unit-coverage verify-coverage test-integration
@$(TASK_DONE)
test-unit:
@if [ -d test/unit ]; then mocha test/unit --recursive && $(TASK_DONE); fi
test-unit-coverage:
@if [ -d test/unit ]; then \
if [ -x $(NPM_BIN)/nyc ]; then \
nyc --reporter=text --reporter=html $(NPM_BIN)/_mocha test/unit --recursive && $(TASK_DONE); \
else \
if [ -x $(NPM_BIN)/istanbul ]; then \
istanbul cover $(NPM_BIN)/_mocha -- test/unit --recursive && $(TASK_DONE); \
else \
make test-unit; \
fi \
fi \
fi
test-integration:
@if [ -d test/integration ]; then mocha test/integration --timeout $(INTEGRATION_TIMEOUT) --slow $(INTEGRATION_SLOW) $(INTEGRATION_FLAGS) && $(TASK_DONE); fi
# Tooling tasks
# -------------
update-makefile:
@curl -s https://raw.githubusercontent.com/rowanmanning/makefiles/master/Makefile.node > Makefile.node
@$(TASK_DONE)

172
README.md
View File

@@ -14,15 +14,16 @@ Pa11y Dashboard is a web interface to the [Pa11y][pa11y] accessibility reporter;
## Requirements ## Requirements
Pa11y Dashboard is a [Node.js][node] application and requires a stable or LTS version of Node, currently version 8 or greater. - [Node.js][node]: Pa11y Dashboard 4 requires a stable (even-numbered) version of Node.js of 12 or above.
- [MongoDB][mongodb]: This project depends on Pa11y Webservice, which stores test results in a MongoDB database and expects one to be available and running.
Pa11y Dashboard also requires a [MongoDB][mongo] database to be available so it can store the results of the tests. The database doesn't have to be in the same server or computer where Pa11y Dashboard is running from. ### Pally Dashboard 4 and Linux/Ubuntu
Since version 3, Pa11y Dashboard uses Headless Chrome in order to run the tests. This means that additional dependencies maybe be required. Pa11y (and therefore this service) uses Headless Chrome to perform accessibility testing. On Linux and other Unix-like systems, Pa11y's attempt to install it as a dependency sometimes fails since additional operating system packages will be required. Your distribution's documentation should describe how to install these.
In [Unix-like](https://en.wikipedia.org/wiki/Unix-like) systems you may need to install the `libnss3` and `libgconf-2-4` libraries in order to be able to run Chrome. If you're trying to run the app in a headless environment (e.g. the cloud, or a headless server), you may also need to configure Xvfb before. Please refer to the documentation from your provider for details on how to do this. In addition, to use Pa11y Dashboard 4 with a version of Ubuntu above 20.04, a path to the Chrome executable must be defined in `chromeLaunchConfig`, as `chromeLaunchConfig.executablePath`. Version 5 of Pa11y Dashboard, which will use Pa11y 7 along with a more recent version of Puppeteer, will resolve this issue.
## Setup ## Setting up Pa11y Dashboard
In order to run Pa11y Dashboard, we recommend cloning this repository locally: In order to run Pa11y Dashboard, we recommend cloning this repository locally:
@@ -37,11 +38,48 @@ cd pa11y-dashboard
npm install npm install
``` ```
You'll also need to have [MongoDB][mongo] installed and running. For quick access, you can install via a package manager such as on Mac OS `brew install mongodb` or on Linux (Debian) it would be `apt-get install mongodb`. To run MongoDB, you can run `mongod` in the command line. See the [MongoDB install guide][mongo-install] for more detailed information. ### Installing MongoDB
The last step before being able to run the application is to define a configuration for it. This can be done in two ways: Instructions for installing and running MongoDB are outside the scope of this document. When in doubt, please refer to the [MongoDB installation instructions](https://docs.mongodb.com/manual/installation/) for details of how to install and run MongoDB on your specific operating system. An example of the installation and configuration process for macOS follows.
### Option 1: Using Environment Variables Pa11y Dashboard uses [MongoDB Node.js Driver][mongodb-package] version 3, which [may not support some features][mongodb-package-compatibility] of MongoDB versions 6 and beyond. We do however test against MongoDB versions 2 to 6, plus the latest major version, which at the time of writing is `7`.
#### Example MongoDB installation for macOS
On recent versions of macOS (10.13 or later), you can use [Homebrew] to install MongoDB Community Edition.
Tap the MongoDB Homebrew Tap:
```sh
brew tap mongodb/brew
```
Install a supported Community version of MongoDB:
```sh
brew install mongodb-community@4.4
```
Start the MongoDB server:
```sh
brew services start mongodb/brew/mongodb-community@4.4
```
Check that the service has started properly:
```console
$ brew services list
Name Status User Plist
mongodb-community started pa11y /Users/pa11y/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
```
### Configuring Pa11y Dashboard
The last step before being able to run Pa11y Dashboard is to define a configuration for it. This can be done in two ways:
#### Option 1: Using environment variables
Each configuration can be set with an environment variable rather than a config file. For example to run the application on port `8080` you can use the following: Each configuration can be set with an environment variable rather than a config file. For example to run the application on port `8080` you can use the following:
@@ -49,54 +87,63 @@ Each configuration can be set with an environment variable rather than a config
PORT=8080 node index.js PORT=8080 node index.js
``` ```
The [available configurations are documented here](#configurations). The [available configurations](#configurations) are documented in the next section.
### Option 2: Using Config Files #### Option 2: Using config files
You'll need to copy and modify different config files depending on your environment (set with `NODE_ENV`): You can store the configuration for Pa11y Dashboard on a JSON file. You can use a different configuration file for each environment you're planning to run Pa11y Dashboard on. You can choose a specific environment to run the application from by setting the `NODE_ENV` environment variable:
```sh
cp config/development.sample.json config/development.json
cp config/production.sample.json config/production.json
cp config/test.sample.json config/test.json
```
Each of these files defines configurations for a different environment. If you're just running the application locally, then you should be OK with just development and test configurations. The [available configurations are documented here](#configurations).
Now that you've got your application configured, make sure you have a MongoDB server running with the `mongod` command in another terminal window. You can run in each mode by changing the `NODE_ENV` environment variable:
```sh ```sh
NODE_ENV=development node index.js NODE_ENV=development node index.js
``` ```
See [Contributing](#contributing) for more information about running locally (and restarting automatically when files change). Three example files are provided in this repository, you can copy and customise them to your liking:
If you run into problems, check the [troubleshooting guide][troubleshooting]. ```sh
cp config/development.sample.json config/development.json
```
```sh
cp config/production.sample.json config/production.json
```
```sh
cp config/test.sample.json config/test.json
```
The [available configurations](#configurations) are documented in the next section.
If you run into problems, check the [troubleshooting guide](#troubleshooting).
## Configurations ## Configurations
The boot configurations for Pa11y Dashboard are as follows. Look at the sample JSON files in the repo for example usage. The boot configurations for Pa11y Dashboard are as follows. Look at the sample JSON files in the repo for example usage.
### port ### `port`
*(number)* The port to run the application on. Set via a config file or the `PORT` environment variable. *(number)* The port to run the application on. Set via a config file or the `PORT` environment variable.
### noindex ### `noindex`
*(boolean)* If set to `true` (default), the dashboard will not be indexed by search engines. Set to `false` to allow indexing. Set via a config file or the `NOINDEX` environment variable. *(boolean)* If set to `true` (default), the dashboard will not be indexed by search engines. Set to `false` to allow indexing. Set via a config file or the `NOINDEX` environment variable.
### readonly ### `readonly`
*(boolean)* If set to `true`, users will not be able to add, delete or run URLs (defaults to `false`). Set via a config file or the `READONLY` environment variable. *(boolean)* If set to `true`, users will not be able to add, delete or run URLs (defaults to `false`). Set via a config file or the `READONLY` environment variable.
### siteMessage ### `siteMessage`
*(string)* A message to display prominently on the site home page. Defaults to `null`. *(string)* A message to display prominently on the site home page. Defaults to `null`.
### webservice ### `webservice`
This can either be an object containing [Pa11y Webservice configurations][pa11y-webservice-config], or a string which is the base URL of a [Pa11y Webservice][pa11y-webservice] instance you are running separately. If using environment variables, prefix the webservice vars with `WEBSERVICE_`.
This can either be an object containing [Pa11y Webservice configurations][pa11y-webservice-config], or a string which is the base URL of a Pa11y Webservice instance you are running separately. If using environment variables, prefix the webservice vars with `WEBSERVICE_`.
## Contributing ## Contributing
There are many ways to contribute to Pa11y Dashboard, we cover these in the [contributing guide](CONTRIBUTING.md) for this repo. There are many ways to contribute to Pa11y Dashboard, we cover these in the [contributing guide](CONTRIBUTING.md) for this repo.
If you're ready to contribute some code, you'll need to clone the repo and get set up as outlined in the [setup guide](#setup). You'll then need to start the application in test mode with: If you're ready to contribute some code, you'll need to clone the repo and get set up as outlined in the [setup guide](#setting-up-pa11y-dashboard). You'll then need to start the application in test mode with:
```sh ```sh
NODE_ENV=test node index.js NODE_ENV=test node index.js
@@ -105,9 +152,8 @@ NODE_ENV=test node index.js
You'll now be able to run the following commands: You'll now be able to run the following commands:
```sh ```sh
make verify # Verify all of the code (ESLint) npm run lint # Lint the code
make test # Run all tests npm test # Run all tests
make test-integration # Run the integration tests
``` ```
To compile the client-side JavaScript and CSS, you'll need the following commands. Compiled code is committed to the repository. To compile the client-side JavaScript and CSS, you'll need the following commands. Compiled code is committed to the repository.
@@ -117,46 +163,58 @@ make less # Compile the site CSS from LESS files
make uglify # Compile and uglify the client-side JavaScript make uglify # Compile and uglify the client-side JavaScript
``` ```
## Useful Resources ## Useful resources
* [Setting up An Accessibility Dashboard from Scratch with Pa11y on DigitalOcean](https://una.im/pa11y-dash/) - [Setting up An Accessibility Dashboard from Scratch with Pa11y on DigitalOcean](https://una.im/pa11y-dash/)
* [Monitoring Web Accessibility Compliance With Pa11y Dashboard](https://www.lullabot.com/articles/monitoring-web-accessibility-compliance-with-pa11y-dashboard) - [Monitoring Web Accessibility Compliance With Pa11y Dashboard](https://www.lullabot.com/articles/monitoring-web-accessibility-compliance-with-pa11y-dashboard)
## Support and Migration ## Troubleshooting
Pa11y Dashboard major versions are normally supported for 6 months after their last minor release. This means that patch-level changes will be added and bugs will be fixed. The table below outlines the end-of-support dates for major versions, and the last minor release for that version. ### Common issues
We also maintain a [migration guide](MIGRATION.md) to help you migrate. - `500` errors or `Could not connect to pa11y-webservice` messages are often related to MongoDB. Ensure that you have the [appropriate version of MongoDB](#installing-mongodb) installed, and that it's running - it doesn't always start automatically.
- Error messages saying that pa11y-webservice isn't running may be due to dependency installation problems. Try deleting your `pa11y-dashboard/node_modules` directory and running `npm install` again.
| :grey_question: | Major Version | Last Minor Release | Node.js Versions | Support End Date | ### Create a new issue
| :-------------- | :------------ | :----------------- | :--------------- | :--------------- |
| :heart: | 3 | N/A | 8+ | N/A |
| :hourglass: | 2 | 2.4.2 | 4+ | 2020-01-16 |
| :skull: | 1 | 1.12 | 0.106 | 2016-12-05 |
If you're opening issues related to these, please mention the version that the issue relates to. Check the [issue tracker][issues] for similar issues before creating a new one. If the problem that you're experiencing is not covered by one of the existing issues, you can [create a new issue][issues-create]. Please include your node.js and MongoDB version numbers, and your operating system, as well as any information that may be useful in debugging the issue.
## Support and migration
> [!NOTE]
> We maintain a [migration guide](MIGRATION.md) to help you migrate between major versions.
When we release a new major version we will continue to support the previous major version for 6 months. This support will be limited to fixes for critical bugs and security issues. If you're opening an issue related to this project, please mention the specific version that the issue affects.
The following table lists the major versions available and, for each previous major version, its end-of-support date, and its final minor version released.
| Major version | Last minor release | Node.js support | Support end date |
| :------------ | :----------------- | :------------------------ | :--------------- |
| `4` | Imminent | `>= 12` | ✅ Current major version |
| `3` | `3.3.0` | `8`, `10` | 2022-05-26 |
| `2` | `2.4.2` | `4`, `6` | 2020-01-16 |
| `1` | `1.12.0` | `0.10`, `0.12`, `4`, `6` | 2016-12-05 |
## License ## License
Pa11y Dashboard is licensed under the [GNU General Public License 3.0][info-license].<br/> Pa11y Dashboard is licensed under the [GNU General Public License 3.0][info-license].
Copyright &copy; 20132019, Team Pa11y and contributors Copyright &copy; 2023, Team Pa11y and contributors
[gpl]: http://www.gnu.org/licenses/gpl-3.0.html [homebrew]: https://brew.sh/
[mongo]: http://www.mongodb.org/ [issues]: https://github.com/pa11y/pa11y-dashboard/issues?utf8=%E2%9C%93&q=is%3Aissue
[mongo-install]: https://docs.mongodb.org/manual/installation/ [issues-create]: https://github.com/pa11y/pa11y-dashboard/issues/new
[mongodb]: http://www.mongodb.org/
[mongodb-package]: https://www.npmjs.com/package/mongodb
[mongodb-package-compatibility]: https://docs.mongodb.com/drivers/node/current/compatibility
[node]: http://nodejs.org/ [node]: http://nodejs.org/
[pa11y]: https://github.com/pa11y/pa11y [pa11y]: https://github.com/pa11y/pa11y
[pa11y-webservice-config]: https://github.com/pa11y/webservice#configurations [pa11y-webservice-config]: https://github.com/pa11y/webservice#configurations
[phantom]: http://phantomjs.org/
[sidekick-proposal]: https://github.com/pa11y/sidekick/blob/master/PROPOSAL.md
[travis]: https://travis-ci.org/pa11y/dashboard
[travis-img]: https://travis-ci.org/pa11y/dashboard.png?branch=master
[troubleshooting]: https://github.com/pa11y/dashboard/blob/master/TROUBLESHOOTING.md
[info-node]: package.json [info-node]: package.json
[info-build]: https://travis-ci.org/pa11y/pa11y-dashboard [info-build]: https://github.com/pa11y/pa11y-dashboard/actions/workflows/tests.yml
[info-license]: LICENSE [info-license]: LICENSE
[shield-version]: https://img.shields.io/github/package-json/v/pa11y/pa11y-dashboard.svg [shield-version]: https://img.shields.io/github/package-json/v/pa11y/pa11y-dashboard.svg
[shield-node]: https://img.shields.io/node/v/pa11y/pa11y-dashboard.svg [shield-node]: https://img.shields.io/node/v/pa11y/pa11y-dashboard.svg
[shield-build]: https://img.shields.io/travis/pa11y/pa11y-dashboard/master.svg [shield-build]: https://github.com/pa11y/pa11y-dashboard/actions/workflows/tests.yml/badge.svg
[shield-license]: https://img.shields.io/badge/license-GPL%203.0-blue.svg [shield-license]: https://img.shields.io/badge/license-GPL%203.0-blue.svg

View File

@@ -1,27 +0,0 @@
Troubleshooting
===============
Common issues
-----
* `500` errors or `Could not connect to pa11y-webservice` messages are often related to MongoDB. Ensure that you have the [latest version of MongoDB][mongo-install] installed, and that it's running - it doesn't always start automatically.
* Error messages saying that pa11y-webservice isn't running may be due to dependency installation problems. Try deleting your `pa11y-dashboard/node_modules` directory and running `npm install` again.
Check to see if the issue has been reported
-----
* Check the [issue tracker][issues] for similar issues.
Create an issue
-----
If all else fails, [create an issue][create-issue] and we'll help you. Please include your node.js, Phantom, and MongoDB version numbers, and your operating system.
[issues]: https://github.com/pa11y/dashboard/issues?utf8=%E2%9C%93&q=is%3Aissue
[mongo-install]: https://docs.mongodb.org/manual/installation/
[create-issue]: https://github.com/pa11y/dashboard/issues/new

90
app.js
View File

@@ -17,15 +17,16 @@
const bodyParser = require('body-parser'); const bodyParser = require('body-parser');
const compression = require('compression'); const compression = require('compression');
const createClient = require('pa11y-webservice-client-node'); const createClient = require('pa11y-webservice-client-node');
const EventEmitter = require('events').EventEmitter; const {EventEmitter} = require('events');
const express = require('express'); const express = require('express');
const hbs = require('express-hbs'); const hbs = require('express-hbs');
const morgan = require('morgan');
const {nanoid} = require('nanoid');
const http = require('http'); const http = require('http');
const pkg = require('./package.json'); const pkg = require('./package.json');
module.exports = initApp; module.exports = initApp;
// Initialise the application
function initApp(config, callback) { function initApp(config, callback) {
config = defaultConfig(config); config = defaultConfig(config);
@@ -35,14 +36,54 @@ function initApp(config, callback) {
} }
const app = new EventEmitter(); const app = new EventEmitter();
app.address = null;
app.express = express(); app.express = express();
app.server = http.createServer(app.express); app.server = http.createServer(app.express);
app.webservice = createClient(webserviceUrl); app.webservice = createClient(webserviceUrl);
// Compression loadMiddleware(app);
// View engine
loadViewEngine(app, config);
// Load routes
loadRoutes(app, config);
// Error handling
loadErrorHandling(app, config, callback);
}
function defaultConfig(config) {
if (typeof config.noindex !== 'boolean') {
config.noindex = true;
}
if (typeof config.readonly !== 'boolean') {
config.readonly = false;
}
return config;
}
function loadMiddleware(app) {
app.express.use(compression()); app.express.use(compression());
// Adds an ID to every request, used later for logging
app.express.use(addRequestId);
// Logging middleware
morgan.token('id', request => {
return request.id;
});
// Log the start of all HTTP requests
const startLog = '[:date[iso] #:id] Started :method :url for :remote-addr';
// Immediate: true is required to log the request
// before the response happens
app.express.use(morgan(startLog, {immediate: true}));
// Log the end of all HTTP requests
const endLog = '[:date[iso] #:id] Completed :status :res[content-length] in :response-time ms';
app.express.use(morgan(endLog));
// Public files // Public files
app.express.use(express.static(`${__dirname}/public`, { app.express.use(express.static(`${__dirname}/public`, {
maxAge: (process.env.NODE_ENV === 'production' ? 604800000 : 0) maxAge: (process.env.NODE_ENV === 'production' ? 604800000 : 0)
@@ -53,8 +94,9 @@ function initApp(config, callback) {
app.express.use(bodyParser.urlencoded({ app.express.use(bodyParser.urlencoded({
extended: true extended: true
})); }));
}
// View engine function loadViewEngine(app, config) {
app.express.engine('html', hbs.express4({ app.express.engine('html', hbs.express4({
extname: '.html', extname: '.html',
contentHelperName: 'content', contentHelperName: 'content',
@@ -89,12 +131,16 @@ function initApp(config, callback) {
response.locals.host = request.hostname; response.locals.host = request.hostname;
next(); next();
}); });
}
// Load routes function loadRoutes(app, config) {
// Because there's some overlap between the different routes,
// they have to be loaded in a specific order in order to avoid
// passing mongo the wrong id which would result in
// "ObjectID generation failed." errors (e.g. #277)
require('./route/index')(app); require('./route/index')(app);
require('./route/task/index')(app);
require('./route/result/index')(app);
require('./route/result/download')(app); require('./route/result/download')(app);
if (!config.readonly) { if (!config.readonly) {
require('./route/new')(app); require('./route/new')(app);
require('./route/task/delete')(app); require('./route/task/delete')(app);
@@ -104,7 +150,13 @@ function initApp(config, callback) {
require('./route/task/unignore')(app); require('./route/task/unignore')(app);
} }
// Error handling // Needs to be loaded after `/route/new`
require('./route/task/index')(app);
// Needs to be loaded after `/route/task/edit`
require('./route/result/index')(app);
}
function loadErrorHandling(app, config, callback) {
app.express.get('*', (request, response) => { app.express.get('*', (request, response) => {
response.status(404); response.status(404);
response.render('404'); response.render('404');
@@ -123,20 +175,16 @@ function initApp(config, callback) {
}); });
app.server.listen(config.port, error => { app.server.listen(config.port, error => {
const address = app.server.address();
app.address = `http://${address.address}:${address.port}`;
callback(error, app); callback(error, app);
}); });
} }
// Get default configurations // Express middleware
function defaultConfig(config) { function addRequestId(request, response, next) {
if (typeof config.noindex !== 'boolean') { // Create a random request (nano)id, 10 characters long
config.noindex = true; // Nano ids are [0-9A-Za-z_-] so chance of collision is 1 in 64^10
} // If a site has so much traffic that this chance is too high
if (typeof config.readonly !== 'boolean') { // we probably have worse things to worry about
config.readonly = false; request.id = nanoid(10);
} next();
return config;
} }

View File

@@ -1,6 +1,5 @@
{ {
"name": "pa11y-dashboard", "name": "pa11y-dashboard",
"dependencies": { "dependencies": {
"jquery": "~1.10", "jquery": "~1.10",
"bootstrap": "~3.0", "bootstrap": "~3.0",

View File

@@ -15,6 +15,7 @@
'use strict'; 'use strict';
const fs = require('fs'); const fs = require('fs');
const environment = (process.env.NODE_ENV || 'development'); const environment = (process.env.NODE_ENV || 'development');
const jsonPath = `./config/${environment}.json`; const jsonPath = `./config/${environment}.json`;
const jsPath = `./config/${environment}.js`; const jsPath = `./config/${environment}.js`;
@@ -28,7 +29,6 @@ if (fs.existsSync(jsonPath)) {
port: Number(env('PORT', '4000')), port: Number(env('PORT', '4000')),
noindex: env('NOINDEX', 'true') === 'true', noindex: env('NOINDEX', 'true') === 'true',
readonly: env('READONLY', 'false') === 'true', readonly: env('READONLY', 'false') === 'true',
webservice: env('WEBSERVICE_URL', { webservice: env('WEBSERVICE_URL', {
database: env('WEBSERVICE_DATABASE', 'mongodb://localhost/pa11y-webservice'), database: env('WEBSERVICE_DATABASE', 'mongodb://localhost/pa11y-webservice'),
host: env('WEBSERVICE_HOST', '0.0.0.0'), host: env('WEBSERVICE_HOST', '0.0.0.0'),

View File

@@ -2,7 +2,6 @@
"port": 4000, "port": 4000,
"noindex": true, "noindex": true,
"readonly": false, "readonly": false,
"webservice": { "webservice": {
"database": "mongodb://localhost/pa11y-webservice-dev", "database": "mongodb://localhost/pa11y-webservice-dev",
"host": "0.0.0.0", "host": "0.0.0.0",

View File

@@ -2,7 +2,6 @@
"port": 4000, "port": 4000,
"noindex": true, "noindex": true,
"readonly": false, "readonly": false,
"webservice": { "webservice": {
"database": "mongodb://localhost/pa11y-webservice", "database": "mongodb://localhost/pa11y-webservice",
"host": "0.0.0.0", "host": "0.0.0.0",

View File

@@ -2,10 +2,9 @@
"port": 4000, "port": 4000,
"noindex": true, "noindex": true,
"readonly": false, "readonly": false,
"webservice": { "webservice": {
"database": "mongodb://localhost/pa11y-webservice-test", "database": "mongodb://127.0.0.1/pa11y-dashboard-integration-test",
"host": "0.0.0.0", "host": "127.0.0.1",
"port": 3000, "port": 3000,
"cron": "0 30 0 * * *" "cron": "0 30 0 * * *"
} }

View File

@@ -1,7 +1,7 @@
'use strict'; 'use strict';
// Clone the main config // Clone the main config
var config = module.exports = JSON.parse(JSON.stringify(require('../.eslintrc'))); const config = module.exports = JSON.parse(JSON.stringify(require('../.eslintrc')));
// Disable max line length/statements // Disable max line length/statements
config.rules['max-len'] = 'off'; config.rules['max-len'] = 'off';

View File

@@ -12,219 +12,10 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
// jscs:disable maximumLineLength
'use strict'; 'use strict';
module.exports = getStandards; module.exports = function getStandards() {
function getStandards() {
return [ return [
{
title: 'Section508',
rules: [
{
name: 'Section508.A.Audio',
description: 'For multimedia containing audio only, ensure an alternative is available, such as a full text transcript.'
},
{
name: 'Section508.A.Img.EmptyAltInLink',
description: 'Img element is the only content of the link, but is missing alt text. The alt text should describe the purpose of the link.'
},
{
name: 'Section508.A.Img.NullAltWithTitle',
description: 'Img element with empty alt text must have absent or empty title attribute.'
},
{
name: 'Section508.A.Img.Ignored',
description: 'Img element is marked so that it is ignored by Assistive Technology.'
},
{
name: 'Section508.A.Img.MissingAlt',
description: 'Img element missing an alt attribute. Use the alt attribute to specify a short text alternative.'
},
{
name: 'Section508.A.Img.GeneralAlt',
description: 'Ensure that the img element\'s alt text serves the same purpose and presents the same information as the image.'
},
{
name: 'Section508.A.InputImage.MissingAlt',
description: 'Image submit button missing an alt attribute. Specify a text alternative that describes the button\'s function, using the alt attribute.'
},
{
name: 'Section508.A.InputImage.GeneralAlt',
description: 'Ensure that the image submit button\'s alt text identifies the purpose of the button.'
},
{
name: 'Section508.A.Area.MissingAlt',
description: 'Area element in an image map missing an alt attribute. Each area element must have a text alternative that describes the function of the image map area.'
},
{
name: 'Section508.A.Area.GeneralAlt',
description: 'Ensure that the area element\'s text alternative serves the same purpose as the part of image map image it references.'
},
{
name: 'Section508.A.Object.MissingBody',
description: 'Object elements must contain a text alternative after all other alternatives are exhausted.'
},
{
name: 'Section508.A.Object.GeneralAlt',
description: 'Check that short (and if appropriate, long) text alternatives are available for non-text content that serve the same purpose and present the same information.'
},
{
name: 'Section508.A.Applet.MissingBody',
description: 'Applet elements must contain a text alternative in the element\'s body, for browsers without support for the applet element.'
},
{
name: 'Section508.A.Applet.MissingAlt',
description: 'Applet elements must contain an alt attribute, to provide a text alternative to browsers supporting the element but are unable to load the applet.'
},
{
name: 'Section508.A.Applet.GeneralAlt',
description: 'Check that short (and if appropriate, long) text alternatives are available for non-text content that serve the same purpose and present the same information.'
},
{
name: 'Section508.B.Video',
description: 'For multimedia containing video, ensure a synchronised audio description or text alternative for the video portion is provided.'
},
{
name: 'Section508.B.Captions',
description: 'For multimedia containing synchronised audio and video, ensure synchronised captions are provided for the audio portion.'
},
{
name: 'Section508.C.Colour',
description: 'Ensure that any information conveyed using colour alone is also available without colour, such as through context or markup.'
},
{
name: 'Section508.D.Linearised',
description: 'Ensure that content is ordered in a meaningful sequence when linearised, such as when style sheets are disabled.'
},
{
name: 'Section508.D.HiddenText',
description: 'If content is hidden and made visible using scripting (such as "click to expand" sections), ensure this content is readable when scripts and style sheets are disabled.'
},
{
name: 'Section508.D.[msgCode]',
description: 'Semantic markup should be used to mark emphasised or special text so that it can be programmatically determined.'
},
{
name: 'Section508.D.HeadingOrder',
description: 'The heading structure is not logically nested. This [Node name, eg. h2] element appears to be the primary document heading, so should be an h1 element.'
},
{
name: 'Section508.D.HeadingOrder',
description: 'The heading structure is not logically nested. This [Node name, eg. h4] element should be an [Expected heading node name, eg. h2] to be properly nested.'
},
{
name: 'Section508.G.TableHeaders',
description: 'This table has no headers. If this is a data table, ensure row and column headers are identified using th elements.'
},
{
name: 'Section508.H.IncorrectHeadersAttr',
description: 'Incorrect headers attribute on this td element. Expected "[Expected list of IDs]" but found "[Actual list of IDs]".'
},
{
name: 'Section508.H.MissingHeadersAttrs',
description: 'The relationship between td elements and their associated th elements is not defined. As this table has multiple levels of th elements, you must use the headers attribute on td elements.'
},
{
name: 'Section508.H.MissingHeaderIds',
description: 'Not all th elements in this table contain an id attribute. These cells should contain ids so that they may be referenced by td elements headers attributes.\''
},
{
name: 'Section508.H.IncompleteHeadersAttrs',
description: 'Not all td elements in this table contain a headers attribute. Each headers attribute should list the ids of all th elements associated with that cell.'
},
{
name: 'Section508.I.Frames',
description: 'This [Node Name] element is missing title text. Frames should be titled with text that facilitates frame identification and navigation.'
},
{
name: 'Section508.J.Flicker',
description: 'Check that no component of the content flickers at a rate of greater than 2 and less than 55 times per second.'
},
{
name: 'Section508.K.AltVersion',
description: 'If this page cannot be made compliant, a text-only page with equivalent information or functionality should be provided. The alternative page needs to be updated in line with this page\'s content.'
},
{
name: 'Section508.L.EmptyAnchorNoId',
description: 'Anchor element found with no link content and no name and/or ID attribute.'
},
{
name: 'Section508.L.PlaceholderAnchor',
description: 'Anchor element found with link content, but no href, ID or name attribute has been supplied.'
},
{
name: 'Section508.L.NoContentAnchor',
description: 'Anchor element found with a valid href attribute, but no link content has been supplied.'
},
{
name: 'Section508.L.DblClick',
description: 'Ensure the functionality provided by double-clicking on this element is available through the keyboard.'
},
{
name: 'Section508.L.MouseOver',
description: 'Ensure the functionality provided by mousing over this element is available through the keyboard; for instance, using the focus event.'
},
{
name: 'Section508.L.MouseOut',
description: 'Ensure the functionality provided by mousing out of this element is available through the keyboard; for instance, using the blur event.'
},
{
name: 'Section508.L.MouseMove',
description: 'Ensure the functionality provided by moving the mouse on this element is available through the keyboard.'
},
{
name: 'Section508.L.MouseDown',
description: 'Ensure the functionality provided by mousing down on this element is available through the keyboard; for instance, using the keydown event.'
},
{
name: 'Section508.L.MouseUp',
description: 'Ensure the functionality provided by mousing up on this element is available through the keyboard; for instance, using the keyup event.'
},
{
name: 'Section508.M.PluginLink',
description: 'If external media requires a plugin or application to view, ensure a link is provided to a plugin or application that complies with Section 508 accessibility requirements for applications.'
},
{
name: 'Section508.N.Errors',
description: 'If an input error is automatically detected in this form, check that the item(s) in error are identified and the error(s) are described to the user in text.'
},
{
name: 'Section508.N.Labels',
description: 'Check that descriptive labels or instructions (including for required fields) are provided for user input in this form.'
},
{
name: 'Section508.N.KeyboardNav',
description: 'Ensure that this form can be navigated using the keyboard and other accessibility tools.'
},
{
name: 'Section508.O.SkipLinks',
description: 'Ensure that any common navigation elements can be bypassed; for instance, by use of skip links, header elements, or ARIA landmark roles.'
},
{
name: 'Section508.O.NoSuchID',
description: 'This link points to a named anchor [ID] within the document, but no anchor exists with that name.'
},
{
name: 'Section508.O.NoSuchIDFragment',
description: 'This link points to a named anchor [ID] within the document, but no anchor exists with that name in the fragment tested.'
},
{
name: 'Section508.P.TimeLimit',
description: 'If a timed response is required on this page, alert the user and provide sufficient time to allow them to indicate that more time is required.'
},
{
name: 'Section508.P.MetaRedirect',
description: 'Meta refresh tag used to redirect to another page, with a time limit that is not zero. Users cannot control this time limit.'
},
{
name: 'Section508.P.MetaRefresh',
description: 'Meta refresh tag used to refresh the current page. Users cannot control the time limit for this refresh.'
}
]
},
{ {
title: 'WCAG2A', title: 'WCAG2A',
rules: [ rules: [
@@ -516,6 +307,10 @@ function getStandards() {
name: 'WCAG2A.Principle2.Guideline2_1.2_1_2.F10', name: 'WCAG2A.Principle2.Guideline2_1.2_1_2.F10',
description: 'Check that this applet or plugin provides the ability to move the focus away from itself when using the keyboard.' description: 'Check that this applet or plugin provides the ability to move the focus away from itself when using the keyboard.'
}, },
{
name: 'WCAG2A.1.Principle1.Guideline2_1.2_1_4.Check',
description: 'Check that if a keyboard shortcut is implemented in content using only letter (including upper- and lower-case letters), punctuation, number, or symbol characters, then at least one of the following is true: \nTurn off: A mechanism is available to turn the shortcut off;\nRemap: A mechanism is available to remap the shortcut to use one or more non- printable keyboard characters(e.g.Ctrl, Alt, etc);\nActive only on focus: The keyboard shortcut for a user interface component is only active when that component has focus.'
},
{ {
name: 'WCAG2A.Principle2.Guideline2_2.2_2_1.F40.2', name: 'WCAG2A.Principle2.Guideline2_2.2_2_1.F40.2',
description: 'Meta refresh tag used to redirect to another page, with a time limit that is not zero. Users cannot control this time limit.' description: 'Meta refresh tag used to redirect to another page, with a time limit that is not zero. Users cannot control this time limit.'
@@ -536,6 +331,10 @@ function getStandards() {
name: 'WCAG2A.Principle2.Guideline2_2.2_2_2.F47', name: 'WCAG2A.Principle2.Guideline2_2.2_2_2.F47',
description: 'Blink elements cannot satisfy the requirement that blinking information can be stopped within five seconds.' description: 'Blink elements cannot satisfy the requirement that blinking information can be stopped within five seconds.'
}, },
{
name: 'WCAG2A.Principle1.Guideline2_2.2_2_6.Check',
description: 'Check that users are warned of the duration of any user inactivity that could cause data loss, unless the data is preserved for more than 20 hours when the user does not take any actions.'
},
{ {
name: 'WCAG2A.Principle2.Guideline2_3.2_3_1.G19,G176', name: 'WCAG2A.Principle2.Guideline2_3.2_3_1.G19,G176',
description: 'Check that no component of the content flashes more than three times in any 1-second period, or that the size of any flashing area is sufficiently small.' description: 'Check that no component of the content flashes more than three times in any 1-second period, or that the size of any flashing area is sufficiently small.'
@@ -584,6 +383,38 @@ function getStandards() {
name: 'WCAG2A.Principle2.Guideline2_4.2_4_4.H77,H78,H79,H80,H81', name: 'WCAG2A.Principle2.Guideline2_4.2_4_4.H77,H78,H79,H80,H81',
description: 'Check that the link text combined with programmatically determined link context identifies the purpose of the link.' description: 'Check that the link text combined with programmatically determined link context identifies the purpose of the link.'
}, },
{
name: 'WCAG2A.Principle1.Guideline2_5.2_5_1.Check',
description: 'Check that all functionality that uses multipoint or path-based gestures for operation can be operated with a single pointer without a path-based gesture, unless a multipoint or path-based gesture is essential.'
},
{
name: 'WCAG2A.Principle1.Guideline2_5.2_5_2.SinglePointer_Check',
description: 'Check that for functionality that can be operated using a single pointer, at least one of the following is true: \nNo Down- Event: The down - event of the pointer is not used to execute any part of the function; \nAbort or Undo: Completion of the function is on the up - event, and a mechanism is available to abort the function before completion or to undo the function after completion; \nUp Reversal: The up - event reverses any outcome of the preceding down - event; \nEssential: Completing the function on the down - event is essential.'
},
{
name: 'WCAG2A.Principle1.Guideline2_5.2_5_2.Mousedown_Check',
description: 'This element has an mousedown event listener. Check that for functionality that can be operated using a single pointer, at least one of the following is true: \nNo Down- Event: The down - event of the pointer is not used to execute any part of the function; \nAbort or Undo: Completion of the function is on the up - event, and a mechanism is available to abort the function before completion or to undo the function after completion; \nUp Reversal: The up - event reverses any outcome of the preceding down - event; \nEssential: Completing the function on the down - event is essential.'
},
{
name: 'WCAG2A.Principle1.Guideline2_5.2_5_2.Touchstart_Check',
description: 'This element has a touchstart event listener. Check that for functionality that can be operated using a single pointer, at least one of the following is true: \nNo Down- Event: The down - event of the pointer is not used to execute any part of the function; \nAbort or Undo: Completion of the function is on the up - event, and a mechanism is available to abort the function before completion or to undo the function after completion; \nUp Reversal: The up - event reverses any outcome of the preceding down - event; \nEssential: Completing the function on the down - event is essential.'
},
{
name: 'WCAG2A.Principle1.Guideline2_5.2_5_3_F96.Check',
description: 'Check that for user interface components with labels that include text or images of text, the name contains the text that is presented visually.'
},
{
name: 'WCAG2A.Principle1.Guideline2_5.2_5_3_F96.AccessibleName',
description: 'Accessible name for this element does not contain the visible label text. Check that for user interface components with labels that include text or images of text, the name contains the text that is presented visually.'
},
{
name: 'WCAG2A.Principle1.Guideline2_5.2_5_4.Check',
description: 'Check that functionality that can be operated by device motion or user motion can also be operated by user interface components and responding to the motion can be disabled to prevent accidental actuation, except when: \nSupported Interface: The motion is used to operate functionality through an accessibility supported interface; \nEssential: The motion is essential for the function and doing so would invalidate the activity.'
},
{
name: 'WCAG2A.Principle1.Guideline2_5.2_5_4.Devicemotion',
description: 'This element has a devicemotion event listener. Check that functionality that can be operated by device motion or user motion can also be operated by user interface components and responding to the motion can be disabled to prevent accidental actuation, except when: \nSupported Interface: The motion is used to operate functionality through an accessibility supported interface; \nEssential: The motion is essential for the function and doing so would invalidate the activity.'
},
{ {
name: 'WCAG2A.Principle3.Guideline3_1.3_1_1.H57.2', name: 'WCAG2A.Principle3.Guideline3_1.3_1_1.H57.2',
description: 'The html element should have a lang or xml:lang attribute which describes the language of the document.' description: 'The html element should have a lang or xml:lang attribute which describes the language of the document.'
@@ -901,6 +732,54 @@ function getStandards() {
name: 'WCAG2AA.Principle1.Guideline1_3.1_3_3.G96', name: 'WCAG2AA.Principle1.Guideline1_3.1_3_3.G96',
description: 'Where instructions are provided for understanding the content, do not rely on sensory characteristics alone (such as shape, size or location) to describe objects.' description: 'Where instructions are provided for understanding the content, do not rely on sensory characteristics alone (such as shape, size or location) to describe objects.'
}, },
{
name: 'WCAG2AA.Principle1.Guideline1_3.1_3_4.RestrictView',
description: 'Check that content does not restrict its view and operation to a single display orientation, such as portrait or landscape, unless a specific display orientation is essential.'
},
{
name: 'WCAG2AA.Principle1.Guideline1_3.1_3_5_H98.FaultyValue',
description: 'This element contains a potentially faulty value in its autocomplete attribute.'
},
{
name: 'WCAG2AA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Text',
description: 'Invalid autocomplete value. Element does not belong to Text control group.'
},
{
name: 'WCAG2AA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Multiline',
description: 'Invalid autocomplete value. Element does not belong to Multiline control group.'
},
{
name: 'WCAG2AA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Password',
description: 'Invalid autocomplete value. Element does not belong to Password control group.'
},
{
name: 'WCAG2AA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Url',
description: 'Invalid autocomplete value. Element does not belong to Url control group.'
},
{
name: 'WCAG2AA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Telephone',
description: 'Invalid autocomplete value. Element does not belong to Telephone control group.'
},
{
name: 'WCAG2AA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Numeric',
description: 'Invalid autocomplete value. Element does not belong to Numeric control group.'
},
{
name: 'WCAG2AA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Month',
description: 'Invalid autocomplete value. Element does not belong to Month control group.'
},
{
name: 'WCAG2AA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Date',
description: 'Invalid autocomplete value. Element does not belong to Date control group.'
},
{
name: 'WCAG2AA.Principle1.Guideline1_3.1_3_5_H98.Purpose',
description: 'Check that the input field serves a purpose identified in the Input Purposes for User Interface Components section; and that the content is implemented using technologies with support for identifying the expected meaning for form input data.'
},
{
name: 'WCAG2AA.Principle1.Guideline1_3.1_3_5_H98.MissingAutocomplete',
description: 'This element does not have an autocomplete attribute. If this field collects information about the user, consider adding one to comply with this Success Criterion.'
},
{ {
name: 'WCAG2AA.Principle1.Guideline1_4.1_4_1.G14,G182', name: 'WCAG2AA.Principle1.Guideline1_4.1_4_1.G14,G182',
description: 'Check that any information conveyed using colour alone is also available in text, or through other visual cues.' description: 'Check that any information conveyed using colour alone is also available in text, or through other visual cues.'
@@ -922,7 +801,7 @@ function getStandards() {
description: 'This element\'s text is placed on a background image. Ensure the contrast ratio between the text and all covered parts of the image are at least 4.5:1.' description: 'This element\'s text is placed on a background image. Ensure the contrast ratio between the text and all covered parts of the image are at least 4.5:1.'
}, },
{ {
name: 'WCAG2AA.Principle1.Guideline1_4.1_4_3.G145', name: 'WCAG2AA.Principle1.Guideline1_4.1_4_3.G1451',
description: 'This element\'s text is placed on a background image. Ensure the contrast ratio between the text and all covered parts of the image are at least 3:1.' description: 'This element\'s text is placed on a background image. Ensure the contrast ratio between the text and all covered parts of the image are at least 3:1.'
}, },
{ {
@@ -941,6 +820,30 @@ function getStandards() {
name: 'WCAG2AA.Principle1.Guideline1_4.1_4_5.G140,C22,C30.AALevel', name: 'WCAG2AA.Principle1.Guideline1_4.1_4_5.G140,C22,C30.AALevel',
description: 'If the technologies being used can achieve the visual presentation, check that text is used to convey information rather than images of text, except when the image of text is essential to the information being conveyed, or can be visually customised to the user\'s requirements.' description: 'If the technologies being used can achieve the visual presentation, check that text is used to convey information rather than images of text, except when the image of text is essential to the information being conveyed, or can be visually customised to the user\'s requirements.'
}, },
{
name: 'WCAG2AA.Principle1.Guideline1_4.1_4_10_C32,C31,C33,C38,SCR34,G206.Check',
description: 'Check that content can be presented without loss of information or functionality, and without requiring scrolling in two dimensions for: \nVertical scrolling content at a width equivalent to 320 CSS pixels;\\n Horizontal scrolling content at a height equivalent to 256 CSS pixels; \nExcept for parts of the content which require two-dimensional layout for usage or meaning.'
},
{
name: 'WCAG2AA.Principle1.Guideline1_4.1_4_10_C32,C31,C33,C38,SCR34,G206.Fixed',
description: 'Principle1.Guideline1_4.1_4_10_C32,C31,C33,C38,SCR34,G206.Scrolling'
},
{
name: 'WCAG2AA.Principle1.Guideline1_4.1_4_10_C32,C31,C33,C38,SCR34,G206.Zoom',
description: 'Interfering with a user agents ability to zoom may be a failure of this Success Criterion.'
},
{
name: 'WCAG2AA.Principle1.Guideline1_4.1_4_11_G195,G207,G18,G145,G174,F78.Check',
description: 'Check that the visual presentation of the following have a contrast ratio of at least 3:1 against adjacent color(s): \nUser Interface Components: Visual information required to identify user interface components and states, except for inactive components or where the appearance of the component is determined by the user agent and not modified by the author; \nGraphical Objects: Parts of graphics required to understand the content, except when a particular presentation of graphics is essential to the information being conveyed.'
},
{
name: 'WCAG2AA.Principle1.Guideline1_4.1_4_12_C36,C35.Check',
description: 'Check that no loss of content or functionality occurs by setting all of the following and by changing no other style property: \nLine height(line spacing) to at least 1.5 times the font size; \nSpacing following paragraphs to at least 2 times the font size; \nLetter spacing(tracking) to at least 0.12 times the font size; \nWord spacing to at least 0.16 times the font size'
},
{
name: 'WCAG2AA.Principle1.Guideline1_4.1_4_13_F95.Check',
description: 'Check that where receiving and then removing pointer hover or keyboard focus triggers additional content to become visible and then hidden, the following are true: \nDismissable: A mechanism is available to dismiss the additional content without moving pointer hover or keyboard focus, unless the additional content communicates an input error or does not obscure or replace other content; \nHoverable: If pointer hover can trigger the additional content, then the pointer can be moved over the additional content without the additional content disappearing; \nPersistent: The additional content remains visible until the hover or focus trigger is removed, the user dismisses it, or its information is no longer valid.'
},
{ {
name: 'WCAG2AA.Principle2.Guideline2_1.2_1_1.SCR20.DblClick', name: 'WCAG2AA.Principle2.Guideline2_1.2_1_1.SCR20.DblClick',
description: 'Ensure the functionality provided by double-clicking on this element is available through the keyboard.' description: 'Ensure the functionality provided by double-clicking on this element is available through the keyboard.'
@@ -969,6 +872,10 @@ function getStandards() {
name: 'WCAG2AA.Principle2.Guideline2_1.2_1_2.F10', name: 'WCAG2AA.Principle2.Guideline2_1.2_1_2.F10',
description: 'Check that this applet or plugin provides the ability to move the focus away from itself when using the keyboard.' description: 'Check that this applet or plugin provides the ability to move the focus away from itself when using the keyboard.'
}, },
{
name: 'WCAG2AA.Principle1.Guideline2_1.2_1_4.Check',
description: 'Check that if a keyboard shortcut is implemented in content using only letter (including upper- and lower-case letters), punctuation, number, or symbol characters, then at least one of the following is true: \nTurn off: A mechanism is available to turn the shortcut off; \nRemap: A mechanism is available to remap the shortcut to use one or more non- printable keyboard characters(e.g.Ctrl, Alt, etc); \nActive only on focus: The keyboard shortcut for a user interface component is only active when that component has focus.'
},
{ {
name: 'WCAG2AA.Principle2.Guideline2_2.2_2_1.F40.2', name: 'WCAG2AA.Principle2.Guideline2_2.2_2_1.F40.2',
description: 'Meta refresh tag used to redirect to another page, with a time limit that is not zero. Users cannot control this time limit.' description: 'Meta refresh tag used to redirect to another page, with a time limit that is not zero. Users cannot control this time limit.'
@@ -989,6 +896,10 @@ function getStandards() {
name: 'WCAG2AA.Principle2.Guideline2_2.2_2_2.F47', name: 'WCAG2AA.Principle2.Guideline2_2.2_2_2.F47',
description: 'Blink elements cannot satisfy the requirement that blinking information can be stopped within five seconds.' description: 'Blink elements cannot satisfy the requirement that blinking information can be stopped within five seconds.'
}, },
{
name: 'WCAG2AA.Principle1.Guideline2_2.2_2_6.Check',
description: 'Check that users are warned of the duration of any user inactivity that could cause data loss, unless the data is preserved for more than 20 hours when the user does not take any actions.'
},
{ {
name: 'WCAG2AA.Principle2.Guideline2_3.2_3_1.G19,G176', name: 'WCAG2AA.Principle2.Guideline2_3.2_3_1.G19,G176',
description: 'Check that no component of the content flashes more than three times in any 1-second period, or that the size of any flashing area is sufficiently small.' description: 'Check that no component of the content flashes more than three times in any 1-second period, or that the size of any flashing area is sufficiently small.'
@@ -1049,6 +960,38 @@ function getStandards() {
name: 'WCAG2AA.Principle2.Guideline2_4.2_4_7.G149,G165,G195,C15,SCR31', name: 'WCAG2AA.Principle2.Guideline2_4.2_4_7.G149,G165,G195,C15,SCR31',
description: 'Check that there is at least one mode of operation where the keyboard focus indicator can be visually located on user interface controls.' description: 'Check that there is at least one mode of operation where the keyboard focus indicator can be visually located on user interface controls.'
}, },
{
name: 'WCAG2AA.Principle1.Guideline2_5.2_5_1.Check',
description: 'Check that all functionality that uses multipoint or path-based gestures for operation can be operated with a single pointer without a path-based gesture, unless a multipoint or path-based gesture is essential.'
},
{
name: 'WCAG2AA.Principle1.Guideline2_5.2_5_2.SinglePointer_Check',
description: 'Check that for functionality that can be operated using a single pointer, at least one of the following is true: \nNo Down- Event: The down - event of the pointer is not used to execute any part of the function; \nAbort or Undo: Completion of the function is on the up - event, and a mechanism is available to abort the function before completion or to undo the function after completion; \nUp Reversal: The up - event reverses any outcome of the preceding down - event; \nEssential: Completing the function on the down - event is essential.'
},
{
name: 'WCAG2AA.Principle1.Guideline2_5.2_5_2.Mousedown_Check',
description: 'This element has an mousedown event listener. Check that for functionality that can be operated using a single pointer, at least one of the following is true: \nNo Down- Event: The down - event of the pointer is not used to execute any part of the function; \nAbort or Undo: Completion of the function is on the up - event, and a mechanism is available to abort the function before completion or to undo the function after completion; \nUp Reversal: The up - event reverses any outcome of the preceding down - event; \nEssential: Completing the function on the down - event is essential.'
},
{
name: 'WCAG2AA.Principle1.Guideline2_5.2_5_2.Touchstart_Check',
description: 'This element has a touchstart event listener. Check that for functionality that can be operated using a single pointer, at least one of the following is true: \nNo Down- Event: The down - event of the pointer is not used to execute any part of the function; \nAbort or Undo: Completion of the function is on the up - event, and a mechanism is available to abort the function before completion or to undo the function after completion; \nUp Reversal: The up - event reverses any outcome of the preceding down - event; \nEssential: Completing the function on the down - event is essential.'
},
{
name: 'WCAG2AA.Principle1.Guideline2_5.2_5_3_F96.Check',
description: 'Check that for user interface components with labels that include text or images of text, the name contains the text that is presented visually.'
},
{
name: 'WCAG2AA.Principle1.Guideline2_5.2_5_3_F96.AccessibleName',
description: 'Accessible name for this element does not contain the visible label text. Check that for user interface components with labels that include text or images of text, the name contains the text that is presented visually.'
},
{
name: 'WCAG2AA.Principle1.Guideline2_5.2_5_4.Check',
description: 'Check that functionality that can be operated by device motion or user motion can also be operated by user interface components and responding to the motion can be disabled to prevent accidental actuation, except when: \nSupported Interface: The motion is used to operate functionality through an accessibility supported interface; \nEssential: The motion is essential for the function and doing so would invalidate the activity.'
},
{
name: 'WCAG2AA.Principle1.Guideline2_5.2_5_4.Devicemotion',
description: 'WCAG2AA.This element has a devicemotion event listener. Check that functionality that can be operated by device motion or user motion can also be operated by user interface components and responding to the motion can be disabled to prevent accidental actuation, except when: \nSupported Interface: The motion is used to operate functionality through an accessibility supported interface; \nEssential: The motion is essential for the function and doing so would invalidate the activity.'
},
{ {
name: 'WCAG2AA.Principle3.Guideline3_1.3_1_1.H57.2', name: 'WCAG2AA.Principle3.Guideline3_1.3_1_1.H57.2',
description: 'The html element should have a lang or xml:lang attribute which describes the language of the document.' description: 'The html element should have a lang or xml:lang attribute which describes the language of the document.'
@@ -1140,6 +1083,10 @@ function getStandards() {
{ {
name: 'WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.[NodeName].Value', name: 'WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.[NodeName].Value',
description: 'This [element type] does not have a value available to an accessibility API. Add one [using a element-specific method].' description: 'This [element type] does not have a value available to an accessibility API. Add one [using a element-specific method].'
},
{
name: 'WCAG2AA.Principle1.Guideline4_1.4_1_3_ARIA22,G199,ARIA19,G83,G84,G85,G139,G177,G194,ARIA23.Check',
description: 'Check that status messages can be programmatically determined through role or properties such that they can be presented to the user by assistive technologies without receiving focus.'
} }
] ]
}, },
@@ -1410,6 +1357,58 @@ function getStandards() {
name: 'WCAG2AAA.Principle1.Guideline1_3.1_3_3.G96', name: 'WCAG2AAA.Principle1.Guideline1_3.1_3_3.G96',
description: 'Where instructions are provided for understanding the content, do not rely on sensory characteristics alone (such as shape, size or location) to describe objects.' description: 'Where instructions are provided for understanding the content, do not rely on sensory characteristics alone (such as shape, size or location) to describe objects.'
}, },
{
name: 'WCAG2AAA.Principle1.Guideline1_3.1_3_4.RestrictView',
description: 'Check that content does not restrict its view and operation to a single display orientation, such as portrait or landscape, unless a specific display orientation is essential.'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_3.1_3_5_H98.FaultyValue',
description: 'This element contains a potentially faulty value in its autocomplete attribute.'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Text',
description: 'Invalid autocomplete value. Element does not belong to Text control group.'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Multiline',
description: 'Invalid autocomplete value. Element does not belong to Multiline control group.'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Password',
description: 'Invalid autocomplete value. Element does not belong to Password control group.'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Url',
description: 'Invalid autocomplete value. Element does not belong to Url control group.'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Telephone',
description: 'Invalid autocomplete value. Element does not belong to Telephone control group.'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Numeric',
description: 'Invalid autocomplete value. Element does not belong to Numeric control group.'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Month',
description: 'Invalid autocomplete value. Element does not belong to Month control group.'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_3.1_3_5_H98.InvalidAutocomplete_Date',
description: 'Invalid autocomplete value. Element does not belong to Date control group.'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_3.1_3_5_H98.Purpose',
description: 'Check that the input field serves a purpose identified in the Input Purposes for User Interface Components section; and that the content is implemented using technologies with support for identifying the expected meaning for form input data.'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_3.1_3_5_H98.MissingAutocomplete',
description: 'This element does not have an autocomplete attribute. If this field collects information about the user, consider adding one to comply with this Success Criterion.'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_3.1_3_6_ARIA11.Check',
description: 'Check that the purpose of User Interface Components, icons, and regions can be programmatically determined.'
},
{ {
name: 'WCAG2AAA.Principle1.Guideline1_4.1_4_1.G14,G182', name: 'WCAG2AAA.Principle1.Guideline1_4.1_4_1.G14,G182',
description: 'Check that any information conveyed using colour alone is also available in text, or through other visual cues.' description: 'Check that any information conveyed using colour alone is also available in text, or through other visual cues.'
@@ -1427,11 +1426,11 @@ function getStandards() {
description: 'This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of /{value/}. Recommendation: /{colour recommendations/}.' description: 'This element has insufficient contrast at this conformance level. Expected a contrast ratio of at least 4.5:1, but text in this element has a contrast ratio of /{value/}. Recommendation: /{colour recommendations/}.'
}, },
{ {
name: 'WCAG2AAA.Principle1.Guideline1_4.1_4_6.G17', name: 'WCAG2AAA.Principle1.Guideline1_4.1_4_6.G17-1',
description: 'This element\'s text is placed on a background image. Ensure the contrast ratio between the text and all covered parts of the image are at least 7:1.' description: 'This element\'s text is placed on a background image. Ensure the contrast ratio between the text and all covered parts of the image are at least 7:1.'
}, },
{ {
name: 'WCAG2AAA.Principle1.Guideline1_4.1_4_6.G18', name: 'WCAG2AAA.Principle1.Guideline1_4.1_4_6.G18-1',
description: 'This element\'s text is placed on a background image. Ensure the contrast ratio between the text and all covered parts of the image are at least 4.5:1.' description: 'This element\'s text is placed on a background image. Ensure the contrast ratio between the text and all covered parts of the image are at least 4.5:1.'
}, },
{ {
@@ -1462,6 +1461,34 @@ function getStandards() {
name: 'WCAG2AAA.Principle1.Guideline1_4.1_4_9.G140,C22,C30.NoException', name: 'WCAG2AAA.Principle1.Guideline1_4.1_4_9.G140,C22,C30.NoException',
description: 'Check that images of text are only used for pure decoration or where a particular presentation of text is essential to the information being conveyed.' description: 'Check that images of text are only used for pure decoration or where a particular presentation of text is essential to the information being conveyed.'
}, },
{
name: 'WCAG2AAA.Principle1.Guideline1_4.1_4_10_C32,C31,C33,C38,SCR34,G206.Check',
description: 'Check that content can be presented without loss of information or functionality, and without requiring scrolling in two dimensions for: \nVertical scrolling content at a width equivalent to 320 CSS pixels;\\n Horizontal scrolling content at a height equivalent to 256 CSS pixels; \nExcept for parts of the content which require two-dimensional layout for usage or meaning.'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_4.1_4_10_C32,C31,C33,C38,SCR34,G206.Fixed',
description: 'Principle1.Guideline1_4.1_4_10_C32,C31,C33,C38,SCR34,G206.Scrolling'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_4.1_4_10_C32,C31,C33,C38,SCR34,G206.Zoom',
description: 'Interfering with a user agents ability to zoom may be a failure of this Success Criterion.'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_4.1_4_11_G195,G207,G18,G145,G174,F78.Check',
description: 'Check that the visual presentation of the following have a contrast ratio of at least 3:1 against adjacent color(s): \nUser Interface Components: Visual information required to identify user interface components and states, except for inactive components or where the appearance of the component is determined by the user agent and not modified by the author; \nGraphical Objects: Parts of graphics required to understand the content, except when a particular presentation of graphics is essential to the information being conveyed.'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_4.1_4_12_C36,C35.Check',
description: 'Check that no loss of content or functionality occurs by setting all of the following and by changing no other style property: \nLine height(line spacing) to at least 1.5 times the font size; \nSpacing following paragraphs to at least 2 times the font size; \nLetter spacing(tracking) to at least 0.12 times the font size; \nWord spacing to at least 0.16 times the font size'
},
{
name: 'WCAG2AAA.Principle1.Guideline1_4.1_4_13_F95.Check',
description: 'Check that where receiving and then removing pointer hover or keyboard focus triggers additional content to become visible and then hidden, the following are true: \nDismissable: A mechanism is available to dismiss the additional content without moving pointer hover or keyboard focus, unless the additional content communicates an input error or does not obscure or replace other content; \nHoverable: If pointer hover can trigger the additional content, then the pointer can be moved over the additional content without the additional content disappearing; \nPersistent: The additional content remains visible until the hover or focus trigger is removed, the user dismisses it, or its information is no longer valid.'
},
{
name: 'WCAG2AAA.Principle1.Guideline2_1.2_1_4.Check',
description: 'Check that if a keyboard shortcut is implemented in content using only letter (including upper- and lower-case letters), punctuation, number, or symbol characters, then at least one of the following is true: \nTurn off: A mechanism is available to turn the shortcut off; \nRemap: A mechanism is available to remap the shortcut to use one or more non- printable keyboard characters(e.g.Ctrl, Alt, etc); \nActive only on focus: The keyboard shortcut for a user interface component is only active when that component has focus.'
},
{ {
name: 'WCAG2AAA.Principle2.Guideline2_1.2_1_1.SCR20.DblClick', name: 'WCAG2AAA.Principle2.Guideline2_1.2_1_1.SCR20.DblClick',
description: 'Ensure the functionality provided by double-clicking on this element is available through the keyboard.' description: 'Ensure the functionality provided by double-clicking on this element is available through the keyboard.'
@@ -1522,10 +1549,58 @@ function getStandards() {
name: 'WCAG2AAA.Principle2.Guideline2_2.2_2_5.G105,G181', name: 'WCAG2AAA.Principle2.Guideline2_2.2_2_5.G105,G181',
description: 'If this Web page is part of a set of Web pages with an inactivity time limit, check that an authenticated user can continue the activity without loss of data after re-authenticating.' description: 'If this Web page is part of a set of Web pages with an inactivity time limit, check that an authenticated user can continue the activity without loss of data after re-authenticating.'
}, },
{
name: 'WCAG2AAA.Principle1.Guideline2_2.2_2_6.Check',
description: 'Check that users are warned of the duration of any user inactivity that could cause data loss, unless the data is preserved for more than 20 hours when the user does not take any actions.'
},
{ {
name: 'WCAG2AAA.Principle2.Guideline2_3.2_3_2.G19', name: 'WCAG2AAA.Principle2.Guideline2_3.2_3_2.G19',
description: 'Check that no component of the content flashes more than three times in any 1-second period.' description: 'Check that no component of the content flashes more than three times in any 1-second period.'
}, },
{
name: 'WCAG2AAA.Principle1.Guideline2_3.2_3_3.Check',
description: 'Check that motion animation triggered by interaction can be disabled, unless the animation is essential to the functionality or the information being conveyed.'
},
{
name: 'WCAG2AAA.Principle1.Guideline2_5.2_5_1.Check',
description: 'Check that all functionality that uses multipoint or path-based gestures for operation can be operated with a single pointer without a path-based gesture, unless a multipoint or path-based gesture is essential.'
},
{
name: 'WCAG2AAA.Principle1.Guideline2_5.2_5_2.SinglePointer_Check',
description: 'Check that for functionality that can be operated using a single pointer, at least one of the following is true: \nNo Down- Event: The down - event of the pointer is not used to execute any part of the function; \nAbort or Undo: Completion of the function is on the up - event, and a mechanism is available to abort the function before completion or to undo the function after completion; \nUp Reversal: The up - event reverses any outcome of the preceding down - event; \nEssential: Completing the function on the down - event is essential.'
},
{
name: 'WCAG2AAA.Principle1.Guideline2_5.2_5_2.Mousedown_Check',
description: 'This element has an mousedown event listener. Check that for functionality that can be operated using a single pointer, at least one of the following is true: \nNo Down- Event: The down - event of the pointer is not used to execute any part of the function; \nAbort or Undo: Completion of the function is on the up - event, and a mechanism is available to abort the function before completion or to undo the function after completion; \nUp Reversal: The up - event reverses any outcome of the preceding down - event; \nEssential: Completing the function on the down - event is essential.'
},
{
name: 'WCAG2AAA.Principle1.Guideline2_5.2_5_2.Touchstart_Check',
description: 'This element has a touchstart event listener. Check that for functionality that can be operated using a single pointer, at least one of the following is true: \nNo Down- Event: The down - event of the pointer is not used to execute any part of the function; \nAbort or Undo: Completion of the function is on the up - event, and a mechanism is available to abort the function before completion or to undo the function after completion; \nUp Reversal: The up - event reverses any outcome of the preceding down - event; \nEssential: Completing the function on the down - event is essential.'
},
{
name: 'WCAG2AAA.Principle1.Guideline2_5.2_5_3_F96.Check',
description: 'Check that for user interface components with labels that include text or images of text, the name contains the text that is presented visually.'
},
{
name: 'WCAG2AAA.Principle1.Guideline2_5.2_5_3_F96.AccessibleName',
description: 'Accessible name for this element does not contain the visible label text. Check that for user interface components with labels that include text or images of text, the name contains the text that is presented visually.'
},
{
name: 'WCAG2AAA.Principle1.Guideline2_5.2_5_4.Check',
description: 'Check that functionality that can be operated by device motion or user motion can also be operated by user interface components and responding to the motion can be disabled to prevent accidental actuation, except when: \nSupported Interface: The motion is used to operate functionality through an accessibility supported interface; \nEssential: The motion is essential for the function and doing so would invalidate the activity.'
},
{
name: 'WCAG2AAA.Principle1.Guideline2_5.2_5_4.Devicemotion',
description: 'WCAG2AA.This element has a devicemotion event listener. Check that functionality that can be operated by device motion or user motion can also be operated by user interface components and responding to the motion can be disabled to prevent accidental actuation, except when: \nSupported Interface: The motion is used to operate functionality through an accessibility supported interface; \nEssential: The motion is essential for the function and doing so would invalidate the activity.'
},
{
name: 'WCAG2AAA.Principle1.Guideline2_5.2_5_5.Check',
description: 'Check that the size of the target for pointer inputs is at least 44 by 44 CSS pixels except when:\nEquivalent: The target is available through an equivalent link or control on the same page that is at least 44 by 44 CSS pixels;\nInline: The target is in a sentence or block of text;\nUser Agent Control: The size of the target is determined by the user agent and is not modified by the author;\nEssential: A particular presentation of the target is essential to the information being conveyed.'
},
{
name: 'WCAG2AAA.Principle1.Guideline2_5.2_5_6.Check',
description: 'Check that the content does not restrict use of input modalities available on a platform except where the restriction is essential, required to ensure the security of the content, or required to respect user settings.'
},
{ {
name: 'WCAG2AAA.Principle2.Guideline2_4.2_4_1.H64.1', name: 'WCAG2AAA.Principle2.Guideline2_4.2_4_1.H64.1',
description: 'Iframe element requires a non-empty title attribute that identifies the frame.' description: 'Iframe element requires a non-empty title attribute that identifies the frame.'
@@ -1713,8 +1788,12 @@ function getStandards() {
{ {
name: 'WCAG2AAA.Principle4.Guideline4_1.4_1_2.H91.[NodeName].Value', name: 'WCAG2AAA.Principle4.Guideline4_1.4_1_2.H91.[NodeName].Value',
description: 'This [element type] does not have a value available to an accessibility API. Add one [using a element-specific method].' description: 'This [element type] does not have a value available to an accessibility API. Add one [using a element-specific method].'
},
{
name: 'WCAG2AAA.Principle1.Guideline4_1.4_1_3_ARIA22,G199,ARIA19,G83,G84,G85,G139,G177,G194,ARIA23.Check',
description: 'Check that status messages can be programmatically determined through role or properties such that they can be presented to the user by assistive technologies without receiving focus.'
} }
] ]
} }
]; ];
} };

View File

@@ -12,13 +12,9 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
// jscs:disable maximumLineLength
'use strict'; 'use strict';
module.exports = getTechniques; module.exports = function getTechniques() {
function getTechniques() {
return { return {
H30: { H30: {
title: 'H30: Providing link text that describes the purpose of a link for anchor elements', title: 'H30: Providing link text that describes the purpose of a link for anchor elements',
@@ -603,6 +599,114 @@ function getTechniques() {
H91: { H91: {
title: 'H91: Using HTML form controls and links', title: 'H91: Using HTML form controls and links',
url: 'http://www.w3.org/TR/WCAG20-TECHS/H91' url: 'http://www.w3.org/TR/WCAG20-TECHS/H91'
},
F102: {
title: 'F102: Failure of Success Criterion 1.4.10 due to content disappearing and not being available when content has reflowed',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/failures/F102'
},
F103: {
title: 'F103: Failure of Success Criterion 4.1.3 due to providing status messages that cannot be programmatically determined through role or properties',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/failures/F103'
},
F104: {
title: 'F104: Failure of Success Criterion 1.4.12 due to clipped or overlapped content when text spacing is adjusted',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/failures/F104'
},
F105: {
title: 'F105: Failure of Success Criterion 2.5.1 due to providing functionality via a path- based gesture without simple pointer alternative',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/failures/F105'
},
F106: {
title: 'F106: Failure due to inability to deactivate motion actuation',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/failures/F106'
},
G216: {
title: 'G216: Providing single point activation for a control slider',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/general/G216'
},
G215: {
title: 'G215: Providing controls to achieve the same result as path based or multipoint gestures',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/general/G215'
},
F100: {
title: 'F100: Failure of Success Criterion 1.3.4 due to showing a message asking to reorient device',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/failures/F100'
},
G214: {
title: 'G214: Using a control to allow access to content in different orientations which is otherwise restricted',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/general/G214'
},
C40: {
title: 'C40: Creating a two-color focus indicator to ensure sufficient contrast with all components',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/css/C40'
},
F99: {
title: 'F99: Failure of Success Criterion 2.1.4 due to implementing character key shortcuts that cannot be turned off or remapped',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/failures/F99'
},
SCR39: {
title: 'SCR39: Making content on focus or hover hoverable, dismissible, and persistent',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/client-side-script/SCR39'
},
G212: {
title: 'G212: Using native controls to ensure functionality is triggered on the up-event.',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/general/G212'
},
F98: {
title: 'F98: Failure due to interactions being limited to touch-only on touchscreen devices',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/failures/F98'
},
G213: {
title: 'G213: Provide conventional controls and an application setting for motion activated input',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/general/G213'
},
ARIA24: {
title: 'ARIA24: Semantically identifying a font icon with role="img"',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA24'
},
F97: {
title: 'F97: Failure due to locking the orientation to landscape or portrait view',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/failures/F97'
},
F52: {
title: 'F52: Failure of Success Criterion 3.2.1 and 3.2.5 due to opening a new window as soon as a new page is loaded ',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/failures/F52'
},
G209: {
title: 'G209: Provide sufficient contrast at the boundaries between adjoining colors',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/general/G209'
},
C39: {
title: 'C39: Using the CSS reduce-motion query to prevent motion',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/css/C39'
},
G207: {
title: 'G207: Ensuring that a contrast ratio of 3:1 is provided for icons',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/general/G207'
},
C38: {
title: 'C38: Using CSS width, max-width and flexbox to fit labels and inputs',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/css/C38'
},
C34: {
title: 'C34: Using media queries to un-fixing sticky headers / footers',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/css/C34'
},
C36: {
title: 'C36: Allowing for text spacing override',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/css/C36'
},
C37: {
title: 'C37: Using CSS max-width and height to fit images',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/css/C37'
},
F95: {
title: 'F95: Failure of Success Criterion 1.4.13 due to content shown on hover not being hoverable',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/failures/F95'
},
F96: {
title: 'F96: Failure due to the accessible name not containing the visible label text',
url: 'https://www.w3.org/WAI/WCAG21/Techniques/failures/F96'
} }
}; };
} };

View File

@@ -14,48 +14,56 @@
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
'use strict'; 'use strict';
const chalk = require('chalk'); const initService = require('pa11y-webservice');
const kleur = require('kleur');
const config = require('./config'); const config = require('./config');
const initDashboard = require('./app');
process.on('SIGINT', () => { process.on('SIGINT', () => {
console.log('\nGracefully shutting down from SIGINT (Ctrl-C)'); console.log('\nGracefully shutting down from SIGINT (Ctrl-C)');
process.exit(); process.exit();
}); });
require('./app')(config, (error, app) => { initDashboard(config, (error, app) => {
if (error) { if (error) {
console.error(error.stack); console.error(error.stack);
process.exit(1); process.exit(1);
} }
console.log(''); const mode = process.env.NODE_ENV;
console.log(chalk.underline.magenta('Pa11y Dashboard started')); const dashboardAddress = app.server.address();
console.log(chalk.grey('mode: %s'), process.env.NODE_ENV);
console.log(chalk.grey('uri: %s'), app.address);
app.on('route-error', error => { console.log(kleur.underline().magenta('\nPa11y Dashboard started'));
const stack = (error.stack ? error.stack.split('\n') : [error.message]); console.log(kleur.grey('mode: %s'), mode);
const msg = chalk.red(stack.shift()); console.log(kleur.grey('uri (intended): %s'), `http://localhost:${config.port}/`);
console.log(
kleur.grey(`uri (actual, ${dashboardAddress.family}): %s`),
`http://${dashboardAddress.address}:${dashboardAddress.port}/`
);
app.on('route-error', routeError => {
const stack = (routeError.stack ? routeError.stack.split('\n') : [routeError.message]);
const msg = kleur.red(stack.shift());
console.error(''); console.error('');
console.error(msg); console.error(msg);
console.error(chalk.grey(stack.join('\n'))); console.error(kleur.grey(stack.join('\n')));
}); });
// Start the webservice if required // Start the webservice if required
if (typeof config.webservice === 'object') { if (typeof config.webservice === 'object') {
require('pa11y-webservice')(config.webservice, (error, webservice) => { console.log(kleur.underline().cyan('\nPa11y Webservice starting'));
if (error) { initService(config.webservice, (webserviceError, webservice) => {
console.error(error.stack); if (webserviceError) {
console.error(webserviceError.stack);
process.exit(1); process.exit(1);
} }
console.log(''); console.log(kleur.cyan('\nPa11y Webservice started'));
console.log(chalk.underline.cyan('Pa11y Webservice started')); console.log(kleur.grey('mode: %s'), mode);
console.log(chalk.grey('mode: %s'), process.env.NODE_ENV); console.log(kleur.grey('uri: %s'), webservice.server.info.uri);
console.log(chalk.grey('uri: %s'), webservice.server.info.uri); console.log(kleur.grey('database: %s'), config.webservice.database);
console.log(chalk.grey('database: %s'), config.webservice.database); console.log(kleur.grey('cron: %s'), config.webservice.cron);
console.log(chalk.grey('cron: %s'), config.webservice.cron);
}); });
} }
}); });

8826
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "pa11y-dashboard", "name": "pa11y-dashboard",
"version": "3.0.0", "version": "4.2.0",
"private": true, "private": true,
"description": "Pa11y Dashboard is a visual web interface to the Pa11y accessibility reporter", "description": "Pa11y Dashboard is a visual web interface to the Pa11y accessibility reporter",
"keywords": [ "keywords": [
@@ -15,40 +15,44 @@
], ],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/pa11y/dashboard.git" "url": "https://github.com/pa11y/pa11y-dashboard.git"
}, },
"homepage": "https://github.com/pa11y/dashboard", "homepage": "https://github.com/pa11y/pa11y-dashboard",
"bugs": "https://github.com/pa11y/dashboard/issues", "bugs": "https://github.com/pa11y/pa11y-dashboard/issues",
"license": "GPL-3.0", "license": "GPL-3.0",
"engines": { "engines": {
"node": ">=8", "node": ">=12"
"npm": ">=6"
}, },
"dependencies": { "dependencies": {
"body-parser": "~1.19.0", "body-parser": "~1.19.2",
"chalk": "~2.4.2",
"compression": "~1.7.4", "compression": "~1.7.4",
"express-hbs": "~2.1.2", "express": "~4.19.2",
"express": "~4.17.1", "express-hbs": "~2.4.0",
"http-headers": "~3.0.2", "http-headers": "~3.0.2",
"moment": "~2.24.0", "kleur": "~4.1.4",
"pa11y-webservice-client-node": "~2.0.0", "lodash.groupby": "~4.6.0",
"pa11y-webservice": "~3.0.1", "lodash.keys": "~4.2.0",
"underscore": "~1.9.1" "moment": "~2.29.4",
"morgan": "~1.10.0",
"nanoid": "~3.3.2",
"pa11y-webservice": "^4.3.1",
"pa11y-webservice-client-node": "~3.0.0"
}, },
"devDependencies": { "devDependencies": {
"bower": "^1.8.8", "bower": "^1.8.13",
"cheerio": "^1.0.0-rc.3", "cheerio": "^1.0.0-rc.10",
"eslint": "^6.0.1", "eslint": "^7.27.0",
"less": "^3.9.0", "less": "^3.11.1",
"mocha": "^6.1.4", "mocha": "^10.2.0",
"pa11y-lint-config": "^1.2.1", "node-fetch": "^2.7.0",
"pa11y-lint-config": "^3.0.0",
"proclaim": "^3.6.0", "proclaim": "^3.6.0",
"request": "^2.88.0", "uglify-js": "^3.11.0"
"uglify-js": "^3.6.0"
}, },
"scripts": { "scripts": {
"start": "node index.js", "start": "node index.js",
"test": "make ci" "test": "npm run test:integration",
"test:integration": "mocha 'test/integration/**/*.js' --recursive --timeout 20000 --slow 4000",
"lint": "eslint ."
} }
} }

File diff suppressed because one or more lines are too long

View File

@@ -27,6 +27,8 @@ $(document).ready(function(){
var graphContainer = $('[data-role="graph"]'); var graphContainer = $('[data-role="graph"]');
var dateSelectDropdownMenu = $('[data-role="date-select-dropdown-menu"]'); var dateSelectDropdownMenu = $('[data-role="date-select-dropdown-menu"]');
var legend = graphContainer.parent('.graph-container').find('.dashedLegend'); var legend = graphContainer.parent('.graph-container').find('.dashedLegend');
var list = localStorage.getItem("listview") || ""; // get choice or nothing
var graphOptions = { var graphOptions = {
series: { series: {
@@ -397,4 +399,38 @@ $(document).ready(function(){
$.fn.collapse.Constructor.prototype.keydown $.fn.collapse.Constructor.prototype.keydown
); );
// List View
$('.btn-list').click(function () {
var elements = $("#grid-container .task-card");
for (i = 0; i < elements.length; i++) {
$(elements[i]).removeClass('col-md-4 col-sm-6');
$(elements[i]).addClass('col-md-12');
$(elements[i]).find('.gridview:nth-child(1)').addClass('listview col-md-9 col-sm-8');
$(elements[i]).find('.gridview:nth-child(2)').addClass('listview col-md-3 col-sm-4 task-actions clearfix');
$(elements[i]).find('.gridview').removeClass('gridview');
};
$('.view-btn').removeClass('btn-default')
$(this).addClass('btn-default');
localStorage.setItem("listview", "yes") //save the choice
});
// Grid View
$('.btn-grid').click(function () {
var elements = $("#grid-container .task-card");
for (i = 0; i < elements.length; i++) {
$(elements[i]).removeClass('col-md-12');
$(elements[i]).addClass('col-md-4 col-sm-6');
$(elements[i]).find('.listview').addClass('gridview')
$(elements[i]).find('.listview:nth-child(1)').removeClass('listview col-md-9 col-sm-8');
$(elements[i]).find('.listview:nth-child(2)').removeClass('listview col-md-3 col-sm-4 task-actions clearfix');
};
$('.view-btn').removeClass('btn-default')
$(this).addClass('btn-default')
localStorage.setItem("listview", "") //clears the choice
});
//load the view as per user's choice
if (list === 'yes') {
$('.btn-list').trigger('click');
}
}); });

File diff suppressed because one or more lines are too long

View File

@@ -43,9 +43,9 @@
</ul> </ul>
</div> </div>
</div> </div>
<div class="col-md-9" role="main"> <main class="col-md-9" role="main">
{{ content }} {{ content }}
</div> </main>
</div> </div>
</div> </div>

View File

@@ -68,10 +68,12 @@
function next() { function next() {
$active $active
.removeClass('active') .removeClass('active')
.attr('aria-selected', false)
.find('> .dropdown-menu > .active') .find('> .dropdown-menu > .active')
.removeClass('active') .removeClass('active')
element.addClass('active') element.addClass('active')
element.attr('aria-selected', true)
if (transition) { if (transition) {
element[0].offsetWidth // reflow for transition element[0].offsetWidth // reflow for transition

View File

@@ -32,7 +32,7 @@ $(function () {
$.support.transition = false $.support.transition = false
var alertHTML = '<div class="alert-message warning fade in">' var alertHTML = '<div class="alert-message warning fade in">'
+ '<a class="close" href="#" data-dismiss="alert">×</a>' + '<a class="close" href="#" data-dismiss="alert" aria-label="Close">×</a>'
+ '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>' + '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
+ '</div>' + '</div>'
, alert = $(alertHTML).appendTo('#qunit-fixture').alert() , alert = $(alertHTML).appendTo('#qunit-fixture').alert()

View File

@@ -3,7 +3,7 @@
// Amend the width of container if you want to here // Amend the width of container if you want to here
@container-md-ie8: @container-md; @container-md-ie8: @container-md;
@grid-adjustment: percentage(@grid-gutter-width / @container-md-ie8); @grid-adjustment: percentage((@grid-gutter-width / @container-md-ie8));
.ie7, .ie8 { .ie7, .ie8 {
* { * {

File diff suppressed because it is too large Load Diff

View File

@@ -18,9 +18,9 @@
// ------------------------- // -------------------------
@brand-primary: #2C3E50; @brand-primary: #2C3E50;
@brand-success: #00806F; @brand-success: #006053;
@brand-warning: #A86700; @brand-warning: #b24d04;
@brand-danger: #D83D2D; @brand-danger: #c92a2a;
@brand-info: #177BBE; @brand-info: #177BBE;
// Scaffolding // Scaffolding
@@ -233,7 +233,7 @@
@navbar-default-bg: @brand-primary; @navbar-default-bg: @brand-primary;
@navbar-default-border: darken(@navbar-default-bg, 6.5%); @navbar-default-border: darken(@navbar-default-bg, 6.5%);
@navbar-border-radius: @border-radius-base; @navbar-border-radius: @border-radius-base;
@navbar-padding-horizontal: floor(@grid-gutter-width / 2); // ~15px @navbar-padding-horizontal: floor((@grid-gutter-width / 2)); // ~15px
@navbar-padding-vertical: ((@navbar-height - @line-height-computed) / 2); @navbar-padding-vertical: ((@navbar-height - @line-height-computed) / 2);
// Navbar links // Navbar links

View File

@@ -247,7 +247,7 @@
@navbar-height: 50px; @navbar-height: 50px;
@navbar-margin-bottom: @line-height-computed; @navbar-margin-bottom: @line-height-computed;
@navbar-border-radius: @border-radius-base; @navbar-border-radius: @border-radius-base;
@navbar-padding-horizontal: floor(@grid-gutter-width / 2); @navbar-padding-horizontal: floor((@grid-gutter-width / 2));
@navbar-padding-vertical: ((@navbar-height - @line-height-computed) / 2); @navbar-padding-vertical: ((@navbar-height - @line-height-computed) / 2);
@navbar-default-color: #777; @navbar-default-color: #777;

View File

@@ -16,10 +16,7 @@
const presentTask = require('../view/presenter/task'); const presentTask = require('../view/presenter/task');
module.exports = route; module.exports = function index(app) {
// Route definition
function route(app) {
app.express.get('/', (request, response, next) => { app.express.get('/', (request, response, next) => {
app.webservice.tasks.get({lastres: true}, (error, tasks) => { app.webservice.tasks.get({lastres: true}, (error, tasks) => {
if (error) { if (error) {
@@ -32,4 +29,4 @@ function route(app) {
}); });
}); });
}); });
} };

View File

@@ -1,3 +1,4 @@
/* eslint-disable complexity */
// This file is part of Pa11y Dashboard. // This file is part of Pa11y Dashboard.
// //
// Pa11y Dashboard is free software: you can redistribute it and/or modify // Pa11y Dashboard is free software: you can redistribute it and/or modify
@@ -17,80 +18,80 @@
const getStandards = require('../data/standards'); const getStandards = require('../data/standards');
const httpHeaders = require('http-headers'); const httpHeaders = require('http-headers');
module.exports = route; module.exports = function route(app) {
// Route definition
function route(app) {
app.express.get('/new', (request, response) => { app.express.get('/new', (request, response) => {
const standards = getStandards().map(standard => { const standards = getStandards().map(
if (standard.title === 'WCAG2AA') { standard => {
standard.selected = true; if (standard.title === 'WCAG2AA') {
} standard.selected = true;
return standard; }
}); return standard;
});
response.render('new', { response.render('new', {
standards: standards, standards,
isNewTaskPage: true isNewTaskPage: true
}); });
}); });
app.express.post('/new', (request, response) => { app.express.post('/new', (request, response) => {
const parsedActions = parseActions(request.body.actions);
const parsedHeaders = request.body.headers && httpHeaders(request.body.headers, true);
let parsedActions; const newTask = createNewTask(request, parsedActions, parsedHeaders);
if (request.body.actions) {
parsedActions = request.body.actions.split(/[\r\n]+/)
.map(action => {
return action.trim();
})
.filter(action => {
return Boolean(action);
});
}
let parsedHeaders;
if (request.body.headers) {
parsedHeaders = httpHeaders(request.body.headers, true);
}
const newTask = {
name: request.body.name,
url: request.body.url,
standard: request.body.standard,
ignore: request.body.ignore || [],
timeout: request.body.timeout || undefined,
wait: request.body.wait || undefined,
actions: parsedActions,
username: request.body.username || undefined,
password: request.body.password || undefined,
headers: parsedHeaders,
hideElements: request.body.hideElements || undefined
};
app.webservice.tasks.create(newTask, (error, task) => { app.webservice.tasks.create(newTask, (error, task) => {
if (error) { if (!error) {
const standards = getStandards().map(standard => { return response.redirect(`/${task.id}?added`);
if (standard.title === newTask.standard) {
standard.selected = true;
}
standard.rules = standard.rules.map(rule => {
if (newTask.ignore.indexOf(rule.name) !== -1) {
rule.ignored = true;
}
return rule;
});
return standard;
});
newTask.actions = request.body.actions;
newTask.headers = request.body.headers;
return response.render('new', {
error: error,
standards: standards,
task: newTask
});
} }
response.redirect(`/${task.id}?added`);
const standards = getStandards().map(standard => {
if (standard.title === newTask.standard) {
standard.selected = true;
}
standard.rules = standard.rules.map(rule => {
if (newTask.ignore.indexOf(rule.name) !== -1) {
rule.ignored = true;
}
return rule;
});
return standard;
});
newTask.actions = request.body.actions;
newTask.headers = request.body.headers;
response.render('new', {
error,
standards,
task: newTask
});
}); });
}); });
};
function parseActions(actions) {
if (actions) {
return actions.split(/[\r\n]+/)
.map(action => {
return action.trim();
})
.filter(action => {
return Boolean(action);
});
}
}
function createNewTask({body}, actions, headers) {
return {
name: body.name,
url: body.url,
standard: body.standard,
ignore: body.ignore || [],
timeout: body.timeout || undefined,
wait: body.wait || undefined,
actions,
username: body.username || undefined,
password: body.password || undefined,
headers,
hideElements: body.hideElements || undefined
};
} }

View File

@@ -16,11 +16,7 @@
const moment = require('moment'); const moment = require('moment');
module.exports = route; module.exports = function download(app) {
// Route definition
function route(app) {
function getTaskAndResult(request, response, next) { function getTaskAndResult(request, response, next) {
app.webservice.task(request.params.id).get({}, (error, task) => { app.webservice.task(request.params.id).get({}, (error, task) => {
if (error) { if (error) {
@@ -29,8 +25,8 @@ function route(app) {
app.webservice app.webservice
.task(request.params.id) .task(request.params.id)
.result(request.params.rid) .result(request.params.rid)
.get({full: true}, (error, result) => { .get({full: true}, (webserviceError, result) => {
if (error) { if (webserviceError) {
return next('route'); return next('route');
} }
response.locals.task = task; response.locals.task = task;
@@ -83,5 +79,4 @@ function route(app) {
result.task = task; result.task = task;
response.send(result); response.send(result);
}); });
};
}

View File

@@ -17,21 +17,17 @@
const presentTask = require('../../view/presenter/task'); const presentTask = require('../../view/presenter/task');
const presentResult = require('../../view/presenter/result'); const presentResult = require('../../view/presenter/result');
module.exports = route; module.exports = function resultIndex(app) {
app.express.get('/:id/:rid', ({params}, response, next) => {
// Route definition app.webservice.task(params.id).get({}, (error, task) => {
function route(app) {
app.express.get('/:id/:rid', (request, response, next) => {
app.webservice.task(request.params.id).get({}, (error, task) => {
if (error) { if (error) {
return next(); return next();
} }
app.webservice app.webservice
.task(request.params.id) .task(params.id)
.result(request.params.rid) .result(params.rid)
.get({full: true}, (error, result) => { .get({full: true}, (webserviceError, result) => {
if (error) { if (webserviceError) {
return next(); return next();
} }
response.render('result', { response.render('result', {
@@ -42,5 +38,4 @@ function route(app) {
}); });
}); });
}); });
};
}

View File

@@ -16,13 +16,9 @@
const presentTask = require('../../view/presenter/task'); const presentTask = require('../../view/presenter/task');
module.exports = route; module.exports = function del(app) {
app.express.get('/:id/delete', ({params}, response, next) => {
// Route definition app.webservice.task(params.id).get({}, (error, task) => {
function route(app) {
app.express.get('/:id/delete', (request, response, next) => {
app.webservice.task(request.params.id).get({}, (error, task) => {
if (error) { if (error) {
return next(); return next();
} }
@@ -33,13 +29,12 @@ function route(app) {
}); });
}); });
app.express.post('/:id/delete', (request, response, next) => { app.express.post('/:id/delete', ({params}, response, next) => {
app.webservice.task(request.params.id).remove(error => { app.webservice.task(params.id).remove(error => {
if (error) { if (error) {
return next(); return next();
} }
response.redirect('/?deleted'); response.redirect('/?deleted');
}); });
}); });
};
}

View File

@@ -18,11 +18,7 @@ const presentTask = require('../../view/presenter/task');
const getStandards = require('../../data/standards'); const getStandards = require('../../data/standards');
const httpHeaders = require('http-headers'); const httpHeaders = require('http-headers');
module.exports = route; module.exports = function edit(app) {
// Route definition
function route(app) {
app.express.get('/:id/edit', (request, response, next) => { app.express.get('/:id/edit', (request, response, next) => {
app.webservice.task(request.params.id).get({}, (error, task) => { app.webservice.task(request.params.id).get({}, (error, task) => {
if (error) { if (error) {
@@ -43,13 +39,15 @@ function route(app) {
task.actions = (task.actions ? task.actions.join('\n') : ''); task.actions = (task.actions ? task.actions.join('\n') : '');
response.render('task/edit', { response.render('task/edit', {
edited: (typeof request.query.edited !== 'undefined'), edited: (typeof request.query.edited !== 'undefined'),
standards: standards, standards,
task: presentTask(task), task: presentTask(task),
isTaskSubPage: true isTaskSubPage: true
}); });
}); });
}); });
/* eslint-disable complexity */
/* eslint-disable max-statements */
app.express.post('/:id/edit', (request, response, next) => { app.express.post('/:id/edit', (request, response, next) => {
app.webservice.task(request.params.id).get({}, (error, task) => { app.webservice.task(request.params.id).get({}, (error, task) => {
if (error) { if (error) {
@@ -57,9 +55,11 @@ function route(app) {
} }
const originalActions = request.body.actions; const originalActions = request.body.actions;
const originalHeaders = request.body.headers; const originalHeaders = request.body.headers;
request.body.ignore = request.body.ignore || []; request.body.ignore = request.body.ignore || [];
request.body.timeout = request.body.timeout || undefined; request.body.timeout = request.body.timeout || undefined;
request.body.wait = request.body.wait || undefined; request.body.wait = request.body.wait || undefined;
if (request.body.actions) { if (request.body.actions) {
request.body.actions = request.body.actions.split(/[\r\n]+/) request.body.actions = request.body.actions.split(/[\r\n]+/)
.map(action => { .map(action => {
@@ -69,15 +69,18 @@ function route(app) {
return Boolean(action); return Boolean(action);
}); });
} }
if (!request.body.actions) { if (!request.body.actions) {
request.body.actions = []; request.body.actions = [];
} }
request.body.username = request.body.username || undefined; request.body.username = request.body.username || undefined;
request.body.password = request.body.password || undefined; request.body.password = request.body.password || undefined;
request.body.hideElements = request.body.hideElements || undefined; request.body.hideElements = request.body.hideElements || undefined;
request.body.headers = httpHeaders(request.body.headers || '', true); request.body.headers = httpHeaders(request.body.headers || '', true);
app.webservice.task(request.params.id).edit(request.body, error => {
if (error) { app.webservice.task(request.params.id).edit(request.body, webserviceError => {
if (webserviceError) {
task.name = request.body.name; task.name = request.body.name;
task.ignore = request.body.ignore; task.ignore = request.body.ignore;
task.timeout = request.body.timeout; task.timeout = request.body.timeout;
@@ -100,9 +103,9 @@ function route(app) {
return standard; return standard;
}); });
return response.render('task/edit', { return response.render('task/edit', {
error: error, webserviceError,
standards: standards, standards,
task: task, task,
isTaskSubPage: true isTaskSubPage: true
}); });
} }
@@ -110,5 +113,4 @@ function route(app) {
}); });
}); });
}); });
};
}

View File

@@ -1,10 +1,6 @@
'use strict'; 'use strict';
module.exports = route; module.exports = function ignore(app) {
// Route definition
function route(app) {
app.express.post('/:id/ignore', (request, response, next) => { app.express.post('/:id/ignore', (request, response, next) => {
app.webservice.task(request.params.id).get({}, (error, task) => { app.webservice.task(request.params.id).get({}, (error, task) => {
if (error) { if (error) {
@@ -22,5 +18,4 @@ function route(app) {
}); });
}); });
}); });
};
}

View File

@@ -18,19 +18,15 @@ const presentTask = require('../../view/presenter/task');
const presentResult = require('../../view/presenter/result'); const presentResult = require('../../view/presenter/result');
const presentResultList = require('../../view/presenter/result-list'); const presentResultList = require('../../view/presenter/result-list');
module.exports = route; module.exports = function taskIndex(app) {
// Route definition
function route(app) {
app.express.get('/:id', (request, response, next) => { app.express.get('/:id', (request, response, next) => {
app.webservice.task(request.params.id).get({lastres: true}, (error, task) => { app.webservice.task(request.params.id).get({lastres: true}, (error, task) => {
if (error) { if (error) {
return next(); return next();
} }
app.webservice.task(request.params.id).results({}, (error, results) => { app.webservice.task(request.params.id).results({}, (webserviceError, results) => {
if (error) { if (webserviceError) {
return next(error); return next(webserviceError);
} }
const presentedResults = presentResultList(results.map(presentResult)); const presentedResults = presentResultList(results.map(presentResult));
response.render('task', { response.render('task', {
@@ -47,5 +43,4 @@ function route(app) {
}); });
}); });
}); });
};
}

View File

@@ -14,11 +14,7 @@
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
'use strict'; 'use strict';
module.exports = route; module.exports = function run(app) {
// Route definition
function route(app) {
app.express.get('/:id/run', (request, response, next) => { app.express.get('/:id/run', (request, response, next) => {
app.webservice.task(request.params.id).run(error => { app.webservice.task(request.params.id).run(error => {
if (error) { if (error) {
@@ -27,5 +23,4 @@ function route(app) {
response.redirect(`/${request.params.id}?running`); response.redirect(`/${request.params.id}?running`);
}); });
}); });
};
}

View File

@@ -2,9 +2,7 @@
module.exports = route; module.exports = route;
// Route definition
function route(app) { function route(app) {
app.express.post('/:id/unignore', (request, response, next) => { app.express.post('/:id/unignore', (request, response, next) => {
app.webservice.task(request.params.id).get({}, (error, task) => { app.webservice.task(request.params.id).get({}, (error, task) => {
if (error) { if (error) {
@@ -23,5 +21,4 @@ function route(app) {
}); });
}); });
}); });
} }

View File

@@ -1,15 +1,9 @@
'use strict'; 'use strict';
// Clone the main config const config = require('../.eslintrc');
var config = module.exports = JSON.parse(JSON.stringify(require('../.eslintrc')));
// We use `this` all over the integration tests // We use `this` all over the integration tests
config.rules['no-invalid-this'] = 'off'; config.rules['no-invalid-this'] = 'off';
// Because of our use of `this`, arrow functions
// aren't really gonna work in the integration tests
config.rules['prefer-arrow-callback'] = 'off'; config.rules['prefer-arrow-callback'] = 'off';
// Disable max line length/statements module.exports = config;
config.rules['max-len'] = 'off';
config.rules['max-statements'] = 'off';

View File

@@ -12,19 +12,13 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
// jscs:disable requireArrowFunctions
'use strict'; 'use strict';
const cheerio = require('cheerio'); const cheerio = require('cheerio');
const request = require('request'); const request = require('request');
module.exports = createNavigator;
// Create a navigate function
function createNavigator(baseUrl, store) { function createNavigator(baseUrl, store) {
return function(opts, callback) { return function(opts, callback) {
store.body = null; store.body = null;
store.dom = null; store.dom = null;
store.request = null; store.request = null;
@@ -54,8 +48,8 @@ function createNavigator(baseUrl, store) {
store.dom = cheerio.load(store.body); store.dom = cheerio.load(store.body);
} }
callback(); callback();
}); });
}; };
} }
module.exports = createNavigator;

View File

@@ -1,30 +0,0 @@
// This file is part of Pa11y Dashboard.
//
// Pa11y Dashboard is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Pa11y Dashboard is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
// jscs:disable requireArrowFunctions
'use strict';
const createClient = require('pa11y-webservice-client-node');
module.exports = createWebserviceClient;
// Create a webservice client
function createWebserviceClient(config) {
let webserviceUrl = config.webservice;
if (typeof webserviceUrl === 'object') {
webserviceUrl = `http://${webserviceUrl.host}:${webserviceUrl.port}/`;
}
return createClient(webserviceUrl);
}

View File

@@ -12,14 +12,11 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
// jscs:disable maximumLineLength, requireArrowFunctions
'use strict'; 'use strict';
const assert = require('proclaim'); const assert = require('proclaim');
describe.only('GET /', function() { describe('GET /', function() {
beforeEach(function(done) { beforeEach(function(done) {
const request = { const request = {
method: 'GET', method: 'GET',
@@ -41,10 +38,18 @@ describe.only('GET /', function() {
it('should display all of the expected tasks', function() { it('should display all of the expected tasks', function() {
const tasks = this.last.dom('[data-test=task]'); const tasks = this.last.dom('[data-test=task]');
assert.strictEqual(tasks.length, 4); assert.strictEqual(tasks.length, 4);
assert.match(tasks.eq(0).text(), /npg home\s+\(wcag2aa\)/i); assert.equal(tasks.eq(0).find('.h3').text(), 'NPG Home');
assert.match(tasks.eq(1).text(), /npg home\s+\(wcag2aaa\)/i); assert.equal(tasks.eq(0).find('.h4').text(), 'nature.com');
assert.match(tasks.eq(2).text(), /nature news\s+\(section508\)/i); assert.equal(tasks.eq(0).find('.h5').text(), '(WCAG2AA)');
assert.match(tasks.eq(3).text(), /z integration test\s+\(wcag2aa\)/i); assert.equal(tasks.eq(1).find('.h3').text(), 'NPG Home');
assert.equal(tasks.eq(1).find('.h4').text(), 'nature.com');
assert.equal(tasks.eq(1).find('.h5').text(), '(WCAG2AAA)');
assert.equal(tasks.eq(2).find('.h3').text(), 'Nature News');
assert.equal(tasks.eq(2).find('.h4').text(), 'nature.com/news');
assert.equal(tasks.eq(2).find('.h5').text(), '(Section508)');
assert.equal(tasks.eq(3).find('.h3').text(), 'Z Integration Test');
assert.equal(tasks.eq(3).find('.h4').text(), 'localhost:8132');
assert.equal(tasks.eq(3).find('.h5').text(), '(WCAG2AA)');
}); });
it('should have links to each task', function() { it('should have links to each task', function() {
@@ -86,7 +91,7 @@ describe.only('GET /', function() {
assert.match(tasks.eq(0).text(), /3\s*notices/i); assert.match(tasks.eq(0).text(), /3\s*notices/i);
}); });
it('should display a message indicating that there are no results if the task has not been run', function() { it('should indicate there are no results if the task has not been run', function() {
const tasks = this.last.dom('[data-test=task]'); const tasks = this.last.dom('[data-test=task]');
assert.match(tasks.eq(2).text(), /no results/i); assert.match(tasks.eq(2).text(), /no results/i);
}); });
@@ -94,5 +99,4 @@ describe.only('GET /', function() {
it('should not display an alert message', function() { it('should not display an alert message', function() {
assert.strictEqual(this.last.dom('[data-test=alert]').length, 0); assert.strictEqual(this.last.dom('[data-test=alert]').length, 0);
}); });
}); });

View File

@@ -12,20 +12,16 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
// jscs:disable maximumLineLength, requireArrowFunctions
'use strict'; 'use strict';
const assert = require('proclaim'); const assert = require('proclaim');
describe('GET /new', function() { describe('GET /new', function() {
beforeEach(function(done) { beforeEach(function(done) {
const request = { this.navigate({
method: 'GET', method: 'GET',
endpoint: '/new' endpoint: '/new'
}; }, done);
this.navigate(request, done);
}); });
it('should send a 200 status', function() { it('should send a 200 status', function() {
@@ -44,7 +40,6 @@ describe('GET /new', function() {
}); });
describe('"Add New URL" form', function() { describe('"Add New URL" form', function() {
beforeEach(function() { beforeEach(function() {
this.form = this.last.dom('[data-test=new-url-form]').eq(0); this.form = this.last.dom('[data-test=new-url-form]').eq(0);
}); });
@@ -92,7 +87,7 @@ describe('GET /new', function() {
it('should have a "standard" field', function() { it('should have a "standard" field', function() {
const field = this.form.find('select[name=standard]').eq(0); const field = this.form.find('select[name=standard]').eq(0);
assert.isDefined(field); assert.isDefined(field);
assert.strictEqual(field.find('option').length, 4); assert.greaterThanOrEqual(field.find('option').length, 1);
}); });
it('should have "ignore" fields', function() { it('should have "ignore" fields', function() {
@@ -112,15 +107,11 @@ describe('GET /new', function() {
const field = this.form.find('textarea[name=headers]').eq(0); const field = this.form.find('textarea[name=headers]').eq(0);
assert.isDefined(field); assert.isDefined(field);
}); });
}); });
}); });
describe('POST /new', function() { describe('POST /new', function() {
describe('with invalid query', function() { describe('with invalid query', function() {
beforeEach(function(done) { beforeEach(function(done) {
const request = { const request = {
method: 'POST', method: 'POST',
@@ -140,22 +131,21 @@ describe('POST /new', function() {
it('should display an error message', function() { it('should display an error message', function() {
assert.strictEqual(this.last.dom('[data-test=error]').length, 1); assert.strictEqual(this.last.dom('[data-test=error]').length, 1);
}); });
}); });
describe('with valid query', function() { describe('with valid query', function() {
const requestOptions = {
method: 'POST',
endpoint: '/new',
form: {
name: 'Example',
url: 'http://example.com/',
standard: 'WCAG2AA'
}
};
beforeEach(function(done) { beforeEach(function(done) {
const request = { this.navigate(requestOptions, done);
method: 'POST',
endpoint: '/new',
form: {
name: 'Example',
url: 'http://example.com/',
standard: 'WCAG2AA'
}
};
this.navigate(request, done);
}); });
it('should send a 200 status', function() { it('should send a 200 status', function() {
@@ -163,9 +153,18 @@ describe('POST /new', function() {
}); });
it('should create the task', function(done) { it('should create the task', function(done) {
this.webservice.tasks.get({}, function(error, tasks) { const getTaskCount = then =>
assert.strictEqual(tasks.length, 4); this.webservice.tasks.get({}, (error, tasks) => {
done(error); then(tasks.length);
});
getTaskCount(firstTaskCount => {
this.navigate(requestOptions, () => {
getTaskCount(secondTaskCount => {
assert.strictEqual(secondTaskCount, firstTaskCount + 1);
done();
});
});
}); });
}); });
@@ -180,9 +179,7 @@ describe('POST /new', function() {
it('should display a success message', function() { it('should display a success message', function() {
const alert = this.last.dom('[data-test=alert]').eq(0); const alert = this.last.dom('[data-test=alert]').eq(0);
assert.isDefined(alert); assert.isDefined(alert);
assert.match(alert.textContent, /url has been added/i); assert.match(alert.text(), /url has been added/i);
}); });
}); });
}); });

View File

@@ -12,14 +12,11 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
// jscs:disable maximumLineLength, requireArrowFunctions
'use strict'; 'use strict';
const assert = require('proclaim'); const assert = require('proclaim');
describe('GET /<task-id>/<result-id>.csv', function() { describe('GET /<task-id>/<result-id>.csv', function() {
beforeEach(function(done) { beforeEach(function(done) {
const request = { const request = {
method: 'GET', method: 'GET',
@@ -36,11 +33,9 @@ describe('GET /<task-id>/<result-id>.csv', function() {
it('should output CSV results', function() { it('should output CSV results', function() {
assert.match(this.last.body, /^"code","message","type"/); assert.match(this.last.body, /^"code","message","type"/);
}); });
}); });
describe('GET /<task-id>/<result-id>.json', function() { describe('GET /<task-id>/<result-id>.json', function() {
beforeEach(function(done) { beforeEach(function(done) {
const request = { const request = {
method: 'GET', method: 'GET',
@@ -64,5 +59,4 @@ describe('GET /<task-id>/<result-id>.json', function() {
assert.strictEqual(json.count.notice, 3); assert.strictEqual(json.count.notice, 3);
assert.isArray(json.results); assert.isArray(json.results);
}); });
}); });

View File

@@ -12,8 +12,6 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
// jscs:disable maximumLineLength, requireArrowFunctions
'use strict'; 'use strict';
const assert = require('proclaim'); const assert = require('proclaim');
@@ -35,13 +33,19 @@ describe('GET /<task-id>/<result-id>', function() {
it('should display a "Download CSV" button', function() { it('should display a "Download CSV" button', function() {
const elem = this.last.dom('[data-test=download-csv]'); const elem = this.last.dom('[data-test=download-csv]');
assert.strictEqual(elem.length, 1); assert.strictEqual(elem.length, 1);
assert.strictEqual(elem.eq(0).attr('href'), '/abc000000000000000000001/def000000000000000000001.csv'); assert.strictEqual(
elem.eq(0).attr('href'),
'/abc000000000000000000001/def000000000000000000001.csv'
);
}); });
it('should display a "Download JSON" button', function() { it('should display a "Download JSON" button', function() {
const elem = this.last.dom('[data-test=download-json]'); const elem = this.last.dom('[data-test=download-json]');
assert.strictEqual(elem.length, 1); assert.strictEqual(elem.length, 1);
assert.strictEqual(elem.eq(0).attr('href'), '/abc000000000000000000001/def000000000000000000001.json'); assert.strictEqual(
elem.eq(0).attr('href'),
'/abc000000000000000000001/def000000000000000000001.json'
);
}); });
it('should display a link back to the task', function() { it('should display a link back to the task', function() {

View File

@@ -12,8 +12,6 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
// jscs:disable maximumLineLength, requireArrowFunctions
'use strict'; 'use strict';
const assert = require('proclaim'); const assert = require('proclaim');

View File

@@ -12,20 +12,16 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
// jscs:disable maximumLineLength, requireArrowFunctions
'use strict'; 'use strict';
const assert = require('proclaim'); const assert = require('proclaim');
describe('GET /<task-id>/edit', function() { describe('GET /<task-id>/edit', function() {
beforeEach(function(done) { beforeEach(function(done) {
const request = { this.navigate({
method: 'GET', method: 'GET',
endpoint: '/abc000000000000000000001/edit' endpoint: '/abc000000000000000000001/edit'
}; }, done);
this.navigate(request, done);
}); });
it('should send a 200 status', function() { it('should send a 200 status', function() {
@@ -113,13 +109,10 @@ describe('GET /<task-id>/edit', function() {
assert.isDefined(fields); assert.isDefined(fields);
assert.notStrictEqual(fields.length, 0); assert.notStrictEqual(fields.length, 0);
}); });
}); });
}); });
describe('POST /<task-id>/edit', function() { describe('POST /<task-id>/edit', function() {
beforeEach(function(done) { beforeEach(function(done) {
const request = { const request = {
method: 'POST', method: 'POST',
@@ -153,5 +146,4 @@ describe('POST /<task-id>/edit', function() {
assert.isDefined(alert); assert.isDefined(alert);
assert.match(alert.text(), /been saved/i); assert.match(alert.text(), /been saved/i);
}); });
}); });

View File

@@ -12,22 +12,17 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
// jscs:disable maximumLineLength, requireArrowFunctions
'use strict'; 'use strict';
const assert = require('proclaim'); const assert = require('proclaim');
describe('GET /<task-id>', function() { describe('GET /<task-id>', function() {
describe('when task has results', function() { describe('when task has results', function() {
beforeEach(function(done) { beforeEach(function(done) {
const request = { this.navigate({
method: 'GET', method: 'GET',
endpoint: '/abc000000000000000000001' endpoint: '/abc000000000000000000001'
}; }, done);
this.navigate(request, done);
}); });
it('should send a 200 status', function() { it('should send a 200 status', function() {
@@ -35,11 +30,17 @@ describe('GET /<task-id>', function() {
}); });
it('should display an "Edit" button', function() { it('should display an "Edit" button', function() {
assert.strictEqual(this.last.dom('[href="/abc000000000000000000001/edit"]').length, 1); assert.strictEqual(
this.last.dom('[href="/abc000000000000000000001/edit"]').length,
1
);
}); });
it('should display a "Delete" button', function() { it('should display a "Delete" button', function() {
assert.strictEqual(this.last.dom('[href="/abc000000000000000000001/delete"]').length, 1); assert.strictEqual(
this.last.dom('[href="/abc000000000000000000001/delete"]').length,
1
);
}); });
it('should display a "Run" button', function() { it('should display a "Run" button', function() {
@@ -47,16 +48,30 @@ describe('GET /<task-id>', function() {
}); });
it('should display a "Download CSV" button for the latest result', function() { it('should display a "Download CSV" button for the latest result', function() {
assert.strictEqual(this.last.dom('[href="/abc000000000000000000001/def000000000000000000001.csv"]').length, 1); assert.strictEqual(
1,
this.last.dom(
'[href="/abc000000000000000000001/def000000000000000000001.csv"]'
).length
);
}); });
it('should display a "Download JSON" button for the latest result', function() { it('should display a "Download JSON" button for the latest result', function() {
assert.strictEqual(this.last.dom('[href="/abc000000000000000000001/def000000000000000000001.json"]').length, 1); assert.strictEqual(
1,
this.last.dom(
'[href="/abc000000000000000000001/def000000000000000000001.json"]'
).length
);
}); });
it('should display links to all results', function() { it('should display links to all results', function() {
assert.isDefined(this.last.dom('[href="/abc000000000000000000001/def000000000000000000001"]').eq(0)); assert.isDefined(
assert.isDefined(this.last.dom('[href="/abc000000000000000000001/def000000000000000000003"]').eq(0)); this.last.dom('[href="/abc000000000000000000001/def000000000000000000001"]').eq(0)
);
assert.isDefined(
this.last.dom('[href="/abc000000000000000000001/def000000000000000000003"]').eq(0)
);
}); });
it('should display errors', function() { it('should display errors', function() {
@@ -76,11 +91,9 @@ describe('GET /<task-id>', function() {
assert.isDefined(elem); assert.isDefined(elem);
assert.match(elem.text(), /notices \( 3 \)/i); assert.match(elem.text(), /notices \( 3 \)/i);
}); });
}); });
describe('when task has no results', function() { describe('when task has no results', function() {
beforeEach(function(done) { beforeEach(function(done) {
const request = { const request = {
method: 'GET', method: 'GET',
@@ -104,7 +117,5 @@ describe('GET /<task-id>', function() {
assert.isDefined(alert); assert.isDefined(alert);
assert.match(alert.text(), /there are no results to show/i); assert.match(alert.text(), /there are no results to show/i);
}); });
}); });
}); });

View File

@@ -12,8 +12,6 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
// jscs:disable maximumLineLength, requireArrowFunctions
'use strict'; 'use strict';
const assert = require('proclaim'); const assert = require('proclaim');
@@ -21,11 +19,10 @@ const assert = require('proclaim');
describe('GET /<task-id>/run', function() { describe('GET /<task-id>/run', function() {
beforeEach(function(done) { beforeEach(function(done) {
const request = { this.navigate({
method: 'GET', method: 'GET',
endpoint: '/abc000000000000000000001/run' endpoint: '/abc000000000000000000001/run'
}; }, done);
this.navigate(request, done);
}); });
it('should send a 200 status', function() { it('should send a 200 status', function() {

View File

@@ -12,39 +12,54 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
// jscs:disable requireArrowFunctions
'use strict'; 'use strict';
const config = require('../../config/test.json'); const {promisify} = require('util');
const createNavigator = require('./helper/navigate'); const createNavigator = require('./helper/navigate');
const createWebserviceClient = require('./helper/webservice'); const createWebserviceClient = require('pa11y-webservice-client-node');
const loadFixtures = require('pa11y-webservice/data/fixture/load'); const fetch = require('node-fetch');
const request = require('request');
const loadFixtures = promisify(require('pa11y-webservice/data/fixture/load'));
const config = {
host: process.env.HOST || '0.0.0.0',
port: Number(process.env.PORT) || 4000,
noindex: true,
readonly: false
};
const webserviceConfig = {
database: process.env.WEBSERVICE_DATABASE || 'mongodb://127.0.0.1/pa11y-dashboard-integration-test',
host: process.env.WEBSERVICE_HOST || '0.0.0.0',
port: Number(process.env.WEBSERVICE_PORT) || 3000,
dbOnly: true
};
async function assertDashboardIsAvailable(baseUrl) {
try {
const response = await fetch(baseUrl);
if (!response.ok) {
console.error('Service found but returned an error. HTTP status:', response.status);
throw Error();
}
} catch (error) {
console.error('Service under test not found or returned error.');
throw error;
}
}
before(async function() {
this.baseUrl = `http://${config.host}:${config.port}`;
await assertDashboardIsAvailable(this.baseUrl);
await loadFixtures('test', webserviceConfig);
this.webservice = createWebserviceClient(`http://${webserviceConfig.host}:${webserviceConfig.port}/`);
// Run before all tests
before(function(done) {
this.baseUrl = `http://localhost:${config.port}`;
this.last = {}; this.last = {};
this.navigate = createNavigator(this.baseUrl, this.last); this.navigate = createNavigator(this.baseUrl, this.last);
this.webservice = createWebserviceClient(config);
assertTestAppIsRunning(this.baseUrl, () => {
loadFixtures('test', config.webservice, done);
});
}); });
// Run after each test afterEach(async function() {
afterEach(function(done) { await loadFixtures('test', webserviceConfig);
loadFixtures('test', config.webservice, done);
}); });
// Check that the test application is running, and exit if not
function assertTestAppIsRunning(url, done) {
request(url, error => {
if (error) {
console.error('Error: Test app not started; run with `NODE_ENV=test node index.js`');
process.exit(1);
}
done();
});
}

View File

@@ -19,7 +19,7 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
<p class="h2">Let's see what we can do here:</h2> <p class="h2">Let's see what we can do here:</h2>
<ul> <ul>
<li>Do you have <a href="https://www.mongodb.com/">MongoDB</a> installed and <code>mongod</code> running?</li> <li>Do you have <a href="https://www.mongodb.com/">MongoDB</a> installed and <code>mongod</code> running?</li>
<li>Check out the <a href="https://github.com/pa11y/dashboard/blob/master/TROUBLESHOOTING.md">Troubleshooting doc</a> for more information.</li> <li>Check out the <a href="https://github.com/pa11y/dashboard/blob/master/README.md#troubleshooting">Troubleshooting guide</a> for more information.</li>
<li>Search for a related <a href="https://github.com/pa11y/dashboard/issues">Github issue</a>, or open one yourself.</li> <li>Search for a related <a href="https://github.com/pa11y/dashboard/issues">Github issue</a>, or open one yourself.</li>
</ul> </ul>
{{#if error}} {{#if error}}

View File

@@ -40,7 +40,7 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
{{#deleted}} {{#deleted}}
<div class="col-md-12 clearfix" data-test="alert"> <div class="col-md-12 clearfix" data-test="alert">
<div class="alert alert-info"> <div class="alert alert-info">
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button> <button data-dismiss="alert" class="close" type="button" aria-label="Close">×</button>
<strong>Bye Bye URL</strong> <strong>Bye Bye URL</strong>
<p>The URL you selected and its associated results have been deleted.</p> <p>The URL you selected and its associated results have been deleted.</p>
</div> </div>

View File

@@ -27,7 +27,7 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
{{#if noindex}}<meta name="robots" content="noindex"/>{{/if}} {{#if noindex}}<meta name="robots" content="noindex"/>{{/if}}
<link rel="icon" type="image/png" href="favicon.png" /> <link rel="icon" type="image/png" href="/favicon.png" />
<!-- For mobile devices. --> <!-- For mobile devices. -->
<meta name="viewport" content="width=device-width"/> <meta name="viewport" content="width=device-width"/>
@@ -47,19 +47,17 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
{{> breadcrumb}} {{> breadcrumb}}
<div class="container"> <main class="container" >
{{#if readonly}} {{#if readonly}}
<div class="row readonly-mode"> <div class="row readonly-mode">
{{else}} {{else}}
<div class="row"> <div class="row">
{{/if}} {{/if}}
<section> <div class="section">
<div class="section" role="main"> {{{body}}}
{{{body}}} </div>
</div>
</section>
</div> </div>
</div> </main>
{{> page-footer}} {{> page-footer}}

View File

@@ -19,7 +19,7 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
Add a new URL Add a new URL
{{/content}} {{/content}}
<form role="form" class="col-md-12" action="/new" method="post" data-test="new-url-form"> <form class="col-md-12" action="/new" method="post" data-test="new-url-form">
<div class="legend"> <div class="legend">
<h1 class="h2 crunch-top">Add a new URL</h1> <h1 class="h2 crunch-top">Add a new URL</h1>
@@ -78,8 +78,8 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
<div class="row"> <div class="row">
<div class="col-md-4 col-sm-4 col-xs-6"> <div class="col-md-4 col-sm-4 col-xs-6">
<label class="control-label" for="new-task-wait">Wait (milliseconds)</label> <label class="control-label" for="new-task-wait">Wait (milliseconds)</label>
<input class="form-control" id="new-task-wait" type="text" placeholder="E.g. 3000" name="wait" value="{{task.wait}}"/> <input class="form-control" id="new-task-wait" type="text" placeholder="E.g. 3000" name="wait" value="{{task.wait}}" aria-describedby="int3"/>
<em>(Note: default wait time is 0ms)</em> <em id="int3">(Note: default wait time is 0ms)</em>
</div> </div>
</div> </div>
</div> </div>
@@ -110,7 +110,7 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
<div class="row"> <div class="row">
<div class="col-md-4 col-sm-4 col-xs-6"> <div class="col-md-4 col-sm-4 col-xs-6">
<label class="control-label" for="new-task-password">Password</label> <label class="control-label" for="new-task-password">Password</label>
<input class="form-control" id="new-task-password" type="text" name="password" value="{{task.password}}"/> <em>(Note: this will be stored and displayed in plain-text - only suitable for use in a secure environment)</em> <input class="form-control" id="new-task-password" type="text" name="password" value="{{task.password}}" aria-describedby="pwd"/> <span id="pwd"><em>(Note: this will be stored and displayed in plain-text - only suitable for use in a secure environment)</em></span>
</div> </div>
</div> </div>
</div> </div>
@@ -119,8 +119,8 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
<div class="row"> <div class="row">
<div class="col-md-4 col-sm-4 col-xs-6"> <div class="col-md-4 col-sm-4 col-xs-6">
<label class="control-label" for="new-task-headers">HTTP Headers</label> <label class="control-label" for="new-task-headers">HTTP Headers</label>
<textarea class="form-control" id="new-task-headers" name="headers" placeholder="Cookie: foo=bar">{{task.headers}}</textarea> <textarea class="form-control" id="new-task-headers" name="headers" placeholder="Cookie: foo=bar" aria-describedby="int1">{{task.headers}}</textarea>
<em>(As key/value pairs, separated by newlines/colons)</em> <em id="int1">(As key/value pairs, separated by newlines/colons)</em>
</div> </div>
</div> </div>
</div> </div>
@@ -129,7 +129,8 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
<div class="row"> <div class="row">
<div class="col-md-4 col-sm-4 col-xs-6"> <div class="col-md-4 col-sm-4 col-xs-6">
<label class="control-label" for="new-task-hide-elements">Hide Elements</label> <label class="control-label" for="new-task-hide-elements">Hide Elements</label>
<input class="form-control" id="new-task-hide-elements" type="text" name="hideElements" value="{{task.hideElements}}" placeholder=".advert, #modal, div[aria-role=presentation]"/> <em>(CSS selector)</em> <input class="form-control" id="new-task-hide-elements" type="text" name="hideElements" value="{{task.hideElements}}" placeholder=".advert, #modal, div[aria-role=presentation]" aria-describedby="int2"/>
<em id="int2">(CSS selector)</em>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -15,16 +15,17 @@ You should have received a copy of the GNU General Public License
along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
}} }}
{{#unless isHomePage}} {{#unless isHomePage}}
<div class="container"> <nav class="container" aria-labelledby="breadcrumb">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<h2 id="breadcrumb" class="sr-only">Breadcrumb Navigation</h2>
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><a href="/">Dashboard</a></li> <li><a href="/">Dashboard</a></li>
{{#if isNewTaskPage}} {{#if isNewTaskPage}}
<li class="active">Add URL</li> <li class="active">Add URL</li>
{{/if}} {{/if}}
{{#if isTaskPage}} {{#if isTaskPage}}
<li class="active">{{task.name}}</li> <li class="active">{{task.name}}</li>
{{/if}} {{/if}}
{{#if isTaskSubPage}} {{#if isTaskSubPage}}
<li><a href="{{task.href}}">{{task.name}}</a></li> <li><a href="{{task.href}}">{{task.name}}</a></li>
@@ -36,5 +37,5 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
</ol> </ol>
</div> </div>
</div> </div>
</div> </nav>
{{/unless}} {{/unless}}

View File

@@ -18,9 +18,8 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
<div class="graph-container graph-spacer ruled clearfix"> <div class="graph-container graph-spacer ruled clearfix">
<div class="row"> <div class="row">
<div class="col-md-3 col-sm-4 col-xs-3"> <div class="col-md-3 col-sm-4 col-xs-3">
<span class="btn btn-sm btn-default btn-full-width btn_action_export">Export graph</span> <button class="btn btn-sm btn-default btn-full-width btn_action_export" type="button">Export graph</button>
</div> </div>
<div class="col-md-5 col-sm-6 col-xs-9 pull-right"> <div class="col-md-5 col-sm-6 col-xs-9 pull-right">
<ul class="list-unstyled floated-list series-checkboxes clearfix" data-role="series-checkboxes"></ul> <ul class="list-unstyled floated-list series-checkboxes clearfix" data-role="series-checkboxes"></ul>
</div> </div>
@@ -28,62 +27,63 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
<div data-role="graph" class="graph"></div> <div data-role="graph" class="graph"></div>
<div class="dashedLegend"> <div class="dashedLegend">
<div class="dashedContainer"> <div class="dashedContainer">
<table> <table>
<tbody> <tbody>
<tr> <tr>
<td class="legendColorBox"> <td class="legendColorBox">
<div class="clearfix legendIcon legendErrors"> <div class="clearfix legendIcon legendErrors">
<div></div> <div></div>
</div> </div>
</td> </td>
<td class="legendLabel">Errors</td> <td class="legendLabel">Errors</td>
</tr> </tr>
<tr> <tr>
<td class="legendColorBox"> <td class="legendColorBox">
<div class="clearfix legendIcon legendWarnings"> <div class="clearfix legendIcon legendWarnings">
<div></div><div></div> <div></div><div></div>
</div> </div>
</td> </td>
<td class="legendLabel">Warnings</td> <td class="legendLabel">Warnings</td>
</tr> </tr>
<tr> <tr>
<td class="legendColorBox"> <td class="legendColorBox">
<div class="clearfix legendIcon legendNotices"> <div class="clearfix legendIcon legendNotices">
<div></div><div></div><div></div> <div></div><div></div><div></div>
</div> </div>
</td> </td>
<td class="legendLabel">Notices</td> <td class="legendLabel">Notices</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<button data-role='zoom-reset' class="btn btn-xs btn-primary pull-right btn-reset hidden">Reset Zoom <i class="glyphicon glyphicon-zoom-out"></i></button> <button data-role='zoom-reset' class="btn btn-xs btn-primary pull-right btn-reset hidden">Reset Zoom <i class="glyphicon glyphicon-zoom-out"></i></button>
</div>
</div>
<div class="col-md-12 hidden"> </div>
<div class="graph-spacer ruled">
<table id="graph-data" class="table graph-table" summary="Accessibility results from Pa11y for this page"> <div class="col-md-12 hidden">
<caption>Pa11y results for this URL</caption> <div class="graph-spacer ruled">
<thead> <table id="graph-data" class="table graph-table" summary="Accessibility results from Pa11y for this page">
<tr> <caption>Pa11y results for this URL</caption>
<th>Date</th> <thead>
<th class="text-center">Errors</th> <tr>
<th class="text-center">Warnings</th> <th>Date</th>
<th class="text-center">Notices</th> <th class="text-center">Errors</th>
</tr> <th class="text-center">Warnings</th>
</thead> <th class="text-center">Notices</th>
<tbody> </tr>
{{#results}} </thead>
<tr data-role="url-stats"> <tbody>
<td data-value="{{date-timestamp date}}" data-role="date">{{date-format date format="DD MMM YYYY"}}</td> {{#results}}
<td class="text-center" data-label="error">{{count.error}}</td> <tr data-role="url-stats">
<td class="text-center" data-label="warning">{{count.warning}}</td> <td data-value="{{date-timestamp date}}" data-role="date">{{date-format date format="DD MMM YYYY"}}</td>
<td class="text-center" data-label="notice">{{count.notice}}</td> <td class="text-center" data-label="error">{{count.error}}</td>
</tr> <td class="text-center" data-label="warning">{{count.warning}}</td>
{{/results}} <td class="text-center" data-label="notice">{{count.notice}}</td>
</tbody> </tr>
</table> {{/results}}
</tbody>
</table>
</div>
</div> </div>
</div> </div>

View File

@@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License
along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
}} }}
<footer> <footer>
<div class="footer" role="contentinfo"> <div class="footer">
<div class="container"> <div class="container">
<div class="col-md-5"> <div class="col-md-5">
<small>&copy; 2013{{year}} Team Pa11y.<br/>Pa11y Dashboard is licensed under the GNU General Public License 3.0.<br/>Version {{version}}</small> <small>&copy; 2013{{year}} Team Pa11y.<br/>Pa11y Dashboard is licensed under the GNU General Public License 3.0.<br/>Version {{version}}</small>
@@ -29,7 +29,7 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
<a href="{{bugtracker}}">Bug Tracker</a> <a href="{{bugtracker}}">Bug Tracker</a>
</li> </li>
<li> <li>
<a href="http://www.w3.org/TR/WCAG20/">WCAG 2.0 spec</a> <a href="https://www.w3.org/TR/WCAG21/">WCAG 2.1 spec</a>
</li> </li>
<li> <li>
<a href="http://squizlabs.github.io/HTML_CodeSniffer/">HTML_CodeSniffer</a> <a href="http://squizlabs.github.io/HTML_CodeSniffer/">HTML_CodeSniffer</a>

View File

@@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License
along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
}} }}
<header> <header>
<div role="banner" class="header"> <div class="header">
<div class="container"> <div class="container">
{{#if isHomePage}}<h1>{{else}}<div class="h1">{{/if}} {{#if isHomePage}}<h1>{{else}}<div class="h1">{{/if}}
<a href="/">Pa11y Dashboard</a> - <a href="/">Pa11y Dashboard</a> -

View File

@@ -32,20 +32,21 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
</div> </div>
</div> </div>
</div> </div>
<div class="row date-selector-row"> <div class="row date-selector-row">
<div id="top" class="col-md-12 col-sm-12 clearfix"> <div class="col-md-12 col-sm-12 clearfix">
<div class="well dark-well"> <div class="well dark-well">
<div class="date-selector"> <div class="date-selector">
<div class="btn-group block-level clearfix"> <div class="btn-group block-level clearfix">
<h2 class="h4">
<span class="glyphicon glyphicon-calendar" aria-hidden="true"></span>&nbsp;&nbsp;{{date-format task.lastResult.date format="DD MMM YYYY"}} <h2 class="h3" id="dates-navigation">Select a date to show stats for: <span class="glyphicon glyphicon-calendar"></span></h2>
</h2> <nav aria-labelledby="dates-navigation">
<h3 class="h5 show-stats">Select a date to show stats for:</h3> <ul class="dates-list">
<ul role="navigation" class="dates-list"> {{#results}}
{{#results}} <li><a class="" href="{{href}}">{{date-format date format="DD MMM YYYY"}}</a></li>
<li><a class="" href="{{href}}">{{date-format date format="DD MMM YYYY"}}</a></li> {{/results}}
{{/results}} </ul>
</ul> </nav>
</div> </div>
</div> </div>
</div> </div>
@@ -54,31 +55,32 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
<div class="row"> <div class="row">
<div class="col-md-12 col-sm-12 clearfix"> <div class="col-md-12 col-sm-12 clearfix">
<div class="well"> <div class="well">
<h4 class="crunch-top">View results in browser</h4> <h2 class="crunch-top h3">View results in browser</h2>
<p class="crunch-bottom">Pa11y uses HTML_CodeSniffer to find accessibility issues. <a href="http://squizlabs.github.io/HTML_CodeSniffer/">Use their bookmarklet</a> to view results on the page you are testing.</p> <p class="crunch-bottom">Pa11y uses HTML_CodeSniffer to find accessibility issues. <a href="http://squizlabs.github.io/HTML_CodeSniffer/">Use their bookmarklet</a> to view results on the page you are testing.</p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-9" role="main"> <section class="col-md-9" id="top">
<ul class="nav nav-tabs category-list" role="tablist"> <h2 id="tabSectionHeading" class="crunch-top">Results</h2>
<li class="category-list__item category-list__item_type_error active" role="presentation"> <ul class="nav nav-tabs category-list" aria-labelledby="tabSectionHeading" role="tablist">
<li class="category-list__item category-list__item_type_error active" aria-selected="true" role="presentation">
<a class="category-list__link" id="errors" href="#errors-list" aria-controls="errors-list" role="tab" data-toggle="tab" data-test="task-errors"> <a class="category-list__link" id="errors" href="#errors-list" aria-controls="errors-list" role="tab" data-toggle="tab" data-test="task-errors">
Errors ( {{mainResult.count.error}} ) Errors ( {{mainResult.count.error}} )
</a> </a>
</li> </li>
<li class="category-list__item category-list__item_type_warning" role="presentation"> <li class="category-list__item category-list__item_type_warning" aria-selected="false" role="presentation">
<a class="category-list__link" id="warnings" href="#warnings-list" aria-controls="warnings-list" role="tab" data-toggle="tab" data-test="task-warnings"> <a class="category-list__link" id="warnings" href="#warnings-list" aria-controls="warnings-list" role="tab" data-toggle="tab" data-test="task-warnings">
Warnings ( {{mainResult.count.warning}} ) Warnings ( {{mainResult.count.warning}} )
</a> </a>
</li> </li>
<li class="category-list__item category-list__item_type_notice" role="presentation"> <li class="category-list__item category-list__item_type_notice" aria-selected="false" role="presentation">
<a class="category-list__link" id="notices" href="#notices-list" aria-controls="notices-list" role="tab" data-toggle="tab" data-test="task-notices"> <a class="category-list__link" id="notices" href="#notices-list" aria-controls="notices-list" role="tab" data-toggle="tab" data-test="task-notices">
Notices ( {{mainResult.count.notice}} ) Notices ( {{mainResult.count.notice}} )
</a> </a>
</li> </li>
<li class="category-list__item category-list__item_type_ignore" role="presentation"> <li class="category-list__item category-list__item_type_ignore" aria-selected="false" role="presentation">
<a class="category-list__link" id="ignore" href="#ignore-list" aria-controls="ignore-list" role="tab" data-toggle="tab"> <a class="category-list__link" id="ignore" href="#ignore-list" aria-controls="ignore-list" role="tab" data-toggle="tab">
Ignored rules ( {{mainResult.ignore.length}} ) Ignored rules ( {{mainResult.ignore.length}} )
</a> </a>
@@ -86,7 +88,7 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div id="errors-list" role="tabpanel" class="tab-pane tasks-list fade in active"> <div id="errors-list" role="tabpanel" class="tab-pane tasks-list fade in active" aria-labelledby="errors">
{{#if mainResult.count.error}} {{#if mainResult.count.error}}
{{#mainResult.errors}} {{#mainResult.errors}}
<div class="panel panel-default task task_type_error"> <div class="panel panel-default task task_type_error">
@@ -116,10 +118,10 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
<div class="task-details collapse" id="error-index-{{@index}}"> <div class="task-details collapse" id="error-index-{{@index}}">
{{#if solutions.length}} {{#if solutions.length}}
<div class="subtitle" id="error-solutions">Solutions:</div> <div class="subtitle">Solutions:</div>
<ul class="list-unstyled solutions-list" role="list" aria-labelledby="error-solutions"> <ul class="list-unstyled solutions-list">
{{#each solutions}} {{#each solutions}}
<li class="list-unstyled__item" role="listitem"> <li class="list-unstyled__item">
<a class="link" href="{{url}}" target="_blank"> <a class="link" href="{{url}}" target="_blank">
<span class="glyphicon glyphicon-share" aria-hidden="true"></span>&nbsp;{{title}} <span class="glyphicon glyphicon-share" aria-hidden="true"></span>&nbsp;{{title}}
</a> </a>
@@ -129,10 +131,10 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
{{/if}} {{/if}}
{{#if items.length}} {{#if items.length}}
<div class="subtitle" id="error-selectors">Selectors:</div> <div class="subtitle">Selectors:</div>
<ul class="list-unstyled selectors-list" role="list" aria-labelledby="error-selectors"> <ul class="list-unstyled selectors-list">
{{#each items}} {{#each items}}
<li class="list-unstyled__item" role="listitem"> <li class="list-unstyled__item">
<span title="Context" data-role="context-popover" data-toggle="popover" data-content="{{context}}"> <span title="Context" data-role="context-popover" data-toggle="popover" data-content="{{context}}">
<code class="code">{{selector}}</code> <code class="code">{{selector}}</code>
</span> </span>
@@ -145,14 +147,14 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
</div> </div>
{{/mainResult.errors}} {{/mainResult.errors}}
<div class="to-top"> <div class="to-top">
<a class="link" href="#top" data-role="top"><span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>Back to top</a> <a class="link" href="#top"><span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>Back to top</a>
</div> </div>
{{else}} {{else}}
<div class="text">Well done! You have 0 errors. <span class="glyphicon glyphicon-ok pull-right" aria-hidden="true"></span></div> <div class="text">Well done! You have 0 errors. <span class="glyphicon glyphicon-ok pull-right" aria-hidden="true"></span></div>
{{/if}} {{/if}}
</div> </div>
<div id="warnings-list" role="tabpanel" class="tab-pane tasks-list fade"> <div id="warnings-list" role="tabpanel" class="tab-pane tasks-list fade" aria-labelledby="warning">
{{#if mainResult.count.warning}} {{#if mainResult.count.warning}}
{{#mainResult.warnings}} {{#mainResult.warnings}}
<div class="panel panel-default task task_type_warning"> <div class="panel panel-default task task_type_warning">
@@ -182,10 +184,10 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
<div class="task-details collapse" id="warning-index-{{@index}}"> <div class="task-details collapse" id="warning-index-{{@index}}">
{{#if solutions.length}} {{#if solutions.length}}
<div class="subtitle" id="warning-solutions">Solutions:</div> <div class="subtitle">Solutions:</div>
<ul class="list-unstyled solutions-list" role="list" aria-labelledby="warning-solutions"> <ul class="list-unstyled solutions-list">
{{#each solutions}} {{#each solutions}}
<li class="list-unstyled__item" role="listitem"> <li class="list-unstyled__item">
<a class="link" href="{{url}}" target="_blank"> <a class="link" href="{{url}}" target="_blank">
<span class="glyphicon glyphicon-share" aria-hidden="true"></span>&nbsp;{{title}} <span class="glyphicon glyphicon-share" aria-hidden="true"></span>&nbsp;{{title}}
</a> </a>
@@ -195,10 +197,10 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
{{/if}} {{/if}}
{{#if items.length}} {{#if items.length}}
<div class="subtitle" id="warning-selectors">Selectors:</div> <div class="subtitle">Selectors:</div>
<ul class="list-unstyled selectors-list" role="list" aria-labelledby="warning-selectors"> <ul class="list-unstyled selectors-list">
{{#each items}} {{#each items}}
<li class="list-unstyled__item" role="listitem"> <li class="list-unstyled__item">
<span title="Context" data-role="context-popover" data-toggle="popover" data-content="{{context}}"> <span title="Context" data-role="context-popover" data-toggle="popover" data-content="{{context}}">
<code class="code">{{selector}}</code> <code class="code">{{selector}}</code>
</span> </span>
@@ -211,14 +213,14 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
</div> </div>
{{/mainResult.warnings}} {{/mainResult.warnings}}
<div class="to-top"> <div class="to-top">
<a class="link" href="#top" data-role="top"><span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>Back to top</a> <a class="link" href="#top"><span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>Back to top</a>
</div> </div>
{{else}} {{else}}
<div class="text">Well done! You have 0 warnings. <span class="glyphicon glyphicon-ok pull-right" aria-hidden="true"></span></div> <div class="text">Well done! You have 0 warnings. <span class="glyphicon glyphicon-ok pull-right" aria-hidden="true"></span></div>
{{/if}} {{/if}}
</div> </div>
<div id="notices-list" role="tabpanel" class="tab-pane tasks-list fade"> <div id="notices-list" role="tabpanel" class="tab-pane tasks-list fade" aria-labelledby="notices">
{{#if mainResult.count.notice}} {{#if mainResult.count.notice}}
{{#mainResult.notices}} {{#mainResult.notices}}
<div class="panel panel-default task task_type_notice"> <div class="panel panel-default task task_type_notice">
@@ -248,10 +250,10 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
<div class="task-details collapse" id="notice-index-{{@index}}"> <div class="task-details collapse" id="notice-index-{{@index}}">
{{#if solutions.length}} {{#if solutions.length}}
<div class="subtitle" id="notice-solutions">Solutions:</div> <div class="subtitle">Solutions:</div>
<ul class="list-unstyled solutions-list" role="list" aria-labelledby="notice-solutions"> <ul class="list-unstyled solutions-list">
{{#each solutions}} {{#each solutions}}
<li class="list-unstyled__item" role="listitem"> <li class="list-unstyled__item">
<a class="link" href="{{url}}" target="_blank"> <a class="link" href="{{url}}" target="_blank">
<span class="glyphicon glyphicon-share" aria-hidden="true"></span>&nbsp;{{title}} <span class="glyphicon glyphicon-share" aria-hidden="true"></span>&nbsp;{{title}}
</a> </a>
@@ -261,10 +263,10 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
{{/if}} {{/if}}
{{#if items.length}} {{#if items.length}}
<div class="subtitle" id="notice-selectors">Selectors:</div> <div class="subtitle">Selectors:</div>
<ul class="list-unstyled selectors-list" role="list" aria-labelledby="notice-selectors"> <ul class="list-unstyled selectors-list">
{{#each items}} {{#each items}}
<li class="list-unstyled__item" role="listitem"> <li class="list-unstyled__item">
<span title="Context" data-role="context-popover" data-toggle="popover" data-content="{{context}}"> <span title="Context" data-role="context-popover" data-toggle="popover" data-content="{{context}}">
<code class="code">{{selector}}</code> <code class="code">{{selector}}</code>
</span> </span>
@@ -277,14 +279,14 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
</div> </div>
{{/mainResult.notices}} {{/mainResult.notices}}
<div class="to-top"> <div class="to-top">
<a class="link" href="#top" data-role="top"><span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>Back to top</a> <a class="link" href="#top"><span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>Back to top</a>
</div> </div>
{{else}} {{else}}
<div class="text">Well done! You have 0 notices. <span class="glyphicon glyphicon-ok pull-right" aria-hidden="true"></span></div> <div class="text">Well done! You have 0 notices. <span class="glyphicon glyphicon-ok pull-right" aria-hidden="true"></span></div>
{{/if}} {{/if}}
</div> </div>
<div id="ignore-list" role="tabpanel" class="tab-pane tasks-list fade"> <div id="ignore-list" role="tabpanel" class="tab-pane tasks-list fade" aria-labelledby="ignore">
{{#if mainResult.ignore.length}} {{#if mainResult.ignore.length}}
{{#mainResult.ignore}} {{#mainResult.ignore}}
<div class="panel panel-default task task_type_ignore"> <div class="panel panel-default task task_type_ignore">
@@ -314,11 +316,11 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
</div> </div>
{{/mainResult.ignore}} {{/mainResult.ignore}}
<div class="to-top"> <div class="to-top">
<a class="link" href="#top" data-role="top"><span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>Back to top</a> <a class="link" href="#top"><span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>Back to top</a>
</div> </div>
{{else}} {{else}}
<div class="text">You have no ignored rules.</div> <div class="text">You have no ignored rules.</div>
{{/if}} {{/if}}
</div> </div>
</div> </div>
</div> </section>

View File

@@ -14,7 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
}} }}
<div class="col-md-12 zfix"> <section class="col-md-12 zfix">
<div class="ruled task-header"> <div class="ruled task-header">
<div class="row clearfix"> <div class="row clearfix">
<div class="col-md-12"> <div class="col-md-12">
@@ -24,11 +24,13 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
<div class="run-details task-header clearfix"> <div class="run-details task-header clearfix">
<div class="col-md-12 clearfix"> <div class="col-md-12 clearfix">
{{#unless readonly}} {{#unless readonly}}
<ul class="inline-list" role="menu"> <nav aria-label="task tools">
<li><a href="/{{task.id}}/edit">Edit this task</a></li> <ul class="inline-list">
<li><a href="/{{task.id}}/delete">Delete this task</a></li> <li><a href="/{{task.id}}/edit">Edit this task</a></li>
<li><a href="{{task.hrefRun}}" data-test="run-task">Run Pa11y</a></li> <li><a href="/{{task.id}}/delete">Delete this task</a></li>
</ul> <li><a href="{{task.hrefRun}}" data-test="run-task">Run Pa11y</a></li>
</ul>
</nav>
{{/unless}} {{/unless}}
{{#if mainResult}} {{#if mainResult}}
<div class="date">Last run: <strong>{{date-format mainResult.date format="DD MMM YYYY"}}</strong></div> <div class="date">Last run: <strong>{{date-format mainResult.date format="DD MMM YYYY"}}</strong></div>
@@ -39,4 +41,4 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
</div> </div>
</div> </div>
</div> </div>
</div> </section>

View File

@@ -14,31 +14,41 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
}} }}
<div class="col-md-12 task-card clearfix">
<button class="btn view-btn btn-grid btn-default"><i class="glyphicon glyphicon-th"></i> Grid</button>
<button class="btn view-btn btn-list"><i class="glyphicon glyphicon-align-justify "></i> List</button>
<ul class="list-unstyled clearfix crunch-bottom"> </div>
<ul class="list-unstyled clearfix crunch-bottom" id="grid-container">
{{#unless readonly}} {{#unless readonly}}
<li class="col-md-4 col-sm-6 task-card add-task"> <li class="col-md-4 col-sm-6 task-card add-task">
<a class="well task-card-link crunch-bottom" data-role="add-task" href="/new" data-test="add-task"> <a class="well task-card-link crunch-bottom" data-role="add-task" href="/new" data-test="add-task">
<p class="h3 crunch">Add new URL</p> <p class="h3 crunch">Add new URL</p>
<p class="supersize-me crunch">+</p> <p class="supersize-me crunch" aria-hidden="true">+</p>
</a> </a>
</li> </li>
{{/unless}} {{/unless}}
{{#each tasks}} {{#each tasks}}
<li class="col-md-4 col-sm-6 task-card" data-test="task" data-role="task" data-keywords="{{lowercase name}} {{lowercase standard}} {{simplify-url url}}"> <li class="col-md-4 col-sm-6 task-card" data-test="task" data-role="task" data-keywords="{{lowercase name}} {{lowercase standard}} {{simplify-url url}}">
<a class="well task-card-link crunch-bottom" title="Details for URL {{simplify-url url}}" href="{{href}}"> <a class="well task-card-link crunch-bottom" title="Details for URL {{simplify-url url}}" href="{{href}}">
<p class="h3">{{name}}</p> <div class="gridview">
<p class="h5">({{standard}})</p> <p class="h3">{{name}}</p>
<p class="h4">{{simplify-url url}}</p>
<p class="h5">({{standard}})</p>
</div>
{{#if lastResult}} {{#if lastResult}}
<ul class="clearfix list-unstyled floated-list task-stats"> <div class="gridview">
{{#lastResult}} <ul class="clearfix list-unstyled floated-list task-stats">
<li class="danger" title="Number of errors ({{count.error}})">{{count.error}}<span class="stat-type">Errors</span></li> {{#lastResult}}
<li class="warning" title="Number of warnings ({{count.warning}})">{{count.warning}}<span class="stat-type">Warnings</span></li> <li class="danger" title="Number of errors ({{count.error}})">{{count.error}}<span class="stat-type">Errors</span></li>
<li class="info last" title="Number of notices ({{count.notice}})">{{count.notice}}<span class="stat-type">Notices</span></li> <li class="warning" title="Number of warnings ({{count.warning}})">{{count.warning}}<span class="stat-type">Warnings</span></li>
{{/lastResult}} <li class="info last" title="Number of notices ({{count.notice}})">{{count.notice}}<span class="stat-type">Notices</span></li>
</ul> {{/lastResult}}
Last run {{date-format lastResult.date format="DD MMM YYYY"}} </ul>
</div>
<div class="last-run">Last run {{date-format lastResult.date format="DD MMM YYYY"}}</div>
{{else}} {{else}}
<p class="no-results">No results</p> <p class="no-results">No results</p>
{{/if}} {{/if}}
@@ -46,12 +56,14 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
{{#unless ../readonly}} {{#unless ../readonly}}
<div class="btn-group options-button text-right"> <div class="btn-group options-button text-right">
<button type="button" class="btn btn-info btn-xs dropdown-toggle" data-toggle="dropdown"><span class="sr-only">Options</span><span class="glyphicon glyphicon-cog"></span></button> <button type="button" class="btn btn-info btn-xs dropdown-toggle" data-toggle="dropdown"><span class="sr-only">Options</span><span class="glyphicon glyphicon-cog"></span></button>
<ul class="dropdown-menu pull-right" role="menu"> <nav class="dropdown-menu pull-right" aria-label="task tools">
<li><a href="{{href}}/edit">Edit this task</a></li> <ul class="options-menu">
<li><a href="{{href}}/delete">Delete this task</a></li> <li><a href="{{href}}/edit">Edit this task</a></li>
<li class="divider"></li> <li><a href="{{href}}/delete">Delete this task</a></li>
<li><a href="{{href}}/run" data-test="run-task">Run Pa11y</a></li> <li class="divider"></li>
</ul> <li><a href="{{href}}/run" data-test="run-task">Run Pa11y</a></li>
</ul>
</nav>
</div> </div>
{{/unless}} {{/unless}}
</li> </li>

View File

@@ -22,7 +22,7 @@ module.exports = presentIgnoreRules;
function presentIgnoreRules(ignore) { function presentIgnoreRules(ignore) {
return ignore.map(name => { return ignore.map(name => {
return { return {
name: name, name,
description: rules[name] description: rules[name]
}; };
}); });

View File

@@ -14,17 +14,18 @@
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
'use strict'; 'use strict';
const _ = require('underscore'); const groupBy = require('lodash.groupby');
const keys = require('lodash.keys');
const moment = require('moment'); const moment = require('moment');
module.exports = presentResultList; module.exports = presentResultList;
function presentResultList(results) { function presentResultList(results) {
const resultsByDay = _.groupBy(results, result => { const resultsByDay = groupBy(results, result => {
return moment(result.date).format('YYYY-MM-DD'); return moment(result.date).format('YYYY-MM-DD');
}); });
const uniqueDayResults = []; const uniqueDayResults = [];
_.keys(resultsByDay).forEach(day => { keys(resultsByDay).forEach(day => {
uniqueDayResults.push(resultsByDay[day][0]); uniqueDayResults.push(resultsByDay[day][0]);
}); });
return uniqueDayResults; return uniqueDayResults;

View File

@@ -14,7 +14,8 @@
// along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>. // along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
'use strict'; 'use strict';
const _ = require('underscore'); const groupBy = require('lodash.groupby');
const keys = require('lodash.keys');
const presentIgnoreRules = require('./ignore'); const presentIgnoreRules = require('./ignore');
const techs = require('../../data/techniques')(); const techs = require('../../data/techniques')();
@@ -35,12 +36,12 @@ function presentResult(result) {
// Split out message types // Split out message types
if (result.results) { if (result.results) {
const groupedByType = _.groupBy(result.results, 'type'); const groupedByType = groupBy(result.results, 'type');
['error', 'warning', 'notice'].forEach(type => { ['error', 'warning', 'notice'].forEach(type => {
const pluralType = `${type}s`; const pluralType = `${type}s`;
const results = groupedByType[type] || []; const results = groupedByType[type] || [];
const groupedByCode = _.groupBy(results, 'code'); const groupedByCode = groupBy(results, 'code');
result[pluralType] = _.keys(groupedByCode).map(group => { result[pluralType] = keys(groupedByCode).map(group => {
const groupMessage = groupedByCode[group][0]; const groupMessage = groupedByCode[group][0];
groupMessage.count = groupedByCode[group].length; groupMessage.count = groupedByCode[group].length;
groupMessage.items = groupedByCode[group].map(plural => ({ groupMessage.items = groupedByCode[group].map(plural => ({

View File

@@ -16,7 +16,7 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
}} }}
{{#content "title"}} {{#content "title"}}
{{task.name}} - {{simplify-url task.url}} ({{task.standard}}) - {{date-format mainResult.date format="DD MMM YYYY"}} Pa11y Dashboard Results - {{task.name}} - {{date-format mainResult.date format="DD MMM YYYY"}}
{{/content}} {{/content}}
{{> result-header}} {{> result-header}}

View File

@@ -22,14 +22,14 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
{{#edited}} {{#edited}}
<div class="col-md-12 clearfix" data-test="alert"> <div class="col-md-12 clearfix" data-test="alert">
<div class="alert alert-success"> <div class="alert alert-success">
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button> <button aria-hidden="true" data-dismiss="alert" class="close" type="button" aria-label="Close">×</button>
<strong>Success!</strong> <strong>Success!</strong>
<p>Your changes have been saved.</p> <p>Your changes have been saved.</p>
</div> </div>
</div> </div>
{{/edited}} {{/edited}}
<form role="form" class="col-md-12" action="/{{task.id}}/edit" method="post" data-test="edit-url-form"> <form class="col-md-12" action="/{{task.id}}/edit" method="post" data-test="edit-url-form">
<div class="legend"> <div class="legend">
<h1 class="h2 crunch-top">Edit URL</h1> <h1 class="h2 crunch-top">Edit URL</h1>
@@ -146,7 +146,7 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
</div> </div>
</div> </div>
<p class="control-label"><b>Ignore these rules</b> <a target="_blank" href="https://github.com/pa11y/pa11y/wiki/HTML-CodeSniffer-Rules">(full list of rules here)</a></p> <p class="control-label"><b>Ignore these rules</b> (<a target="_blank" href="https://github.com/pa11y/pa11y/wiki/HTML-CodeSniffer-Rules">full list of rules here</a>) <a href="#submitEditBtn" id="skipRules">Skip list of rules</a></p>
<div class="standards-lists"> <div class="standards-lists">
{{#standards}} {{#standards}}
@@ -166,7 +166,7 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
{{/standards}} {{/standards}}
</div> </div>
<button type="submit" class="btn btn-success">Save changes <span class="glyphicon glyphicon-save"></span></button> <button type="submit" id="submitEditBtn" class="btn btn-success">Save changes <span class="glyphicon glyphicon-save"></span></button>
<a href="/{{task.id}}/edit" class="btn btn-primary">Undo <span class="glyphicon glyphicon-refresh"></span></a> <a href="/{{task.id}}/edit" class="btn btn-primary">Undo <span class="glyphicon glyphicon-refresh"></span></a>
</form> </form>

View File

@@ -16,13 +16,13 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
}} }}
{{#content "title"}} {{#content "title"}}
{{task.name}} - {{simplify-url task.url}} ({{task.standard}}) Pa11y Dashboard Results for {{task.name}} - ({{task.standard}})
{{/content}} {{/content}}
{{#added}} {{#added}}
<div class="col-md-12 clearfix" data-test="alert"> <div class="col-md-12 clearfix" data-test="alert">
<div class="alert alert-success"> <div class="alert alert-success">
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button> <button data-dismiss="alert" class="close" type="button" aria-label="Close">×</button>
<strong>Whoop whoop!</strong> <strong>Whoop whoop!</strong>
<p>Your new URL has been added.</p> <p>Your new URL has been added.</p>
</div> </div>
@@ -32,7 +32,7 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
{{#running}} {{#running}}
<div class="col-md-12 clearfix" data-test="alert"> <div class="col-md-12 clearfix" data-test="alert">
<div class="alert alert-success"> <div class="alert alert-success">
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button> <button data-dismiss="alert" class="close" type="button" aria-label="Close">×</button>
<strong>New results incoming!</strong> <strong>New results incoming!</strong>
<p> <p>
New results are being generated for this URL in the background. New results are being generated for this URL in the background.
@@ -45,7 +45,7 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
{{#ruleIgnored}} {{#ruleIgnored}}
<div class="col-md-12 clearfix" data-test="alert"> <div class="col-md-12 clearfix" data-test="alert">
<div class="alert alert-success"> <div class="alert alert-success">
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button> <button data-dismiss="alert" class="close" type="button" aria-label="Close">×</button>
<strong>Rule ignored!</strong> <strong>Rule ignored!</strong>
<p> <p>
You've ignored an accessibility rule for this URL. You've ignored an accessibility rule for this URL.
@@ -58,7 +58,7 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
{{#ruleUnignored}} {{#ruleUnignored}}
<div class="col-md-12 clearfix" data-test="alert"> <div class="col-md-12 clearfix" data-test="alert">
<div class="alert alert-success"> <div class="alert alert-success">
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button> <button data-dismiss="alert" class="close" type="button" aria-label="Close">×</button>
<strong>Rule unignored!</strong> <strong>Rule unignored!</strong>
<p> <p>
You've removed an ignored accessibility rule for this URL. You've removed an ignored accessibility rule for this URL.