@ministryofjustice/hmpps-mpop-frontend-components-lib 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/_all.scss CHANGED
@@ -4,3 +4,4 @@
4
4
  @import "./mpop/components/supervision-package/supervision-package";
5
5
  @import "./mpop/components/pop-header/pop-header";
6
6
  @import "./mpop/components/supervision-final-third-progress/supervision-final-third-progress";
7
+ @import "./mpop/components/person-header/person-header";
package/dist/index.d.ts CHANGED
@@ -137,7 +137,7 @@ type NextAppointment = {
137
137
  description: string;
138
138
  };
139
139
  type SupervisionPackageFrontendContextResponse = {
140
- currentPhase: CurrentPhase;
140
+ currentPhase: CurrentPhase | null;
141
141
  earlyEngagement: EarlyEngagement;
142
142
  currentYear: CurrentYear;
143
143
  nextAppointment: NextAppointment;
@@ -0,0 +1,49 @@
1
+ .person-header {
2
+ margin-bottom: govuk-spacing(4);
3
+ }
4
+
5
+ .person-header__band {
6
+ background-color: govuk-colour("blue");
7
+ color: govuk-colour("white");
8
+ padding: govuk-spacing(4) govuk-spacing(4) govuk-spacing(3);
9
+ }
10
+
11
+ .person-header__name {
12
+ color: govuk-colour("white");
13
+ }
14
+
15
+ .person-header__crn {
16
+ color: govuk-colour("white");
17
+ }
18
+
19
+ .person-header__managed-by {
20
+ text-decoration: underline;
21
+ }
22
+
23
+ .person-header__meta {
24
+ display: flex;
25
+ flex-wrap: wrap;
26
+ column-gap: govuk-spacing(6);
27
+ row-gap: govuk-spacing(1);
28
+ margin: 0;
29
+ color: govuk-colour("white");
30
+
31
+ li {
32
+ list-style: none;
33
+ }
34
+ }
35
+
36
+ .person-header__risk-panel {
37
+ display: flex;
38
+ flex-direction: column;
39
+ gap: govuk-spacing(2);
40
+ background-color: govuk-colour("black", $variant: "tint-95");
41
+ padding: govuk-spacing(3) govuk-spacing(4);
42
+ }
43
+
44
+ .person-header__risk-tags {
45
+ display: flex;
46
+ flex-wrap: nowrap;
47
+ align-items: center;
48
+ gap: govuk-spacing(2);
49
+ }
@@ -0,0 +1,3 @@
1
+ {% macro personHeader(params) %}
2
+ {% include './template.njk' %}
3
+ {% endmacro %}
@@ -0,0 +1,37 @@
1
+ <div class='person-header'>
2
+ <div class='person-header__band'>
3
+ <h1 class='govuk-heading-xl govuk-!-margin-bottom-2 person-header__name' data-qa='personName'>{{ params.name }}</h1>
4
+
5
+ <p class='govuk-caption-l govuk-!-margin-bottom-3 person-header__crn'>
6
+ <span class='govuk-!-font-weight-bold'>CRN:</span> <span data-qa='crn'>{{ params.crn }}</span>
7
+ </p>
8
+
9
+ <ul class='govuk-list person-header__meta'>
10
+ <li>
11
+ <span class='govuk-!-font-weight-bold'>Date of birth:</span> <span data-qa='dob'>{{ params.dob }}</span>
12
+ </li>
13
+ <li>
14
+ <span class='govuk-!-font-weight-bold'>Tier:</span> <a class='govuk-link govuk-link--inverse' href='{{ params.historyHref }}' data-qa='tier'>{{ params.tier }}</a>
15
+ </li>
16
+ <li>
17
+ <span class='govuk-!-font-weight-bold'>Managed by:</span> <span class='person-header__managed-by' data-qa='managedBy'>{{ params.managedBy }}</span>
18
+ </li>
19
+ </ul>
20
+ </div>
21
+
22
+ <div class='person-header__risk-panel'>
23
+ <div class='person-header__risk-tags'>
24
+ {% if params.ogrs %}
25
+ <h2 class='govuk-heading-s govuk-!-margin-0' data-qa='ogrsLabel'>OGRS</h2>
26
+ {% endif %}
27
+
28
+ {% if params.rosh %}
29
+ <h2 class='govuk-heading-s govuk-!-margin-0' data-qa='roshLabel'>ROSH</h2>
30
+ {% endif %}
31
+ </div>
32
+
33
+ {% if params.riskFlags and params.riskFlags.length %}
34
+ <h2 class='govuk-heading-s govuk-!-margin-0' data-qa='riskAlertBadges'>Risk alert badges</h2>
35
+ {% endif %}
36
+ </div>
37
+ </div>
@@ -1,4 +1,4 @@
1
- {% if not (params.context.sentences | isInCustody or params.context.sentences | isAtLarge or params.currentPhase.phase.code == 'FTHRD' ) and (params.arrangeAppointmentHref or (params.crn and params.deliusBaseURL)) %}
1
+ {% if not (params.context.sentences | isInCustody or params.context.sentences | isAtLarge or phaseCode == 'FTHRD' ) and (params.arrangeAppointmentHref or (params.crn and params.deliusBaseURL)) %}
2
2
  <div class='govuk-button-group'>
3
3
  {% if params.arrangeAppointmentHref %}
4
4
  <a href='{{ params.arrangeAppointmentHref }}' role='button' draggable='false' class='govuk-button' data-module='govuk-button'>
@@ -1,40 +1,44 @@
1
1
  {% set sentence = params.context.sentences | getPrimarySentence %}
2
2
 
3
- {% if params.context.name.forename and (params.earlyEngagement.completed | int < params.earlyEngagement.weeks | int) %}
3
+ {% if forename and (params.earlyEngagement.completed | int < params.earlyEngagement.weeks | int) %}
4
4
  <p class='govuk-body'>
5
- You should see {{ params.context.name.forename }} every week for the first {{ params.earlyEngagement.weeks }} weeks of the sentence.
5
+ You should see {{ forename }} every week for the first {{ params.earlyEngagement.weeks }} weeks of the sentence.
6
6
  </p>
7
7
  {% endif %}
8
8
 
9
- {% if params.context.name.forename and params.currentYear.appointments.allowance is defined and params.earlyEngagement.weeks is defined %}
9
+ {% if forename and params.currentYear.appointments.allowance is defined and params.earlyEngagement.weeks is defined %}
10
10
  <p class='govuk-body'>Early engagement is expected to end on {{ params.currentPhase.endDate | dateWithYear }}{% if (params.earlyEngagement.completed | int < params.earlyEngagement.weeks | int) %} if {{ params.context.name.forename }} attends the required appointments by then{% endif %}.</p>
11
11
  {% endif %}
12
12
 
13
+ {% if lifeCategoryCode == 'LF01' or lifeCategoryCode == 'LF02' or lifeCategoryCode == 'LF03' or lifeCategoryCode == 'x9' %}
14
+ {% include './_no-end-date.njk' %}
15
+ {% endif %}
16
+
13
17
  {% if params.currentYear.appointments.allowance is defined and params.earlyEngagement.weeks is defined %}
14
18
  <p class='govuk-body'>
15
- {{ params.context.name.forename }} will then have a maximum of {{ (params.currentYear.appointments.allowance | int) - (params.earlyEngagement.weeks | int) }} supervision appointments for the rest of this sentence year.
19
+ {{ forename }} will then have a maximum of {{ (params.currentYear.appointments.allowance | int) - (params.earlyEngagement.weeks | int) }} supervision appointments for the rest of this sentence year.
16
20
  </p>
17
21
  {% endif %}
18
22
 
19
23
  {% if sentence.type.isCustodial %}
20
24
  {% if params.context.finalThirdEligibility.eligible == true %}
21
25
  <p class='govuk-body'>
22
- {{ params.context.name.forename }} is eligible to start the final third stage on {{ sentence.custody.finalThirdDate | dateWithYear }}.
26
+ {{ forename }} is eligible to start the final third stage on {{ sentence.custody.finalThirdDate | dateWithYear }}.
23
27
  </p>
24
28
  {% elseif params.context.finalThirdEligibility.eligible == false%}
25
- <p class='govuk-body'>{{ params.context.name.forename }} is not eligible for the final third stage.</p>
29
+ <p class='govuk-body'>{{ forename }} is not eligible for the final third stage.</p>
26
30
  {% endif %}
27
31
  {% endif %}
28
32
 
29
33
  {% include './_progress-bar.njk' %}
30
34
  {% if params.context.integratedOffenderManagementRedRated %}
31
35
  <p class='govuk-body'>
32
- {{ params.context.name.forename }} has an IOM red RAG status. The maximum number of appointments is the same as tier A.
36
+ {{ forename }} has an IOM red RAG status. The maximum number of appointments is the same as tier A.
33
37
  </p>
34
38
  {% endif %}
35
39
 
36
40
  {% if params.context | isEligibleForDiscretionaryAppointments(params.tierScore) %}
37
41
  <p class='govuk-body'>
38
- As a woman in tier {{ params.tierScore }}, {{ params.context.name.forename }} can have up to 5 additional discretionary appointments.
42
+ As a woman in tier {{ params.tierScore }}, {{ forename }} can have up to 5 additional discretionary appointments.
39
43
  </p>
40
44
  {% endif %}
@@ -1,7 +1,5 @@
1
1
  <p class='govuk-body'>There is no supervision end date.</p>
2
2
 
3
- {% include './_progress-bar.njk' %}
4
-
5
3
  {% if params.context.integratedOffenderManagementRedRated %}
6
4
  <p class='govuk-body'>{{ params.context.name.forename }} has an IOM red RAG status. The maximum number of appointments is the same as tier A.</p>
7
5
  {% endif %}
@@ -1,4 +1,4 @@
1
- {% if params.currentPhase.phase.code == 'INIT' %}
1
+ {% if phaseCode == 'INIT' %}
2
2
  {% set completed = params.earlyEngagement.completed | int(0) %}
3
3
  {% set allowance = params.earlyEngagement.weeks | int(0) %}
4
4
  {% else %}
@@ -17,13 +17,13 @@
17
17
  <p class='govuk-body'>{{ completed }} of {{ allowance }} appointments used</p>
18
18
 
19
19
  <div class="appointment-progress" aria-hidden="true">
20
- <div class="{{ 'appointment-progress__bar-maximum' if params.currentPhase.phase.code != 'INIT' and widthPercent == 100 else 'appointment-progress__bar' }} appointment-progress__bar--width-{{ widthPercent }}"></div>
20
+ <div class="{{ 'appointment-progress__bar-maximum' if phaseCode != 'INIT' and widthPercent == 100 else 'appointment-progress__bar' }} appointment-progress__bar--width-{{ widthPercent }}"></div>
21
21
  </div>
22
22
  <span class="govuk-visually-hidden">progress indicator, {{ widthPercent }}%</span>
23
23
 
24
24
  <div class='govuk-grid-row govuk-!-margin-top-4'>
25
25
  <div class='govuk-grid-column-one-third'>
26
- <p class='govuk-body govuk-!-margin-bottom-2'>{{ 'Required' if params.currentPhase.phase.code == 'INIT' else 'Maximum' }}</p>
26
+ <p class='govuk-body govuk-!-margin-bottom-2'>{{ 'Required' if phaseCode == 'INIT' else 'Maximum' }}</p>
27
27
  <p class='govuk-body-l govuk-!-font-weight-bold'>{{ allowance }}</p>
28
28
  </div>
29
29
 
@@ -1,29 +1,30 @@
1
1
  {% set sentence = params.context.sentences | getPrimarySentence %}
2
2
 
3
- {% if params.context.name.forename and (params.currentYear.appointments.completed | int >= params.currentYear.appointments.allowance | int)%}
3
+ <p class='govuk-body'>{{ forename }} has an IOM red RAG status. The maximum number of appointments is the same as tier A.</p>
4
+
5
+
6
+ {% if forename and (params.currentYear.appointments.completed | int >= params.currentYear.appointments.allowance | int)%}
4
7
  <p class='govuk-body'>
5
- {{ params.context.name.forename }} has used all the supervision package appointments. If new risks emerge or there are exceptional circumstances, you can arrange contingency appointments.
8
+ {{ forename }} has used all the supervision package appointments. If new risks emerge or there are exceptional circumstances, you can arrange contingency appointments.
6
9
  </p>
7
10
  {% endif %}
8
11
 
9
12
  {% if params.currentYear.endDate | supervisionAppointmentsReset(params.context.sentences) %}
10
- <p class='govuk-body'>{{ params.context.name.forename }} has {{ (params.currentYear.appointments.allowance | int) - (params.currentYear.appointments.completed | int) }} supervision appointments remaining until the supervision package resets on {{ params.currentYear.endDate | dateWithYear }}.</p>
13
+ <p class='govuk-body'>{{ forename }} has {{ (params.currentYear.appointments.allowance | int) - (params.currentYear.appointments.completed | int) }} supervision appointments remaining until the supervision package resets on {{ params.currentYear.endDate | dateWithYear }}.</p>
11
14
  {% else %}
12
- <p class='govuk-body'>{{ params.context.name.forename }} has {{ (params.currentYear.appointments.allowance | int) - (params.currentYear.appointments.completed | int) }} supervision appointments remaining until the supervision stage ends on {{ params.currentYear.endDate | dateWithYear }}.</p>
15
+ <p class='govuk-body'>{{ forename }} has {{ (params.currentYear.appointments.allowance | int) - (params.currentYear.appointments.completed | int) }} supervision appointments remaining until the supervision stage ends on {{ params.currentYear.endDate | dateWithYear }}.</p>
13
16
  {% endif %}
14
17
 
15
18
  {% if sentence.type.isCustodial %}
16
19
  {% if params.context.finalThirdEligibility.eligible %}
17
- <p class='govuk-body'>{{ params.context.name.forename }} is eligible to start the final third stage on {{ sentence.custody.finalThirdDate | dateWithYear }}.</p>
20
+ <p class='govuk-body'>{{ forename }} is eligible to start the final third stage on {{ sentence.custody.finalThirdDate | dateWithYear }}.</p>
18
21
  {% elseif params.context.finalThirdEligibility.eligible == false %}
19
- <p class='govuk-body'>{{ params.context.name.forename }} is not eligible for the final third stage.</p>
22
+ <p class='govuk-body'>{{ forename }} is not eligible for the final third stage.</p>
20
23
  {% endif %}
21
24
  {% endif %}
22
25
 
23
26
  {% include './_progress-bar.njk' %}
24
27
 
25
- <p class='govuk-body'>{{ params.context.name.forename }} has an IOM red RAG status. The maximum number of appointments is the same as tier A.</p>
26
-
27
28
  {% if params.context | isEligibleForDiscretionaryAppointments(params.tierScore) %}
28
- <p class='govuk-body'>As a woman in tier {{ params.tierScore }}, {{ params.context.name.forename }} can have up to 5 additional discretionary appointments.</p>
29
+ <p class='govuk-body'>As a woman in tier {{ params.tierScore }}, {{ forename }} can have up to 5 additional discretionary appointments.</p>
29
30
  {% endif %}
@@ -1,31 +1,35 @@
1
1
  {% set sentence = params.context.sentences | getPrimarySentence %}
2
2
 
3
- {% if params.context.name.forename and (params.currentYear.appointments.completed | int >= params.currentYear.appointments.allowance | int)%}
3
+ {% if forename and (params.currentYear.appointments.completed | int >= params.currentYear.appointments.allowance | int)%}
4
4
  <p class='govuk-body'>
5
- {{ params.context.name.forename }} has used all the supervision package appointments. If new risks emerge or there are exceptional circumstances, you can arrange contingency appointments.
5
+ {{ forename }} has used all the supervision package appointments. If new risks emerge or there are exceptional circumstances, you can arrange contingency appointments.
6
6
  </p>
7
7
  {% endif %}
8
8
 
9
9
  {% if params.currentYear.endDate | supervisionAppointmentsReset(params.context.sentences) %}
10
- <p class='govuk-body'>{{ params.context.name.forename }} has {{ (params.currentYear.appointments.allowance | int) - (params.currentYear.appointments.completed | int) }} supervision appointments remaining until the supervision package resets on {{ params.currentYear.endDate | dateWithYear }}.</p>
10
+ <p class='govuk-body'>{{ forename }} has {{ (params.currentYear.appointments.allowance | int) - (params.currentYear.appointments.completed | int) }} supervision appointments remaining until the supervision package resets on {{ params.currentYear.endDate | dateWithYear }}.</p>
11
11
  {% else %}
12
- <p class='govuk-body'>{{ params.context.name.forename }} has {{ (params.currentYear.appointments.allowance | int) - (params.currentYear.appointments.completed | int) }} supervision appointments remaining until the supervision stage ends on {{ params.currentYear.endDate | dateWithYear }}.</p>
12
+ <p class='govuk-body'>{{ forename }} has {{ (params.currentYear.appointments.allowance | int) - (params.currentYear.appointments.completed | int) }} supervision appointments remaining until the supervision stage ends on {{ params.currentYear.endDate | dateWithYear }}.</p>
13
+ {% endif %}
14
+
15
+ {% if lifeCategoryCode == 'LF01' or lifeCategoryCode == 'LF02' or lifeCategoryCode == 'LF03' or lifeCategoryCode == 'x9' %}
16
+ {% include './_no-end-date.njk' %}
13
17
  {% endif %}
14
18
 
15
19
  {% if sentence.type.isCustodial %}
16
20
  {% if params.context.finalThirdEligibility.eligible %}
17
- <p class='govuk-body'>{{ params.context.name.forename }} is eligible to start the final third stage on {{ sentence.custody.finalThirdDate | dateWithYear }}.</p>
21
+ <p class='govuk-body'>{{ forename }} is eligible to start the final third stage on {{ sentence.custody.finalThirdDate | dateWithYear }}.</p>
18
22
  {% elseif params.context.finalThirdEligibility.eligible == false %}
19
- <p class='govuk-body'>{{ params.context.name.forename }} is not eligible for the final third stage.</p>
23
+ <p class='govuk-body'>{{ forename }} is not eligible for the final third stage.</p>
20
24
  {% endif %}
21
25
  {% endif %}
22
26
 
23
27
  {% include './_progress-bar.njk' %}
24
28
 
25
29
  {% if params.context.integratedOffenderManagementRedRated %}
26
- <p class='govuk-body'>{{ params.context.name.forename }} has an IOM red RAG status. The maximum number of appointments is the same as tier A.</p>
30
+ <p class='govuk-body'>{{ forename }} has an IOM red RAG status. The maximum number of appointments is the same as tier A.</p>
27
31
  {% endif %}
28
32
 
29
33
  {% if params.context | isEligibleForDiscretionaryAppointments(params.tierScore) %}
30
- <p class='govuk-body'>As a woman in tier {{ params.tierScore }}, {{ params.context.name.forename }} can have up to 5 additional discretionary appointments.</p>
34
+ <p class='govuk-body'>As a woman in tier {{ params.tierScore }}, {{ forename }} can have up to 5 additional discretionary appointments.</p>
31
35
  {% endif %}
@@ -1,5 +1,5 @@
1
1
  {% if params.allAppointmentsHref %}
2
- {% if params.currentPhase.phase.code == 'FTHRD' %}
2
+ {% if phaseCode == 'FTHRD' %}
3
3
  <p class='govuk-body'>
4
4
  <a class='govuk-link govuk-link--no-visited-state' href='{{ params.allAppointmentsHref }}' >View last appointment</a>
5
5
  </p>
@@ -3,7 +3,7 @@
3
3
  <span class='govuk-warning-text__icon' aria-hidden='true'>!</span>
4
4
  <strong class='govuk-warning-text__text'>
5
5
  <span class='govuk-visually-hidden'>Warning</span>
6
- {{ params.context.name.forename }} is in breach. You should continue to offer appointments.
6
+ {{ forename }} is in breach. You should continue to offer appointments.
7
7
  </strong>
8
8
  </div>
9
9
  {% elseif params.context.sentences | isInCustody %}
@@ -11,7 +11,7 @@
11
11
  <span class='govuk-warning-text__icon' aria-hidden='true'>!</span>
12
12
  <strong class='govuk-warning-text__text'>
13
13
  <span class='govuk-visually-hidden'>Warning</span>
14
- {{ params.context.name.forename }} has been recalled. Their appointments are paused.
14
+ {{ forename }} has been recalled. Their appointments are paused.
15
15
  </strong>
16
16
  </div>
17
17
  {% endif %}
@@ -6,6 +6,7 @@
6
6
  {% set showPhaseColumn = phaseCode == 'INIT' or phaseCode == 'STD' or phaseCode == 'FTHRD' or phaseCode == 'IOM' or phaseCode == 'OPD' %}
7
7
  {% set lifeCategoryCode = params.context.liferCategory.code | upper %}
8
8
  {% set sentence = params.context.sentences | getPrimarySentence %}
9
+ {% set forename = params.context.name.forename %}
9
10
 
10
11
  {% if
11
12
  params.context.nationalSecurityDivision
@@ -18,7 +19,7 @@
18
19
  supervisionPackage: params
19
20
  }) }}
