Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
4d58f2e
proxy
yambanso Aug 21, 2024
d3340ea
changes
yambanso Aug 21, 2024
3555857
new datasets for local daata
yambanso Aug 21, 2024
26d744f
changes
yambanso Aug 21, 2024
6ffd534
changes
yambanso Aug 21, 2024
8c882c7
useImportEngine
yambanso Aug 21, 2024
0137ffb
changes
yambanso Aug 29, 2024
dc49b21
proxy
yambanso Aug 29, 2024
b57b240
fetch from local data API
yambanso Aug 29, 2024
5ef57f0
changes
yambanso Aug 29, 2024
62adde4
changes
yambanso Aug 29, 2024
7d692b0
changes
yambanso Aug 29, 2024
88cc31c
comment periods undefuned
yambanso Aug 29, 2024
29f092d
props
yambanso Aug 29, 2024
e83151f
changes
yambanso Aug 31, 2024
92b984d
removed some part of the error message
yambanso Aug 31, 2024
fcbe54d
unused datasets
yambanso Aug 31, 2024
0a980ea
changes
yambanso Aug 31, 2024
23c542a
changes
yambanso Aug 31, 2024
a7cf5c6
changes
yambanso Aug 31, 2024
3de03ef
proxy pass
yambanso Sep 8, 2024
ee08f58
Merge branch 'main' into main
yambanso Jan 8, 2025
621ced9
fix: bring PR up to date with main branch and fix merge conflicts
Jun 20, 2025
b42ee8d
feat: modular hooks to load datasets and data from hardcoded iri enac…
Jun 30, 2025
52a6616
feat: get iri url from routes api, show status on settings page, and …
Jul 30, 2025
9919770
fix: explicitly set all allowed period types for datasets periodtypes…
Jul 30, 2025
781ed59
fix: correctly fetch data values from iri enacts api, minor fixes to …
Jul 30, 2025
2b73f3a
fix: fetch iri info via correct routes api proxy url
Aug 19, 2025
6ea598a
fix: correctly request and parse results from iri server before import
Aug 25, 2025
f49febb
chore: centrally define data provider info in providers.js
Aug 29, 2025
75de69f
fix: rename from IRI ENACTS to just ENACTS
Aug 29, 2025
96fa8cf
chore: streamline so that earth engine datasets works the same way as…
Aug 29, 2025
4c7f803
chore: nicer enacts dataset and source description
Aug 29, 2025
9a2c918
fix: correctly send the enacts dataset code with data request
Aug 29, 2025
38abd9c
chore: switch to using period type constants for enacts integration
Sep 1, 2025
b0408c3
fix: missing return values are set to NaN, filtered, and reported to …
Sep 1, 2025
52603c7
fix: handle additional errors messages from enacts
Sep 1, 2025
1ce13d0
fix: switch away from period-specific datasets as listed by enacts, f…
Sep 2, 2025
d2e63ef
fix: show correct data element metadata on setup guide page
Sep 3, 2025
18e71c7
chore: switch enacts datasets back to period specific, add periodRang…
Sep 11, 2025
3fd607c
chore: switch away from dataset minYear/maxYear towards periodRange
Sep 11, 2025
10cd718
fix: bug when auto changing period type
Sep 11, 2025
a5ad31f
chore: add supportedPeriodTypes dataset param to explicitly specify a…
Sep 12, 2025
6decbba
chore: show period type dropdown also for yearly data for more consis…
Sep 12, 2025
8198801
fix: crash when switching from yearly to other period type due to inc…
Sep 12, 2025
5884980
chore: switch back to one dataset per variable and multiple supported…
Sep 12, 2025
120e6f5
fix: switch so enacts datasets only show a generic instruction text f…
Oct 6, 2025
6ffc008
fix: read enacts dataset source from info endpoint (but return hardco…
Oct 6, 2025
0f1c889
fix: merge main into enacts branch and fix conflicts
Oct 6, 2025
61c8582
fix: add missing provider to merged gee dataset
Oct 6, 2025
f07c1aa
chore: update docs
jenniferarnesen Oct 10, 2025
6b4e1b3
chore: update d2-style and add i18n extract to git pre-commit hook
jenniferarnesen Oct 10, 2025
2d4b0ad
chore: more linting
jenniferarnesen Oct 10, 2025
78273c9
fix: always add json content type header, since some dhis2 and routes…
Oct 13, 2025
c4e9dd4
chore: code cleaning and adding i18n strings
jenniferarnesen Oct 14, 2025
ef0b017
Merge branch 'iri-integration' of github.com:dhis2/climate-app into i…
jenniferarnesen Oct 14, 2025
5449748
chore: fix code smells
jenniferarnesen Oct 14, 2025
81de476
chore: remove unused enacts dataset params, check and remove other to…
Oct 14, 2025
ff64af3
chore: remove unneeded TODO
jenniferarnesen Oct 14, 2025
8ea11d0
Merge branch 'iri-integration' of github.com:dhis2/climate-app into i…
jenniferarnesen Oct 14, 2025
5f57a62
docs: add documentation for setting up ENACTS
jenniferarnesen Oct 15, 2025
01dae05
fix: dont break <40 versions unnecessarily
jenniferarnesen Oct 15, 2025
3cdcbb9
chore: headings
jenniferarnesen Oct 15, 2025
1b406d2
chore: small tweaks to data provider list
jenniferarnesen Oct 15, 2025
0a42d39
chore: adjust hover color
jenniferarnesen Oct 15, 2025
86007d4
style(test): run prettier on time.test.js
jenniferarnesen Oct 16, 2025
e8caa26
chore: remove package-lock file
jenniferarnesen Oct 27, 2025
346e54a
chore: rename var to periodTypeName to give more meaning
jenniferarnesen Oct 27, 2025
fab54e1
fix: use string interpolation for the resolution text
jenniferarnesen Oct 27, 2025
7cb098b
feat: handle date validation
jenniferarnesen Oct 28, 2025
33ad444
Merge branch 'main' into iri-integration
jenniferarnesen Oct 28, 2025
39bc5f2
chore: move period error message to separate block instead of calenda…
jenniferarnesen Oct 28, 2025
12f9632
chore: code smell fix and test udpates
jenniferarnesen Oct 28, 2025
bd4f1d8
chore: time cleanup
jenniferarnesen Oct 28, 2025
a42aa37
fix: switch parsing of enacts datasets to store period range for each…
karimbahgat Nov 26, 2025
8f452bd
chore: use reduce to put together datasets
jenniferarnesen Nov 27, 2025
d45b466
fix: the period component should get valid period range from supporte…
jenniferarnesen Nov 27, 2025
971b4e0
chore: remove cypress config
jenniferarnesen Dec 11, 2025
b8c10de
chore: in string use string interpolation
jenniferarnesen Dec 11, 2025
8ab476a
chore: cleanup
jenniferarnesen Dec 11, 2025
cf25d15
chore: update yarn
jenniferarnesen Dec 12, 2025
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ src/locales
build
.DS_Store
.vscode
cypress.env.json
67 changes: 59 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,83 @@
## DHIS2 Climate app
# DHIS2 Climate App

This app allows you to explore and import temperature and precipitation data in DHIS2. The data source is "ERA5-Land", which is considered the most accurate and complete global climate dataset available.
---

## General Documentation

### Overview

This app allows you to explore and import climate/weather data into DHIS2.

### Data Sources

- **ERA5-Land**: By default, the app uses ERA5-Land, a highly accurate and complete global climate dataset.
- **ENACTS**: If ENACTS is configured (see Admin Documentation), the app can also use ENACTS DST as a data source for local climate data.

> ![Screenshot](public/images/explore.png)

---

![Screenshot](public/images/explore.png)
## Admin Documentation

### ENACTS Setup Instructions

The ENACTS API is made available to this app using a DHIS2 route. To set up ENACTS integration, follow these steps:

1. **Follow the [DHIS2 Routes documentation](https://docs.dhis2.org/en/develop/using-the-api/dhis-core-version-master/route.html)** to set up the route. Make sure to use the documentation specific to your DHIS2 version, as there are some differences between versions.

2. **Route configuration fields:**

- The following fields must be set in the route configuration. Note that the `code` must be `enacts`.
- **name**: Choose a name that indicates this route is to ENACTS DST
- **code**: `enacts`
- **url**: The URL where your ENACTS DST is hosted. You must append `/**` to the URL.
- **headers**:
- `Content-Type`: `application/json`
- `X-API-Key`: _Your ENACTS API key here_
- **disabled**: `false`

3. **Example configuration:**

```json
{
"name": "ENACTS API",
"code": "enacts",
"url": "https://your-enacts-dst-url/**",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "Your enacts api key here"
},
"disabled": false
}
```

After configuring the route, the ENACTS API will be available for use in the Climate app.

---

## Developer Documentation

This project was bootstrapped with [DHIS2 Application Platform](https://github.com/dhis2/app-platform).

## Available Scripts
### Available Scripts

In the project directory, you can run:

### `yarn start`
#### `yarn start`

Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br />
You will also see any lint errors in the console.

### `yarn test`
#### `yarn test`

Launches the test runner and runs all available tests found in `/src`.<br />

See the section about [running tests](https://platform.dhis2.nu/#/scripts/test) for more information.

### `yarn build`
#### `yarn build`

Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
Expand All @@ -36,7 +87,7 @@ A deployable `.zip` file can be found in `build/bundle`!

See the section about [building](https://platform.dhis2.nu/#/scripts/build) for more information.

### `yarn deploy`
#### `yarn deploy`

Deploys the built app in the `build` folder to a running DHIS2 instance.<br />
This command will prompt you to enter a server URL as well as the username and password of a DHIS2 user with the App Management authority.<br/>
Expand Down
123 changes: 95 additions & 28 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2025-09-08T09:55:48.384Z\n"
"PO-Revision-Date: 2025-09-08T09:55:48.384Z\n"
"POT-Creation-Date: 2025-12-11T11:59:19.879Z\n"
"PO-Revision-Date: 2025-12-11T11:59:19.880Z\n"

msgid "About this app"
msgstr "About this app"
Expand Down Expand Up @@ -644,6 +644,9 @@ msgstr ""
msgid "Extracting data for {{orgUnitsCount}} org units"
msgstr "Extracting data for {{orgUnitsCount}} org units"

msgid "Dataset provider not recognized"
msgstr "Dataset provider not recognized"

msgid "Importing data to DHIS2"
msgstr "Importing data to DHIS2"

Expand All @@ -656,16 +659,19 @@ msgstr "One or more conflicts encountered"
msgid "Import weather and climate data"
msgstr "Import weather and climate data"

msgid "Data"
msgstr "Data"

msgid ""
"You can maximum import {{maxValues}} data values in a single import, but "
"you are trying to import {{valueCount}} values for {{orgUnitCount}} "
"organisation units over {{periodCount}} {{periodType}} periods. Please "
"organisation units over {{periodCount}} {{periodTypeName}} periods. Please "
"select a shorter period or fewer organisation units. You can always import "
"more data later."
msgstr ""
"You can maximum import {{maxValues}} data values in a single import, but "
"you are trying to import {{valueCount}} values for {{orgUnitCount}} "
"organisation units over {{periodCount}} {{periodType}} periods. Please "
"organisation units over {{periodCount}} {{periodTypeName}} periods. Please "
"select a shorter period or fewer organisation units. You can always import "
"more data later."

Expand All @@ -686,9 +692,6 @@ msgstr ""
"Data can be imported in batches. We recommend that you start with a few "
"organisation units to make sure everything works as expected."

msgid "Data"
msgstr "Data"

msgid "Select the variable you would like to import."
msgstr "Select the variable you would like to import."

Expand Down Expand Up @@ -754,14 +757,17 @@ msgstr ""
msgid "Data is imported"
msgstr "Data is imported"

msgid "Imported"
msgstr "Imported"
msgid "Imported: {{imported}}"
msgstr "Imported: {{imported}}"

msgid "Updated: {{updated}}"
msgstr "Updated: {{updated}}"

msgid "Updated"
msgstr "Updated"
msgid "Ignored: {{ignored}}"
msgstr "Ignored: {{ignored}}"

msgid "Ignored"
msgstr "Ignored"
msgid "Missing: {{missing}}"
msgstr "Missing: {{missing}}"

msgid "No data for the following org units"
msgstr "No data for the following org units"
Expand All @@ -779,6 +785,15 @@ msgstr "Organisation unit level to import data to"
msgid "Org unit parent needs to be above or equal to the org unit level"
msgstr "Org unit parent needs to be above or equal to the org unit level"

msgid "Start and end date are not within the valid range."
msgstr "Start and end date are not within the valid range."

msgid "Start date is not within the valid range."
msgstr "Start date is not within the valid range."

msgid "End date is not within the valid range."
msgstr "End date is not within the valid range."

msgid ""
"The data will be assigned a default yearly period that matches the year it "
"was collected: {{datasetPeriod}}"
Expand All @@ -789,6 +804,9 @@ msgstr ""
msgid "Daily values will be imported between start and end dates"
msgstr "Daily values will be imported between start and end dates"

msgid "Valid range"
msgstr "Valid range"

msgid "Period type"
msgstr "Period type"

Expand Down Expand Up @@ -831,6 +849,28 @@ msgstr "Heat stress upper category"
msgid "Heat stress lower category"
msgstr "Heat stress lower category"

msgid "Data Providers"
msgstr "Data Providers"

msgid ""
"The following data providers can be configured and used in the Climate app. "
"Contact your administrator to add or update data providers."
msgstr ""
"The following data providers can be configured and used in the Climate app. "
"Contact your administrator to add or update data providers."

msgid "Provider name"
msgstr "Provider name"

msgid "Status"
msgstr "Status"

msgid "Setup info"
msgstr "Setup info"

msgid "Close"
msgstr "Close"

msgid "Calculate from data"
msgstr "Calculate from data"

Expand All @@ -840,6 +880,9 @@ msgstr "App settings"
msgid "Changes made below will apply to all users of this app."
msgstr "Changes made below will apply to all users of this app."

msgid "General settings"
msgstr "General settings"

msgid "Default start page for users"
msgstr "Default start page for users"

Expand Down Expand Up @@ -873,6 +916,9 @@ msgstr "Aggregate"
msgid "Aggregation type"
msgstr "Aggregation type"

msgid "Use your domain knowledge to select the appropriate aggregation type"
msgstr "Use your domain knowledge to select the appropriate aggregation type"

msgid "Store zero data values"
msgstr "Store zero data values"

Expand Down Expand Up @@ -1009,9 +1055,21 @@ msgstr ""
msgid "Loading data"
msgstr "Loading data"

msgid "Error"
msgstr "Error"

msgid "Select data to import"
msgstr "Select data to import"

msgid "Data is from {{source}}. Accessed via {{provider}}."
msgstr "Data is from {{source}}. Accessed via {{provider}}."

msgid "Warning"
msgstr "Warning"

msgid "Error fetching additional datasets from one or more local data providers"
msgstr "Error fetching additional datasets from one or more local data providers"

msgid "You need access to Google Earth Engine to use this app."
msgstr "You need access to Google Earth Engine to use this app."

Expand Down Expand Up @@ -1106,21 +1164,6 @@ msgstr ""
msgid "Land cover types at yearly intervals"
msgstr "Land cover types at yearly intervals"

msgid "Climate/Weather"
msgstr "Climate/Weather"

msgid "Environment"
msgstr "Environment"

msgid "Weekly or Monthly"
msgstr "Weekly or Monthly"

msgid "Land"
msgstr "Land"

msgid "Yearly"
msgstr "Yearly"

msgid "Air temperature (ERA5-Land)"
msgstr "Air temperature (ERA5-Land)"

Expand Down Expand Up @@ -1194,6 +1237,15 @@ msgstr ""
"that can exist in the air at its current temperature. Calculated using air "
"temperature and dewpoint temperature at 2 m above surface."

msgid "Local Min Tempreture (Land)"
msgstr "Local Min Tempreture (Land)"

msgid "Local Max Tempreture (Land)"
msgstr "Local Max Tempreture (Land)"

msgid "Local Precipitation "
msgstr "Local Precipitation "

msgid "Heat stress (ERA5-HEAT)"
msgstr "Heat stress (ERA5-HEAT)"

Expand Down Expand Up @@ -1266,6 +1318,21 @@ msgstr "Standard deviation of elevation in meters above sea level."
msgid "Percentage of area with this land cover type."
msgstr "Percentage of area with this land cover type."

msgid "Climate/Weather"
msgstr "Climate/Weather"

msgid "Environment"
msgstr "Environment"

msgid "Weekly or Monthly"
msgstr "Weekly or Monthly"

msgid "Land"
msgstr "Land"

msgid "Yearly"
msgstr "Yearly"

msgid "Heat/cold stress"
msgstr "Heat/cold stress"

Expand Down
15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,18 @@
"format": "d2-style apply"
},
"devDependencies": {
"@dhis2/cli-app-scripts": "^12.0.0",
"@dhis2/cli-style": "^10.7.7"
"@dhis2/cli-app-scripts": "^12.8.0",
"@dhis2/cli-style": "^10.7.9"
},
"dependencies": {
"@dhis2/app-runtime": "^3.12.1",
"@dhis2/multi-calendar-dates": "1.0.0-alpha.27",
"@dhis2/ui": "^10.1.10",
"@dhis2/app-runtime": "^3.14.6",
"@dhis2/multi-calendar-dates": "^2.1.2",
"@dhis2/ui": "^10.9",
"@turf/area": "^6.5.0",
"classnames": "^2.5.1",
"highcharts": "^10.3.3",
"react-router-dom": "^6.26.1",
"zustand": "^4.5.5"
},
"resolutions": {
"@dhis2/cli-app-scripts/**/@dhis2/multi-calendar-dates": "1.2.3",
"@dhis2/multi-calendar-dates": "1.0.0-alpha.27"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
2 changes: 1 addition & 1 deletion src/components/explore/climateChange/ClimateChange.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useMemo } from 'react'
import {
era5MonthlyTemperatures,
era5MonthlyNormals,
} from '../../../data/datasets.js'
} from '../../../data/earth-engine-datasets.js'
import useAppSettings from '../../../hooks/useAppSettings.js'
import useEarthEngineClimateNormals from '../../../hooks/useEarthEngineClimateNormals.js'
import useEarthEngineTimeSeries from '../../../hooks/useEarthEngineTimeSeries.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/explore/elevation/Elevation.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import i18n from '@dhis2/d2-i18n'
import { demResolution } from '../../../data/datasets.js'
import { demResolution } from '../../../data/earth-engine-datasets.js'
import useEarthEngineTimeSeries from '../../../hooks/useEarthEngineTimeSeries.js'
import exploreStore from '../../../store/exploreStore.js'
import DataLoader from '../../shared/DataLoader.jsx'
Expand Down
2 changes: 1 addition & 1 deletion src/components/explore/heat/HeatDaily.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { era5HeatDaily } from '../../../data/datasets.js'
import { era5HeatDaily } from '../../../data/earth-engine-datasets.js'
import useAppSettings from '../../../hooks/useAppSettings.js'
import useEarthEngineTimeSeries from '../../../hooks/useEarthEngineTimeSeries.js'
import exploreStore from '../../../store/exploreStore.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/explore/heat/HeatMonthly.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { era5HeatMonthly } from '../../../data/datasets.js'
import { era5HeatMonthly } from '../../../data/earth-engine-datasets.js'
import useAppSettings from '../../../hooks/useAppSettings.js'
import useEarthEngineTimeSeries from '../../../hooks/useEarthEngineTimeSeries.js'
import exploreStore from '../../../store/exploreStore.js'
Expand Down
Loading
Loading