Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b282ae4
feat: support outliers table vis type and layout (DHIS2-16344)
edoardo Dec 19, 2023
e1ebe37
feat: support outlierDetection endpoint (DHIS2-16345)
edoardo Dec 20, 2023
213c5ab
chore: cleanup code and unit tests
edoardo Dec 20, 2023
1940f08
feat: add support for period item max limit (DHIS2-16399)
edoardo Jan 4, 2024
81536d6
feat: allow pass data types in DataDimension (DHIS2-16433)
edoardo Jan 25, 2024
129c204
fix: use translated title and subtitle when available (DHIS2-16216)
edoardo Dec 7, 2023
3409e99
fix(OpenFileDialog): use table toolbars
cooper-joe Jun 28, 2023
b0c001b
chore: bump UI version
cooper-joe Jun 29, 2023
44c58b3
Merge branch 'open-dialog-design' into feat/bundle-26.4.0
edoardo Feb 20, 2024
dc4430f
fix: dimension item design
cooper-joe Jun 29, 2023
a3cbc54
chore: update test snapshots
cooper-joe Jun 29, 2023
7e5ffa1
fix: update dimension chip style
cooper-joe Dec 15, 2023
a0e9ba9
fix: append className passed in as prop
martinkrulltott Dec 18, 2023
30b56da
chore: update snapshots
martinkrulltott Dec 18, 2023
3a6ab36
fix: locked dimension color and story example
cooper-joe Dec 18, 2023
52d2608
refactor: remove css module
martinkrulltott Dec 22, 2023
c581ff4
chore: update snapshots
martinkrulltott Dec 22, 2023
29898c8
Merge branch 'dimension-list-design' into feat/bundle-26.4.0
edoardo Feb 20, 2024
8fdb736
fix: rendering a spinner based on fetching causes flash
jenniferarnesen Dec 21, 2023
2990e72
fix: dont use loader and mask when like/unliking
jenniferarnesen Feb 9, 2024
3abb23a
fix: when liking just update the object instead of new request
jenniferarnesen Feb 12, 2024
f86ecd7
fix: unneeded changes
jenniferarnesen Feb 12, 2024
e326724
fix: unneeded changes
jenniferarnesen Feb 12, 2024
a444691
fix: more cleanup
jenniferarnesen Feb 12, 2024
fe2a3d3
fix: set dirty so parent component refreshes interpretations list
jenniferarnesen Feb 12, 2024
6d1ceb4
Merge branch 'fix/like-causing-flashing-interp-panel' into feat/bundl…
edoardo Feb 20, 2024
b5a7d09
test: fix failing test
edoardo Feb 20, 2024
a088b86
Merge branch 'feat/outliers-table-DHIS2-13858' into feat/bundle-26.4.0
edoardo Feb 20, 2024
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
22 changes: 17 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: 2023-09-27T14:15:13.876Z\n"
"PO-Revision-Date: 2023-09-27T14:15:13.876Z\n"
"POT-Creation-Date: 2024-01-25T12:05:03.360Z\n"
"PO-Revision-Date: 2024-01-25T12:05:03.360Z\n"

msgid "view only"
msgstr "view only"
Expand Down Expand Up @@ -150,6 +150,9 @@ msgstr "Math operators"
msgid "Data Type"
msgstr "Data Type"

msgid "Only {{dataType}} can be used in {{visType}}"
msgstr "Only {{dataType}} can be used in {{visType}}"

msgid "All types"
msgstr "All types"

Expand Down Expand Up @@ -180,6 +183,9 @@ msgstr "No event data items found"
msgid "No program indicators found"
msgstr "No program indicators found"

msgid "No calculations found"
msgstr "No calculations found"

msgid "No indicators found for \"{{- searchTerm}}\""
msgstr "No indicators found for \"{{- searchTerm}}\""

Expand All @@ -192,6 +198,9 @@ msgstr "No event data items found for \"{{- searchTerm}}\""
msgid "No program indicators found for \"{{- searchTerm}}\""
msgstr "No program indicators found for \"{{- searchTerm}}\""

msgid "No calculations found for \"{{- searchTerm}}\""
msgstr "No calculations found for \"{{- searchTerm}}\""

