Implement the task list-supported template#453
Conversation
f36b622 to
718e796
Compare
c2d18fb to
e8ca350
Compare
b55ff94 to
1362a42
Compare
| const questionnaire = createQuestionnaireHelper({questionnaireDefinition}); | ||
| const taskListService = createTaskListService({questionnaireDefinition}); | ||
|
|
||
| const section = questionnaire.getSection(sectionId); |
There was a problem hiding this comment.
Rather than using questionnaire.getSection() then section.getSchema() you could just get the schema by using questionnaire.getSectionDefinition().schema
| const {states} = questionnaireDefinition.routes; | ||
|
|
||
| if (supportsTaskList(questionnaireDefinition)) { | ||
| const tasks = states; |
| const AjvErrors = require('ajv-errors'); | ||
| const VError = require('verror'); | ||
| const createQRouter = require('q-router'); | ||
| const router = require('q-router'); |
There was a problem hiding this comment.
Probably not necessary, the module is still called q-router!
| previousProgressEntryLink = `${process.env.DCS_URL}/api/questionnaires/${ | ||
| questionnaire.id | ||
| }/progress-entries?filter[sectionId]=${qRouter.previous(sectionId).id}`; | ||
| } |
There was a problem hiding this comment.
Fine for now, but we should chuck a ToDo in to get rid of this. Would be trivial for q-router to return the correct thing rather than being queried by the DCS
| } | ||
|
|
||
| // TODO: pass in the sectionSchema, not the sectionId. OR | ||
| // TODO: get schema from sectionId and interrogate the shape instead of the IDs value. |
There was a problem hiding this comment.
Another reason to improve the progress entries function
| } | ||
|
|
||
| return taskApplicabilityStatus; | ||
| } |
There was a problem hiding this comment.
I understand what you've done here, but I think it should be:
const status = taskApplicabilityStatus = 'applicable' ? taskCompletionStatus : taskApplicabilityStatus
It's not a perfect solution but I think it's just far easier to read and understand than these precedence arrays.
1362a42 to
51316e0
Compare
54ebc73 to
ebf26e0
Compare
b6673c8 to
2e64e6b
Compare
No description provided.