@ministryofjustice/hmpps-mpop-frontend-components-lib 0.0.5 → 0.0.6
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/README.md +30 -0
- package/dist/MPoPComponents.d.ts +3 -0
- package/dist/components/supervision-package/partials/_early-engagement.test.d.ts +1 -0
- package/dist/components/supervision-package/partials/_progress-bar.test.d.ts +1 -0
- package/dist/components/supervision-package/partials/tags.test.d.ts +1 -0
- package/dist/index.cjs.js +72 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +80 -1
- package/dist/index.esm.js +71 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/mpop/components/supervision-package/_supervision-package.scss +25 -1
- package/dist/mpop/components/supervision-package/partials/_early-engagement.njk +21 -0
- package/dist/mpop/components/supervision-package/partials/_progress-bar.njk +38 -0
- package/dist/mpop/components/supervision-package/partials/_tags.njk +19 -0
- package/dist/mpop/components/supervision-package/template.njk +44 -3
- package/dist/types/MPoPComponentsConfig.d.ts +1 -0
- package/dist/types/SupervisionPackage.d.ts +73 -0
- package/dist/utils/nunjucksFilters.d.ts +2 -0
- package/dist/utils/toTitleCase.d.ts +1 -0
- package/dist/utils/toTitleCase.test.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
# hmpps-mpop-frontend-components-lib
|
|
2
2
|
MPoP front-end library
|
|
3
3
|
|
|
4
|
+
## Usage
|
|
5
|
+
|
|
6
|
+
### Installation
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install @ministryofjustice/hmpps-mpop-frontend-components-lib
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Nunjucks setup
|
|
13
|
+
|
|
14
|
+
The components in this library use custom Nunjucks filters. You must register them with your Nunjucks environment before rendering any components, otherwise you will see a `filter not found` error.
|
|
15
|
+
|
|
16
|
+
Call `mpopNunjucksSetup` once when configuring your application:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import nunjucks from 'nunjucks'
|
|
20
|
+
import { mpopNunjucksSetup } from '@ministryofjustice/hmpps-mpop-frontend-components-lib'
|
|
21
|
+
|
|
22
|
+
const env = nunjucks.configure([...])
|
|
23
|
+
mpopNunjucksSetup(env)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### SCSS
|
|
27
|
+
|
|
28
|
+
Import the component styles in your SCSS entry point:
|
|
29
|
+
|
|
30
|
+
```scss
|
|
31
|
+
@import '@ministryofjustice/hmpps-mpop-frontend-components-lib/dist/all';
|
|
32
|
+
```
|
|
33
|
+
|
|
4
34
|
## Releasing
|
|
5
35
|
|
|
6
36
|
This package is published to npm using GitHub Releases and npm Trusted Publishing.
|
package/dist/MPoPComponents.d.ts
CHANGED
|
@@ -4,11 +4,14 @@ import type Logger from 'bunyan';
|
|
|
4
4
|
import type { MPoPComponentsConfig } from './types/MPoPComponentsConfig';
|
|
5
5
|
import type { LatestTierResponse, TierTag } from './types/TierCalculation';
|
|
6
6
|
import type { PersonalDetailsResponse } from './types/PersonalDetails';
|
|
7
|
+
import type { SupervisionPackageResponse } from './types/SupervisionPackage';
|
|
7
8
|
export declare const tierTags: Record<string, TierTag>;
|
|
8
9
|
export default class MPoPComponents {
|
|
9
10
|
private readonly tierApiRestClient;
|
|
10
11
|
private readonly masApiRestClient;
|
|
12
|
+
private readonly supervisionPackageApiRestClient;
|
|
11
13
|
constructor(authenticationClient: AuthenticationClient, config: MPoPComponentsConfig, logger?: Logger | Console);
|
|
12
14
|
getTierDetails(authOptions: AuthOptions | string, crn: string): Promise<LatestTierResponse>;
|
|
13
15
|
getPersonalDetails(authOptions: AuthOptions | string, crn: string): Promise<PersonalDetailsResponse>;
|
|
16
|
+
getSupervisionPackage(authOptions: AuthOptions | string, crn: string): Promise<SupervisionPackageResponse>;
|
|
14
17
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.cjs.js
CHANGED
|
@@ -42,9 +42,10 @@ const tierTags = {
|
|
|
42
42
|
};
|
|
43
43
|
class MPoPComponents {
|
|
44
44
|
constructor(authenticationClient, config, logger = console) {
|
|
45
|
-
var _a;
|
|
45
|
+
var _a, _b;
|
|
46
46
|
this.tierApiRestClient = new SuppressingRestClient(new hmppsRestClient.RestClient('Tier API', config, logger, authenticationClient), logger);
|
|
47
47
|
this.masApiRestClient = new SuppressingRestClient(new hmppsRestClient.RestClient('MAS API', (_a = config.masApiConfig) !== null && _a !== void 0 ? _a : config, logger, authenticationClient), logger);
|
|
48
|
+
this.supervisionPackageApiRestClient = new SuppressingRestClient(new hmppsRestClient.RestClient('Supervision Package API', (_b = config.supervisionPackageApiConfig) !== null && _b !== void 0 ? _b : config, logger, authenticationClient), logger);
|
|
48
49
|
}
|
|
49
50
|
async getTierDetails(authOptions, crn) {
|
|
50
51
|
let error = null;
|
|
@@ -103,17 +104,17 @@ class MPoPComponents {
|
|
|
103
104
|
}
|
|
104
105
|
async getPersonalDetails(authOptions, crn) {
|
|
105
106
|
let error = null;
|
|
106
|
-
let
|
|
107
|
+
let personalDetailsResponse;
|
|
107
108
|
try {
|
|
108
109
|
const response = await this.masApiRestClient.get(`/personal-details/${crn}/summary`, authOptions);
|
|
109
110
|
if (!response) {
|
|
110
|
-
|
|
111
|
+
personalDetailsResponse = {
|
|
111
112
|
personalDetails: null,
|
|
112
113
|
httpStatus: 404,
|
|
113
114
|
};
|
|
114
115
|
}
|
|
115
116
|
else {
|
|
116
|
-
|
|
117
|
+
personalDetailsResponse = {
|
|
117
118
|
personalDetails: { ...response, age: yearsSince(response.dateOfBirth) },
|
|
118
119
|
httpStatus: 200,
|
|
119
120
|
};
|
|
@@ -122,17 +123,82 @@ class MPoPComponents {
|
|
|
122
123
|
catch (err) {
|
|
123
124
|
error = err instanceof Error ? err : new Error('500 Internal Server Error');
|
|
124
125
|
const responseStatus = err === null || err === void 0 ? void 0 : err.responseStatus;
|
|
125
|
-
|
|
126
|
+
personalDetailsResponse = {
|
|
126
127
|
personalDetails: null,
|
|
127
128
|
httpStatus: responseStatus !== null && responseStatus !== void 0 ? responseStatus : 500,
|
|
128
129
|
};
|
|
129
130
|
}
|
|
130
131
|
return {
|
|
131
|
-
...
|
|
132
|
+
...personalDetailsResponse,
|
|
133
|
+
error,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
async getSupervisionPackage(authOptions, crn) {
|
|
137
|
+
let error = null;
|
|
138
|
+
let supervisionPackageResponse;
|
|
139
|
+
try {
|
|
140
|
+
const response = await this.supervisionPackageApiRestClient.get(`/case/${crn}/current-phase`, authOptions);
|
|
141
|
+
if (!response) {
|
|
142
|
+
supervisionPackageResponse = {
|
|
143
|
+
supervisionPackage: null,
|
|
144
|
+
httpStatus: 404,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
supervisionPackageResponse = {
|
|
149
|
+
supervisionPackage: response,
|
|
150
|
+
httpStatus: 200,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
const responseStatus = err === null || err === void 0 ? void 0 : err.responseStatus;
|
|
156
|
+
error = err instanceof Error ? err : new Error('500 Internal Server Error');
|
|
157
|
+
supervisionPackageResponse = {
|
|
158
|
+
supervisionPackage: null,
|
|
159
|
+
httpStatus: responseStatus !== null && responseStatus !== void 0 ? responseStatus : 500,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
...supervisionPackageResponse,
|
|
132
164
|
error,
|
|
133
165
|
};
|
|
134
166
|
}
|
|
135
167
|
}
|
|
136
168
|
|
|
169
|
+
const govukTime = (datetimeString) => {
|
|
170
|
+
if (!datetimeString || isBlank(datetimeString))
|
|
171
|
+
return null;
|
|
172
|
+
const datetime = luxon.DateTime.fromISO(datetimeString);
|
|
173
|
+
if (!datetime.isValid)
|
|
174
|
+
return null;
|
|
175
|
+
const hourMinuteFormat = datetime.minute === 0 ? 'ha' : 'h:mma';
|
|
176
|
+
return datetime.toFormat(hourMinuteFormat).toLowerCase();
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const dateWithYear = (datetimeString, showTime = false) => {
|
|
180
|
+
if (!datetimeString || isBlank(datetimeString))
|
|
181
|
+
return null;
|
|
182
|
+
const dt = luxon.DateTime.fromISO(datetimeString, { zone: 'Europe/London' });
|
|
183
|
+
if (!dt.isValid)
|
|
184
|
+
return null;
|
|
185
|
+
const time = showTime ? govukTime(datetimeString) : null;
|
|
186
|
+
return `${dt.toFormat('d MMMM yyyy')}${time ? ` at ${time}` : ''}`;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const toTitleCase = (value) => {
|
|
190
|
+
if (!value)
|
|
191
|
+
return '';
|
|
192
|
+
const lower = value.toLowerCase();
|
|
193
|
+
return `${lower.charAt(0).toUpperCase()}${lower.substring(1)}`;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
const mpopNunjucksSetup = (env) => {
|
|
197
|
+
env.addFilter('dateWithYear', dateWithYear);
|
|
198
|
+
env.addFilter('toTitleCase', toTitleCase);
|
|
199
|
+
};
|
|
200
|
+
|
|
137
201
|
exports.MPoPComponents = MPoPComponents;
|
|
202
|
+
exports.addFilters = mpopNunjucksSetup;
|
|
203
|
+
exports.mpopNunjucksSetup = mpopNunjucksSetup;
|
|
138
204
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/SuppressingRestClient.ts","../src/utils/isBlank.ts","../src/utils/yearsSince.ts","../src/MPoPComponents.ts"],"sourcesContent":[null,null,null,null],"names":["DateTime","RestClient"],"mappings":";;;;;MAGa,qBAAqB,CAAA;IAChC,WAAA,CACmB,UAAsB,EACtB,MAAwB,EAAA;Q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../src/MPoPComponents.ts","../src/utils/govukTime.ts","../src/utils/dateWithYear.ts","../src/utils/toTitleCase.ts","../src/utils/nunjucksFilters.ts"],"sourcesContent":[null,null,null,null,null,null,null,null],"names":["DateTime","RestClient"],"mappings":";;;;;MAGa,qBAAqB,CAAA;IAChC,WAAA,CACmB,UAAsB,EACtB,MAAwB,EAAA;QADxB,IAAA,CAAA,UAAU,GAAV,UAAU;QACV,IAAA,CAAA,MAAM,GAAN,MAAM;IACtB;AAEH,IAAA,MAAM,GAAG,CAAI,IAAY,EAAE,WAAiC,EAAA;AAC1D,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CACxB;YACE,IAAI;YACJ,YAAY,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,KAAI;AAC3C,gBAAA,IAAI,KAAK,CAAC,cAAc,KAAK,GAAG,EAAE;oBAChC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA,iCAAA,EAAoC,MAAM,CAAA,EAAA,EAAK,WAAW,CAAA,CAAE,CAAC;AAC/E,oBAAA,OAAO,IAAI;gBACb;AACA,gBAAA,MAAM,KAAK;YACb,CAAC;SACF,EACD,WAAW,CACZ;IACH;AACD;;ACxBM,MAAM,OAAO,GAAG,CAAC,GAAW,KAAc,CAAC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;;ACGnE,MAAM,UAAU,GAAG,CAAC,cAAsB,KAAmB;AAClE,IAAA,IAAI,CAAC,cAAc,IAAI,OAAO,CAAC,cAAc,CAAC;AAAE,QAAA,OAAO,IAAI;AAE3D,IAAA,MAAM,EAAE,GAAGA,cAAQ,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;IACtE,IAAI,CAAC,EAAE,CAAC,OAAO;AAAE,QAAA,OAAO,IAAI;IAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAACA,cAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAA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AS,CAAC,CAAC,CAAC,EAAE;AAChE,CAAC;;ACAM,MAAM,iBAAiB,GAAG,CAAC,GAAgB,KAAU;AAC1D,IAAA,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,YAAY,CAAC;AAC3C,IAAA,GAAG,CAAC,SAAS,CAAC,aAAa,EAAE,WAAW,CAAC;AAC3C;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ApiConfig, AuthOptions } from '@ministryofjustice/hmpps-rest-client';
|
|
2
2
|
import { AuthenticationClient } from '@ministryofjustice/hmpps-auth-clients';
|
|
3
3
|
import Logger from 'bunyan';
|
|
4
|
+
import { Environment } from 'nunjucks';
|
|
4
5
|
|
|
5
6
|
interface MPoPComponentsConfig extends ApiConfig {
|
|
6
7
|
masApiConfig?: ApiConfig;
|
|
8
|
+
supervisionPackageApiConfig?: ApiConfig;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
type TierTag = {
|
|
@@ -45,13 +47,90 @@ type PersonalDetailsSummary = {
|
|
|
45
47
|
age: string | null;
|
|
46
48
|
};
|
|
47
49
|
|
|
50
|
+
type SupervisionPackage = {
|
|
51
|
+
phase: {
|
|
52
|
+
name: {
|
|
53
|
+
code: string;
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
startDate: string;
|
|
57
|
+
endDate: string;
|
|
58
|
+
};
|
|
59
|
+
earlyEngagement: {
|
|
60
|
+
startDate: string;
|
|
61
|
+
endDate: string;
|
|
62
|
+
weeks: number;
|
|
63
|
+
completed: number;
|
|
64
|
+
};
|
|
65
|
+
currentYear: {
|
|
66
|
+
startDate: string;
|
|
67
|
+
endDate: string;
|
|
68
|
+
isFirstYear: boolean;
|
|
69
|
+
appointments: {
|
|
70
|
+
allowance: number;
|
|
71
|
+
scheduled: number;
|
|
72
|
+
completed: number;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
inputs: {
|
|
76
|
+
date: string;
|
|
77
|
+
gender: string;
|
|
78
|
+
integratedOffenderManagementRedRated: boolean;
|
|
79
|
+
offenderPersonalDisorderPathway: boolean;
|
|
80
|
+
intensiveSupervisionCourt: boolean;
|
|
81
|
+
nationalSecurityDivision: boolean;
|
|
82
|
+
contactSuspendedDate?: string;
|
|
83
|
+
finalThirdEligibility: {
|
|
84
|
+
eligible: boolean;
|
|
85
|
+
since: string;
|
|
86
|
+
};
|
|
87
|
+
sentences: Array<Sentence>;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
type Sentence = {
|
|
91
|
+
eventNumber: string;
|
|
92
|
+
startDate: string;
|
|
93
|
+
endDate: string;
|
|
94
|
+
supervisionPackage: {
|
|
95
|
+
code: string;
|
|
96
|
+
description: string;
|
|
97
|
+
};
|
|
98
|
+
type: {
|
|
99
|
+
code: string;
|
|
100
|
+
description: string;
|
|
101
|
+
isCustodial: boolean;
|
|
102
|
+
};
|
|
103
|
+
custody: {
|
|
104
|
+
status: {
|
|
105
|
+
code: string;
|
|
106
|
+
description: string;
|
|
107
|
+
};
|
|
108
|
+
finalThirdDate: string;
|
|
109
|
+
releases: Array<Release>;
|
|
110
|
+
};
|
|
111
|
+
inBreach: boolean;
|
|
112
|
+
};
|
|
113
|
+
type Release = {
|
|
114
|
+
releaseDate: string;
|
|
115
|
+
recallDate?: string;
|
|
116
|
+
};
|
|
117
|
+
type SupervisionPackageResponse = {
|
|
118
|
+
supervisionPackage: SupervisionPackage | null;
|
|
119
|
+
httpStatus: number;
|
|
120
|
+
error?: Error | null;
|
|
121
|
+
};
|
|
122
|
+
|
|
48
123
|
declare class MPoPComponents {
|
|
49
124
|
private readonly tierApiRestClient;
|
|
50
125
|
private readonly masApiRestClient;
|
|
126
|
+
private readonly supervisionPackageApiRestClient;
|
|
51
127
|
constructor(authenticationClient: AuthenticationClient, config: MPoPComponentsConfig, logger?: Logger | Console);
|
|
52
128
|
getTierDetails(authOptions: AuthOptions | string, crn: string): Promise<LatestTierResponse>;
|
|
53
129
|
getPersonalDetails(authOptions: AuthOptions | string, crn: string): Promise<PersonalDetailsResponse>;
|
|
130
|
+
getSupervisionPackage(authOptions: AuthOptions | string, crn: string): Promise<SupervisionPackageResponse>;
|
|
54
131
|
}
|
|
55
132
|
|
|
56
|
-
|
|
133
|
+
declare const mpopNunjucksSetup: (env: Environment) => void;
|
|
134
|
+
|
|
135
|
+
export { MPoPComponents, mpopNunjucksSetup as addFilters, mpopNunjucksSetup };
|
|
57
136
|
export type { MPoPComponentsConfig };
|
package/dist/index.esm.js
CHANGED
|
@@ -40,9 +40,10 @@ const tierTags = {
|
|
|
40
40
|
};
|
|
41
41
|
class MPoPComponents {
|
|
42
42
|
constructor(authenticationClient, config, logger = console) {
|
|
43
|
-
var _a;
|
|
43
|
+
var _a, _b;
|
|
44
44
|
this.tierApiRestClient = new SuppressingRestClient(new RestClient('Tier API', config, logger, authenticationClient), logger);
|
|
45
45
|
this.masApiRestClient = new SuppressingRestClient(new RestClient('MAS API', (_a = config.masApiConfig) !== null && _a !== void 0 ? _a : config, logger, authenticationClient), logger);
|
|
46
|
+
this.supervisionPackageApiRestClient = new SuppressingRestClient(new RestClient('Supervision Package API', (_b = config.supervisionPackageApiConfig) !== null && _b !== void 0 ? _b : config, logger, authenticationClient), logger);
|
|
46
47
|
}
|
|
47
48
|
async getTierDetails(authOptions, crn) {
|
|
48
49
|
let error = null;
|
|
@@ -101,17 +102,17 @@ class MPoPComponents {
|
|
|
101
102
|
}
|
|
102
103
|
async getPersonalDetails(authOptions, crn) {
|
|
103
104
|
let error = null;
|
|
104
|
-
let
|
|
105
|
+
let personalDetailsResponse;
|
|
105
106
|
try {
|
|
106
107
|
const response = await this.masApiRestClient.get(`/personal-details/${crn}/summary`, authOptions);
|
|
107
108
|
if (!response) {
|
|
108
|
-
|
|
109
|
+
personalDetailsResponse = {
|
|
109
110
|
personalDetails: null,
|
|
110
111
|
httpStatus: 404,
|
|
111
112
|
};
|
|
112
113
|
}
|
|
113
114
|
else {
|
|
114
|
-
|
|
115
|
+
personalDetailsResponse = {
|
|
115
116
|
personalDetails: { ...response, age: yearsSince(response.dateOfBirth) },
|
|
116
117
|
httpStatus: 200,
|
|
117
118
|
};
|
|
@@ -120,17 +121,80 @@ class MPoPComponents {
|
|
|
120
121
|
catch (err) {
|
|
121
122
|
error = err instanceof Error ? err : new Error('500 Internal Server Error');
|
|
122
123
|
const responseStatus = err === null || err === void 0 ? void 0 : err.responseStatus;
|
|
123
|
-
|
|
124
|
+
personalDetailsResponse = {
|
|
124
125
|
personalDetails: null,
|
|
125
126
|
httpStatus: responseStatus !== null && responseStatus !== void 0 ? responseStatus : 500,
|
|
126
127
|
};
|
|
127
128
|
}
|
|
128
129
|
return {
|
|
129
|
-
...
|
|
130
|
+
...personalDetailsResponse,
|
|
131
|
+
error,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
async getSupervisionPackage(authOptions, crn) {
|
|
135
|
+
let error = null;
|
|
136
|
+
let supervisionPackageResponse;
|
|
137
|
+
try {
|
|
138
|
+
const response = await this.supervisionPackageApiRestClient.get(`/case/${crn}/current-phase`, authOptions);
|
|
139
|
+
if (!response) {
|
|
140
|
+
supervisionPackageResponse = {
|
|
141
|
+
supervisionPackage: null,
|
|
142
|
+
httpStatus: 404,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
supervisionPackageResponse = {
|
|
147
|
+
supervisionPackage: response,
|
|
148
|
+
httpStatus: 200,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
catch (err) {
|
|
153
|
+
const responseStatus = err === null || err === void 0 ? void 0 : err.responseStatus;
|
|
154
|
+
error = err instanceof Error ? err : new Error('500 Internal Server Error');
|
|
155
|
+
supervisionPackageResponse = {
|
|
156
|
+
supervisionPackage: null,
|
|
157
|
+
httpStatus: responseStatus !== null && responseStatus !== void 0 ? responseStatus : 500,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
...supervisionPackageResponse,
|
|
130
162
|
error,
|
|
131
163
|
};
|
|
132
164
|
}
|
|
133
165
|
}
|
|
134
166
|
|
|
135
|
-
|
|
167
|
+
const govukTime = (datetimeString) => {
|
|
168
|
+
if (!datetimeString || isBlank(datetimeString))
|
|
169
|
+
return null;
|
|
170
|
+
const datetime = DateTime.fromISO(datetimeString);
|
|
171
|
+
if (!datetime.isValid)
|
|
172
|
+
return null;
|
|
173
|
+
const hourMinuteFormat = datetime.minute === 0 ? 'ha' : 'h:mma';
|
|
174
|
+
return datetime.toFormat(hourMinuteFormat).toLowerCase();
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
const dateWithYear = (datetimeString, showTime = false) => {
|
|
178
|
+
if (!datetimeString || isBlank(datetimeString))
|
|
179
|
+
return null;
|
|
180
|
+
const dt = DateTime.fromISO(datetimeString, { zone: 'Europe/London' });
|
|
181
|
+
if (!dt.isValid)
|
|
182
|
+
return null;
|
|
183
|
+
const time = showTime ? govukTime(datetimeString) : null;
|
|
184
|
+
return `${dt.toFormat('d MMMM yyyy')}${time ? ` at ${time}` : ''}`;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const toTitleCase = (value) => {
|
|
188
|
+
if (!value)
|
|
189
|
+
return '';
|
|
190
|
+
const lower = value.toLowerCase();
|
|
191
|
+
return `${lower.charAt(0).toUpperCase()}${lower.substring(1)}`;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const mpopNunjucksSetup = (env) => {
|
|
195
|
+
env.addFilter('dateWithYear', dateWithYear);
|
|
196
|
+
env.addFilter('toTitleCase', toTitleCase);
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export { MPoPComponents, mpopNunjucksSetup as addFilters, mpopNunjucksSetup };
|
|
136
200
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/SuppressingRestClient.ts","../src/ut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C5E,IAAA,OAAO,KAAK,CAAC,QAAQ,EAAE;AACzB,CAAC;;
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/SuppressingRestClient.ts","../src/utils/isBlank.ts","../src/utils/yearsSince.ts","../src/MPoPComponents.ts","../src/utils/govukTime.ts","../src/utils/dateWithYear.ts","../src/utils/toTitleCase.ts","../src/utils/nunjucksFilters.ts"],"sourcesContent":[null,null,null,null,null,null,null,null],"names":[],"mappings":";;;MAGa,qBAAqB,CAAA;IAChC,WAAA,CACmB,UAAsB,EACtB,MAAwB,EAAA;QADxB,IAAA,CAAA,UAAU,GAAV,UAAU;QACV,IAAA,CAAA,MAAM,GAAN,MAAM;IACtB;AAEH,IAAA,MAAM,GAAG,CAAI,IAAY,EAAE,WAAiC,EAAA;AAC1D,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CACxB;YACE,IAAI;YACJ,YAAY,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,KAAI;AAC3C,gBAAA,IAAI,KAAK,CAAC,cAAc,KAAK,GAAG,EAAE;oBAChC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA,iCAAA,EAAoC,MAAM,CAAA,EAAA,EAAK,WAAW,CAAA,CAAE,CAAC;AAC/E,oBAAA,OAAO,IAAI;gBACb;AACA,gBAAA,MAAM,KAAK;YACb,CAAC;SACF,EACD,WAAW,CACZ;IACH;AACD;;ACxBM,MAAM,OAAO,GAAG,CAAC,GAAW,KAAc,CAAC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;;ACGnE,MAAM,UAAU,GAAG,CAAC,cAAsB,KAAmB;AAClE,IAAA,IAAI,CAAC,cAAc,IAAI,OAAO,CAAC,cAAc,CAAC;AAAE,QAAA,OAAO,IAAI;AAE3D,IAAA,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;IACtE,IAAI,CAAC,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CAAC,WAAW,EAAE;AACjC,IAAA,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA,EAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;AAChE,CAAC;;ACAM,MAAM,iBAAiB,GAAG,CAAC,GAAgB,KAAU;AAC1D,IAAA,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,YAAY,CAAC;AAC3C,IAAA,GAAG,CAAC,SAAS,CAAC,aAAa,EAAE,WAAW,CAAC;AAC3C;;;;"}
|
|
@@ -18,5 +18,29 @@ $supervision-package-accent-colour: govuk-colour("blue");
|
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
20
20
|
gap: govuk-spacing(2);
|
|
21
|
+
flex-wrap: wrap;
|
|
21
22
|
margin-bottom: govuk-spacing(3);
|
|
22
|
-
|
|
23
|
+
|
|
24
|
+
> h2,
|
|
25
|
+
> h3 {
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.appointment-progress {
|
|
31
|
+
background-color: govuk-colour("teal", $variant: "tint-80");
|
|
32
|
+
border-radius: 20px;
|
|
33
|
+
height: 19px;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
width: 100%;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.appointment-progress__bar {
|
|
39
|
+
background-color: govuk-colour("teal", $variant: "tint-25");
|
|
40
|
+
height: 100%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.appointment-progress__bar-maximum {
|
|
44
|
+
background-color: govuk-colour("red");
|
|
45
|
+
height: 100%;
|
|
46
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{% if params.forename and (params.earlyEngagement.completed | int < params.earlyEngagement.weeks | int) %}
|
|
2
|
+
<p class='govuk-body'>You should see {{ params.forename }} every week for the first {{ params.earlyEngagement.weeks }} weeks of the sentence.</p>
|
|
3
|
+
{% endif %}
|
|
4
|
+
|
|
5
|
+
{% if params.forename and params.currentYear.appointments.allowance is defined and params.earlyEngagement.weeks is defined %}
|
|
6
|
+
<p class='govuk-body'>
|
|
7
|
+
Early engagement ends on {{ params.phase.endDate | dateWithYear }}{% if params.forename and (params.earlyEngagement.completed | int < params.earlyEngagement.weeks | int) %} if {{ params.forename }} attends the required appointments by then{% endif %}.
|
|
8
|
+
</p>
|
|
9
|
+
{% endif %}
|
|
10
|
+
|
|
11
|
+
{% if params.currentYear.appointments.allowance is defined and params.earlyEngagement.weeks is defined %}
|
|
12
|
+
<p class='govuk-body'>{{ params.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.</p>
|
|
13
|
+
{% endif %}
|
|
14
|
+
|
|
15
|
+
{% include './_progress-bar.njk' %}
|
|
16
|
+
|
|
17
|
+
{% if params.allAppointmentsHref %}
|
|
18
|
+
<p class='govuk-body'>
|
|
19
|
+
<a class='govuk-link govuk-link--no-visited-state' href='{{ params.allAppointmentsHref }}' >View all appointments</a>
|
|
20
|
+
</p>
|
|
21
|
+
{% endif %}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{% if params.phase.name.code == 'INIT' %}
|
|
2
|
+
{% set completed = params.earlyEngagement.completed | int %}
|
|
3
|
+
{% set allowance = params.earlyEngagement.weeks | int %}
|
|
4
|
+
{% else %}
|
|
5
|
+
{% set completed = params.currentYear.appointments.completed | int %}
|
|
6
|
+
{% set allowance = (params.currentYear.appointments.allowance | int) - (params.earlyEngagement.weeks | int) %}
|
|
7
|
+
{% endif %}
|
|
8
|
+
|
|
9
|
+
{% if allowance > 0 %}
|
|
10
|
+
{% set rawPercent = (completed / allowance * 100) | round %}
|
|
11
|
+
{% else %}
|
|
12
|
+
{% set rawPercent = 0 %}
|
|
13
|
+
{% endif %}
|
|
14
|
+
|
|
15
|
+
{% set widthPercent = 100 if rawPercent > 100 else (0 if rawPercent < 0 else rawPercent) %}
|
|
16
|
+
|
|
17
|
+
<p class='govuk-body'>{{ completed }} of {{ allowance }} appointments used</p>
|
|
18
|
+
|
|
19
|
+
<div class="appointment-progress" aria-hidden="true">
|
|
20
|
+
<div class="{{ 'appointment-progress__bar-maximum' if widthPercent == 100 else 'appointment-progress__bar' }}" style="width: {{ widthPercent }}%;"></div>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class='govuk-grid-row govuk-!-margin-top-4'>
|
|
24
|
+
<div class='govuk-grid-column-one-third'>
|
|
25
|
+
<p class='govuk-body govuk-!-margin-bottom-2'>Maximum</p>
|
|
26
|
+
<p class='govuk-body-l govuk-!-font-weight-bold'>{{ allowance }}</p>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div class='govuk-grid-column-one-third'>
|
|
30
|
+
<p class='govuk-body govuk-!-margin-bottom-2'>Remaining</p>
|
|
31
|
+
<p class='govuk-body-l govuk-!-font-weight-bold'>{{ allowance - completed }}</p>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class='govuk-grid-column-one-third'>
|
|
35
|
+
<p class='govuk-body govuk-!-margin-bottom-2'>Upcoming</p>
|
|
36
|
+
<p class='govuk-body-l govuk-!-font-weight-bold'>{{ params.currentYear.appointments.scheduled | int }}</p>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{% if params.currentYear.appointments.allowance is defined and params.currentYear.appointments.completed is defined and (params.currentYear.appointments.completed | int) >= (params.currentYear.appointments.allowance | int) and not params.inputs.offenderPersonalDisorderPathway %}
|
|
2
|
+
<strong class='app-status-badge govuk-tag govuk-tag--red'>No appointments remaining</strong>
|
|
3
|
+
{% endif %}
|
|
4
|
+
|
|
5
|
+
{% if params.isInBreach %}
|
|
6
|
+
<strong class='app-status-badge govuk-tag govuk-tag--yellow'>In breach</strong>
|
|
7
|
+
{% endif %}
|
|
8
|
+
|
|
9
|
+
{% if params.isCustody %}
|
|
10
|
+
<strong class='app-status-badge govuk-tag govuk-tag--yellow'>In custody</strong>
|
|
11
|
+
{% endif %}
|
|
12
|
+
|
|
13
|
+
{% if params.inputs.offenderPersonalDisorderPathway %}
|
|
14
|
+
<strong class='app-status-badge govuk-tag govuk-tag--purple'>Offender personality disorder</strong>
|
|
15
|
+
{% endif %}
|
|
16
|
+
|
|
17
|
+
{% if params.inputs.integratedOffenderManagementRedRated %}
|
|
18
|
+
<strong class='app-status-badge govuk-tag govuk-tag--red'>IOM (Integrated Offender Management): Red</strong>
|
|
19
|
+
{% endif %}
|
|
@@ -1,17 +1,31 @@
|
|
|
1
|
+
{% set standardAppointmentsComplete = params.currentYear.appointments.allowance is defined and params.currentYear.appointments.completed is defined and (params.currentYear.appointments.completed | int) >= (params.currentYear.appointments.allowance| int) %}
|
|
2
|
+
{% set hasSpecialStatus = params.inputs.offenderPersonalDisorderPathway or params.isInBreach or params.isCustody or params.inputs.integratedOffenderManagementRedRated %}
|
|
3
|
+
|
|
1
4
|
<div class='govuk-width-container supervision-package'>
|
|
2
|
-
|
|
5
|
+
{% if standardAppointmentsComplete or hasSpecialStatus %}
|
|
6
|
+
<div class='app-tier-header'>
|
|
7
|
+
<h2 class='govuk-heading-m govuk-!-margin-bottom-0'>{{ 'Supervision package: ' ~ params.sentenceType if params.sentenceType else 'Supervision package' }}</h2>
|
|
8
|
+
{% include './partials/_tags.njk' %}
|
|
9
|
+
</div>
|
|
10
|
+
{% else %}
|
|
11
|
+
<h2 class='govuk-heading-m'>{{ 'Supervision package: ' ~ params.sentenceType if params.sentenceType else 'Supervision package' }}</h2>
|
|
12
|
+
{% endif %}
|
|
13
|
+
|
|
3
14
|
<div class='govuk-grid-row'>
|
|
4
|
-
<div class='govuk-grid-column-two-thirds'>
|
|
15
|
+
<div class='{{ "govuk-grid-column-one-half" if params.phase.name.description else "govuk-grid-column-two-thirds" }}'>
|
|
5
16
|
<div class='app-tier-header'>
|
|
6
17
|
<h3 class='govuk-heading-s govuk-!-margin-bottom-0'>
|
|
7
18
|
Tier {{ '' if params.tierScore == 'MISSING' else params.tierScore }}
|
|
8
19
|
</h3>
|
|
9
|
-
|
|
10
20
|
{% if params.tag.text and params.tag.color %}
|
|
11
21
|
<strong class='govuk-tag govuk-tag--{{ params.tag.color }}'>{{ params.tag.text }}</strong>
|
|
12
22
|
{% endif %}
|
|
13
23
|
</div>
|
|
14
24
|
|
|
25
|
+
{% if params.createdOn %}
|
|
26
|
+
<p class='govuk-body'>The supervision package was created on {{ params.createdOn }}.</p>
|
|
27
|
+
{% endif %}
|
|
28
|
+
|
|
15
29
|
{% if params.tag.text == 'Provisional' %}
|
|
16
30
|
<p class='govuk-body'>
|
|
17
31
|
We will calculate the supervision package once the tier is confirmed.
|
|
@@ -31,6 +45,33 @@
|
|
|
31
45
|
</a>
|
|
32
46
|
</p>
|
|
33
47
|
{% endif %}
|
|
48
|
+
|
|
49
|
+
{% if params.nextAppointment and params.nextAppointmentHref %}
|
|
50
|
+
<h3 class='govuk-heading-s'>Next appointment</h3>
|
|
51
|
+
<p class='govuk-body'>
|
|
52
|
+
<a href='{{ params.nextAppointmentHref }}' class='govuk-link govuk-link--no-visited-state'>{{ params.nextAppointment }}</a>
|
|
53
|
+
</p>
|
|
54
|
+
{% endif %}
|
|
34
55
|
</div>
|
|
56
|
+
|
|
57
|
+
{% if params.phase.name.description %}
|
|
58
|
+
<div class='govuk-grid-column-one-half'>
|
|
59
|
+
<h3 class='govuk-heading-s'>{{ params.phase.name.description | toTitleCase }} stage</h3>
|
|
60
|
+
{% if params.phase.name.code == 'INIT' %}
|
|
61
|
+
{% include './partials/_early-engagement.njk' %}
|
|
62
|
+
{% endif %}
|
|
63
|
+
</div>
|
|
64
|
+
{% endif %}
|
|
35
65
|
</div>
|
|
66
|
+
|
|
67
|
+
{% if params.arrangeAppointmentHref and params.updateRiskFlagHref %}
|
|
68
|
+
<div class='govuk-button-group'>
|
|
69
|
+
<a href='{{ params.arrangeAppointmentHref }}' role='button' draggable='false' class='govuk-button' data-module='govuk-button'>
|
|
70
|
+
Arrange an appointment
|
|
71
|
+
</a>
|
|
72
|
+
<a href='{{ params.updateRiskFlagHref }}' role='button' draggable='false' class='govuk-button govuk-button--secondary' data-module='govuk-button'>
|
|
73
|
+
Update NDelius risk flag
|
|
74
|
+
</a>
|
|
75
|
+
</div>
|
|
76
|
+
{% endif %}
|
|
36
77
|
</div>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export type SupervisionPackage = {
|
|
2
|
+
phase: {
|
|
3
|
+
name: {
|
|
4
|
+
code: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
startDate: string;
|
|
8
|
+
endDate: string;
|
|
9
|
+
};
|
|
10
|
+
earlyEngagement: {
|
|
11
|
+
startDate: string;
|
|
12
|
+
endDate: string;
|
|
13
|
+
weeks: number;
|
|
14
|
+
completed: number;
|
|
15
|
+
};
|
|
16
|
+
currentYear: {
|
|
17
|
+
startDate: string;
|
|
18
|
+
endDate: string;
|
|
19
|
+
isFirstYear: boolean;
|
|
20
|
+
appointments: {
|
|
21
|
+
allowance: number;
|
|
22
|
+
scheduled: number;
|
|
23
|
+
completed: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
inputs: {
|
|
27
|
+
date: string;
|
|
28
|
+
gender: string;
|
|
29
|
+
integratedOffenderManagementRedRated: boolean;
|
|
30
|
+
offenderPersonalDisorderPathway: boolean;
|
|
31
|
+
intensiveSupervisionCourt: boolean;
|
|
32
|
+
nationalSecurityDivision: boolean;
|
|
33
|
+
contactSuspendedDate?: string;
|
|
34
|
+
finalThirdEligibility: {
|
|
35
|
+
eligible: boolean;
|
|
36
|
+
since: string;
|
|
37
|
+
};
|
|
38
|
+
sentences: Array<Sentence>;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type Sentence = {
|
|
42
|
+
eventNumber: string;
|
|
43
|
+
startDate: string;
|
|
44
|
+
endDate: string;
|
|
45
|
+
supervisionPackage: {
|
|
46
|
+
code: string;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
type: {
|
|
50
|
+
code: string;
|
|
51
|
+
description: string;
|
|
52
|
+
isCustodial: boolean;
|
|
53
|
+
};
|
|
54
|
+
custody: {
|
|
55
|
+
status: {
|
|
56
|
+
code: string;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
finalThirdDate: string;
|
|
60
|
+
releases: Array<Release>;
|
|
61
|
+
};
|
|
62
|
+
inBreach: boolean;
|
|
63
|
+
};
|
|
64
|
+
type Release = {
|
|
65
|
+
releaseDate: string;
|
|
66
|
+
recallDate?: string;
|
|
67
|
+
};
|
|
68
|
+
export type SupervisionPackageResponse = {
|
|
69
|
+
supervisionPackage: SupervisionPackage | null;
|
|
70
|
+
httpStatus: number;
|
|
71
|
+
error?: Error | null;
|
|
72
|
+
};
|
|
73
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const toTitleCase: (value: string | null | undefined) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|