Skip to content
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

Allow multiple inventory years, add region and country population during onboarding #386

Merged
merged 33 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7675446
Add support for downscaling based on region population and add region…
lemilonkh Mar 14, 2024
b2c4628
Allow population entries from +-5 years of the inventory year
lemilonkh Mar 14, 2024
da8e289
Add city, region and country population to onboarding setup step
lemilonkh Mar 14, 2024
c92a6dd
Use NEXT_PUBLIC_OPENCLIMATE_API_URL instead so it's accessible in fro…
lemilonkh Mar 14, 2024
ecb1bd6
Change env var names in k8s config and env.example
lemilonkh Mar 14, 2024
bd39f61
Creat migration that adds region_population to Population table
lemilonkh Mar 18, 2024
e440b2d
Reformat information text on onboarding setup page and add spanish tr…
lemilonkh Mar 18, 2024
d4e672f
Add regionPopulation to POST population route validation
lemilonkh Mar 18, 2024
ed1420e
Add region population and find closest year instead of exact match
lemilonkh Mar 18, 2024
9e1358a
Merge branch 'fix/openclimate-api' into feature/population-multiple-y…
lemilonkh Mar 18, 2024
cbc1e70
Correctly determine region locode and get closest population entry be…
lemilonkh Mar 18, 2024
f4c8484
Change form values when OC population info has been loaded
lemilonkh Mar 18, 2024
0a2edad
Move OCCityAttributes to types.d.ts instead of the City model file
lemilonkh Mar 18, 2024
86a247e
Move API calls into SetupStep on onboarding setup page
lemilonkh Mar 18, 2024
64e0ee6
Fix wrong years being selected for population
lemilonkh Mar 18, 2024
6ed29a6
Make city name input uncontrolled and listen to focus/ blur events
lemilonkh Mar 18, 2024
5c7cdfc
Prevent and log errors in case population was not found
lemilonkh Mar 19, 2024
7f3b1c0
Fix not being able to select cities during onboarding
lemilonkh Mar 19, 2024
7e9f1e0
Remove populationData object and directly modify inputs for less bugg…
lemilonkh Mar 19, 2024
fae452a
Disable recent searches feature as it's hardcoded and cities can't be…
lemilonkh Mar 19, 2024
8729d18
Don't allow years outside of dropdown range for population entries
lemilonkh Mar 19, 2024
3b92cb8
Disable autocomplete for city input since it overlaps the dropdown
lemilonkh Mar 19, 2024
4d924bf
Send individual years for city, region and country to population API …
lemilonkh Mar 19, 2024
17b2eec
Allow saving populations for multiple different years in API
lemilonkh Mar 19, 2024
90c9e40
Add test cases for create populations endpoint
lemilonkh Mar 19, 2024
d4b6283
Reformat some test code with prettier
lemilonkh Mar 19, 2024
eb0ad02
Only accept natural numbers for population and year
lemilonkh Mar 19, 2024
b209029
Fix existing population entries not being overwritten
lemilonkh Mar 19, 2024
795c5c1
Fix not being able to go to second step and fix data flow between com…
lemilonkh Mar 19, 2024
d7be3f6
Return city, region and country population from add populations route
lemilonkh Mar 20, 2024
21872fc
Update population tests to check for returned data
lemilonkh Mar 20, 2024
59d6804
Fix city and region population not being returned from API endpoint
lemilonkh Mar 20, 2024
d373ebb
Add more assertions about returned data to make sure it's correct
lemilonkh Mar 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ VERIFICATION_TOKEN_SECRET="80c70dfdeedf2c01757b880d39c79214e915c786dd48d5473c9c0
HUGGINGFACE_API_KEY=hf_MY_SECRET_KEY
OPENAI_API_KEY=sk-MY_SECRET_KEY
CHAT_PROVIDER=huggingface
NEXT_PUBLIC_OPENCLIMATE_API_URL="https://openclimate.openearth.dev"
16 changes: 16 additions & 0 deletions app/migrations/20240318105130-region-population.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"use strict";

/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn(
"Population",
"region_population",
Sequelize.BIGINT,
);
},

async down(queryInterface) {
await queryInterface.removeColumn("Population", "region_population");
},
};
Loading