-
Notifications
You must be signed in to change notification settings - Fork 1
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
APS-1702 Suitability search filter changes #2274
APS-1702 Suitability search filter changes #2274
Conversation
63e949e
to
27ade91
Compare
27ade91
to
811d0ae
Compare
server/utils/utils.ts
Outdated
export const lowerCase = (string: string) => { | ||
const result = Case.lower(string) | ||
return result | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introducing a variable here seems unnecessary -- though this method seems unnecessary in itself... 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup - nice spot. I think I added a log in there.
Turns out that this method messes up hyphens.
Anyway - I'll revert this.
fe06e13
to
a0d8530
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to go, but if possible some more tidying up around related services and factories would be good to see to truly represent latest state of play.
const filterByTypeOrder = (mapping: CriteriaLabelMap, defaultLabels: CriteriaLabelMap): CriteriaLabelMap => | ||
Object.entries(mapping).reduce( | ||
(criteria, [key, value]) => ({ ...criteria, [key]: value || defaultLabels[key] }), | ||
{} as CriteriaLabelMap, | ||
) | ||
|
||
export const spaceSearchCriteriaApLevelLabels = filterByTypeOrder(apLevelSearchCriteria, placementCriteriaLabels) | ||
|
||
export const spaceSearchCriteriaRoomLevelLabels = filterByTypeOrder(roomLevelSearchCriteria, placementCriteriaLabels) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to see a test or 2 around these, if only to document what they're meant to achieve.
Alternatively, those could be set rather than processed -- this is a fair bit of logic for a couple of default labels!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is. The idea was to avoid replicating all the characteristic labels for the suitability search, and just replacing the altered ones. As it happens, most are being overridden so you're probably right and I should just re-declare the entire set.
4cb4848
to
b8d8df4
Compare
Context
https://dsdmoj.atlassian.net/browse/APS-1702
Changes in this PR
Update to the suitability search filters.
Screenshots of UI changes
Before
After