From 18ed75f2b43342aa55bcddb4150cbf0c1062150d Mon Sep 17 00:00:00 2001 From: Adam Silver Date: Thu, 26 Jul 2018 13:57:45 +0100 Subject: [PATCH 1/4] FR journey amendments --- app/data/cases.js | 24 ++++---- app/routes/fr.js | 35 +++++++++--- app/routes/helpers.js | 6 +- app/views/app/case/fr/decision/check.html | 29 +++++++--- .../app/case/fr/decision/confirmation.html | 24 ++++---- app/views/app/case/fr/decision/decision.html | 25 +++++---- .../case/fr/decision/more-information.html | 55 +++++++++++++++++++ app/views/app/case/fr/summary.html | 2 +- app/views/app/dashboard.html | 4 +- 9 files changed, 150 insertions(+), 54 deletions(-) create mode 100644 app/views/app/case/fr/decision/more-information.html diff --git a/app/data/cases.js b/app/data/cases.js index e9f988fb..6298ab8a 100644 --- a/app/data/cases.js +++ b/app/data/cases.js @@ -6,7 +6,7 @@ module.exports = [ { id: 'FR1231612322', typeId: types.fr.id, - status: 'Draft consent order submitted', + status: 'Review draft consent order', applicationDate: moment('2017-11-20 13:01'), lastAction: moment('2018-01-25 16:48'), tribunalCentre: 'Fox Court', @@ -20,13 +20,13 @@ module.exports = [ }, { id: uuid(), - date: moment('2018-07-07 13:01'), - title: 'D84 submitted', + date: moment('2018-05-20 13:01'), + title: 'Statement of information (D81) submitted', by: 'John Smith' }, { id: uuid(), - date: moment('2018-07-10 13:01'), + date: moment('2018-05-20 13:01'), title: 'Form A submitted', by: 'John Smith' }, @@ -61,13 +61,13 @@ module.exports = [ ], documents: [{ id: '1', - label: 'Consent order' + label: 'Draft consent order' + }, { + id: '3', + label: 'Statement of information (D81)' }, { id: '2', label: 'Form A' - }, { - id: '3', - label: 'D81' }], linkedCases: [{ type: 'Divorce', @@ -78,7 +78,7 @@ module.exports = [ { id: 'SC1231612322', typeId: types.pip.id, - status: 'Deadline expired', + status: 'Review case', applicationDate: moment('2017-11-20 13:01'), lastAction: moment('2018-01-25 16:48'), urgent: true, @@ -273,7 +273,7 @@ module.exports = [ } } ], - status: 'Party replied', + status: 'Review party response', applicationDate: moment('2018-05-09'), lastAction: moment('2018-05-09'), urgent: false, @@ -342,7 +342,7 @@ module.exports = [ } } ], - status: 'Consider decree nisi', + status: 'Review decree nisi', reason: 'Separated for 2 years and consent', applicationDate: moment('2018-05-09'), documents: [{ @@ -404,7 +404,7 @@ module.exports = [ } } ], - status: 'Consider decree nisi', + status: 'Review decree nisi', reason: 'Separated for 2 years and consent', applicationDate: moment('2018-05-09'), documents: [{ diff --git a/app/routes/fr.js b/app/routes/fr.js index e9a7c0a2..1c633210 100644 --- a/app/routes/fr.js +++ b/app/routes/fr.js @@ -75,10 +75,12 @@ router.get('/app/cases/:id/fr/decision', (req, res) => { }); router.post('/app/cases/:id/fr/decision', (req, res) => { - if(req.body.decision === 'Approve') { + if(req.body.decision === 'Approve consent order') { res.redirect(`/app/cases/${req.params.id}/fr/notes`); - } else if(req.body.decision === 'Approve with changes') { - res.redirect(`/app/cases/${req.params.id}/fr/upload-1`); + } else if(req.body.decision === 'Ask for more information') { + res.redirect(`/app/cases/${req.params.id}/fr/more-information`); + } else if(req.body.decision === 'List for hearing') { + res.redirect(`/app/cases/${req.params.id}/fr/hearing-details`); } else { res.redirect(`/app/cases/${req.params.id}/fr/upload-1`); } @@ -104,11 +106,11 @@ router.post('/app/cases/:id/fr/upload-1', (req, res) => { res.redirect(`/app/cases/${req.params.id}/fr/upload-2`); } else { switch(req.session.data.decision) { - case 'Approve': - case 'Approve with changes': + case 'Approve consent order': + case 'Ask for more information': res.redirect(`/app/cases/${req.params.id}/fr/notes`); break; - case 'Reject': + case 'Reject consent order': res.redirect(`/app/cases/${req.params.id}/fr/reject-reasons`); break; } @@ -131,13 +133,32 @@ router.get('/app/cases/:id/fr/upload-2', (req, res) => { }); router.post('/app/cases/:id/fr/upload-2', (req, res) => { - if(req.session.data.decision === 'Approve with changes') { + if(req.session.data.decision === 'Ask for more information') { res.redirect(`/app/cases/${req.params.id}/fr/notes`); } else { res.redirect(`/app/cases/${req.params.id}/fr/reject-reasons`); } }); +router.get('/app/cases/:id/fr/more-information', (req, res) => { + var _case = helpers.getCase(req.session.cases, req.params.id); + + var pageObject = { + casebar: helpers.getCaseBarObject(_case), + caseActions: helpers.getCaseActions(_case), + backLink: { + href: `/app/cases/${_case.id}/fr/decision` + }, + _case: _case + }; + + res.render('app/case/fr/decision/more-information', pageObject); +}); + +router.post('/app/cases/:id/fr/more-information', (req, res) => { + res.redirect(`/app/cases/${req.params.id}/fr/check`); +}); + router.get('/app/cases/:id/fr/notes', (req, res) => { var _case = helpers.getCase(req.session.cases, req.params.id); diff --git a/app/routes/helpers.js b/app/routes/helpers.js index 4a3d79f9..9dbb87e8 100644 --- a/app/routes/helpers.js +++ b/app/routes/helpers.js @@ -46,7 +46,7 @@ function getCaseActions(_case) { return [ { href: `/app/cases/${_case.id}/pip/make-decision`, - text: 'Make a decision' + text: 'Make decision' }, { href: `/app/cases/${_case.id}/pip/list-for-hearing`, @@ -57,14 +57,14 @@ function getCaseActions(_case) { return [ { href: `/app/cases/${_case.id}/fr/decision`, - text: 'Make a decision' + text: 'Make decision' } ]; case 'divorce': return [ { href: `/app/cases/${_case.id}/divorce/make-decision`, - text: 'Make a decision' + text: 'Make decision' }, { href: `/app/cases/${_case.id}/divorce/mark-as-prepared`, diff --git a/app/views/app/case/fr/decision/check.html b/app/views/app/case/fr/decision/check.html index 4142b179..91c2a1b2 100644 --- a/app/views/app/case/fr/decision/check.html +++ b/app/views/app/case/fr/decision/check.html @@ -67,17 +67,32 @@

Check your decision

{% endif %} -
+ {% if data['information-needed'] %} +
-
Notes
+
Information needed
-
{{data['decision-notes']}}
+
{{data['information-needed']}}
-
- Change decision -
+
+ Change information needed +
-
+
+ {% endif %} + {% if data['decision-notes'] %} +
+ +
Notes
+ +
{{data['decision-notes']}}
+ +
+ Change decision +
+ +
+ {% endif %} diff --git a/app/views/app/case/fr/decision/confirmation.html b/app/views/app/case/fr/decision/confirmation.html index 6a17342b..a5dfe02f 100644 --- a/app/views/app/case/fr/decision/confirmation.html +++ b/app/views/app/case/fr/decision/confirmation.html @@ -13,25 +13,25 @@

- {% if data.decision == 'Approve' %} - Consent order approved - {% elseif data.decision == 'Approve with changes' %} - Consent order approved with changes - {% elseif data.decision == 'Reject' %} - Consent order rejected - {% endif %} + Decision submitted

{{_case.id}}
-

- Something here? -

-

What happens next

-

We’ve sent your decision to admin and it will be issued to the parties involved.

+ + {% if data.decision == 'Approve consent order' %} +

Your decision has been sent to a court administrator who will seal the consent order and send it out to the parties.

+ {% elseif data.decision == 'Ask for more information' %} +

Your request for more information has been sent to the parties.

+ {% elseif data.decision == 'List for hearing' %} +

TBD

+ {% elseif data.decision == 'Reject consent order' %} +

Your decision has been sent to a court administrator who will seal the consent order and send it out to the parties.

+ {% endif %} +

Go to your dashboard

diff --git a/app/views/app/case/fr/decision/decision.html b/app/views/app/case/fr/decision/decision.html index e133188a..ee01cde7 100644 --- a/app/views/app/case/fr/decision/decision.html +++ b/app/views/app/case/fr/decision/decision.html @@ -68,26 +68,31 @@ "name": "decision", "fieldset": { "legend": { - text: 'Make decision', + text: 'Make a decision', isPageHeading: true, classes: 'govuk-fieldset__legend--l' } }, "items": [ { - value: "Approve", - html: "Approve", - checked: checked('decision', "Approve") == 'checked' + value: "Approve consent order", + html: "Approve consent order", + checked: checked('decision', "Approve consent order") == 'checked' }, { - value: "Approve with changes", - html: "Approve with changes", - checked: checked('decision', "Approve with changes") == 'checked' + value: "Ask for more information", + html: "Ask for more information", + checked: checked('decision', "Ask for more information") == 'checked' }, { - value: "Reject", - html: "Reject", - checked: checked('decision', "Reject") == 'checked' + value: "List for hearing", + html: "List for hearing", + checked: checked('decision', "List for hearing") == 'checked' + }, + { + value: "Reject consent order", + html: "Reject consent order", + checked: checked('decision', "Reject consent order") == 'checked' } ] }) }} diff --git a/app/views/app/case/fr/decision/more-information.html b/app/views/app/case/fr/decision/more-information.html new file mode 100644 index 00000000..a5249404 --- /dev/null +++ b/app/views/app/case/fr/decision/more-information.html @@ -0,0 +1,55 @@ +{% extends "layouts/admin/base.html" %} + +{% block pageTitle %} +More information +{% endblock %} + +{% block content %} + + {{ juiCasebar({ + caseId: casebar.id, + parties: casebar.parties, + caseActions: { + actions: caseActions + } + }) }} + +
+ + {{ govukBackLink({ + "text": "Back", + "href": backLink.href + }) }} + +
+ +
+
+ +
+ + {{ govukTextarea({ + "id": "information-needed", + "name": "information-needed", + "label": { + "text": 'Information needed', + "isPageHeading": true, + "classes": "govuk-label--l" + }, + value: data['information-needed'] + }) }} + + {{ govukButton({ + "text": "Continue" + }) }} + +
+
+
+ +
+ +
+ +{% endblock %} + diff --git a/app/views/app/case/fr/summary.html b/app/views/app/case/fr/summary.html index 4be5a2a6..436fc347 100644 --- a/app/views/app/case/fr/summary.html +++ b/app/views/app/case/fr/summary.html @@ -34,7 +34,7 @@

Case details

"rows": detailsRows }) }} -

Linked cases

+

Related cases

{{ govukTable({ "classes": "govuk-!-margin-bottom-7 jui-table jui-table--fixed", diff --git a/app/views/app/dashboard.html b/app/views/app/dashboard.html index a8c2c3fc..210b385c 100644 --- a/app/views/app/dashboard.html +++ b/app/views/app/dashboard.html @@ -33,8 +33,8 @@

Dashboard

{"text": "Case number"}, {"text": "Parties"}, {"text": "Type"}, - {"text": "Status"}, - {"text": "Start date"}, + {"text": "Action needed"}, + {"text": "Case received"}, {"text": "Date of last event"} ], "rows": caseList From b0fb22a9695edee8b1a384268256b0ddb82b6339 Mon Sep 17 00:00:00 2001 From: Adam Silver Date: Thu, 26 Jul 2018 14:12:59 +0100 Subject: [PATCH 2/4] Confirmation now uses panel component, and summary now has an alert component --- app/assets/sass/application.scss | 20 +++++++++++++++++++ .../app/case/fr/decision/confirmation.html | 13 +++++------- app/views/app/case/fr/summary.html | 5 +++++ 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/app/assets/sass/application.scss b/app/assets/sass/application.scss index 55737082..3af4af4d 100644 --- a/app/assets/sass/application.scss +++ b/app/assets/sass/application.scss @@ -42,3 +42,23 @@ mark.comment { .jui-measure { max-width: 833px; } + +.jui-case-action-alert { + background-color: govuk-colour("bright-red"); + color: govuk-colour("white"); + padding: govuk-spacing(4); + margin-bottom: govuk-spacing(6); +} + +.jui-case-action-alert h2 { + color: govuk-colour("white"); +} + +.jui-case-action-alert p { + margin-bottom: 0; + color: govuk-colour("white"); +} + +.jui-case-action-alert a { + color: govuk-colour("white"); +} \ No newline at end of file diff --git a/app/views/app/case/fr/decision/confirmation.html b/app/views/app/case/fr/decision/confirmation.html index a5dfe02f..8a68adaf 100644 --- a/app/views/app/case/fr/decision/confirmation.html +++ b/app/views/app/case/fr/decision/confirmation.html @@ -11,14 +11,11 @@
-
-

- Decision submitted -

-
- {{_case.id}} -
-
+ {{ govukPanel({ + headingLevel: 1, + titleText: "Decision submitted", + html: _case.id + }) }}

What happens next

diff --git a/app/views/app/case/fr/summary.html b/app/views/app/case/fr/summary.html index 436fc347..46b6de20 100644 --- a/app/views/app/case/fr/summary.html +++ b/app/views/app/case/fr/summary.html @@ -22,6 +22,11 @@

Summary

+
+

Action needed

+

Review draft consent order

+
+
From 53f0a1e9ca2baa2b5e752c904e5f942699e1b312 Mon Sep 17 00:00:00 2001 From: Adam Silver Date: Thu, 26 Jul 2018 14:31:00 +0100 Subject: [PATCH 3/4] Hearing details form --- app/routes/fr.js | 19 ++ .../app/case/fr/decision/hearing-details.html | 167 ++++++++++++++++++ package.json | 2 +- 3 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 app/views/app/case/fr/decision/hearing-details.html diff --git a/app/routes/fr.js b/app/routes/fr.js index 1c633210..1675fcc0 100644 --- a/app/routes/fr.js +++ b/app/routes/fr.js @@ -159,6 +159,25 @@ router.post('/app/cases/:id/fr/more-information', (req, res) => { res.redirect(`/app/cases/${req.params.id}/fr/check`); }); +router.get('/app/cases/:id/fr/hearing-details', (req, res) => { + var _case = helpers.getCase(req.session.cases, req.params.id); + + var pageObject = { + casebar: helpers.getCaseBarObject(_case), + caseActions: helpers.getCaseActions(_case), + backLink: { + href: `/app/cases/${_case.id}/fr/decision` + }, + _case: _case + }; + + res.render('app/case/fr/decision/hearing-details', pageObject); +}); + +router.post('/app/cases/:id/fr/hearing-details', (req, res) => { + res.redirect(`/app/cases/${req.params.id}/fr/check`); +}); + router.get('/app/cases/:id/fr/notes', (req, res) => { var _case = helpers.getCase(req.session.cases, req.params.id); diff --git a/app/views/app/case/fr/decision/hearing-details.html b/app/views/app/case/fr/decision/hearing-details.html new file mode 100644 index 00000000..4a658c45 --- /dev/null +++ b/app/views/app/case/fr/decision/hearing-details.html @@ -0,0 +1,167 @@ +{% extends "layouts/admin/base.html" %} + +{% block pageTitle %} +Hearing details +{% endblock %} + +{% block content %} + + {{ juiCasebar({ + caseId: casebar.id, + parties: casebar.parties, + caseActions: { + actions: caseActions + } + }) }} + +
+ + {{ govukBackLink({ + "text": "Back", + "href": backLink.href + }) }} + +
+ +

Hearing details

+ +
+
+ +
+ + {{ govukTextarea({ + "id": "reason", + "name": "reason", + "label": { + "text": 'Reason', + "classes": "govuk-label--m" + }, + value: data['reason'] + }) }} + + {{ govukInput({ + id: 'duration', + name: 'duration', + classes: 'govuk-input--width-5', + label: { + text: 'Duration (minutes)', + classes: 'govuk-label--m' + }, + value: data['duration'] + }) }} + + {{ govukInput({ + id: 'minimum-notice-needed', + name: 'minimum-notice-needed', + classes: 'govuk-input--width-5', + label: { + text: 'Minimum notice needed (working days)', + classes: 'govuk-label--m' + }, + value: data['minimum-notice-needed'] + }) }} + + {{ govukDateInput({ + id: "latest-listing-date", + name: "latest-listing-date", + fieldset: { + legend: { + text: "Latest date this can be listed", + classes: "govuk-fieldset__legend--m" + } + }, + hint: { + text: "For example, 31 3 2018" + }, + items: [ + { + name: "day" + }, + { + name: "month" + }, + { + name: "year" + } + ] + }) }} + + {{ govukRadios({ + 'idPrefix': "listed-for-you", + name: "listed-for-you", + classes: "govuk-radios--inline", + fieldset: { + legend: { + text: 'Do you want it to be listed for you?', + classes: 'govuk-fieldset__legend--m' + } + }, + items: [ + { + value: "Yes", + html: "Yes", + checked: checked('listed-for-you', "Yes") == 'checked' + }, + { + value: "No", + html: "No", + checked: checked('listed-for-you', "No") == 'checked' + } + ] + }) }} + + {% set courtNameInputHtml %} + {{ govukInput({ + id: 'name-of-court', + name: 'name-of-court', + label: { + text: 'Name of court', + classes: 'govuk-label--m' + }, + value: data['name-of-court'] + }) }} + {% endset %} + + {{ govukRadios({ + 'idPrefix': "transfer", + name: "transfer", + classes: "govuk-radios--inlin", + fieldset: { + legend: { + text: 'Do you want the hearing to be transferred to another court?', + classes: 'govuk-fieldset__legend--m' + } + }, + items: [ + { + value: "Yes", + html: "Yes", + checked: checked('transfer', "Yes") == 'checked', + conditional: { + html: courtNameInputHtml + } + }, + { + value: "No", + html: "No", + checked: checked('transfer', "No") == 'checked' + } + ] + }) }} + + + {{ govukButton({ + text: "Continue" + }) }} + +
+
+
+ +
+ +
+ +{% endblock %} + diff --git a/package.json b/package.json index d560118e..3701318b 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "express": "4.15.2", "express-session": "^1.13.0", "express-writer": "0.0.4", - "govuk-frontend": "^1.0.0", + "govuk-frontend": "^1.1.0", "gulp": "^3.9.1", "gulp-clean": "^0.3.2", "gulp-mocha": "^4.3.1", From 910bff1fe9f624da5a0d6263c51d65cf5a4c56b8 Mon Sep 17 00:00:00 2001 From: Adam Silver Date: Thu, 26 Jul 2018 16:05:56 +0100 Subject: [PATCH 4/4] Check page shows list for hearing flow --- app/routes/fr.js | 4 + app/views/app/case/fr/decision/check.html | 100 ++++++++++++++++++ .../app/case/fr/decision/confirmation.html | 2 +- .../app/case/fr/decision/hearing-details.html | 9 +- 4 files changed, 111 insertions(+), 4 deletions(-) diff --git a/app/routes/fr.js b/app/routes/fr.js index 1675fcc0..053ee8c3 100644 --- a/app/routes/fr.js +++ b/app/routes/fr.js @@ -226,6 +226,10 @@ router.get('/app/cases/:id/fr/check', (req, res) => { reasons: [] }; + if(req.session.data.decision === 'List for hearing') { + pageObject.backLink.href = `/app/cases/${_case.id}/fr/hearing-details` + } + if(req.session.data.reject) { req.session.data.reject.forEach((item) => { if(item == 'not enough') { diff --git a/app/views/app/case/fr/decision/check.html b/app/views/app/case/fr/decision/check.html index 91c2a1b2..6d6abfbb 100644 --- a/app/views/app/case/fr/decision/check.html +++ b/app/views/app/case/fr/decision/check.html @@ -41,6 +41,105 @@

Check your decision

+ {% if data.reason %} +
+ +
Reason for hearing
+ +
+ {{data.reason}} +
+ +
+ Change hearing details +
+
+ {% endif %} + {% if data.duration %} +
+ +
Hearing duration (minutes)
+ +
+ {{data.duration}} +
+ +
+ Change hearing details +
+
+ {% endif %} + {% if data['minimum-notice-needed'] %} +
+ +
Minimum duration needed (working days)
+ +
+ {{data['minimum-notice-needed']}} +
+ +
+ Change hearing details +
+
+ {% endif %} + + {% if data['latest-listing-date-day'] %} +
+ +
Latest date this can be listed
+ +
+ {{data['latest-listing-date-day']}}/{{data['latest-listing-date-month']}}/{{data['latest-listing-date-year']}} +
+ +
+ Change hearing details +
+
+ {% endif %} + {% if data['listed-for-you'] %} +
+ +
Do you want it to be listed for you?
+ +
+ {{data['listed-for-you']}} +
+ +
+ Change hearing details +
+
+ {% endif %} + {% if data['transfer'] %} +
+ +
Do you want the hearing to be transferred to another court?
+ +
+ {{data['transfer']}} +
+ +
+ Change hearing details +
+
+ {% endif %} + {% if data['name-of-court'] %} +
+ +
Name of court
+ +
+ {{data['name-of-court']}} +
+ +
+ Change hearing details +
+
+ {% endif %} {% if reasons.length %}
@@ -67,6 +166,7 @@

Check your decision

{% endif %} + {% if data['information-needed'] %}
diff --git a/app/views/app/case/fr/decision/confirmation.html b/app/views/app/case/fr/decision/confirmation.html index 8a68adaf..8e552ec2 100644 --- a/app/views/app/case/fr/decision/confirmation.html +++ b/app/views/app/case/fr/decision/confirmation.html @@ -24,7 +24,7 @@

What happens next

{% elseif data.decision == 'Ask for more information' %}

Your request for more information has been sent to the parties.

{% elseif data.decision == 'List for hearing' %} -

TBD

+

Your request has been sent to a court administrator who will list the case for hearing.

{% elseif data.decision == 'Reject consent order' %}

Your decision has been sent to a court administrator who will seal the consent order and send it out to the parties.

{% endif %} diff --git a/app/views/app/case/fr/decision/hearing-details.html b/app/views/app/case/fr/decision/hearing-details.html index 4a658c45..02d9dc35 100644 --- a/app/views/app/case/fr/decision/hearing-details.html +++ b/app/views/app/case/fr/decision/hearing-details.html @@ -76,13 +76,16 @@

Hearing details

}, items: [ { - name: "day" + name: "day", + value: data['latest-listing-date-day'] }, { - name: "month" + name: "month", + value: data['latest-listing-date-month'] }, { - name: "year" + name: "year", + value: data['latest-listing-date-year'] } ] }) }}