|
44 | 44 |
|
45 | 45 | const tableHeaders = [ |
46 | 46 | { |
| 47 | + cellClass: "overdue", |
| 48 | + name: "Approval Overdue", |
| 49 | + longName: "Approval overdue - surveys past their approval due date", |
| 50 | + description: "Survey is past its approval due date within Waltz", |
| 51 | + width: "20%", |
| 52 | + data: d => d.approvalOverdue |
| 53 | + }, { |
47 | 54 | cellClass: "awaiting-approval", |
48 | 55 | name: "Awaiting Approval", |
49 | 56 | longName: "Completed surveys - awaiting approval", |
|
52 | 59 | data: d => d.completed |
53 | 60 | }, { |
54 | 61 | cellClass: "overdue", |
55 | | - name: "Overdue", |
56 | | - longName: "Overdue surveys", |
57 | | - description: "Survey is past its submission due date within Waltz", // check approval or submission due date |
| 62 | + name: "Submission Overdue", |
| 63 | + longName: "Surveys for your approval which have not yet been submitted and are overdue", |
| 64 | + description: "Survey is past its submission due date within Waltz", |
58 | 65 | width: "20%", |
59 | | - data: d => d.overdue |
| 66 | + data: d => d.submissionOverdue |
60 | 67 | }, { |
61 | 68 | cellClass: "awaiting-completion", |
62 | | - name: "Awaiting Completion", |
| 69 | + name: "Awaiting Submission", |
63 | 70 | longName: "Incomplete surveys - awaiting completion", |
64 | 71 | description: "Surveys that will need approval once they have been submitted, this includes overdue surveys and those that have not passed their due date", |
65 | 72 | width: "20%", |
|
130 | 137 | const approved = _.get(surveysByStatus, ["APPROVED"], []) |
131 | 138 | const rejected = _.get(surveysByStatus, ["REJECTED"], []) |
132 | 139 |
|
133 | | - const [overdue, outstanding] = _.partition(incomplete, d => new Date(d.surveyRun.dueDate) < currentDate); |
| 140 | + const submissionOverdue = _.filter(incomplete, d => new Date(d.surveyInstance.dueDate) < currentDate); |
| 141 | + const approvalOverdue = _.filter(completed, d => new Date(d.surveyInstance.approvalDueDate) < currentDate); |
134 | 142 |
|
135 | 143 | return { |
136 | 144 | template: templatesById[k], |
137 | 145 | incomplete, |
138 | 146 | approved, |
139 | 147 | rejected, |
140 | 148 | completed, |
141 | | - overdue, |
| 149 | + submissionOverdue, |
| 150 | + approvalOverdue |
142 | 151 | }}) |
143 | 152 | .orderBy(d => d.template.name) |
144 | 153 | .value(); |
|
0 commit comments