-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from dhis2/ci-add-workflows
ci: add workflows and cli-style
- Loading branch information
Showing
142 changed files
with
55,632 additions
and
52,096 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/lib/earthengine.js | ||
src/locales |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const { config } = require('@dhis2/cli-style') | ||
|
||
module.exports = { | ||
extends: [config.eslint], | ||
// Needed to add this to support ?? and ?. operators, for some reason | ||
parserOptions: { ecmaVersion: 'latest' }, | ||
// These are common lint errors | ||
// TODO: address lines flagged with these rules (either turn off or back on) | ||
rules: { | ||
'import/extensions': 'warn', | ||
'max-params': 'warn', | ||
'no-unused-vars': 'warn', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: comment-and-close | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
|
||
jobs: | ||
comment-and-close: | ||
uses: dhis2/workflows-platform/.github/workflows/comment-and-close.yml@v1 | ||
if: '!contains(fromJson(''["dhis2-bot", "kodiakhq", "dependabot"]''), github.event.issue.sender.login)' | ||
with: | ||
issue_number: ${{ github.event.issue.number }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: deploy-pr | ||
|
||
on: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
deploy: | ||
uses: dhis2/workflows-platform/.github/workflows/deploy-pr.yml@v1 | ||
if: '!github.event.pull_request.head.repo.fork' | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: lint-pr-title | ||
|
||
on: | ||
pull_request: | ||
types: ['opened', 'edited', 'reopened', 'synchronize'] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint-pr-title: | ||
uses: dhis2/workflows-platform/.github/workflows/lint-pr-title.yml@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: test-and-release | ||
|
||
on: push | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
# Cancel previous runs if not on a release branch | ||
cancel-in-progress: ${{ !contains(fromJSON('["refs/heads/main", "ref/heads/main"]'), github.ref) }} | ||
|
||
jobs: | ||
lint-commits: | ||
uses: dhis2/workflows-platform/.github/workflows/lint-commits.yml@v1 | ||
lint: | ||
uses: dhis2/workflows-platform/.github/workflows/lint.yml@v1 | ||
test: | ||
uses: dhis2/workflows-platform/.github/workflows/test.yml@v1 | ||
|
||
# -- e2e tests are currently not implemented | ||
# e2e: | ||
# uses: dhis2/workflows-platform/.github/workflows/legacy-e2e.yml@v1 | ||
# # Skips forks and dependabot PRs | ||
# if: '!github.event.push.repository.fork' | ||
# secrets: inherit | ||
# with: | ||
# api_version: 42 | ||
|
||
release: | ||
needs: [lint-commits, lint, test] # Add e2e here when implemented | ||
uses: dhis2/workflows-platform/.github/workflows/release.yml@v1 | ||
# Skips forks and dependabot PRs | ||
if: '!github.event.push.repository.fork' | ||
secrets: inherit | ||
with: | ||
publish-apphub: true | ||
publish-github: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ node_modules | |
.d2 | ||
src/locales | ||
build | ||
.DS_Store | ||
.DS_Store | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn d2-style check commit "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn d2-style check --staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const { config } = require('@dhis2/cli-style') | ||
|
||
module.exports = { | ||
...require(config.prettier), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
const config = { | ||
type: "app", | ||
title: "DHIS2 Climate App", | ||
entryPoints: { | ||
app: "./src/App.js", | ||
}, | ||
}; | ||
type: 'app', | ||
title: 'DHIS2 Climate App', | ||
id: 'effb986c-a3c7-485e-a2f6-5e54ff9df7c3', | ||
minDHIS2Version: '2.37', | ||
|
||
module.exports = config; | ||
entryPoints: { | ||
app: './src/App.js', | ||
}, | ||
} | ||
|
||
module.exports = config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
{ | ||
"name": "climate-data", | ||
"version": "1.5.1", | ||
"description": "Explore and import weather and climate data in DHIS2.", | ||
"license": "BSD-3-Clause", | ||
"private": true, | ||
"scripts": { | ||
"build": "d2-app-scripts build", | ||
"start": "d2-app-scripts start", | ||
"test": "d2-app-scripts test", | ||
"deploy": "d2-app-scripts deploy" | ||
}, | ||
"devDependencies": { | ||
"@dhis2/cli-app-scripts": "^11.7.0" | ||
}, | ||
"dependencies": { | ||
"@dhis2/app-runtime": "^3.10.6", | ||
"@dhis2/multi-calendar-dates": "1.0.0-alpha.27", | ||
"@turf/area": "^6.5.0", | ||
"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" | ||
} | ||
"name": "climate-data", | ||
"version": "1.5.1", | ||
"description": "Explore and import weather and climate data in DHIS2.", | ||
"license": "BSD-3-Clause", | ||
"private": true, | ||
"scripts": { | ||
"build": "d2-app-scripts build", | ||
"start": "d2-app-scripts start", | ||
"test": "d2-app-scripts test", | ||
"deploy": "d2-app-scripts deploy", | ||
"lint": "d2-style check", | ||
"format": "d2-style apply" | ||
}, | ||
"devDependencies": { | ||
"@dhis2/cli-app-scripts": "^11.7.0", | ||
"@dhis2/cli-style": "^10.7.5" | ||
}, | ||
"dependencies": { | ||
"@dhis2/app-runtime": "^3.10.6", | ||
"@dhis2/multi-calendar-dates": "1.0.0-alpha.27", | ||
"@turf/area": "^6.5.0", | ||
"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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import Routes from "./components/Routes"; | ||
import Routes from './components/Routes' | ||
|
||
const App = () => <Routes />; | ||
const App = () => <Routes /> | ||
|
||
export default App; | ||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,85 @@ | ||
import i18n from "@dhis2/d2-i18n"; | ||
import GEETokenCheck from "./shared/GEETokenCheck"; | ||
import styles from "./styles/AboutPage.module.css"; | ||
import i18n from '@dhis2/d2-i18n' | ||
import GEETokenCheck from './shared/GEETokenCheck' | ||
import styles from './styles/AboutPage.module.css' | ||
|
||
// TODO: How to combine links and i18n.t? | ||
const AboutPage = () => ( | ||
<div className={styles.container}> | ||
<h1>{i18n.t("About this app")}</h1> | ||
<GEETokenCheck /> | ||
<p> | ||
{i18n.t( | ||
"This pilot app is part of the ongoing “DHIS2 for Climate“ project. It will get frequent updates, so please make sure you have the latest version from the DHIS2 App Hub. The app is developed by the University of Oslo, but it is not a DHIS2 core app. Useful parts of this app might be incorporated into the DHIS2 core in the future, based on your feedback." | ||
)} | ||
</p> | ||
<p> | ||
{i18n.t( | ||
"The app allows you to explore and import temperature, precipitation, humidity and heat stress data in DHIS2. The main data source is ERA5-Land, which is considered the most accurate and complete global climate dataset available. The video below shows you how this dataset was created by combining weather observations with a weather model (climate reanalysis)." | ||
)} | ||
</p> | ||
<iframe | ||
src="https://www.youtube-nocookie.com/embed/FAGobvUGl24?si=nBJeVx1_BPM4X5vF&rel=0" | ||
title="YouTube video player" | ||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" | ||
allowFullScreen | ||
></iframe> | ||
<p> | ||
<a | ||
href="https://cds.climate.copernicus.eu/datasets/reanalysis-era5-land" | ||
target="_blank" | ||
> | ||
{i18n.t("Read about ERA5-Land on Copernicus Climate Data Store")} | ||
</a> | ||
</p> | ||
<p> | ||
{i18n.t( | ||
"In additon to ERA5-Land, precipitation data can also be imported from the CHIRPS dataset. For heat stress we use data from ERA5-HEAT." | ||
)} | ||
</p> | ||
<p> | ||
<a href="https://www.chc.ucsb.edu/data/chirps" target="_blank"> | ||
{i18n.t("Read about CHIRPS on Climate Hazards Center")} | ||
</a> | ||
</p> | ||
<p> | ||
<a | ||
href="https://cds.climate.copernicus.eu/datasets/derived-utci-historical" | ||
target="_blank" | ||
> | ||
{i18n.t("Read about ERA5-HEAT on Copernicus Climate Data Store")} | ||
</a> | ||
</p> | ||
<p> | ||
{i18n.t( | ||
"If you just want to look at weather and climate data for your organisation units, click on “Explore data” in the left menu. No configuration is needed." | ||
)} | ||
</p> | ||
<p> | ||
{i18n.t( | ||
"We recommend importing data into DHIS2 data elements. This will allow you to combine weather and climate data with your health data across all DHIS2 analytics apps. You need to configure your DHIS2 instance before you can import data. See our guide by clicking on “Setup guide”." | ||
)} | ||
</p> | ||
<p> | ||
{i18n.t( | ||
"After the configuration is done, you can import temperature and precipitation data under “Import data”." | ||
)} | ||
</p> | ||
<p> | ||
{i18n.t( | ||
"After the data is imported, you should generate the analytics tables in the Data Administration app. This will allow you to see the data in the DHIS2 analytics apps." | ||
)} | ||
</p> | ||
<h2>{i18n.t("How the data is calculated")}</h2> | ||
<p> | ||
{i18n.t( | ||
"The data is calculated for your organsation units on Google Earth Engine. Pleace check the resolution of the data. If you select a health facility we use the value where the facility is located. If you select a district we automatically aggregate the values within that district. If two org units are close to each other (within the resolution), they will have the same data values." | ||
)} | ||
</p> | ||
</div> | ||
); | ||
<div className={styles.container}> | ||
<h1>{i18n.t('About this app')}</h1> | ||
<GEETokenCheck /> | ||
<p> | ||
{i18n.t( | ||
'This pilot app is part of the ongoing “DHIS2 for Climate“ project. It will get frequent updates, so please make sure you have the latest version from the DHIS2 App Hub. The app is developed by the University of Oslo, but it is not a DHIS2 core app. Useful parts of this app might be incorporated into the DHIS2 core in the future, based on your feedback.' | ||
)} | ||
</p> | ||
<p> | ||
{i18n.t( | ||
'The app allows you to explore and import temperature, precipitation, humidity and heat stress data in DHIS2. The main data source is ERA5-Land, which is considered the most accurate and complete global climate dataset available. The video below shows you how this dataset was created by combining weather observations with a weather model (climate reanalysis).' | ||
)} | ||
</p> | ||
<iframe | ||
src="https://www.youtube-nocookie.com/embed/FAGobvUGl24?si=nBJeVx1_BPM4X5vF&rel=0" | ||
title="YouTube video player" | ||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" | ||
allowFullScreen | ||
></iframe> | ||
<p> | ||
<a | ||
href="https://cds.climate.copernicus.eu/datasets/reanalysis-era5-land" | ||
target="_blank" | ||
> | ||
{i18n.t( | ||
'Read about ERA5-Land on Copernicus Climate Data Store' | ||
)} | ||
</a> | ||
</p> | ||
<p> | ||
{i18n.t( | ||
'In additon to ERA5-Land, precipitation data can also be imported from the CHIRPS dataset. For heat stress we use data from ERA5-HEAT.' | ||
)} | ||
</p> | ||
<p> | ||
<a href="https://www.chc.ucsb.edu/data/chirps" target="_blank"> | ||
{i18n.t('Read about CHIRPS on Climate Hazards Center')} | ||
</a> | ||
</p> | ||
<p> | ||
<a | ||
href="https://cds.climate.copernicus.eu/datasets/derived-utci-historical" | ||
target="_blank" | ||
> | ||
{i18n.t( | ||
'Read about ERA5-HEAT on Copernicus Climate Data Store' | ||
)} | ||
</a> | ||
</p> | ||
<p> | ||
{i18n.t( | ||
'If you just want to look at weather and climate data for your organisation units, click on “Explore data” in the left menu. No configuration is needed.' | ||
)} | ||
</p> | ||
<p> | ||
{i18n.t( | ||
'We recommend importing data into DHIS2 data elements. This will allow you to combine weather and climate data with your health data across all DHIS2 analytics apps. You need to configure your DHIS2 instance before you can import data. See our guide by clicking on “Setup guide”.' | ||
)} | ||
</p> | ||
<p> | ||
{i18n.t( | ||
'After the configuration is done, you can import temperature and precipitation data under “Import data”.' | ||
)} | ||
</p> | ||
<p> | ||
{i18n.t( | ||
'After the data is imported, you should generate the analytics tables in the Data Administration app. This will allow you to see the data in the DHIS2 analytics apps.' | ||
)} | ||
</p> | ||
<h2>{i18n.t('How the data is calculated')}</h2> | ||
<p> | ||
{i18n.t( | ||
'The data is calculated for your organsation units on Google Earth Engine. Pleace check the resolution of the data. If you select a health facility we use the value where the facility is located. If you select a district we automatically aggregate the values within that district. If two org units are close to each other (within the resolution), they will have the same data values.' | ||
)} | ||
</p> | ||
</div> | ||
) | ||
|
||
export default AboutPage; | ||
export default AboutPage |
Oops, something went wrong.