Skip to content

Commit

Permalink
Space Search Updates for User Testing
Browse files Browse the repository at this point in the history
This changes should not be merged to main, and are only being made to support user testing. Whilst these changes may be required in the future it’s worth noting that the approach taken here may be incorrect because it will update what options/labels appears on screens other than space search (e.g. assessment).
  • Loading branch information
davidatkinsuk committed Sep 13, 2024
1 parent 75dca18 commit a743806
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ describe('MatchingInformation', () => {
const page = new MatchingInformation({}, assessment)

expect(page.errors()).toEqual({
isStepFreeDesignated: 'You must specify a preference for step-free access',
hasEnSuite: 'You must specify a preference for en-suite bathroom',
isStepFreeDesignated: 'You must specify a preference for limited mobility',
hasEnSuite: 'You must specify a preference for en-suite (room)',
lengthOfStayAgreed: 'You must state if you agree with the length of the stay',
})
})
Expand All @@ -104,17 +104,17 @@ describe('MatchingInformation', () => {
'What type of AP is required?': 'Enhanced Security AP (ESAP)',
'Designated arson room': 'Essential',
'Room suitable for a person with sexual offences': 'Not relevant',
'Wheelchair accessible': 'Essential',
'Single room': 'Desirable',
'Step-free access': 'Desirable',
'Catering required': 'Not relevant',
'En-suite bathroom': 'Not relevant',
'Vulnerable to exploitation': 'Relevant',
'Sexual offences against an adult': 'Relevant',
'Sexual offences against children': 'Relevant',
'Wheelchair needs': 'Essential',
'Single (room)': 'Desirable',
'Limited mobility': 'Desirable',
'Catered (property)': 'Not relevant',
'En-suite (room)': 'Not relevant',
'At risk of criminal exploitation': 'Relevant',
'Poses sexual risk to adults': 'Relevant',
'Poses risk to children': 'Relevant',
'Non sexual offences against children': 'Relevant',
'Hate based offences': 'Relevant',
'Arson offences': 'Relevant',
'Has committed hate-based offences': 'Relevant',
'Poses arson risk': 'Relevant',
'Do you agree with the suggested length of stay?': 'Yes',
'Information for Central Referral Unit (CRU) manager': 'Some info',
})
Expand Down
4 changes: 2 additions & 2 deletions server/utils/apTypeLabels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ export const apTypeLabels: Record<ApType, string> = {
normal: 'Standard AP',
pipe: 'Psychologically Informed Planned Environment (PIPE)',
esap: 'Enhanced Security AP (ESAP)',
mhapElliottHouse: 'Specialist mental health AP (Elliot House, East Midlands)',
mhapStJosephs: 'Specialist mental health AP (St Joseph’s, Greater Manchester)',
rfap: 'Recovery Focused AP (RFAP)',
mhapElliottHouse: 'Specialist Mental Health AP (Elliott House - Midlands)',
mhapStJosephs: 'Specialist Mental Health AP (St Josephs - Greater Manchester)',
} as const

export type ApTypeLabel = (typeof apTypeLabels)[ApType]
19 changes: 16 additions & 3 deletions server/utils/match/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export const addressRow = (spaceSearchResult: SpaceSearchResult) => ({

export const characteristicsRow = (spaceSearchResult: SpaceSearchResult) => {
return {
key: { text: 'Characteristics' },
key: { text: 'Suitable for' },
value: {
html: `<ul class="govuk-list govuk-list--bullet">${spaceSearchResult.premises.premisesCharacteristics.map(characteristic => `<li>${characteristic.name}</li>`).join(' ')}</ul>`,
},
Expand Down Expand Up @@ -275,15 +275,28 @@ export const startDateObjFromParams = (params: { startDate: string } | ObjectWit
return { startDate: params.startDate, ...DateFormats.isoDateToDateInputs(params.startDate, 'startDate') }
}

export const offenceAndRiskCriteriaLabelsFiltered = () => {
const result = offenceAndRiskCriteriaLabels
delete result.acceptsNonSexualChildOffenders
return result
}

export const placementRequirementCriteriaLabelsFiltered = () => {
const result = placementRequirementCriteriaLabels
delete result.isSuitedForSexOffenders
delete result.isArsonDesignated
return result
}

export const groupedCriteria = {
offenceAndRisk: {
title: 'Risks and offences',
items: offenceAndRiskCriteriaLabels,
items: offenceAndRiskCriteriaLabelsFiltered(),
inputName: 'spaceCharacteristics',
},
accessNeeds: {
title: 'Access needs and additional features',
items: placementRequirementCriteriaLabels,
items: placementRequirementCriteriaLabelsFiltered(),
inputName: 'spaceCharacteristics',
},
}
Expand Down
20 changes: 10 additions & 10 deletions server/utils/placementCriteriaUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ export const placementCriteriaLabels: Record<UiPlacementCriteria, string> = {
isMHAPElliottHouse: 'Specialist Mental Health AP (Elliott House - Midlands)',
isMHAPStJosephs: 'Specialist Mental Health AP (St Josephs - Greater Manchester)',
isSemiSpecialistMentalHealth: 'Semi-specialist mental health',
isSuitableForVulnerable: 'Vulnerable to exploitation',
acceptsSexOffenders: 'Sexual offences against an adult',
acceptsChildSexOffenders: 'Sexual offences against children',
isSuitableForVulnerable: 'At risk of criminal exploitation',
acceptsChildSexOffenders: 'Poses risk to children',
acceptsHateCrimeOffenders: 'Has committed hate-based offences',
isArsonSuitable: 'Poses arson risk',
acceptsSexOffenders: 'Poses sexual risk to adults',
acceptsNonSexualChildOffenders: 'Non sexual offences against children',
acceptsHateCrimeOffenders: 'Hate based offences',
isWheelchairDesignated: 'Wheelchair accessible',
isSingle: 'Single room',
isStepFreeDesignated: 'Step-free access',
isCatered: 'Catering required',
hasEnSuite: 'En-suite bathroom',
isWheelchairDesignated: 'Wheelchair needs',
isStepFreeDesignated: 'Limited mobility',
hasEnSuite: 'En-suite (room)',
isSingle: 'Single (room)',
isCatered: 'Catered (property)',
isSuitedForSexOffenders: 'Room suitable for a person with sexual offences',
isArsonSuitable: 'Arson offences',
hasBrailleSignage: 'Braille signage',
hasTactileFlooring: 'Tactile flooring',
hasHearingLoop: 'Hearing loop',
Expand Down
2 changes: 1 addition & 1 deletion server/views/match/search.njk
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
value: requirements.gender,
fieldset: {
legend: {
text: 'Gender',
text: 'Person on probation',
classes: 'govuk-fieldset__legend--s',
isPageHeading: false
}
Expand Down

0 comments on commit a743806

Please sign in to comment.