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

feat(DataExport): Include children in data export #15

Merged
merged 2 commits into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 11 additions & 5 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: 2018-11-05T15:19:26.238Z\n"
"PO-Revision-Date: 2018-11-05T15:19:26.238Z\n"
"POT-Creation-Date: 2018-11-06T11:11:20.768Z\n"
"PO-Revision-Date: 2018-11-06T11:11:20.768Z\n"

msgid "user is not logged in"
msgstr ""
Expand Down Expand Up @@ -122,6 +122,9 @@ msgstr ""
msgid "Category ID scheme"
msgstr ""

msgid "Children"
msgstr ""

msgid "Object type"
msgstr ""

Expand Down Expand Up @@ -242,6 +245,12 @@ msgstr ""
msgid "HR identifier"
msgstr ""

msgid "Include descendant of organisation unit"
msgstr ""

msgid "Selected organisation unit"
msgstr ""

msgid "Yes (faster for large imports)"
msgstr ""

Expand Down Expand Up @@ -323,9 +332,6 @@ msgstr ""
msgid "Non Empty"
msgstr ""

msgid "Selected organisation unit"
msgstr ""

msgid "Include children of organisation unit"
msgstr ""

Expand Down
306 changes: 153 additions & 153 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,160 +1,160 @@
{
"name": "importexport-app",
"description": "Import/Export DHIS2 data",
"version": "31.0.0",
"private": true,
"homepage": ".",
"dependencies": {
"@dhis2/d2-i18n": "^1.0.3",
"@dhis2/d2-i18n-extract": "^1.0.6",
"@dhis2/d2-i18n-generate": "^1.0.18",
"@dhis2/d2-ui-header-bar": "^1.0.11",
"autoprefixer": "7.1.6",
"axios": "^0.18.0",
"babel-core": "6.26.0",
"babel-jest": "20.0.3",
"babel-loader": "7.1.2",
"babel-preset-react-app": "^3.1.1",
"babel-runtime": "6.26.0",
"case-sensitive-paths-webpack-plugin": "2.1.1",
"chalk": "^2.4.1",
"classnames": "^2.2.5",
"css-loader": "0.28.7",
"d2": "^30.0.0",
"d2-manifest": "^1.0.0",
"dotenv": "4.0.0",
"dotenv-expand": "^4.2.0",
"eventemitter2": "^5.0.1",
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "1.1.5",
"fs-extra": "3.0.1",
"gh-pages": "^1.1.0",
"html-webpack-plugin": "2.29.0",
"husky": "^1.0.0-rc.2",
"i18next": "^10.6.0",
"jest": "22.4.3",
"jest-cli": "^22.4.3",
"jest-enzyme": "^6.0.1",
"jszip": "^3.1.5",
"lint-staged": "^7.0.0",
"material-ui": "^0.20.0",
"moment": "^2.22.1",
"object-assign": "4.1.1",
"postcss-flexbugs-fixes": "3.2.0",
"postcss-loader": "2.0.8",
"postcss-rtl": "^1.2.3",
"promise": "8.0.1",
"prop-types": "^15.6.1",
"raf": "3.4.0",
"react": "^16.2.0",
"react-dev-utils": "^5.0.0",
"react-dom": "^16.2.0",
"react-hot-loader": "^4.0.0",
"react-redux": "^5.0.7",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"redux": "^3.7.2",
"rxjs": "^5.5.7",
"style-loader": "0.19.0",
"sw-precache-webpack-plugin": "0.11.4",
"travis-cli": "^1.0.9",
"url-loader": "0.6.2",
"webpack": "3.8.1",
"webpack-dev-server": "2.9.4",
"webpack-manifest-plugin": "^2.0.3",
"whatwg-fetch": "2.0.3"
},
"husky": {
"hooks": {
"pre-commit": "npm run extract-pot && npm run format && CI=true npm run test && git add ./i18n/"
}
},
"scripts": {
"extract-pot": "d2-i18n-extract -p src/ -o i18n/",
"localize": "npm run extract-pot && d2-i18n-generate -n import-export-app -p ./i18n/ -o ./src/locales/",
"format": "code-style",
"prestart": "npm run localize && d2-manifest package.json ./public/manifest.webapp",
"prebuild": "rm -rf build && mkdir build && npm run manifest",
"manifest": "d2-manifest package.json build/manifest.webapp",
"start": "PORT=3000 node scripts/start.js",
"build": "npm run localize && npm run manifest && node scripts/build.js",
"test": "node scripts/test.js --env=jsdom"
},
"manifest.webapp": {
"name": "Import/Export app",
"icons": {
"48": "icon.png"
"name": "importexport-app",
"description": "Import/Export DHIS2 data",
"version": "31.0.0",
"private": true,
"homepage": ".",
"dependencies": {
"@dhis2/d2-i18n": "^1.0.3",
"@dhis2/d2-i18n-extract": "^1.0.6",
"@dhis2/d2-i18n-generate": "^1.0.18",
"@dhis2/d2-ui-header-bar": "^1.0.11",
"autoprefixer": "7.1.6",
"axios": "^0.18.0",
"babel-core": "6.26.0",
"babel-jest": "20.0.3",
"babel-loader": "7.1.2",
"babel-preset-react-app": "^3.1.1",
"babel-runtime": "6.26.0",
"case-sensitive-paths-webpack-plugin": "2.1.1",
"chalk": "^2.4.1",
"classnames": "^2.2.5",
"css-loader": "0.28.7",
"d2": "^30.0.0",
"d2-manifest": "^1.0.0",
"dotenv": "4.0.0",
"dotenv-expand": "^4.2.0",
"eventemitter2": "^5.0.1",
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "1.1.5",
"fs-extra": "3.0.1",
"gh-pages": "^1.1.0",
"html-webpack-plugin": "2.29.0",
"husky": "^1.0.0-rc.2",
"i18next": "^10.6.0",
"jest": "22.4.3",
"jest-cli": "^22.4.3",
"jest-enzyme": "^6.0.1",
"jszip": "^3.1.5",
"lint-staged": "^7.0.0",
"material-ui": "^0.20.0",
"moment": "^2.22.1",
"object-assign": "4.1.1",
"postcss-flexbugs-fixes": "3.2.0",
"postcss-loader": "2.0.8",
"postcss-rtl": "^1.2.3",
"promise": "8.0.1",
"prop-types": "^15.6.1",
"raf": "3.4.0",
"react": "^16.2.0",
"react-dev-utils": "^5.0.0",
"react-dom": "^16.2.0",
"react-hot-loader": "^4.0.0",
"react-redux": "^5.0.7",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"redux": "^3.7.2",
"rxjs": "^5.5.7",
"style-loader": "0.19.0",
"sw-precache-webpack-plugin": "0.11.4",
"travis-cli": "^1.0.9",
"url-loader": "0.6.2",
"webpack": "3.8.1",
"webpack-dev-server": "2.9.4",
"webpack-manifest-plugin": "^2.0.3",
"whatwg-fetch": "2.0.3"
},
"developer": {
"url": "",
"name": "DHIS2"
"husky": {
"hooks": {
"pre-commit": "npm run extract-pot && npm run format && CI=true npm run test && git add ./i18n/"
}
},
"dhis2": {
"apiVersion": "30"
"scripts": {
"extract-pot": "d2-i18n-extract -p src/ -o i18n/",
"localize": "npm run extract-pot && d2-i18n-generate -n import-export-app -p ./i18n/ -o ./src/locales/",
"format": "code-style",
"prestart": "npm run localize && d2-manifest package.json ./public/manifest.webapp",
"prebuild": "rm -rf build && mkdir build && npm run manifest",
"manifest": "d2-manifest package.json build/manifest.webapp",
"start": "PORT=3000 node scripts/start.js",
"build": "npm run localize && npm run manifest && node scripts/build.js",
"test": "node scripts/test.js --env=jsdom"
},
"activities": {
"dhis": {
"href": ".."
}
}
},
"jest": {
"collectCoverageFrom": [
"src/**/*.{js,jsx,mjs}"
],
"setupFiles": [
"<rootDir>/config/polyfills.js"
],
"setupTestFrameworkScriptFile": "<rootDir>/config/setupTests.js",
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}",
"<rootDir>/src/**/?(*.)(spec|test).{js,jsx,mjs}"
],
"testEnvironment": "node",
"testURL": "http://localhost",
"transform": {
"^.+\\.(js|jsx|mjs)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^(?!.*\\.(js|jsx|mjs|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
"manifest.webapp": {
"name": "Import/Export app",
"icons": {
"48": "icon.png"
},
"developer": {
"url": "",
"name": "DHIS2"
},
"dhis2": {
"apiVersion": "30"
},
"activities": {
"dhis": {
"href": ".."
}
}
},
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs)$"
],
"moduleNameMapper": {
"^react-native$": "react-native-web"
"jest": {
"collectCoverageFrom": [
"src/**/*.{js,jsx,mjs}"
],
"setupFiles": [
"<rootDir>/config/polyfills.js"
],
"setupTestFrameworkScriptFile": "<rootDir>/config/setupTests.js",
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}",
"<rootDir>/src/**/?(*.)(spec|test).{js,jsx,mjs}"
],
"testEnvironment": "node",
"testURL": "http://localhost",
"transform": {
"^.+\\.(js|jsx|mjs)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^(?!.*\\.(js|jsx|mjs|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
},
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs)$"
],
"moduleNameMapper": {
"^react-native$": "react-native-web"
},
"moduleFileExtensions": [
"web.js",
"mjs",
"js",
"json",
"web.jsx",
"jsx",
"node"
]
},
"moduleFileExtensions": [
"web.js",
"mjs",
"js",
"json",
"web.jsx",
"jsx",
"node"
]
},
"babel": {
"presets": [
"react-app"
],
"plugins": [
"transform-decorators-legacy"
]
},
"devDependencies": {
"@dhis2/code-style": "^1.4.0",
"babel-eslint": "^10.0.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "^5.8.0",
"eslint-config-prettier": "^3.1.0",
"eslint-config-react-app": "^3.0.4",
"eslint-loader": "^2.1.1",
"eslint-plugin-flowtype": "^3.1.1",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^21.26.2",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.11.1"
}
"babel": {
"presets": [
"react-app"
],
"plugins": [
"transform-decorators-legacy"
]
},
"devDependencies": {
"@dhis2/code-style": "^1.4.0",
"babel-eslint": "^10.0.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "^5.8.0",
"eslint-config-prettier": "^3.1.0",
"eslint-config-react-app": "^3.0.4",
"eslint-loader": "^2.1.1",
"eslint-plugin-flowtype": "^3.1.1",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^21.26.2",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.11.1"
}
}
1 change: 1 addition & 0 deletions src/helpers/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const fields = {
TYPE_RADIO,
CTX_MORE_OPTIONS
),
children: getField('children', i18n.t('Children'), TYPE_RADIO),
classKey: getField(
'classKey',
i18n.t('Object type'),
Expand Down
14 changes: 12 additions & 2 deletions src/helpers/values.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ function getFormat(selected, list) {
function getBoolean(
selected,
labelTrue = i18n.t('Yes'),
labelFalse = i18n.t('No')
labelFalse = i18n.t('No'),
reverseOrder = false
) {
return {
selected,
values: [getValue('true', labelTrue), getValue('false', labelFalse)],
values: reverseOrder
? [getValue('false', labelFalse), getValue('true', labelTrue)]
: [getValue('true', labelTrue), getValue('false', labelFalse)],
}
}

Expand Down Expand Up @@ -72,6 +75,13 @@ const values = {
],
},

children: getBoolean(
'false',
i18n.t('Include descendant of organisation unit'),
i18n.t('Selected organisation unit'),
true
),

preheatCache: getBoolean('false', i18n.t('Yes (faster for large imports)')),

strategy: {
Expand Down
Loading