diff --git a/d2.config.js b/d2.config.js
index 1b29a636..487f8d87 100644
--- a/d2.config.js
+++ b/d2.config.js
@@ -4,6 +4,8 @@ const config = {
title: 'Data Administration',
coreApp: true,
+ minDHIS2Version: '2.38',
+
entryPoints: {
app: './src/App.js',
},
diff --git a/i18n/en.pot b/i18n/en.pot
index 77a4bbf9..7fbcc5bb 100644
--- a/i18n/en.pot
+++ b/i18n/en.pot
@@ -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: 2022-02-09T15:18:51.747Z\n"
-"PO-Revision-Date: 2022-02-09T15:18:51.747Z\n"
+"POT-Creation-Date: 2022-02-14T12:36:03.855Z\n"
+"PO-Revision-Date: 2022-02-14T12:36:03.855Z\n"
msgid "Open user guide"
msgstr "Open user guide"
@@ -408,114 +408,15 @@ msgstr "Batch Deletion"
msgid "No lock exceptions to show."
msgstr "No lock exceptions to show."
+msgid "Failed to load available data integrity checks"
+msgstr "Failed to load available data integrity checks"
+
msgid "Checking data integrity..."
msgstr "Checking data integrity..."
msgid "Run integrity checks"
msgstr "Run integrity checks"
-msgid "{{issueTitle}} ({{issueElementsCount}})"
-msgstr "{{issueTitle}} ({{issueElementsCount}})"
-
-msgid "Data elements without data set"
-msgstr "Data elements without data set"
-
-msgid "Data elements without groups"
-msgstr "Data elements without groups"
-
-msgid "Data elements violating exclusive group sets"
-msgstr "Data elements violating exclusive group sets"
-
-msgid "Data elements assigned to data sets with different period types"
-msgstr "Data elements assigned to data sets with different period types"
-
-msgid "Data sets not assigned to organisation units"
-msgstr "Data sets not assigned to organisation units"
-
-msgid "Indicators with identical formulas"
-msgstr "Indicators with identical formulas"
-
-msgid "Indicators without groups"
-msgstr "Indicators without groups"
-
-msgid "Invalid indicator numerators"
-msgstr "Invalid indicator numerators"
-
-msgid "Invalid indicator denominators"
-msgstr "Invalid indicator denominators"
-
-msgid "Indicators violating exclusive group sets"
-msgstr "Indicators violating exclusive group sets"
-
-msgid "Organisation units with cyclic references"
-msgstr "Organisation units with cyclic references"
-
-msgid "Orphaned organisation units"
-msgstr "Orphaned organisation units"
-
-msgid "Organisation units without groups"
-msgstr "Organisation units without groups"
-
-msgid "Organisation units violating exclusive group sets"
-msgstr "Organisation units violating exclusive group sets"
-
-msgid "Organisation unit groups without group sets"
-msgstr "Organisation unit groups without group sets"
-
-msgid "Validation rules without groups"
-msgstr "Validation rules without groups"
-
-msgid "Invalid validation rule left side expressions"
-msgstr "Invalid validation rule left side expressions"
-
-msgid "Invalid validation rule right side expressions"
-msgstr "Invalid validation rule right side expressions"
-
-msgid "Invalid program indicator expressions"
-msgstr "Invalid program indicator expressions"
-
-msgid "Invalid program indicator filters"
-msgstr "Invalid program indicator filters"
-
-msgid "There are data elements in the form, but not in the form or sections"
-msgstr "There are data elements in the form, but not in the form or sections"
-
-msgid "Invalid category combinations"
-msgstr "Invalid category combinations"
-
-msgid "Duplicate periods"
-msgstr "Duplicate periods"
-
-msgid "Program rules with no condition"
-msgstr "Program rules with no condition"
-
-msgid "Program rules with no action"
-msgstr "Program rules with no action"
-
-msgid "Program rules with no priority"
-msgstr "Program rules with no priority"
-
-msgid "Program rule variables with no data element"
-msgstr "Program rule variables with no data element"
-
-msgid "Program rule variables with no attribute"
-msgstr "Program rule variables with no attribute"
-
-msgid "Program rule actions with no data object"
-msgstr "Program rule actions with no data object"
-
-msgid "Program rule actions with no notification"
-msgstr "Program rule actions with no notification"
-
-msgid "Program rule actions with no section id"
-msgstr "Program rule actions with no section id"
-
-msgid "Program rule actions with no stage id"
-msgstr "Program rule actions with no stage id"
-
-msgid "Program indicators with no expression"
-msgstr "Program indicators with no expression"
-
msgid "Indicators"
msgstr "Indicators"
diff --git a/src/pages/data-integrity/DataIntegrity.js b/src/pages/data-integrity/DataIntegrity.js
index 91c04f1c..944182ee 100644
--- a/src/pages/data-integrity/DataIntegrity.js
+++ b/src/pages/data-integrity/DataIntegrity.js
@@ -1,30 +1,78 @@
+import { useDataQuery } from '@dhis2/app-runtime'
import i18n from '@dhis2/d2-i18n'
-import { Button, NoticeBox } from '@dhis2/ui'
+import { CenteredContent, CircularLoader, Button, NoticeBox } from '@dhis2/ui'
import PropTypes from 'prop-types'
-import React from 'react'
+import React, { useState } from 'react'
import PageHeader from '../../components/PageHeader/PageHeader'
import { i18nKeys } from '../../i18n-keys'
-import Issues from './Issues/Issues'
-import { useDataIntegrity } from './use-data-integrity'
+import styles from './DataIntegrity.module.css'
+import Section from './Section'
-const DataIntegrity = ({ sectionKey }) => {
- const {
- startDataIntegrityCheck,
- loading,
- error,
- issues,
- } = useDataIntegrity()
+const query = {
+ checks: {
+ resource: 'dataIntegrity',
+ },
+}
+
+const groupChecks = checks =>
+ checks.reduce((groupedChecks, check) => {
+ if (!(check.section in groupedChecks)) {
+ groupedChecks[check.section] = []
+ }
+ groupedChecks[check.section].push(check)
+ return groupedChecks
+ }, {})
+
+const DataIntegrity = () => {
+ const { loading, error, data } = useDataQuery(query)
+ const [selectedChecks, setSelectedChecks] = useState(new Set())
+ // XXX
+ const [submitting, setSubmitting] = useState(false)
+
+ const startDataIntegrityCheck = () => {
+ setSubmitting(true)
+ }
+
+ if (loading) {
+ return (
+
+
+
+ )
+ }
+
+ if (error) {
+ return (
+
+ {error.message}
+
+ )
+ }
+
+ const groupedChecks = groupChecks(data.checks)
return (
<>
-
- {error && {error.message}}
- {issues && }
-