- Issue created by @joachim
- 🇬🇧United Kingdom joachim
Never mind, it was caused by ✨ add a bins key Active .
The providers.md file doesn't say that the 'colour' key is optional in the return from getCollections(), so we can assume it's at least an empty string.
- 🇬🇧United Kingdom joachim
Hmm actually, I need to think about how we handle two bins which are different types but the same colour!
Any thoughts?
- 🇬🇧United Kingdom danchamp Angus
Have you actually got two different bin types with the same colour?!
If we need to support that, we may need to decouple bin types, colours, and CSS icon shapes - at the moment blue is always a triangle, and having two collection lines for different bins with the same colour and icon is not good.
Maybe the option to map bin keys to colours and icons in config, then we can adjust CSS classes accordingly if it's set?
Or an easier route, we add the bin type as a class to the collection item alongside colour in localgov-waste-collection-collection-item.html.twig
This will at least provide a hook for custom CSS to override the colour and accommodate types with the same colour, which sounds like an edge case.
- 🇬🇧United Kingdom joachim
Yeah, we have two brown bins: garden waste and food waste.
> If we need to support that, we may need to decouple bin types, colours, and CSS icon shapes - at the moment blue is always a triangle, and having two collection lines for different bins with the same colour and icon is not good.
For the time being, I've set the colour for the food waste bin as 'brown caddy', so that it gets its own css class with 'brown_caddy'. The only slight glitch is that the output in the bin type key says 'Brown Caddy bin' because it appends 'bin' to all the colours!
It's not that much of an edge case -- here in Bristol, among my bins there is a black box, and a black wheelie bin.
We really need 4 things for each bin type:
- The description of the bin's purpose, e.g. 'Food waste', 'Domestic waste'. This is shown on the collection date and in the key.
- The description of the bin, e.g. 'Black bin', 'Green box', 'Brown caddy'. This is shown in the key.
- The short description of the bin, e.g. 'Green', 'Brown'. This is what's currently shown on the collection date. Using the full description of the bin would take up too much space here.
- The machine name of the bin, used for CSS classes and image filesFor Whitespace, we also have the collection service label, which is used in config so we match things up with data from the API, but it's not output.