msgid "Nothing found for \"{{- searchTerm}}\""
msgstr "Nothing found for \"{{- searchTerm}}\""

Expand Down Expand Up @@ -654,15 +663,15 @@ msgstr "Select year"
msgid "Period"
msgstr "Period"

msgid "Selected Periods"
msgstr "Selected Periods"

msgid "Relative periods"
msgstr "Relative periods"

msgid "Fixed periods"
msgstr "Fixed periods"

msgid "Selected Periods"
msgstr "Selected Periods"

msgid "No periods selected"
msgstr "No periods selected"

Expand Down Expand Up @@ -1164,6 +1173,9 @@ msgstr "Scatter"
msgid "Single value"
msgstr "Single value"

msgid "Outlier table"
msgstr "Outlier table"

msgid "All charts"
msgstr "All charts"

Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@dhis2/cli-app-scripts": "^9.0.1",
"@dhis2/cli-style": "^10.4.1",
"@dhis2/d2-i18n": "^1.1.0",
"@dhis2/ui": "^8.4.11",
"@dhis2/ui": "^9.2.0",
"@sambego/storybook-state": "^2.0.1",
"@storybook/addons": "^6.5.16",
"@storybook/preset-create-react-app": "^3.1.7",
Expand All @@ -52,7 +52,7 @@
"peerDependencies": {
"@dhis2/app-runtime": "^3",
"@dhis2/d2-i18n": "^1.1",
"@dhis2/ui": "^8.2.5",
"@dhis2/ui": "^9.2.0",
"prop-types": "^15",
"react": "^16.3",
"react-dom": "^16.3",
Expand All @@ -75,6 +75,9 @@
"react-beautiful-dnd": "^10.1.1",
"resize-observer-polyfill": "^1.5.1"
},
"resolutions": {
"@dhis2/ui": "^9.2.0"
},
"files": [
"build"
]
Expand Down
1 change: 1 addition & 0 deletions src/__demo__/DimensionsPanel.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ storiesOf('DimensionsPanel', module).add('locked dimension', () => {
<DimensionsPanel
dimensions={[...fixedDimensions, ...dynamicDimensions]}
onDimensionClick={onDimensionClick}
selectedIds={[DIMENSION_ID_DATA]}
lockedDimension={(dimension) => dimension === DIMENSION_ID_DATA}
/>
)
Expand Down
4 changes: 4 additions & 0 deletions src/__fixtures__/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ export default (function x() {
require('./json/api/analytics/enrollments.json')
)

addFixture(
'/api/analytics/outlierDetection',
require('./json/api/analytics/outlierDetection.json')
)
return {
get: getFixture,
add: addFixture,
Expand Down
213 changes: 213 additions & 0 deletions src/__fixtures__/json/api/analytics/outlierDetection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
{
"headers": [
{
"name": "dxname",
"column": "Data name",
"valueType": "TEXT",
"type": "java.lang.String",
"hidden": false,
"meta": false
},
{
"name": "ouname",
"column": "Organisation unit name",
"valueType": "TEXT",
"type": "java.lang.String",
"hidden": false,
"meta": false
},
{
"name": "value",
"column": "Value",
"valueType": "NUMBER",
"type": "java.lang.Double",
"hidden": false,
"meta": false
},
{
"name": "absdev",
"column": "Absolute deviation",
"valueType": "NUMBER",
"type": "java.lang.Double",
"hidden": false,
"meta": false
},
{
"name": "modifiedzscore",
"column": "Modified zScore",
"valueType": "NUMBER",
"type": "java.lang.Double",
"hidden": false,
"meta": false
},
{
"name": "median",
"column": "Median",
"valueType": "NUMBER",
"type": "java.lang.Double",
"hidden": false,
"meta": false
},
{
"name": "lowerbound",
"column": "Lower boundary",
"valueType": "NUMBER",
"type": "java.lang.Double",
"hidden": false,
"meta": false
},
{
"name": "upperbound",
"column": "Upper boundary",
"valueType": "NUMBER",
"type": "java.lang.Double",
"hidden": false,
"meta": false
}
],
"metaData": {
"maxResults": 100,
"count": 13,
"orderBy": "mean_abs_dev",
"threshold": 3.0,
"algorithm": "MOD_Z_SCORE"
},
"rowContext": {

},
"rows": [
[
"ANC 2nd visit",
"UMC (Urban Centre) Hospital",
"1669.0",
"920.0",
"3.902767295597484",
"749.0",
"-290.93013894085743",
"1788.9301389408574"
],
[
"ANC 1st visit",
"Charlotte CHP",
"49.0",
"39.0",
"7.515857142857143",
"10.0",
"-23.948490393535913",
"43.94849039353591"
],
[
"ANC 2nd visit",
"Charlotte CHP",
"40.0",
"33.0",
"22.258499999999998",
"7.0",
"-30.86489139031037",
"44.86489139031037"
],
[
"ANC 2nd visit",
"Wilberforce CHC",
"56.0",
"24.5",
"3.004590909090909",
"31.5",
"-1.3890179239210454",
"64.38901792392105"
],
[
"ANC 1st visit",
"Deep Eye water MCHP",
"40.0",
"16.0",
"3.5973333333333333",
"24.0",
"4.850913859925324",
"43.14908614007467"
],
[
"ANC 2nd visit",
"Lion for Lion Clinic",
"30.0",
"16.0",
"3.5973333333333333",
"14.0",
"-5.620896815302167",
"33.62089681530217"
],
[
"ANC 2nd visit",
"Deep Eye water MCHP",
"33.0",
"14.5",
"3.9121",
"18.5",
"-3.4245866551686603",
"40.42458665516866"
],
[
"ANC 2nd visit",
"Blessed Mokaka East Clinic",
"2.0",
"13.0",
"4.38425",
"15.0",
"-3.417043736713012",
"33.41704373671301"
],
[
"ANC 2nd visit",
"Malambay CHP",
"15.0",
"12.0",
"5.396",
"3.0",
"-13.770509831248425",
"19.770509831248425"
],
[
"ANC 2nd visit",
"Wellbody MCHP",
"20.0",
"10.0",
"3.3725",
"10.0",
"-10.999999999999996",
"30.999999999999996"
],
[
"ANC 1st visit",
"Blessed Mokaka East Clinic",
"26.0",
"10.0",
"4.496666666666667",
"16.0",
"1.6734512181055958",
"30.326548781894402"
],
[
"ANC 1st visit",
"Murray Town CHC",
"18.0",
"9.0",
"6.0705",
"9.0",
"-2.43571205496543",
"20.43571205496543"
],
[
"ANC 2nd visit",
"Thompson Bay MCHP",
"11.0",
"6.0",
"4.047",
"5.0",
"-2.038266127580332",
"12.038266127580332"
]
],
"headerWidth": 8,
"width": 8,
"height": 13
}
28 changes: 27 additions & 1 deletion src/api/analytics/AnalyticsAggregate.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,38 @@ class AnalyticsAggregate extends AnalyticsBase {
* .withStartDate('2017-10-01')
* .withEndDate('2017-10-31');
*
* analytics.aggregate.getDebugSql(req);
* analytics.aggregate.getDebugSql(req)
* .then(console.log);
*/
getDebugSql(req) {
return this.fetch(req.withPath('debug/sql'))
}

/**
* @param {!AnalyticsRequest} req Request object
*
* @returns {Promise} Promise that resolves with the SQL statement used to query the database.
*
* @example
* const req = new analytics.request()
* .withParameters({
* dx: 'fbfJHSPpUQD,cYeuwXTCPkU',
* pe: 'THIS_YEAR',
* ou: 'USER_ORGUNIT,USER_ORGUNIT_CHILDREN',
* headers: 'dxname,pename,ouname,value,absdev,modifiedzscore,median,lowerbound,upperbound',
* algorithm: 'MODIFIED_Z_SCORE',
* maxResults: 100,
* threshold: 3,
orderBy: 'value',
sortOrder: 'desc',
* });
*
* analytics.aggregate.getOutliersData(req)
* .then(console.log);
*/
getOutliersData(req) {
return this.fetch(req.withPath('outlierDetection'))
}
}

export default AnalyticsAggregate
Loading