mirror of
https://github.com/pa11y/pa11y-dashboard.git
synced 2025-09-24 22:31:15 +00:00
Add presenters for tasks and results
This commit is contained in:
19
view/presenter/task.js
Normal file
19
view/presenter/task.js
Normal file
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
var presentResult = require('./result');
|
||||
|
||||
module.exports = presentTask;
|
||||
|
||||
function presentTask (task) {
|
||||
|
||||
// Add additional info
|
||||
task.href = '/' + task.id;
|
||||
task.hrefJson = '/' + task.id + '.json';
|
||||
|
||||
// Present the last result if present
|
||||
if (task.last_result) {
|
||||
task.last_result = presentResult(task.last_result);
|
||||
}
|
||||
|
||||
return task;
|
||||
}
|
Reference in New Issue
Block a user