Skip to content

Commit

Permalink
feat: multiple org units support (#333)
Browse files Browse the repository at this point in the history
Fixes DHIS2-7446 and DHIS2-7679.
  • Loading branch information
edoardo authored Oct 15, 2019
1 parent 77b2628 commit 6392efa
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 63 deletions.
7 changes: 7 additions & 0 deletions packages/app/config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ module.exports = {
},
},
// Process JS with Babel.
{
test: /@dhis2\/.*\.(js|jsx|mjs)$/,
loader: require.resolve('babel-loader'),
options: {
cacheDirectory: true,
},
},
{
test: /\.(js|jsx|mjs)$/,
include: paths.appSrc,
Expand Down
7 changes: 7 additions & 0 deletions packages/app/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ module.exports = {
},
},
// Process JS with Babel.
{
test: /@dhis2\/.*\.(js|jsx|mjs)$/,
loader: require.resolve('babel-loader'),
options: {
cacheDirectory: true,
},
},
{
test: /\.(js|jsx|mjs)$/,
include: paths.appSrc,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"webpack-bundle-analyzer": "^3.0.3"
},
"dependencies": {
"@dhis2/analytics": "^2.4.5",
"@dhis2/d2-i18n": "^1.0.3",
"@dhis2/d2-ui-analytics": "^1.0.2",
"@dhis2/d2-ui-core": "^6.2.1",
"@dhis2/d2-ui-file-menu": "^6.2.1",
"@dhis2/d2-ui-interpretations": "^6.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
DynamicDimension,
PeriodDimension,
OrgUnitDimension,
} from '@dhis2/d2-ui-analytics';
} from '@dhis2/analytics';

import HideButton from './HideButton';
import AddToLayoutButton from './AddToLayoutButton/AddToLayoutButton';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jest.mock('@material-ui/core/DialogActions', () => props => (
<div id="mock-mui-dialog-actions">{props.children}</div>
));

