Skip to content

Commit

Permalink
feat: port to app-platform (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
mediremi authored Mar 9, 2021
1 parent e11ea13 commit 6429fd6
Show file tree
Hide file tree
Showing 90 changed files with 9,182 additions and 11,566 deletions.
5 changes: 0 additions & 5 deletions .browserslistrc

This file was deleted.

1 change: 0 additions & 1 deletion .env

This file was deleted.

3 changes: 0 additions & 3 deletions .env.development

This file was deleted.

10 changes: 0 additions & 10 deletions .env.production

This file was deleted.

3 changes: 0 additions & 3 deletions .env.test

This file was deleted.

38 changes: 2 additions & 36 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,5 @@
const SEVERITY = 2
const { config } = require('@dhis2/cli-style')

module.exports = {
root: true,

parser: 'babel-eslint',

env: {
browser: true,
node: true,
jest: true,
},

parserOptions: {
// latest standard is ok, eq. to 9
ecmaVersion: 2018,
ecmaFeatures: {
jsx: true,
modules: true,
},
},

rules: {
'max-params': [
SEVERITY,
{
max: 3,
},
],
'prefer-const': [
SEVERITY,
{
destructuring: 'any',
ignoreReadBeforeAssign: false,
},
],
'no-mixed-spaces-and-tabs': [SEVERITY],
},
extends: [config.eslintReact],
}
4 changes: 4 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
titleOnly: false
commitsOnly: false
titleAndCommits: true
allowMergeCommits: false
28 changes: 7 additions & 21 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,31 +76,15 @@ jobs:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- name: Build
run: yarn build

- name: Lint
run: yarn lint

test:
runs-on: ubuntu-latest
needs: install
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x

- uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- name: Test
run: yarn test

publish:
runs-on: ubuntu-latest
needs: [build, lint, test] # add e2e if you use it
needs: [build, lint]
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
Expand All @@ -117,7 +101,9 @@ jobs:

- uses: dhis2/deploy-build@master
with:
build-dir: build
# uncomment following line for monorepo apps:
#cwd: ./packages/app
build-dir: build/app
github-token: ${{ env.GH_TOKEN }}

release:
Expand Down
31 changes: 5 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# i18n json files
src/locales/
# DHIS2 Platform
node_modules
.d2
src/locales
build
14 changes: 14 additions & 0 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { config } = require('@dhis2/cli-style')
const husky = require(config.husky)

const tasks = arr => arr.join(' && ')

module.exports = {
hooks: {
...husky.hooks,
'pre-commit': tasks([
'd2-style js check --staged',
'd2-style text check --staged',
]),
},
}
19 changes: 3 additions & 16 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
const { config } = require('@dhis2/cli-style')

module.exports = {
printWidth: 80,
tabWidth: 4,
useTabs: false,
semi: false,
singleQuote: true,
trailingComma: 'es5',
bracketSpacing: true,
jsxBracketSameLine: false,
jsxSingleQuote: false,
arrowParens: 'avoid',
rangeStart: 0,
rangeEnd: Infinity,
proseWrap: 'preserve',
requirePragma: false,
insertPragma: false,
endOfLine: 'lf',
...require(config.prettier),
}
51 changes: 27 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
# Data Quality App

[![Build Status](https://travis-ci.com/dhis2/data-quality-app.svg?branch=master)](https://travis-ci.com/dhis2/data-quality-app)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fdhis2%2Fdata-quality-app.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fdhis2%2Fdata-quality-app?ref=badge_shield)
[![Greenkeeper badge](https://badges.greenkeeper.io/dhis2/data-quality-app.svg)](https://greenkeeper.io/)

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Env settings

Env variables for this app can be configured per environment (`development`, `production`, `test`). If you're running your local DHIS2 backend on a different port than the one specified in `.env.development`, you can specify an override in a `.env.development.local` file. For more information see https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables
This project was bootstrapped with [DHIS2 Application Platform](https://github.com/dhis2/app-platform).

## Available Scripts

In the project directory, you can run:

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

Runs the app in the development mode.<br>
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>
The page will reload if you make edits.<br />
You will also see any lint errors in the console.

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

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

Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
See the section about [running tests](https://platform.dhis2.nu/#/scripts/test) for more information.

### `npm run build`
### `yarn build`

Builds the app for production to the `build` folder.<br>
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.

The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!
The build is minified and the filenames include the hashes.<br />
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`

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/>
You must run `yarn build` before running `yarn deploy`.<br />

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

## Learn More

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
You can learn more about the platform in the [DHIS2 Application Platform Documentation](https://platform.dhis2.nu/).

## License
You can learn more about the runtime in the [DHIS2 Application Runtime Documentation](https://runtime.dhis2.nu/).

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fdhis2%2Fdata-quality-app.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fdhis2%2Fdata-quality-app?ref=badge_large)
To learn React, check out the [React documentation](https://reactjs.org/).
12 changes: 12 additions & 0 deletions d2.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const config = {
type: 'app',
name: 'data-quality',
title: 'Data Quality',
coreApp: true,

entryPoints: {
app: './src/App',
},
}

module.exports = config
50 changes: 25 additions & 25 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,37 @@ 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: 2021-02-09T12:09:22.622Z\n"
"PO-Revision-Date: 2021-02-09T12:09:22.622Z\n"
"POT-Creation-Date: 2021-03-02T13:20:58.188Z\n"
"PO-Revision-Date: 2021-03-02T13:20:58.188Z\n"

msgid "Data Quality"
msgid "More than 500 values found, please narrow the search to see all"
msgstr ""

msgid "More than 500 values found, please narrow the search to see all"
msgid "Error loading datasets."
msgstr ""

msgid "No match found"
msgstr ""

msgid "Updating Organisation Units Tree..."
msgid "Something went wrong whilst loading your organisation units."
msgstr ""

msgid "You do not have access to any organisation units."
msgstr ""

msgid "DOWNLOAD AS PDF"
msgid "Download as PDF"
msgstr ""

msgid "DOWNLOAD AS XLS"
msgid "Download as XLS"
msgstr ""

msgid "DOWNLOAD AS CSV"
msgid "Download as CSV"
msgstr ""

msgid "Marked for follow-up"
msgstr ""

msgid "Unmarked for follow-up"
msgstr ""

msgid "Data Element"
Expand Down Expand Up @@ -65,16 +74,16 @@ msgstr ""
msgid "Validation Rule Group"
msgstr ""

msgid "An unexpected error happened during analysis"
msgid "Follow-Up Analysis"
msgstr ""

msgid "No values found"
msgstr ""

msgid "Unfollow done"
msgid "An unexpected error happened during analysis"
msgstr ""

msgid "Follow-Up Analysis"
msgid "Follow up"
msgstr ""

msgid "Data Set"
Expand All @@ -89,9 +98,6 @@ msgstr ""
msgid "End Date"
msgstr ""

msgid "follow up"
msgstr ""

msgid "Close"
msgstr ""

Expand All @@ -104,10 +110,7 @@ msgstr ""
msgid "unfollow"
msgstr ""

msgid "Marked for follow-up"
msgstr ""

msgid "Unmarked for follow-up"
msgid "Start"
msgstr ""

msgid "Threshold"
Expand All @@ -128,9 +131,6 @@ msgstr ""
msgid "Sort by"
msgstr ""

msgid "Outlier Detection"
msgstr ""

msgid "Data set"
msgstr ""

Expand All @@ -149,7 +149,7 @@ msgstr ""
msgid "Max results"
msgstr ""

msgid "Start"
msgid "Outlier Detection"
msgstr ""

msgid "Validation Rule Analysis"
Expand Down Expand Up @@ -185,13 +185,13 @@ msgstr ""
msgid "Validation passed successfully"
msgstr ""

msgid "Send Notifications"
msgid "Validate"
msgstr ""

msgid "Persist new results"
msgid "Send Notifications"
msgstr ""

msgid "validate"
msgid "Persist new results"
msgstr ""

msgid "Attribute Option Combination"
Expand Down
Loading

0 comments on commit 6429fd6

Please sign in to comment.