codeforamerica / ohana-web-search

A mobile-friendly website for finding human and social services in your community
http://ohana-web-search-demo.herokuapp.com
BSD 3-Clause "New" or "Revised" License
69 stars 74 forks source link

Services header is shown when services are empty #383

Closed anselmbradford closed 9 years ago

anselmbradford commented 10 years ago

screen shot 2014-04-25 at 1 33 24 pm

See http://ohana-web-search-demo.herokuapp.com/organizations/admin-test-org/admin-test-location?keyword=&service_area=&utf8=%E2%9C%93

The "Services" header shouldn't show when there are no services listed.

anselmbradford commented 10 years ago

Looks like this is coming up because http://ohana-api-demo.herokuapp.com/api/organizations/8/locations has categories listed in its services, which aren't displayed in https://github.com/codeforamerica/ohana-web-search/blob/master/app/views/component/organizations/detail/_body.html.haml#L175, but still make the services header show up because the services exist.

@monfresh any suggestion on the best way to check if the services exist, but just for the fields we want in https://github.com/codeforamerica/ohana-web-search/blob/master/app/views/component/organizations/detail/_body.html.haml#L175-L188?

monfresh commented 10 years ago

The root of the issue is that none of the service attributes are required, so you can end up with a service like the one above. I would think that a few attributes should actually be required, such as the name at least. I would open an issue on OpenReferral for this.

I don't think it's the client's business to have to come up with complex logic just to be able to show or hide a header.

anselmbradford commented 9 years ago

@monfresh Can this issue be closed? It looks like there are required fields for services now (e.g. the Name).

monfresh commented 9 years ago

:ok_hand: