OpenEugene / little-help-book-web

Human service resource guide powered by White Bird Clinic
MIT License
6 stars 4 forks source link

Experiment with Cat/Subcat structure #14

Closed colindavey closed 3 years ago

colindavey commented 3 years ago

Currently, the database only works well with a single Category/Subcategory pair per help service, so that if the same provider is in several categories, there needs to be a duplicate row for the provider for each category it is in. The current database has dozens or more duplicate providers.

This can cause problems when provider information needs to be revised. For example, if it changes address, the address will have to be edited for every row for that provider.

In addition, the database allows illegal combinations of Category/Subcategory that I think causes the current loop structure of the code to miss some rows, or miscategorize some providers.

Experiment with and propose a solution to these issues.

markdav-is commented 3 years ago

provider cats and sub-cats are now multi-select image

colindavey commented 3 years ago

I'm not sure that that solves all the problems.

markdav-is commented 3 years ago

well, it solves " if the same provider is in several categories, there needs to be a duplicate row for the provider for each category it is in."

colindavey commented 3 years ago

I'm pretty sure it still allows illegal combinations where provider could get missed, or miscategorized. I'll try to come up with examples.

colindavey commented 3 years ago

BTW, once we have a workable solution, be it this, or something else, then there a lot of duplicate records to prune.

markdav-is commented 3 years ago

Cat/Subs are just for the layout of the TOC. and that's mapped in the cat table buy the subcategory column. The TOC lets you pick a cat or subcat and then you are provided a list of all the places that have the cat or sub-cat that you selected. places can show up in more than one list. so places are mapp to cats, places are mapped to sub-cats, cats are mapped to subcats.

markdav-is commented 3 years ago

this diagram might help
image

colindavey commented 3 years ago

If I understand correctly, if there is a subcategory that isn't under any category, then it can't be found through the TOC. But it can be found through search?

markdav-is commented 3 years ago

indeed!

colindavey commented 3 years ago

And we're cool with that?

colindavey commented 3 years ago

That's one of the things I was referring to in the issue description with "causes the current loop structure of the code to miss some rows." So, I'm working on a way to have a route to all providers through the TOC, except maybe when cat/subcat are both blank.

The thinking is that if someone entered the information, and bothered to give it a subcategory, they probably would be disappointed if it didn't show up in the TOC.

ArthurSmid commented 3 years ago

If White Bird staff decide to create a new category and/or a subcategory for an existing category, I think they should be able to. I believe that's an important feature to plan for, it's part of the site being update-able. The table-of-contents html is written to allow for those columns to flow and for new items to be added over time.

The table-of-contents style homepage when viewed on a desktop displays all the Category and Subcategory names, but when someone opens it on a tablet or mobile device, they won't see all of the subcategories unless they click each category to see what's there. And given that this resource directory will be accessed from different screen sizes, the search bar is up top and important. When you resize the homepage in a browser window, making it smaller and the menu bar items rearrange, the search bar moves to the top of the screen to emphasize that feature in finding what's all in there.

https://github.com/OpenEugene/little-help-book-web/blob/develop/table-of-contents-style-homepage/index.html

markdav-is commented 3 years ago

cats and subs can be created on the fly. If you want to use an accordion control for the smaller screen size, I'd make an issue for that and get it on the roadmap. there is an example of this at https://eugenefoodscene.com/ where the filtering controls turn from a grid of toggles to multi-select dropdowns on mobile. slightly different controls, but the same control-switching-on-screen size (media query) sort of thing.

colindavey commented 3 years ago

Done.