Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anonymise names in page titles #627

Merged
merged 3 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ context('Cookies', () => {
it('should navigate to the cookie policy page', () => {
cy.signIn()
cy.contains('Cookies').click()
cy.title().should('eq', 'Cookies')
cy.title().should('eq', 'Cookies - Temporary Accommodation')
cy.contains('Cookies are small files saved on your phone, tablet or computer when you visit a website.')
})
})
1 change: 1 addition & 0 deletions server/@types/ui/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { CallConfig } from '../../data/restClient'

interface TasklistPage {
body: Record<string, unknown>
htmlDocumentTitle: string
}
interface PersonService {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ type ConsentGivenBody = {
export default class ConsentGiven implements TasklistPage {
title = 'Has consent for Temporary Accommodation been given?'

htmlDocumentTitle = this.title

constructor(
readonly body: Partial<ConsentGivenBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import ContactDetails from '../../contactDetails'
export default class BackupContact extends ContactDetails implements TasklistPage {
title = 'Backup contact / senior probation officer details'

htmlDocumentTitle = this.title

nextPageId = 'practitioner-pdu'

previousPageId = 'probation-practitioner'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ type PractitionerPduBody = { pdu: string }
export default class PractitionerPdu implements TasklistPage {
title: string

htmlDocumentTitle = "What is the person's PDU?"

constructor(
readonly body: Partial<PractitionerPduBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import ContactDetails from '../../contactDetails'
export default class ProbationPractitioner extends ContactDetails implements TasklistPage {
title = 'Probation practitioner details'

htmlDocumentTitle = this.title

previousPageId = 'dashboard'

nextPageId = 'backup-contact'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ type AccommodationRequiredFromDateBody = ObjectWithDateParts<'accommodationRequi
export default class AccommodationRequiredFromDate implements TasklistPage {
title = 'What date is accommodation required from?'

htmlDocumentTitle = this.title

constructor(
private _body: Partial<AccommodationRequiredFromDateBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type EligibilityReasonBody = { reason: EligibilityReasonsT }
export default class EligibilityReason implements TasklistPage {
title: string

htmlDocumentTitle = 'How is the person eligible for Temporary Accommodation (TA)?'

constructor(
readonly body: Partial<EligibilityReasonBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ type ReleaseDateBody = ObjectWithDateParts<'releaseDate'>
export default class ReleaseDate implements TasklistPage {
title: string

htmlDocumentTitle = "What is the person's release date?"

constructor(
private _body: Partial<ReleaseDateBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export type OffendingSummaryBody = {
export default class OffendingSummary implements TasklistPage {
title: string

htmlDocumentTitle = "Provide a brief summary of the person's offending history"

constructor(
readonly body: Partial<OffendingSummaryBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ type ReleaseTypeBody = {
export default class ReleaseType implements TasklistPage {
title = 'What is the release type?'

htmlDocumentTitle = this.title

constructor(
private _body: Partial<ReleaseTypeBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ type SentenceExpiryBody = ObjectWithDateParts<'sentenceExpiryDate'>

@Page({ name: 'sentence-expiry', bodyProperties: dateBodyProperties('sentenceExpiryDate') })
export default class SentenceExpiry implements TasklistPage {
title: string
title = 'Sentence expiry date'

htmlDocumentTitle = this.title

constructor(
private _body: Partial<SentenceExpiryBody>,
readonly application: Application,
) {
this.title = 'Sentence expiry date'
}
) {}

public set body(value: Partial<SentenceExpiryBody>) {
this._body = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ const sentenceLengthComponentResponse = (value: string, singularLabel: string, p

@Page({ name: 'sentence-length', bodyProperties: ['years', 'months', 'weeks', 'days'] })
export default class SentenceLength implements TasklistPage {
title: string
title = 'What is the sentence length?'

htmlDocumentTitle = this.title

constructor(
readonly body: Partial<SentenceLengthBody>,
readonly application: Application,
) {
this.title = 'What is the sentence length?'
}
) {}

response() {
const years = sentenceLengthComponentResponse(this.body.years, 'year', 'years')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export type SentenceTypesT = keyof typeof sentenceTypes
export default class SentenceType implements TasklistPage {
title = 'Which of the following best describes the sentence type?'

htmlDocumentTitle = this.title

constructor(
readonly body: { sentenceType?: SentenceTypesT },
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ type ApprovalsForSpecificRisksBody = {
export default class ApprovalsForSpecificRisks implements TasklistPage {
title = 'Approvals for specific risks'

htmlDocumentTitle = this.title

questions = {
approvals: 'Have your received approval for this referral?',
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ type PreviousStaysBody = { previousStays: YesNoOrIDK }

@Page({ name: 'previous-stays', bodyProperties: ['previousStays'] })
export default class PreviousStays implements TasklistPage {
title: string
title = 'Behaviour in previous accommodation'

htmlDocumentTitle = this.title

questions: {
previousStays: string
Expand All @@ -22,8 +24,6 @@ export default class PreviousStays implements TasklistPage {
) {
const name = personName(application.person)

this.title = 'Behaviour in previous accommodation'

this.questions = {
previousStays: `Has ${name} previously stayed in Community Accommodation Services (CAS)?`,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ type PreviousStaysDetailsBody = {
export default class PreviousStaysDetails implements TasklistPage {
title: string

htmlDocumentTitle = 'What type of accommodation did the person stay at?'

constructor(
readonly body: Partial<PreviousStaysDetailsBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ type AdditionalLicenceConditionsBody = {
export default class AdditionalLicenceConditions implements TasklistPage {
title = 'Additional licence conditions'

htmlDocumentTitle = this.title

constructor(
readonly body: Partial<AdditionalLicenceConditionsBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type AccommodationSharingBody = {
export default class AccommodationSharing implements TasklistPage {
title = 'Accommodation sharing'

htmlDocumentTitle = this.title

questions: {
accommodationSharing: string
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ type AntiSocialBehaviourBody = YesOrNoWithDetail<'concerns'>
export default class AntiSocialBehaviour implements TasklistPage {
title = 'Anti-social behaviour'

htmlDocumentTitle = this.title

questions = {
concerns: 'Are there any concerns or risks relating to anti-social behaviour?',
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ type CooperationBody = {
export default class Cooperation implements TasklistPage {
title = 'Cooperation'

htmlDocumentTitle = this.title

questions: {
support: string
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export default class RiskManagementPlan implements OasysPage {

title = 'Risk management plan'

htmlDocumentTitle = this.title

risks: PersonRisksUI

oasysSuccess: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type RoshLevelBody = {
export default class RoshLevel implements TasklistPage {
title = 'RoSH level'

htmlDocumentTitle = this.title

risks: PersonRisksUI

constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ type SubstanceMisuseBody = YesOrNoWithDetail<'substanceMisuse'>
export default class SubstanceMisuse implements TasklistPage {
title = 'Substance misuse'

htmlDocumentTitle = this.title

questions: {
substanceMisuse: string
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export const acctAlertResponse = (acctAlert: PersonAcctAlert) => {
export default class AcctAlerts implements TasklistPage {
title = 'ACCT'

htmlDocumentTitle = this.title

importDate: string

constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export const adjudicationResponse = (adjudication: Adjudication) => {
export default class Adjudications implements TasklistPage {
title = 'Adjudications'

htmlDocumentTitle = this.title

importDate: string

constructor(
Expand Down
2 changes: 2 additions & 0 deletions server/form-pages/apply/check-your-answers/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export default class Review implements TasklistPage {

title = 'Check your answers'

htmlDocumentTitle = this.title

constructor(
public body: { reviewed?: string },
readonly application: TemporaryAccommodationApplication,
Expand Down
2 changes: 2 additions & 0 deletions server/form-pages/apply/contactDetails.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import ContactDetails from './contactDetails'
class ConcreteContactDetails extends ContactDetails implements TasklistPage {
title = 'A title'

htmlDocumentTitle = this.title

previousPageId = 'previous-page-id'

nextPageId = 'next-page-id'
Expand Down
2 changes: 2 additions & 0 deletions server/form-pages/apply/contactDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ type ContactDetailsBody = { name: string; phone: string; email: string }
export default abstract class ContactDetails {
abstract title: string

abstract htmlDocumentTitle: string

abstract previousPageId: string

abstract nextPageId: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ type CrsSubmittedBody = {
export default class CrsSubmitted implements TasklistPage {
title = 'Has a referral to Commissioned Rehabilitative Services (CRS) been submitted?'

htmlDocumentTitle = this.title

constructor(
readonly body: Partial<CrsSubmittedBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ type DtrDetailsBody = {
export default class DtrDetails implements TasklistPage {
title = 'Provide further details'

htmlDocumentTitle = this.title

questions = {
reference: 'DTR / NOP reference number',
date: 'Date DTR / NOP was submitted',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ type DtrSubmittedBody = {
export default class DtrSubmitted implements TasklistPage {
title = 'Has the Duty to Refer (DTR) / National Offender Pathway (NOP) been submitted?'

htmlDocumentTitle = this.title

constructor(
readonly body: Partial<DtrSubmittedBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ type OtherAccommodationOptionsBody = YesOrNoWithDetail<'otherOptions'>
export default class OtherAccommodationOptions implements TasklistPage {
title = 'Have other accommodation options been considered?'

htmlDocumentTitle = this.title

constructor(
readonly body: Partial<OtherAccommodationOptionsBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ type NeedsBody = {
export default class Needs implements TasklistPage {
title: string

htmlDocumentTitle = 'Does the person have any of the following needs?'

constructor(
readonly body: Partial<NeedsBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ type PropertyAttributesOrAdaptationsBody = YesOrNoWithDetail<'propertyAttributes
export default class PropertyAttributesOrAdaptations implements TasklistPage {
title: string

htmlDocumentTitle = 'Will the person require a property with specific attributes or adaptations?'

constructor(
readonly body: Partial<PropertyAttributesOrAdaptationsBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ type ReligiousOrCulturalNeedsBody = YesOrNoWithDetail<'religiousOrCulturalNeeds'
export default class ReligiousOrCulturalNeeds implements TasklistPage {
title: string

htmlDocumentTitle = 'Does the person have any religious or cultural needs?'

constructor(
readonly body: Partial<ReligiousOrCulturalNeedsBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ type FoodAllergiesBody = YesNoOrIDKWithDetail<'foodAllergies'>
export default class FoodAllergies implements TasklistPage {
title = 'Food allergies'

htmlDocumentTitle = this.title

questions: {
foodAllergies: string
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ type MoveOnPlanBody = { plan: string }
export default class MoveOnPlan implements TasklistPage {
title: string

htmlDocumentTitle = 'How will you prepare the person for move on after placement?'

constructor(
readonly body: Partial<MoveOnPlanBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ type AlternativePduBody = YesOrNoWithDetail<'alternativePdu'>
export default class AlternativePdu implements TasklistPage {
title = 'Is placement required in an alternative PDU?'

htmlDocumentTitle = this.title

constructor(
readonly body: Partial<AlternativePduBody>,
readonly application: Application,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ type CaringResponsibilitiesBody = YesOrNoWithDetail<'caringResponsibilities'>
export default class CaringResponsibilities implements TasklistPage {
title = 'Caring responsibilities'

htmlDocumentTitle = this.title

questions: {
caringResponsibilities: string
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ type LocalConnectionsBody = {
export default class LocalConnections implements TasklistPage {
title = 'Local connections'

htmlDocumentTitle = this.title

constructor(
readonly body: Partial<LocalConnectionsBody>,
readonly application: Application,
Expand Down
Loading