20
21
  </div>
21
- {% elif phaseCode != 'SPNA' and not params.context.nationalSecurityDivision and showPhaseColumn %}
22
+ {% elif phaseCode != 'SPNA' and not params.context.nationalSecurityDivision and (showPhaseColumn or not params.currentPhase) %}
22
23
  <div class='govuk-width-container supervision-package' role='region' aria-label='Supervision package'>
23
24
  {% if standardAppointmentsComplete or hasSpecialStatus %}
24
25
  <div class='app-tier-header'>
@@ -26,15 +27,26 @@
26
27
  {% include './partials/_tags.njk' %}
27
28
  </div>
28
29
  {% else %}
29
- <h3 class='govuk-heading-m'>{{ 'Supervision package: ' ~ sentenceTypeValue if sentenceTypeValue else 'Supervision package' }}</h3>
30
+ <h3 class='govuk-heading-m'>{{ 'Supervision package: ' ~ sentenceTypeValue if sentenceTypeValue else 'Supervision package' }}</h3>
30
31
  {% endif %}
31
32
 
32
33
  <div class='govuk-grid-row'>
33
- <div class='{{ "govuk-grid-column-one-half" if showPhaseColumn else "govuk-grid-column-two-thirds" }}'>
34
+ {% if showPhaseColumn %}
35
+ {% set columnClass = 'govuk-grid-column-one-half' %}
36
+ {% elif not params.currentPhase %}
37
+ {% set columnClass = 'govuk-grid-column-full' %}
38
+ {% else %}
39
+ {% set columnClass = 'govuk-grid-column-two-thirds' %}
40
+ {% endif %}
41
+ <div class='{{ columnClass }}'>
34
42
  {% include './partials/_warnings.njk' %}
