diff --git a/config/test.sample.json b/config/test.sample.json deleted file mode 100644 index 23ffdab..0000000 --- a/config/test.sample.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "port": 4000, - "noindex": true, - "readonly": false, - - "webservice": { - "database": "mongodb://localhost/pa11y-webservice-test", - "host": "0.0.0.0", - "port": 3000, - "cron": "0 30 0 * * *" - } -} \ No newline at end of file diff --git a/route/new.js b/route/new.js index 3fd49de..deee01a 100644 --- a/route/new.js +++ b/route/new.js @@ -36,6 +36,15 @@ function route(app) { }); app.express.post('/new', (req, res) => { + + let parsedHeaders = ''; + + try { + parsedHeaders = JSON.parse(req.body.headers); + } catch (e) { + console.log(`error parsing headers object: ${req.body.headers}. Ignoring.`); + } + const newTask = { name: req.body.name, url: req.body.url, @@ -45,7 +54,10 @@ function route(app) { wait: req.body.wait || undefined, username: req.body.username || undefined, password: req.body.password || undefined + headers: parsedHeaders || undefined, + hideElements: req.body.hide || undefined }; + app.webservice.tasks.create(newTask, (err, task) => { if (err) { const standards = getStandards().map(standard => { diff --git a/route/task/edit.js b/route/task/edit.js index ee3bb74..ba99ea4 100644 --- a/route/task/edit.js +++ b/route/task/edit.js @@ -69,6 +69,8 @@ function route(app) { task.wait = req.body.wait; task.username = req.body.username; task.password = req.body.password; + task.headers = req.body.headers; + task.hideElements = req.body.hideElements; const standards = getStandards().map(standard => { if (standard.title === task.standard) { standard.selected = true; diff --git a/view/new.html b/view/new.html index 2acaa34..14a0918 100644 --- a/view/new.html +++ b/view/new.html @@ -102,6 +102,24 @@ along with Pa11y Dashboard. If not, see . +
+
+
+ + +
+
+
+ +
+
+
+ + (CSS selector) +
+
+
+

Ignore these rules (full list of rules here)

diff --git a/view/task/edit.html b/view/task/edit.html index 1807d4a..f6cc827 100644 --- a/view/task/edit.html +++ b/view/task/edit.html @@ -114,6 +114,24 @@ along with Pa11y Dashboard. If not, see .
+
+
+
+ + +
+
+
+ +
+
+
+ + (CSS selector) +
+
+
+

Ignore these rules (full list of rules here)