jest.mock('@dhis2/d2-ui-analytics', () => {
jest.mock('@dhis2/analytics', () => {
return {
DataDimension: () => <div />,
DynamicDimension: () => <div />,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { DimensionsPanel } from '@dhis2/d2-ui-analytics';
import { DimensionsPanel } from '@dhis2/analytics';

import DialogManager from './Dialogs/DialogManager';
import DimensionOptions from './DimensionOptions/DimensionOptions';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { shallow } from 'enzyme';
import { DimensionsPanel } from '@dhis2/d2-ui-analytics';
import { DimensionsPanel } from '@dhis2/analytics';
import { Dimensions } from '../DimensionsPanel';

describe('The Dimensions component ', () => {
Expand Down
147 changes: 89 additions & 58 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,25 @@
debug "^3.1.0"
lodash.once "^4.1.1"

"@dhis2/analytics@^2.1.0", "@dhis2/analytics@^2.4.5":
version "2.4.5"
resolved "https://registry.yarnpkg.com/@dhis2/analytics/-/analytics-2.4.5.tgz#56db1331b70af718664c7b823af60661f2afa88c"
integrity sha512-bf4hXCnDiWdT/S5uoVQ9vb2kaIVlkeJMlolVxIbidg5XDCsoC7TDGnL7RaImsxR54IrLZ8rW6uediqPeP4BWHw==
dependencies:
"@dhis2/d2-i18n" "^1.0.4"
"@dhis2/d2-ui-org-unit-dialog" "^6.3.0"
"@dhis2/d2-ui-period-selector-dialog" "^6.3.0"
"@dhis2/ui-core" "^3.4.0"
"@material-ui/core" "^3.9.3"
"@material-ui/icons" "^3.0.2"
classnames "^2.2.6"
d2-utilizr "^0.2.16"
d3-color "^1.2.3"
highcharts "^7.1.2"
lodash "^4.17.13"
react-beautiful-dnd "^10.1.1"
styled-jsx "^3.2.1"

"@dhis2/d2-i18n-extract@^1.0.6", "@dhis2/d2-i18n-extract@^1.0.7":
version "1.0.7"
resolved "https://registry.yarnpkg.com/@dhis2/d2-i18n-extract/-/d2-i18n-extract-1.0.7.tgz#805c92c75f5d3678a047374a551bda5f7571d7f3"
Expand Down Expand Up @@ -179,50 +198,20 @@
dependencies:
i18next "^10.3"

"@dhis2/d2-ui-analytics@^1.0.0":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@dhis2/d2-ui-analytics/-/d2-ui-analytics-1.0.1.tgz#af33771c203c3c4125cdf7327031b5b5f6599a92"
integrity sha512-gEASO8FC5e/uFgIjANfaz8xeB/RyUvklt4Gc1klivy7qzzqevcieJwZtxPReKAnd1wVj849cF3ZAoBC5J0bdIA==
dependencies:
"@dhis2/d2-i18n" "^1.0.4"
"@dhis2/d2-ui-org-unit-dialog" "^5.3.10"
"@dhis2/d2-ui-period-selector-dialog" "^5.3.10"
"@material-ui/core" "^3.9.3"
"@material-ui/icons" "^3.0.2"
classnames "^2.2.6"
lodash "^4.17.11"
react-beautiful-dnd "^10.1.1"
styled-jsx "^3.2.1"

"@dhis2/d2-ui-analytics@^1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@dhis2/d2-ui-analytics/-/d2-ui-analytics-1.0.2.tgz#fdd3f105695db91e8fc04b4aaa1f311ac0de060e"
integrity sha512-kEgXw5ha8rNpbtobjINVSf3dh4DgKD4wLABMjFTNdyUL2x1x0W5UzRJfUz07+TFr+AZ44NFrdTJr2JM5yP4TKA==
dependencies:
"@dhis2/d2-i18n" "^1.0.4"
"@dhis2/d2-ui-org-unit-dialog" "^5.3.10"
"@dhis2/d2-ui-period-selector-dialog" "^5.3.10"
"@material-ui/core" "^3.9.3"
"@material-ui/icons" "^3.0.2"
classnames "^2.2.6"
lodash "^4.17.11"
react-beautiful-dnd "^10.1.1"
styled-jsx "^3.2.1"

"@dhis2/[email protected]":
version "5.3.10"
resolved "https://registry.yarnpkg.com/@dhis2/d2-ui-core/-/d2-ui-core-5.3.10.tgz#c852149814ed6f5123cb74594c87c6e12a059011"
integrity sha512-rMsK0Un4nui3hOIP0he5Oz9wgjYIFqrSbhDtONTh9lDYdepoR6DadOC1/AsBEKj4uJisePHShvUljCZ2i+SZsw==
"@dhis2/[email protected]", "@dhis2/d2-ui-core@^6.2.1":
version "6.2.1"
resolved "https://registry.yarnpkg.com/@dhis2/d2-ui-core/-/d2-ui-core-6.2.1.tgz#08c461f7658f4cbc198cf4484a470b0481a17f5f"
integrity sha512-yGLditO7a3jsAzblzzHALjwc5C2YEDcH+4JQESxoZoL7qGHjF3z7N9jgFbJWyfEeT8WK2nl/2jYiJhKrXV8Nuw==
dependencies:
babel-runtime "^6.26.0"
d2 "~31.7"
lodash "^4.17.10"
material-ui "^0.20.0"

"@dhis2/d2-ui-core@6.2.1", "@dhis2/d2-ui-core@^6.2.1":
version "6.2.1"
resolved "https://registry.yarnpkg.com/@dhis2/d2-ui-core/-/d2-ui-core-6.2.1.tgz#08c461f7658f4cbc198cf4484a470b0481a17f5f"
integrity sha512-yGLditO7a3jsAzblzzHALjwc5C2YEDcH+4JQESxoZoL7qGHjF3z7N9jgFbJWyfEeT8WK2nl/2jYiJhKrXV8Nuw==
"@dhis2/d2-ui-core@6.3.0":
version "6.3.0"
resolved "https://registry.yarnpkg.com/@dhis2/d2-ui-core/-/d2-ui-core-6.3.0.tgz#ec0ef63978a34d5b2330303c426bf7d59e0836fc"
integrity sha512-ZFthluJBkmbi1F0vNaIvx2Zbjioapo+Ewn1vNqb2MsUadTHOlPcrWQjDz3JCB0qce2ZW2avZ+spasEOytPNsFA==
dependencies:
babel-runtime "^6.26.0"
d2 "~31.7"
Expand Down Expand Up @@ -287,40 +276,37 @@
lodash "^4.17.10"
prop-types "^15.6.2"

"@dhis2/d2-ui-org-unit-dialog@^5.3.10":
version "5.3.10"
resolved "https://registry.yarnpkg.com/@dhis2/d2-ui-org-unit-dialog/-/d2-ui-org-unit-dialog-5.3.10.tgz#45a12d6aa41741d2ea239ea58658a8d276dbc9f6"
integrity sha512-NXxPmFMt+NJkTeVwZGppWN+sa16n6M5C4kHsySaHG7hJ7ZT6vjJnc8WBcqfZbk3oMrTFvRapt25pscwbLTKvBg==
"@dhis2/d2-ui-org-unit-dialog@^6.3.0":
version "6.3.0"
resolved "https://registry.yarnpkg.com/@dhis2/d2-ui-org-unit-dialog/-/d2-ui-org-unit-dialog-6.3.0.tgz#6f12b73fab2ce0448b92267a19aa6a1e9c363c70"
integrity sha512-wgjs1Av9cQzpCThug8uVu5uc61dwcLpfiWcK7Vr046rsw4iH+iMaCk5FE5nIC06LZWsLkENzVEdxo6DYskuq6w==
dependencies:
"@dhis2/d2-i18n" "^1.0.3"
"@dhis2/d2-ui-org-unit-tree" "5.3.10"
"@dhis2/d2-ui-org-unit-tree" "6.3.0"
"@material-ui/core" "^3.3.1"
"@material-ui/icons" "^3.0.1"
prop-types "^15.5.10"

"@dhis2/d2-ui-org-unit-tree@5.3.10":
version "5.3.10"
resolved "https://registry.yarnpkg.com/@dhis2/d2-ui-org-unit-tree/-/d2-ui-org-unit-tree-5.3.10.tgz#181f5666081dbe233adf6db6bb2e1ef7be938869"
integrity sha512-p/IvFEPt5xRDznnpf7M/rYpDfNLzxmheGuTfNd6qlNWKldr8w4NUsFL9mmdMQGJbkGhazmsLmrDM35gPgYgL/w==
"@dhis2/d2-ui-org-unit-tree@6.3.0":
version "6.3.0"
resolved "https://registry.yarnpkg.com/@dhis2/d2-ui-org-unit-tree/-/d2-ui-org-unit-tree-6.3.0.tgz#5c80074a38987f853383aa12f10ecd11127332ef"
integrity sha512-KzO+ZnyN6vQjogFnK4ZWW/fcha40D0g+Vjc6IVS5U1kBiHdpmqngo+6K6DqCaHRkl/7oUyOUkEvrzbWdnkodVA==
dependencies:
"@dhis2/d2-ui-core" "5.3.10"
"@dhis2/d2-ui-core" "6.3.0"
"@material-ui/core" "^3.3.1"
babel-runtime "^6.26.0"
prop-types "^15.5.10"
recompose "^0.26.0"
rxjs "^5.5.7"

"@dhis2/d2-ui-period-selector-dialog@^5.3.10":
version "5.3.10"
resolved "https://registry.yarnpkg.com/@dhis2/d2-ui-period-selector-dialog/-/d2-ui-period-selector-dialog-5.3.10.tgz#79e06ac0b6f45f7a0c9ab8735584de3f0665389b"
integrity sha512-pBeeHabpSB2FO1bdYMSIxPO1RZphx2bkLsu51wdDFepNH63l1SKbLJNLcj/9hrmq1bYVn0U4ce6Rx6uQKyDfNg==
"@dhis2/d2-ui-period-selector-dialog@^6.3.0":
version "6.3.0"
resolved "https://registry.yarnpkg.com/@dhis2/d2-ui-period-selector-dialog/-/d2-ui-period-selector-dialog-6.3.0.tgz#56bba56d8a7e914364e94e3d025dda8f03a3622f"
integrity sha512-JOofPyx+h45PsVi/0Ubf4xQurBwnnq+wTSOtibKfWSvxNgrNUug08F8+LYxoP/+IUogmkzuFD0uQs9pW3pYa0g==
dependencies:
"@dhis2/analytics" "^2.1.0"
"@dhis2/d2-i18n" "^1.0.4"
"@dhis2/d2-ui-analytics" "^1.0.0"
"@material-ui/core" "^3.3.1"
"@material-ui/icons" "^3.0.1"
babel-runtime "^6.26.0"
lodash "^4.17.11"
prop-types "^15.6.0"

"@dhis2/[email protected]":
Expand Down Expand Up @@ -360,6 +346,22 @@
react-select "^2.0.0"
rxjs "^5.5.7"

"@dhis2/prop-types@^1.1.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@dhis2/prop-types/-/prop-types-1.2.1.tgz#acd62fc65f7c2f55126844289e601e2b842d3421"
integrity sha512-L3y0x8TOFwn12oBin4pkfTOn7CqGrKIN73Q4qLooA4/lM1qlM6GE3Qm7zB5p1Ko8rCThjEiHKSb9CfMGoo/GzQ==
dependencies:
prop-types "^15"

"@dhis2/ui-core@^3.4.0":
version "3.12.0"
resolved "https://registry.yarnpkg.com/@dhis2/ui-core/-/ui-core-3.12.0.tgz#6216868b1bd76b816df8c3272c2b9200972f0858"
integrity sha512-9JYl0TP6Wkb2yD5OkiN4juHYxW37UYZF1egbCAxuUCx7Uox5HqUkzxaKw25bQKN+4684vDnIJgh0Z2qSTszg1g==
dependencies:
"@dhis2/prop-types" "^1.1.1"
classnames "^2.2.6"
styled-jsx "^3.2.2"

"@dhis2/ui@^1.0.0-beta.11":
version "1.0.0-beta.15"
resolved "https://registry.yarnpkg.com/@dhis2/ui/-/ui-1.0.0-beta.15.tgz#3dc7484174f1db686dd6f10cbad8271d84f3a0b9"
Expand Down Expand Up @@ -4308,7 +4310,7 @@ [email protected]:
lodash.isset "^4.3.0"
lodash.isstring "^4.0.1"

d2-utilizr@^0.2.15:
d2-utilizr@^0.2.15, d2-utilizr@^0.2.16:
version "0.2.16"
resolved "https://registry.yarnpkg.com/d2-utilizr/-/d2-utilizr-0.2.16.tgz#b71df7ca8c7ab5125ca8bdb4899611bc6782a754"
integrity sha512-8Cqwe/3TIsHeLfRVsWFKYqRrY3ZzuHAJqkEMCPGW9gyNCAAnTPVjROFwBwonv0zodQhVntn1DlJCay/GTBPj1A==
Expand Down Expand Up @@ -4343,6 +4345,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-1.0.1.tgz#73cc91f4ee3f12e00ca06b1596a7c83cf104723a"
integrity sha1-c8yR9O4/EuAMoGsVlqfIPPEEcjo=

d3-color@^1.2.3:
version "1.4.0"
resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-1.4.0.tgz#89c45a995ed773b13314f06460df26d60ba0ecaf"
integrity sha512-TzNPeJy2+iEepfiL92LAAB7fvnp/dV2YwANPVHdDWmYMm23qIJBYww3qT8I8C1wXrmrg4UWs7BKc2tKIgyjzHg==

d@1:
version "1.0.0"
resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f"
Expand Down Expand Up @@ -6531,6 +6538,11 @@ highcharts@^6.2.0:
resolved "https://registry.yarnpkg.com/highcharts/-/highcharts-6.2.0.tgz#2a6d04652eb43c66f462ca7e2d2808f1f2782b61"
integrity sha512-A4E89MA+kto8giic7zyLU6ZxfXnVeCUlKOyzFsah3+n4BROx4bgonl92KIBtwLud/mIWir8ahqhuhe2by9LakQ==

highcharts@^7.1.2:
version "7.2.0"
resolved "https://registry.yarnpkg.com/highcharts/-/highcharts-7.2.0.tgz#d6bd00240767cfab67210ead47c6cd015384e74d"
integrity sha512-jOlMzj3oRuqNBoJg+rqHZI9vnlLHipwVfceJr00gAreXu8268UwahEh7yBGI/m1wa6Uc/XoBMIuzMpXUFMvFdg==

history@^4.7.2:
version "4.9.0"
resolved "https://registry.yarnpkg.com/history/-/history-4.9.0.tgz#84587c2068039ead8af769e9d6a6860a14fa1bca"
Expand Down Expand Up @@ -8713,6 +8725,11 @@ [email protected], "lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.14.0, lodash@^4.15.0
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==

lodash@^4.17.13:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==

[email protected]:
version "2.2.0"
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a"
Expand Down Expand Up @@ -10745,7 +10762,7 @@ promzard@^0.3.0:
dependencies:
read "1"

prop-types@^15.5.10, prop-types@^15.5.6, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
prop-types@^15, prop-types@^15.5.10, prop-types@^15.5.6, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2:
version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
Expand Down Expand Up @@ -12531,6 +12548,20 @@ styled-jsx@^3.2.1:
stylis "3.5.4"
stylis-rule-sheet "0.0.10"

styled-jsx@^3.2.2:
version "3.2.2"
resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-3.2.2.tgz#03d02d26725195d17b6a979eb8d7c34761a16bf8"
integrity sha512-Xb9TPFY2REShznvHt/fw78wk+nxejTr8poepDeS5fRvkQ7lW49CDIWWGLzzALCLcKBIRFK/1Wi4PDZNetpig4w==
dependencies:
babel-plugin-syntax-jsx "6.18.0"
babel-types "6.26.0"
convert-source-map "1.6.0"
loader-utils "1.2.3"
source-map "0.7.3"
string-hash "1.1.3"
stylis "3.5.4"
stylis-rule-sheet "0.0.10"

[email protected], stylis-rule-sheet@^0.0.10:
version "0.0.10"
resolved "https://registry.yarnpkg.com/stylis-rule-sheet/-/stylis-rule-sheet-0.0.10.tgz#44e64a2b076643f4b52e5ff71efc04d8c3c4a430"
Expand Down

0 comments on commit 6392efa

Please sign in to comment.