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

CAS-505 Add "Wheelchair accessible" bedspace attribute to bedspace search filters #1145

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 @@ -64,11 +64,21 @@ export default class BedspaceSearchPage extends Page {
this.checkCheckboxByNameAndValue('probationDeliveryUnits[]', pdu)
})

this.getLegend('Bedspace attributes')
this.getLegend('Property attributes')
this.getLegend('Occupancy (optional)')
searchParameters.attributes.forEach(attribute => {
this.checkCheckboxByNameAndValue('attributes[]', attribute)
})
searchParameters.attributes
.filter(attribute => attribute === 'wheelchairAccessible')
.forEach(attribute => {
this.checkCheckboxByNameAndValue('attributes[]', attribute)
})

this.getLegend('Bedspace attributes')
this.getLegend('Accessibility (optional)')
searchParameters.attributes
.filter(attribute => attribute !== 'wheelchairAccessible')
.forEach(attribute => {
this.checkCheckboxByNameAndValue('attributes[]', attribute)
})
}

clickBedspaceLink(room: Room) {
Expand Down
2 changes: 1 addition & 1 deletion server/testutils/factories/bedSearchParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { DateFormats } from '../../utils/dateUtils'
import referenceData from './referenceData'

const bedSearchAttributes: Array<BedSearchAttributes> = ['singleOccupancy', 'sharedProperty']
const bedSearchAttributes: Array<BedSearchAttributes> = ['singleOccupancy', 'sharedProperty', 'wheelchairAccessible']

export default Factory.define<BedSearchAPIParameters>(() => ({
startDate: DateFormats.dateObjToIsoDate(faker.date.soon()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,53 @@
fieldName: "probationDeliveryUnits"
}, fetchContext()) }}

{% call govukFieldset({
legend: {
text: "Bedspace attributes",
classes: "govuk-fieldset__legend--m"
}
}) %}
{{ formPageCheckboxes({
classes: "govuk-checkboxes--small",
fieldName: "attributes",
fieldset: {
legend: {
text: "Occupancy (optional)",
classes: "govuk-fieldset__legend--s"
}
},
hint: {
text: "Select all that apply"
},
items: [
{ text: "Single", value: "singleOccupancy" },
{ text: "Shared", value: "sharedProperty" }
]
}, fetchContext()) }}
{% endcall %}
<section>
<div class="govuk-form-group">
{% call govukFieldset({
legend: {
text: "Property attributes",
classes: "govuk-fieldset__legend--m"
}
}) %}
{{ formPageCheckboxes({
classes: "govuk-checkboxes--small",
fieldName: "attributes",
fieldset: {
legend: {
text: "Occupancy (optional)",
classes: "govuk-fieldset__legend--s"
}
},
hint: {
text: "Select all that apply"
},
items: [
{ text: "Single", value: "singleOccupancy" },
{ text: "Shared", value: "sharedProperty" }
]
}, fetchContext()) }}
{% endcall %}
</div>
<div class="govuk-form-group">
{% call govukFieldset({
legend: {
text: "Bedspace attributes",
classes: "govuk-fieldset__legend--m"
}
}) %}
{{ formPageCheckboxes({
classes: "govuk-checkboxes--small",
fieldName: "attributes",
fieldset: {
legend: {
text: "Accessibility (optional)",
classes: "govuk-fieldset__legend--s"
}
},
items: [
{ text: "Wheelchair accessible", value: "wheelchairAccessible" }
]
}, fetchContext()) }}
{% endcall %}
</div>
</section>
Loading