35
43
  {% include './partials/_tier.njk' %}
36
44
  {% include './partials/_package-creation-date.njk' %}
37
45
 
46
+ {% if not params.currentPhase and params.oasysReviewHref %}
47
+ <p class='govuk-body'><a href='{{ params.oasysReviewHref }}' class='govuk-link govuk-link--no-visited-state'>Start an OASys review (opens in new tab)</a> to confirm {{ forename}}`s supervision package. Until then, follow national standards for appointments.</p>
48
+ {% endif %}
49
+
38
50
  {% if params.historyHref %}
39
51
  <p class='govuk-body'>
40
52
  <a href='{{ params.historyHref }}' class='govuk-link govuk-link--no-visited-state'>
@@ -43,10 +55,12 @@
43
55
  </p>
44
56
  {% endif %}
45
57
 
46
- {% include './partials/_next-appointment.njk' %}
58
+ {% if params.currentPhase %}
59
+ {% include './partials/_next-appointment.njk' %}
60
+ {% endif %}
47
61
  </div>
48
62
 
49
- {% if showPhaseColumn %}
63
+ {% if showPhaseColumn and params.currentPhase %}
50
64
  <div class='govuk-grid-column-one-half'>
51
65
  {% if params.context.offenderPersonalDisorderPathway %}
52
66
  <h4 class='govuk-heading-s'>Supervision appointments</h4>
@@ -57,9 +71,6 @@
57
71
  {% elseif params.context.sentences | isAtLarge or params.context.sentences | isInCustody %}
58
72
  <h4 class='govuk-heading-s'>{{ params.currentPhase.phase.description | toTitleCase }} stage</h4>
59
73
  {% include './partials/_progress-bar.njk' %}
60
- {% elseif lifeCategoryCode == 'LF01' or lifeCategoryCode == 'LF02' or lifeCategoryCode == 'LF03' or lifeCategoryCode == 'x9' %}
61
- <h4 class='govuk-heading-s'>{{ params.currentPhase.phase.description | toTitleCase }} stage</h4>
62
- {% include './partials/_no-end-date.njk' %}
63
74
  {% elseif phaseCode == 'INIT' %}
64
75
  <h4 class='govuk-heading-s'>{{ params.currentPhase.phase.description | toTitleCase }} stage</h4>
65
76
  {% include './partials/_early-engagement.njk' %}
@@ -76,6 +87,8 @@
76
87
  {% endif %}
77
88
  </div>
78
89
 
79
- {% include './partials/_action-buttons.njk' %}
90
+ {% if params.currentPhase %}
91
+ {% include './partials/_action-buttons.njk' %}
92
+ {% endif %}
80
93
  </div>
81
94
  {% endif %}
@@ -4,6 +4,8 @@
4
4
  {% set sentence = params.context.sentences | getPrimarySentence %}
5
5
 
6
6
  {% set finalThird = params.context.nationalSecurityDivision and params.context.finalThirdEligibility.eligible and sentence.type.isCustodial and sentence.custody.finalThirdDate %}
7
+ {% set phaseCode = params.currentPhase.phase.code | upper %}
8
+ {% set showPhaseColumn = phaseCode == 'INIT' or phaseCode == 'STD' or phaseCode == 'FTHRD' or phaseCode == 'IOM' or phaseCode == 'OPD' %}
7
9
 
8
10
  {% set stage = 'early engagement' %}
9
11
  {% set key = 'Required' %}
@@ -11,6 +13,7 @@
11
13
  {% set required = 0 %}
12
14
  {% set completed = 0 %}
13
15
 
16
+ {% if showPhaseColumn or finalThird %}
14
17
  {% if params.currentPhase.phase.code == 'INIT' %}
15
18
  {% if params.earlyEngagement.weeks is defined and params.earlyEngagement.completed is defined %}
16
19
  {% set required = params.earlyEngagement.weeks | int(0) %}
@@ -110,3 +113,4 @@ The supervision package ends on {{ params.currentYear.endDate | dateWithYear }}.
110
113
  <p class="govuk-body">Meet {{ forename }} if there is a need for responsive management, risk or enforcement activity.</p>
111
114
  {% endif %}
112
115
  </section>
116
+ {% endif %}
@@ -88,7 +88,7 @@ type NextAppointment = {
88
88
  description: string;
89
89
  };
90
90
  export type SupervisionPackageFrontendContextResponse = {
91
- currentPhase: CurrentPhase;
91
+ currentPhase: CurrentPhase | null;
92
92
  earlyEngagement: EarlyEngagement;
93
93
  currentYear: CurrentYear;
94
94
  nextAppointment: NextAppointment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ministryofjustice/hmpps-mpop-frontend-components-lib",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "MPOP front-end components library",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",