Skip to content

Commit

Permalink
Merge pull request #6632 from deutschebank/db-contrib/waltz-6440-surv…
Browse files Browse the repository at this point in the history
…ey-due-tweaks

Db contrib/waltz 6440 survey due tweaks
  • Loading branch information
davidwatkins73 authored May 26, 2023
2 parents 2574aa4 + fc6e1d1 commit 308319e
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 13 deletions.
17 changes: 14 additions & 3 deletions waltz-ng/client/survey/components/survey-run-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 waltz-display-field-label">
Description
<div class="col-sm-2">
<div class="waltz-display-field-label">
Run Description
</div>
<div class="small help-block">
Default description
</div>
</div>
<div class="col-sm-10">
<waltz-markdown text="$ctrl.run.description">
Expand All @@ -45,7 +50,10 @@
<br>
<div class="row">
<div class="col-sm-2 waltz-display-field-label">
Submission Due
Run Submission Due Date
<div class="small help-block">
Default submission due date, can be overriden by instances
</div>
</div>
<div class="col-sm-4">
<waltz-editable-field on-save="$ctrl.updateDueDate"
Expand All @@ -56,6 +64,9 @@
</div>
<div class="col-sm-2 waltz-display-field-label">
Approval Due
<div class="small help-block">
Default approval due date, can be overriden by instances
</div>
</div>
<div class="col-sm-4">
<waltz-editable-field on-save="$ctrl.updateApprovalDueDate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
const tableHeaders = [
{
cellClass: "overdue",
name: "Approval Overdue",
longName: "Approval overdue - surveys past their approval due date",
description: "Survey is past its approval due date within Waltz",
width: "20%",
data: d => d.approvalOverdue
}, {
cellClass: "awaiting-approval",
name: "Awaiting Approval",
longName: "Completed surveys - awaiting approval",
Expand All @@ -52,14 +59,14 @@
data: d => d.completed
}, {
cellClass: "overdue",
name: "Overdue",
longName: "Overdue surveys",
description: "Survey is past its submission due date within Waltz", // check approval or submission due date
name: "Submission Overdue",
longName: "Surveys for your approval which have not yet been submitted and are overdue",
description: "Survey is past its submission due date within Waltz",
width: "20%",
data: d => d.overdue
data: d => d.submissionOverdue
}, {
cellClass: "awaiting-completion",
name: "Awaiting Completion",
name: "Awaiting Submission",
longName: "Incomplete surveys - awaiting completion",
description: "Surveys that will need approval once they have been submitted, this includes overdue surveys and those that have not passed their due date",
width: "20%",
Expand Down Expand Up @@ -130,15 +137,17 @@
const approved = _.get(surveysByStatus, ["APPROVED"], [])
const rejected = _.get(surveysByStatus, ["REJECTED"], [])
const [overdue, outstanding] = _.partition(incomplete, d => new Date(d.surveyRun.dueDate) < currentDate);
const submissionOverdue = _.filter(incomplete, d => new Date(d.surveyInstance.dueDate) < currentDate);
const approvalOverdue = _.filter(completed, d => new Date(d.surveyInstance.approvalDueDate) < currentDate);
return {
template: templatesById[k],
incomplete,
approved,
rejected,
completed,
overdue,
submissionOverdue,
approvalOverdue
}})
.orderBy(d => d.template.name)
.value();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@
const approved = _.get(surveysByStatus, ["APPROVED"], [])
const rejected = _.get(surveysByStatus, ["REJECTED"], [])
const [overdue, outstanding] = _.partition(incomplete, d => new Date(d.surveyRun.dueDate) < currentDate);
const [dueWeek, moreThanWeek] = _.partition(outstanding, d => new Date(d.surveyRun.dueDate) < weekFromNow);
const [dueMonth, future] = _.partition(moreThanWeek, d => new Date(d.surveyRun.dueDate) < monthFromNow);
const [overdue, outstanding] = _.partition(incomplete, d => new Date(d.surveyInstance.dueDate) < currentDate);
const [dueWeek, moreThanWeek] = _.partition(outstanding, d => new Date(d.surveyInstance.dueDate) < weekFromNow);
const [dueMonth, future] = _.partition(moreThanWeek, d => new Date(d.surveyInstance.dueDate) < monthFromNow);
return {
template: templatesById[k],
Expand Down
10 changes: 10 additions & 0 deletions waltz-ng/client/survey/survey-run-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ const columnDefs = [
cellFilter: "toDisplayName:'surveyInstanceStatus'"
}, {
field: "dueDate",
name: "Submission Due",
cellTemplate: `
<div class="ui-grid-cell-contents">
<waltz-from-now timestamp="COL_FIELD"
days-only="true">
</waltz-from-now>
</div>`
}, {
field: "approvalDueDate",
name: "Approval Due",
cellTemplate: `
<div class="ui-grid-cell-contents">
<waltz-from-now timestamp="COL_FIELD"
Expand Down

0 comments on commit 308319e

Please sign in to comment.