@ministryofjustice/hmpps-mpop-frontend-components-lib 0.0.35 → 0.0.37
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/mpop/components/person-header/_risk-flag-badge.scss +15 -7
- package/dist/mpop/components/person-header/template.njk +3 -1
- package/dist/mpop/components/supervision-package/partials/_early-engagement.njk +3 -1
- package/dist/mpop/components/supervision-package-summary/template.njk +3 -2
- package/package.json +19 -9
|
@@ -60,12 +60,17 @@ $risk-badge-very-high: #711a0d;
|
|
|
60
60
|
$risk-badge-high: #d4351c;
|
|
61
61
|
$risk-badge-medium: #f2590d;
|
|
62
62
|
$risk-badge-low: #85994b;
|
|
63
|
+
$cohort-risk-badge: #54319f;
|
|
64
|
+
$misc-risk-badge: #484949;
|
|
63
65
|
|
|
66
|
+
/* Map badge classes to their border and hover colours */
|
|
64
67
|
$risk-badge-colours: (
|
|
65
68
|
'very-high': $risk-badge-very-high,
|
|
66
69
|
'high': $risk-badge-high,
|
|
67
70
|
'medium': $risk-badge-medium,
|
|
68
71
|
'low': $risk-badge-low,
|
|
72
|
+
'cohort': $cohort-risk-badge,
|
|
73
|
+
'misc': $misc-risk-badge,
|
|
69
74
|
);
|
|
70
75
|
|
|
71
76
|
@each $level, $colour in $risk-badge-colours {
|
|
@@ -75,19 +80,22 @@ $risk-badge-colours: (
|
|
|
75
80
|
&:hover {
|
|
76
81
|
background-color: $colour;
|
|
77
82
|
color: #fff;
|
|
78
|
-
text-decoration-thickness: 2px;
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
85
|
}
|
|
82
86
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
/* Keyboard focus state and Mouse hover state */
|
|
88
|
+
.person-header__risk-tags a.dps-alert-status {
|
|
89
|
+
&:hover,
|
|
90
|
+
&:focus,
|
|
91
|
+
&:focus-visible {
|
|
92
|
+
border: 3px solid #0b0c0c !important;
|
|
93
|
+
outline: none !important;
|
|
94
|
+
box-shadow: 0 0 0 3px #ffdd00 !important;
|
|
95
|
+
}
|
|
89
96
|
}
|
|
90
97
|
|
|
98
|
+
/* More risk flags link */
|
|
91
99
|
.person-header__risk-tags .risk-badge-more {
|
|
92
100
|
white-space: nowrap;
|
|
93
101
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
<div class='person-header'>
|
|
2
|
+
<div class='person-header govuk-body'>
|
|
3
3
|
<div class='person-header__band{% if params.photo %} person-header__band--with-photo{% endif %}'>
|
|
4
4
|
{% if params.photo %}
|
|
5
5
|
<img
|
|
@@ -117,6 +117,8 @@
|
|
|
117
117
|
>
|
|
118
118
|
{% if risk.text | replace(' - Very High', '') != risk.text %}
|
|
119
119
|
{{ risk.text | replace(' - Very High', ' - <strong>Very High</strong>') | safe }}
|
|
120
|
+
{% elif risk.text | replace(' - Very high', '') != risk.text %}
|
|
121
|
+
{{ risk.text | replace(' - Very high', ' - <strong>Very high</strong>') | safe }}
|
|
120
122
|
{% elif risk.text | replace(' - High', '') != risk.text %}
|
|
121
123
|
{{ risk.text | replace(' - High', ' - <strong>High</strong>') | safe }}
|
|
122
124
|
{% elif risk.text | replace(' - Medium', '') != risk.text %}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
{% set appointmentsRemaining = (params.currentYear.appointments.allowance | int) - (params.earlyEngagement.weeks | int) %}
|
|
2
|
+
|
|
1
3
|
{% if forename and (params.earlyEngagement.completed | int < params.earlyEngagement.weeks | int) %}
|
|
2
4
|
<p class='govuk-body'>
|
|
3
5
|
You should see {{ forename }} every week for the first {{ params.earlyEngagement.weeks }} weeks of the sentence.
|
|
@@ -10,7 +12,7 @@
|
|
|
10
12
|
|
|
11
13
|
{% if params.currentYear.appointments.allowance is defined and params.earlyEngagement.weeks is defined %}
|
|
12
14
|
<p class='govuk-body'>
|
|
13
|
-
{{ forename }} will then have a maximum of {{ (
|
|
15
|
+
{{ forename }} will then have a maximum of {{ (appointmentsRemaining) if appointmentsRemaining > 0 else 0 }} supervision appointments for the rest of this sentence year.
|
|
14
16
|
</p>
|
|
15
17
|
{% endif %}
|
|
16
18
|
|
|
@@ -98,8 +98,9 @@
|
|
|
98
98
|
{% if completed < required %}
|
|
99
99
|
<p class="govuk-body">You should see {{ forename }} every week for the first {{ params.earlyEngagement.weeks }} weeks of the sentence.</p>
|
|
100
100
|
{% endif %}
|
|
101
|
-
<p class="govuk-body">Early engagement is expected to end on {{ params.earlyEngagement.endDate | dateWithYear }} if {{ forename }} attends the required appointments by then.</p>
|
|
102
|
-
|
|
101
|
+
<p class="govuk-body">Early engagement is expected to end on {{ params.earlyEngagement.endDate | dateWithYear }}{% if completed < required %} if {{ forename }} attends the required appointments by then{% endif %}.</p>
|
|
102
|
+
{% set appointmentsRemaining = (params.currentYear.appointments.allowance | int(0)) - (params.earlyEngagement.weeks | int(0)) %}
|
|
103
|
+
<p class="govuk-body">{{ forename }} will then have a maximum of {{ (appointmentsRemaining) if appointmentsRemaining > 0 else 0 }} supervision appointments for the rest of this sentence year.</p>
|
|
103
104
|
{% endif %}
|
|
104
105
|
{% if params.currentPhase.phase.code == 'STD' %}
|
|
105
106
|
<p class="govuk-body">{{ forename }} has a maximum of {{ remaining }} appointments remaining.</p>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ministryofjustice/hmpps-mpop-frontend-components-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.37",
|
|
4
4
|
"description": "MPOP front-end components library",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -35,10 +35,22 @@
|
|
|
35
35
|
},
|
|
36
36
|
"jest": {
|
|
37
37
|
"transform": {
|
|
38
|
-
"^.+\\.(ts|js|mjs|tsx|jsx)$":
|
|
38
|
+
"^.+\\.(ts|js|mjs|tsx|jsx)$": [
|
|
39
|
+
"ts-jest",
|
|
40
|
+
{
|
|
41
|
+
"tsconfig": {
|
|
42
|
+
"allowJs": true,
|
|
43
|
+
"ignoreDeprecations": "6.0",
|
|
44
|
+
"module": "commonjs",
|
|
45
|
+
"moduleResolution": "node",
|
|
46
|
+
"esModuleInterop": true,
|
|
47
|
+
"allowSyntheticDefaultImports": true
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
39
51
|
},
|
|
40
52
|
"transformIgnorePatterns": [
|
|
41
|
-
"/node_modules/(?!(@exodus|@csstools|
|
|
53
|
+
"/node_modules/(?!(@exodus|@csstools|parse5|abab|entities|nunjucks|@asamuzakjp)/)"
|
|
42
54
|
],
|
|
43
55
|
"testMatch": [
|
|
44
56
|
"<rootDir>/**/**/?(*.)(cy|test).{ts,js,jsx,mjs}"
|
|
@@ -60,9 +72,6 @@
|
|
|
60
72
|
"author": "",
|
|
61
73
|
"license": "ISC",
|
|
62
74
|
"devDependencies": {
|
|
63
|
-
"@babel/core": "^7.29.7",
|
|
64
|
-
"@babel/preset-env": "^7.29.7",
|
|
65
|
-
"@babel/preset-typescript": "^7.29.7",
|
|
66
75
|
"@ministryofjustice/eslint-config-hmpps": "1.0.3",
|
|
67
76
|
"@ministryofjustice/hmpps-npm-script-allowlist": "0.0.6",
|
|
68
77
|
"@ministryofjustice/hmpps-precommit-hooks": "3.0.2",
|
|
@@ -74,7 +83,6 @@
|
|
|
74
83
|
"@types/luxon": "3.7.5",
|
|
75
84
|
"@types/node": "25.9.5",
|
|
76
85
|
"@typescript-eslint/eslint-plugin": "8.69.0",
|
|
77
|
-
"babel-jest": "^30.5.1",
|
|
78
86
|
"dotenv": "17.4.2",
|
|
79
87
|
"eslint-import-resolver-typescript": "4.4.5",
|
|
80
88
|
"eslint-plugin-no-only-tests": "3.4.0",
|
|
@@ -85,8 +93,8 @@
|
|
|
85
93
|
"nunjucks": "^3.2.4",
|
|
86
94
|
"prettier": "3.9.6",
|
|
87
95
|
"rollup": "^4.63.1",
|
|
88
|
-
"rollup-plugin-copy": "3.5.0",
|
|
89
96
|
"rollup-plugin-dts": "^6.5.1",
|
|
97
|
+
"ts-jest": "^29.4.14",
|
|
90
98
|
"tslib": "^2.8.1",
|
|
91
99
|
"tsx": "4.23.13",
|
|
92
100
|
"typescript": "^6.0.3"
|
|
@@ -106,11 +114,13 @@
|
|
|
106
114
|
"brace-expansion@1": "1.1.21",
|
|
107
115
|
"brace-expansion@2": "2.1.7",
|
|
108
116
|
"brace-expansion@5": "5.0.12",
|
|
117
|
+
"handlebars": "4.7.10",
|
|
109
118
|
"jsdom": {
|
|
110
119
|
"undici": "7.29.1"
|
|
111
120
|
},
|
|
112
121
|
"node-gyp": {
|
|
113
122
|
"undici": "6.28.1"
|
|
114
|
-
}
|
|
123
|
+
},
|
|
124
|
+
"source-map-js": "1.2.2"
|
|
115
125
|
}
|
|
116
126
|
}
|