mirror of
https://github.com/pa11y/pa11y-dashboard.git
synced 2025-09-24 22:31:15 +00:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f7c3b5e99a | ||
![]() |
2ec9139ab0 | ||
![]() |
ce9219c01e | ||
![]() |
28a0a861f3 | ||
![]() |
acba762a66 | ||
![]() |
9b80bfa6ab | ||
![]() |
926cb5af3b | ||
![]() |
503ed16265 |
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,6 +1,16 @@
|
||||
|
||||
# Changelog
|
||||
|
||||
## 2.2.1 (2017-02-07)
|
||||
|
||||
* Fix task editing when no actions are specified
|
||||
|
||||
## 2.2.0 (2017-01-27)
|
||||
|
||||
* Add support for Pa11y actions
|
||||
* Update dependencies
|
||||
* pa11y-webservice: ~2.1.2 to ^2.3.0
|
||||
|
||||
## 2.1.2 (2016-12-12)
|
||||
|
||||
* Hide the "add" button in readonly mode
|
||||
|
10
README.md
10
README.md
@@ -22,7 +22,7 @@ Pa11y Dashboard is a web interface to the [Pa11y][pa11y] accessibility reporter;
|
||||
Setup
|
||||
-----
|
||||
|
||||
Pa11y Dashboard requires [Node.js][node] 4+ and [PhantomJS][phantom]. See the [Pa11y][pa11y] documentation for detailed instructions on how to install these dependencies on your operating system.
|
||||
Pa11y Dashboard requires [Node.js][node] 4+. See the [Pa11y][pa11y] documentation for detailed instructions on how to install this on your operating system.
|
||||
|
||||
You'll also need to have [MongoDB][mongo] installed and running. See the [MongoDB install guide][mongo-install] for more information on this.
|
||||
|
||||
@@ -128,7 +128,7 @@ We also maintain a [migration guide](MIGRATION.md) to help you migrate.
|
||||
| :grey_question: | Major Version | Last Minor Release | Node.js Versions | Support End Date |
|
||||
| :-------------- | :------------ | :----------------- | :--------------- | :--------------- |
|
||||
| :heart: | 2 | N/A | 4+ | N/A |
|
||||
| :hourglass: | 1 | 1.12 | 0.10–6 | 2016-12-05 |
|
||||
| :skull: | 1 | 1.12 | 0.10–6 | 2016-12-05 |
|
||||
|
||||
If you're opening issues related to these, please mention the version that the issue relates to.
|
||||
|
||||
@@ -136,8 +136,8 @@ If you're opening issues related to these, please mention the version that the i
|
||||
License
|
||||
-------
|
||||
|
||||
Pa11y Dashboard is licensed under the [GNU General Public License 3.0][info-license].
|
||||
Copyright © 2013–2016, Springer Nature
|
||||
Pa11y Dashboard is licensed under the [GNU General Public License 3.0][info-license].<br/>
|
||||
Copyright © 2013–2017, Team Pa11y
|
||||
|
||||
|
||||
|
||||
@@ -159,5 +159,5 @@ Copyright © 2013–2016, Springer Nature
|
||||
[info-build]: https://travis-ci.org/pa11y/dashboard
|
||||
[shield-license]: https://img.shields.io/badge/license-GPL%203.0-blue.svg
|
||||
[shield-node]: https://img.shields.io/badge/node.js%20support-4–6-brightgreen.svg
|
||||
[shield-version]: https://img.shields.io/badge/version-2.1.2-blue.svg
|
||||
[shield-version]: https://img.shields.io/badge/version-2.2.1-blue.svg
|
||||
[shield-build]: https://img.shields.io/travis/pa11y/dashboard/master.svg
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pa11y-dashboard",
|
||||
"version": "2.1.2",
|
||||
"version": "2.2.1",
|
||||
"private": true,
|
||||
"description": "Pa11y Dashboard is a visual web interface to the Pa11y accessibility reporter",
|
||||
"keywords": [
|
||||
@@ -8,6 +8,7 @@
|
||||
"analysis",
|
||||
"report"
|
||||
],
|
||||
"author": "Team Pa11y",
|
||||
"contributors": [
|
||||
"Perry Harlock (http://www.phwebs.co.uk/)",
|
||||
"Rowan Manning (http://rowanmanning.com/)"
|
||||
@@ -30,7 +31,7 @@
|
||||
"express-hbs": "~1.0",
|
||||
"http-headers": "^3.0.1",
|
||||
"moment": "~2.13",
|
||||
"pa11y-webservice": "^2.1.2",
|
||||
"pa11y-webservice": "^2.3.0",
|
||||
"pa11y-webservice-client-node": "^1.2.1",
|
||||
"underscore": "~1.8"
|
||||
},
|
||||
|
15
route/new.js
15
route/new.js
@@ -40,11 +40,21 @@ function route(app) {
|
||||
|
||||
app.express.post('/new', (req, res) => {
|
||||
|
||||
let parsedActions;
|
||||
if (req.body.actions) {
|
||||
parsedActions = req.body.actions.split(/[\r\n]+/)
|
||||
.map(action => {
|
||||
return action.trim();
|
||||
})
|
||||
.filter(action => {
|
||||
return Boolean(action);
|
||||
});
|
||||
}
|
||||
|
||||
let parsedHeaders;
|
||||
if (req.body.headers) {
|
||||
parsedHeaders = httpHeaders(req.body.headers, true);
|
||||
}
|
||||
console.log(parsedHeaders);
|
||||
|
||||
const newTask = {
|
||||
name: req.body.name,
|
||||
@@ -53,6 +63,7 @@ function route(app) {
|
||||
ignore: req.body.ignore || [],
|
||||
timeout: req.body.timeout || undefined,
|
||||
wait: req.body.wait || undefined,
|
||||
actions: parsedActions,
|
||||
username: req.body.username || undefined,
|
||||
password: req.body.password || undefined,
|
||||
headers: parsedHeaders,
|
||||
@@ -73,6 +84,8 @@ function route(app) {
|
||||
});
|
||||
return standard;
|
||||
});
|
||||
newTask.actions = req.body.actions;
|
||||
newTask.headers = req.body.headers;
|
||||
return res.render('new', {
|
||||
error: err,
|
||||
standards: standards,
|
||||
|
@@ -13,7 +13,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/>.
|
||||
|
||||
/*jshint maxcomplexity:10*/
|
||||
/*jshint maxcomplexity:12*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -43,6 +43,7 @@ function route(app) {
|
||||
});
|
||||
return standard;
|
||||
});
|
||||
task.actions = (task.actions ? task.actions.join('\n') : '');
|
||||
res.render('task/edit', {
|
||||
edited: (typeof req.query.edited !== 'undefined'),
|
||||
standards: standards,
|
||||
@@ -57,10 +58,23 @@ function route(app) {
|
||||
if (err) {
|
||||
return next();
|
||||
}
|
||||
const originalActions = req.body.actions;
|
||||
const originalHeaders = req.body.headers;
|
||||
req.body.ignore = req.body.ignore || [];
|
||||
req.body.timeout = req.body.timeout || undefined;
|
||||
req.body.wait = req.body.wait || undefined;
|
||||
if (req.body.actions) {
|
||||
req.body.actions = req.body.actions.split(/[\r\n]+/)
|
||||
.map(action => {
|
||||
return action.trim();
|
||||
})
|
||||
.filter(action => {
|
||||
return Boolean(action);
|
||||
});
|
||||
}
|
||||
if (!req.body.actions) {
|
||||
req.body.actions = [];
|
||||
}
|
||||
req.body.username = req.body.username || undefined;
|
||||
req.body.password = req.body.password || undefined;
|
||||
req.body.hideElements = req.body.hideElements || undefined;
|
||||
@@ -71,6 +85,7 @@ function route(app) {
|
||||
task.ignore = req.body.ignore;
|
||||
task.timeout = req.body.timeout;
|
||||
task.wait = req.body.wait;
|
||||
task.actions = originalActions;
|
||||
task.username = req.body.username;
|
||||
task.password = req.body.password;
|
||||
task.headers = originalHeaders;
|
||||
|
@@ -70,6 +70,11 @@ describe('GET /new', function() {
|
||||
assert.strictEqual(field.attr('value'), '');
|
||||
});
|
||||
|
||||
it('should have an "actions" field', function() {
|
||||
const field = this.form.find('textarea[name=actions]').eq(0);
|
||||
assert.isDefined(field);
|
||||
});
|
||||
|
||||
it('should have a "username" field', function() {
|
||||
const field = this.form.find('input[name=username]').eq(0);
|
||||
assert.isDefined(field);
|
||||
|
@@ -71,6 +71,11 @@ describe('GET /<task-id>/edit', function() {
|
||||
assert.strictEqual(field.attr('value'), '0');
|
||||
});
|
||||
|
||||
it('should have an "actions" field', function() {
|
||||
const field = this.form.find('textarea[name=actions]').eq(0);
|
||||
assert.isDefined(field);
|
||||
});
|
||||
|
||||
it('should have a disabled "standard" field', function() {
|
||||
const field = this.form.find('select[name=standard]').eq(0);
|
||||
assert.isDefined(field);
|
||||
|
@@ -84,6 +84,19 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group clearfix">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-sm-4 col-xs-6">
|
||||
<label class="control-label" for="new-task-actions">
|
||||
Task Actions
|
||||
(<a href="https://github.com/pa11y/pa11y#actions">see Pa11y documentation</a>)
|
||||
</label>
|
||||
<textarea class="form-control" id="new-task-actions" name="actions" aria-describedby="action-detail" placeholder="E.g. Click element #login-button">{{task.actions}}</textarea>
|
||||
<em id="action-detail">(one action per line)</em>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group clearfix">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-sm-4 col-xs-6">
|
||||
|
@@ -18,7 +18,7 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
|
||||
<div class="footer" role="contentinfo">
|
||||
<div class="container">
|
||||
<div class="col-md-5">
|
||||
<small>© {{year}} Springer Nature.<br/>Pa11y Dashboard is licensed under the GNU General Public License 3.0.<br/>Version {{version}}</small>
|
||||
<small>© 2013–{{year}} Team Pa11y.<br/>Pa11y Dashboard is licensed under the GNU General Public License 3.0.<br/>Version {{version}}</small>
|
||||
</div>
|
||||
<div class="col-md-7 clearfix">
|
||||
<ul class="crunch-bottom floated-list nav">
|
||||
|
@@ -96,6 +96,19 @@ along with Pa11y Dashboard. If not, see <http://www.gnu.org/licenses/>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group clearfix">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-sm-4 col-xs-6">
|
||||
<label class="control-label" for="new-task-actions">
|
||||
Task Actions
|
||||
(<a href="https://github.com/pa11y/pa11y#actions">see Pa11y documentation</a>)
|
||||
</label>
|
||||
<textarea class="form-control" id="new-task-actions" name="actions" aria-describedby="action-detail" placeholder="E.g. Click element #login-button">{{task.actions}}</textarea>
|
||||
<em id="action-detail">(one action per line)</em>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group clearfix">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-sm-4 col-xs-6">
|
||||
|
Reference in New Issue
Block a user