GithubHelp home page GithubHelp logo

pa11y / pa11y-dashboard Goto Github PK

View Code? Open in Web Editor NEW
967.0 188.0 178.0 3.39 MB

Pa11y Dashboard is a web interface which helps you monitor the accessibility of your websites

Home Page: https://pa11y.org

License: GNU General Public License v3.0

JavaScript 46.06% HTML 10.57% Makefile 0.18% Less 43.19%
a11y accessibility dashboard mongo pa11y

pa11y-dashboard's Introduction

Pa11y Dashboard

Pa11y Dashboard is a web interface to the Pa11y accessibility reporter; allowing you to focus on fixing issues rather than hunting them down.

Version Node.js version support Build status GPL-3.0 licensed

dashboard results-page


Requirements

  • Node.js: Pa11y Dashboard 4 requires a stable (even-numbered) version of Node.js of 12 or above.
  • MongoDB: This project depends on Pa11y Webservice, which stores test results in a MongoDB database and expects one to be available and running.

Pally Dashboard 4 and Linux/Ubuntu

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 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.

Setting up Pa11y Dashboard

In order to run Pa11y Dashboard, we recommend cloning this repository locally:

git clone https://github.com/pa11y/pa11y-dashboard.git

Then installing the dependencies:

cd pa11y-dashboard
npm install

Installing MongoDB

Instructions for installing and running MongoDB are outside the scope of this document. When in doubt, please refer to the MongoDB installation instructions 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.

Pa11y Dashboard uses MongoDB Node.js Driver version 3, which may not support some features 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:

brew tap mongodb/brew

Install a supported Community version of MongoDB:

brew install [email protected]

Start the MongoDB server:

brew services start mongodb/brew/[email protected]

Check that the service has started properly:

$ 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:

PORT=8080 node index.js

The available configurations are documented in the next section.

Option 2: Using config files

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:

NODE_ENV=development node index.js

Three example files are provided in this repository, you can copy and customise them to your liking:

cp config/development.sample.json config/development.json
cp config/production.sample.json config/production.json
cp config/test.sample.json config/test.json

The available configurations are documented in the next section.

If you run into problems, check the troubleshooting guide.

Configurations

The boot configurations for Pa11y Dashboard are as follows. Look at the sample JSON files in the repo for example usage.

port

(number) The port to run the application on. Set via a config file or the PORT environment variable.

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.

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.

siteMessage

(string) A message to display prominently on the site home page. Defaults to null.

webservice

This can either be an object containing Pa11y Webservice configurations, 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

There are many ways to contribute to Pa11y Dashboard, we cover these in the contributing guide 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. You'll then need to start the application in test mode with:

NODE_ENV=test node index.js

You'll now be able to run the following commands:

npm run lint   # Lint the code
npm test       # Run all tests

To compile the client-side JavaScript and CSS, you'll need the following commands. Compiled code is committed to the repository.

make less    # Compile the site CSS from LESS files
make uglify  # Compile and uglify the client-side JavaScript

Useful resources

Troubleshooting

Common issues

  • 500 errors or Could not connect to pa11y-webservice messages are often related to MongoDB. Ensure that you have the appropriate version of 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.

Create a new issue

Check the issue tracker 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. 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 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

Pa11y Dashboard is licensed under the GNU General Public License 3.0.
Copyright © 2023, Team Pa11y and contributors

pa11y-dashboard's People

Contributors

alexkilgour avatar andrewmee avatar danyalaytekin avatar dependabot[bot] avatar dotcode avatar dracos avatar emusatova avatar frvge avatar hollsk avatar j-mes avatar jeremyenglert avatar josebolos avatar joshski avatar lc512k avatar m1rp avatar michaelmior avatar paazmaya avatar quannon avatar rayraegah avatar rowanmanning avatar sangitamane avatar snyk-bot avatar una avatar usmanatron avatar wilco42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pa11y-dashboard's Issues

Add some dev fixtures

We need to make it a lot easier to see lots of different URLs with results, so that it's easier to see all the styles etc. Also for demo purposes and to get new developers up-and-running quicker.

Name

What should this be called? "pa11y-web" isn't particularly descriptive in my opinion. Something with "dashboard" in the name might make sense. It doesn't technically have to be pa11y-associated – pa11y is almost just an implementation detail.

Suggestions welcome.

Refactor layout of task results page

Move the date selector to the main section above the graph.
Add the current date being shown to the main section above the graph
Add a Results from dd/mm/yyy to the bottom section below the graph as a title.

This will then make the results page clearer that the results being shown (apart from the graph are just from this particular date)

Fix layout grid in IE7 and IE8

Bootstrap 3 does not support less than IE9 unless you use response.js to enable media-queries in IE8. In IE7 you get bugger all.
Rather than rely on a js script I have adopted a fixed width for IE8 and IE7 and made specific styles for these browsers. No js needed :-)

Investigate using Dust for templates

Handlebars is being used at the moment, because it works well with Express and we can easily get layout/partial/block support. Investigate replacing with Dust, as we're using Dust on some internal projects.

Add context to numbers in index view

The numbers in the index view could do with something to contextualise them. I went to hover over them, maybe a title attribute would make sense explaining what the numbers mean?

Add ability to remove tasks / urls

As a user
When I am on the pa11y site
And I have added a task / url
If I no longer need it I should be able to delete it

I think this is pretty important until we workout how to give edit access. If I add a task / url and the url is wrong or I no longer need it I should be able to remove it as it will be throwing my stats out

Refactor date selector navigation to be non-js friendly

As a user
When on the tasks page
Then I should be able to navigate to results for another date from the list of date links in the left hand column when js is disabled as well as when it is enabled.

Currently the standard implementation of the bootstrap dropdown menu does not degrade gracefully.

Fix js for jumping to an already opened task list

As a user
When in the task view and I click on one of the stats boxes
Then I should jump to the correct type of list (error, warning or notice) and if this box is already showing the contents it should stay open and not toggle closed.

H1s should describe the page

Small thing I noticed: the page h1 is always the same. Ideally it should describe the current page, not be used for the banner.

I've got around this before by making the banner a h1 on the home page, but just an anchor on all other pages.

Look at reducing number of js files

There are a number of separate js files being called in.
1 ) Reduce number of files being called. Reduce bootstrap to one minified bootstrap. Same with flot?
2) For @rowanmanning : Could do with these being compiled into a single minified js file for production.

Allow editing of tasks

This isn't as simple as it seems; there are a couple of questions to discuss:

  1. Will it be confusing/misleading to see sudden drops in number of errors (for example, if somebody adds some ignore rules to an existing task)
  2. Do we want to log changes to a task, to allow people to easily see when something changed? If so, how should this look?
  3. Is this required, or would it be better to just create a new task? If we do this, would it make sense to be able to "archive" old tasks, in order to give them less prominence in the interface?

View diffs between results

Add the ability to view diffs between results, so you can easily see which errors are new or which errors have been fixed.

Convert current css to less files

Currently we use 2 separate css files. One for the bootstrap template and one for the pa11y specific styles.
We should ideally be using the less files for the bootstrap theme and extra pa11y specific less files which get compiled into a single css file for production.

Add descriptions to ignore rules

This can be accessed using {{description}}. I don't know what's best for this, maybe as a title attribute or something? Your call

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.