thegreenwebfoundation / admin-portal

The member portal and platform powering The Green Web Foundation
Apache License 2.0
24 stars 11 forks source link

Improve directory filtering to exclude archived providers #616

Closed fershad closed 1 month ago

fershad commented 1 month ago

This tiny PR improves the filtering of providers when the Directory list is rendered.

The previous logic would only exclude providers who were marked as showOnWebsite=false. This exposed an edge case where providers might be archived (archived=true) however might still have the showOnWebsite variable set to true (showOnWebsite=true). In this case the provider would incorrectly be shown on the Directory even though they are archived.

This PR fixes that.

github-actions[bot] commented 1 month ago
Eco-CI Output: Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 26.689 451.091 3.79 119
checkout 8.96 3.59424 1.80 2
pip install uv wheel 9.07 3.59487 3.59 1
pip install requirements 67.2367 38.7742 5.54 7
pytest 24.1852 405.128 3.86 105

🌳 CO2 Data: City: Chicago, Lat: 41.8874, Lon: -87.6318 IP: 172.183.131.99 CO₂ from energy is: 0.175474399 g CO₂ from manufacturing (embodied carbon) is: 0.033952343 g Carbon Intensity for this location: 389 gCO₂eq/kWh SCI: 0.209427 gCO₂eq / pipeline run emitted