diff --git a/.eslintignore b/.eslintignore index 9ca98e28..3f810a72 100644 --- a/.eslintignore +++ b/.eslintignore @@ -11,3 +11,4 @@ cypress.env.json cypress/screenshots/* src/types/generated +.prettierrc.js \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 1d9010c9..45d91b63 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,4 @@ -// eslint-disable-next-line @typescript-eslint/no-var-requires +// eslint-disable-next-line @typescript-eslint/no-require-imports const { config } = require('@dhis2/cli-style') module.exports = { @@ -16,5 +16,7 @@ module.exports = { }, rules: { 'import/extensions': 'off', + '@typescript-eslint/no-explicit-any': 1, + '@typescript-eslint/no-unused-vars': 1, }, } diff --git a/.github/workflows/dhis2-verify-app.yml b/.github/workflows/dhis2-verify-app.yml index 495641db..8a3ef598 100644 --- a/.github/workflows/dhis2-verify-app.yml +++ b/.github/workflows/dhis2-verify-app.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: c-hive/gha-yarn-cache@v1 - run: yarn install --frozen-lockfile @@ -30,7 +30,7 @@ jobs: - name: Build run: yarn d2-app-scripts build - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: app-build path: | @@ -44,7 +44,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: c-hive/gha-yarn-cache@v1 - run: yarn install --frozen-lockfile @@ -63,7 +63,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: c-hive/gha-yarn-cache@v1 - run: yarn install --frozen-lockfile @@ -86,7 +86,7 @@ jobs: uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: - node-version: 16 + node-version: 20 - name: End-to-End tests uses: cypress-io/github-action@v5 @@ -117,9 +117,9 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: app-build diff --git a/.prettierrc.js b/.prettierrc.js index 33aabee2..def7934e 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,4 +1,3 @@ -// eslint-disable-next-line @typescript-eslint/no-var-requires const { config } = require('@dhis2/cli-style') module.exports = { diff --git a/CHANGELOG.md b/CHANGELOG.md index 07ce1e73..2ed9d8d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,26 @@ +# [0.6.0](https://github.com/dhis2/maintenance-app-beta/compare/v0.5.0...v0.6.0) (2024-09-30) + + +### Features + +* add details panel to org list ([8d3b87b](https://github.com/dhis2/maintenance-app-beta/commit/8d3b87b7c47399bac5a8c4b88a8c0046fd69ca74)) + +# [0.5.0](https://github.com/dhis2/maintenance-app-beta/compare/v0.4.0...v0.5.0) (2024-09-30) + + +### Features + +* **catCombo:** add category combo form and list ([#410](https://github.com/dhis2/maintenance-app-beta/issues/410)) ([7687c13](https://github.com/dhis2/maintenance-app-beta/commit/7687c13d99335154880275e7631af9c221d0aceb)) + +# [0.4.0](https://github.com/dhis2/maintenance-app-beta/compare/v0.3.1...v0.4.0) (2024-09-28) + + +### Features + +* **categories:** category forms and form refactor ([#407](https://github.com/dhis2/maintenance-app-beta/issues/407)) ([66216c4](https://github.com/dhis2/maintenance-app-beta/commit/66216c4c4c7beb11411e790fd804a0761e980b19)) +* org list deselect all + multi select actions ([56fa5fc](https://github.com/dhis2/maintenance-app-beta/commit/56fa5fc572903636e802a2ff0c47d23432abe38a)) +* remove select all checkbox from org list ([84cfd3e](https://github.com/dhis2/maintenance-app-beta/commit/84cfd3eb8d5161b3ee7d47779fae88bd13790021)) + ## [0.3.1](https://github.com/dhis2/maintenance-app-beta/compare/v0.3.0...v0.3.1) (2024-08-20) diff --git a/i18n/en.pot b/i18n/en.pot index 428511c1..8e3d64b6 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: 2024-08-28T01:15:41.705Z\n" -"PO-Revision-Date: 2024-08-28T01:15:41.705Z\n" +"POT-Creation-Date: 2024-09-30T15:09:50.864Z\n" +"PO-Revision-Date: 2024-09-30T15:09:50.864Z\n" msgid "schemas" msgstr "schemas" @@ -66,9 +66,6 @@ msgstr "All" msgid "Filter options" msgstr "Filter options" -msgid "Something went wrong when submitting the form" -msgstr "Something went wrong when submitting the form" - msgid "Save and close" msgstr "Save and close" @@ -78,6 +75,15 @@ msgstr "Exit without saving" msgid "Create {{modelName}} " msgstr "Create {{modelName}} " +msgid "Validation errors" +msgstr "Validation errors" + +msgid "Some fields have validation errors. Please fix them before saving." +msgstr "Some fields have validation errors. Please fix them before saving." + +msgid "Something went wrong when submitting the form" +msgstr "Something went wrong when submitting the form" + msgid "" msgstr "" @@ -114,6 +120,21 @@ msgstr "Failed to load {{label}}" msgid "Failed to load" msgstr "Failed to load" +msgid "Download" +msgstr "Download" + +msgid "Merge" +msgstr "Merge" + +msgid "Delete source data element values" +msgstr "Delete source data element values" + +msgid "Last updated" +msgstr "Last updated" + +msgid "Discard" +msgstr "Discard" + msgid "Aggregation level(s)" msgstr "Aggregation level(s)" @@ -213,9 +234,6 @@ msgstr "Created" msgid "Last updated by" msgstr "Last updated by" -msgid "Last updated" -msgstr "Last updated" - msgid "Id" msgstr "Id" @@ -237,9 +255,6 @@ msgstr "Details" msgid "Failed to load details" msgstr "Failed to load details" -msgid "Download" -msgstr "Download" - msgid "Download {{section}}" msgstr "Download {{section}}" @@ -276,6 +291,9 @@ msgstr "Include user sharing settings" msgid "Clear all filters" msgstr "Clear all filters" +msgid "Category" +msgstr "Category" + msgid "Type to filter options" msgstr "Type to filter options" @@ -408,9 +426,6 @@ msgstr "Edit and view" msgid "Search for a user or group" msgstr "Search for a user or group" -msgid "Category" -msgstr "Category" - msgid "Categories" msgstr "Categories" @@ -810,6 +825,9 @@ msgstr "GeoJSON" msgid "Disaggregation" msgstr "Disaggregation" +msgid "Aggregation type" +msgstr "Aggregation type" + msgid "Favorite" msgstr "Favorite" @@ -837,6 +855,21 @@ msgstr "Data dimension type" msgid "This field requires a unique value, please choose another one" msgstr "This field requires a unique value, please choose another one" +msgid "{{label}} (required)" +msgstr "{{label}} (required)" + +msgid "No changes to be saved" +msgstr "No changes to be saved" + +msgid "Saved successfully" +msgstr "Saved successfully" + +msgid "Cannot save empty object" +msgstr "Cannot save empty object" + +msgid "Created successfully" +msgstr "Created successfully" + msgid "Required" msgstr "Required" @@ -876,6 +909,30 @@ msgstr "Filter available category options" msgid "Filter selected category options" msgstr "Filter selected category options" +msgid "Choose how this category combo will be used to capture and analyze data." +msgstr "Choose how this category combo will be used to capture and analyze data." + +msgid "Skip category total in reports" +msgstr "Skip category total in reports" + +msgid "Choose the categories to include in this category combo." +msgstr "Choose the categories to include in this category combo." + +msgid "Available categories" +msgstr "Available categories" + +msgid "Selected categories" +msgstr "Selected categories" + +msgid "Filter available categories" +msgstr "Filter available categories" + +msgid "Filter selected categories" +msgstr "Filter selected categories" + +msgid "At least one category is required" +msgstr "At least one category is required" + msgid "Create data element group" msgstr "Create data element group" @@ -909,9 +966,6 @@ msgstr "The default way to aggregate this data element in analytics." msgid "Disabled for the selected value type." msgstr "Disabled for the selected value type." -msgid "Aggregation type" -msgstr "Aggregation type" - msgid "Color and icon" msgstr "Color and icon" diff --git a/package.json b/package.json index 99caa77b..0bfba2d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "maintenance-app", - "version": "0.3.1", + "version": "0.6.0", "description": "", "license": "BSD-3-Clause", "private": true, @@ -19,38 +19,40 @@ "postinstall": "yarn d2-style install" }, "devDependencies": { - "@dhis2/cli-app-scripts": "^10.3.9", + "@dhis2/cli-app-scripts": "^11.7.0", "@dhis2/cli-style": "^10.5.1", "@dhis2/cypress-commands": "^10.0.3", "@dhis2/cypress-plugins": "^10.0.3", + "@faker-js/faker": "^8.4.1", "@testing-library/jest-dom": "^6.1.2", "@testing-library/react": "^12.1.5", "@testing-library/react-hooks": "^8.0.1", - "@testing-library/user-event": "^12.8.3", + "@testing-library/user-event": "^14.5.2", "@types/jest": "^29.5.3", "@types/react": "^18.2.6", - "@typescript-eslint/eslint-plugin": "^5.55.0", - "@typescript-eslint/parser": "^5.55.0", - "cypress": "^12.14.0", - "typescript": "^5.0.4", + "@typescript-eslint/eslint-plugin": "^8.2.0", + "@typescript-eslint/parser": "^8.2.0", + "cypress": "^13.13.3", + "eslint": "^8", + "typescript": "^5.5.4", "whatwg-fetch": "^3.6.17" }, "dependencies": { "@dhis2/app-runtime": "^3.9.3", - "@dhis2/ui": "^9.2.0", + "@dhis2/ui": "^9.11.3", "@tanstack/react-table": "^8.16.0", "@types/lodash": "^4.14.198", "lodash": "^4.17.21", "react-color": "^2.19.3", "react-error-boundary": "^4.0.11", "react-final-form": "^6.5.9", - "react-router-dom": "^6.11.2", - "use-debounce": "^9.0.4", + "react-router-dom": "^6.26.1", + "use-debounce": "^10.0.3", "use-query-params": "^2.2.1", "zod": "^3.22.2", "zustand": "^4.4.0" }, "resolutions": { - "@dhis2/ui": "^9.2.0" + "eslint": "^8" } } diff --git a/src/__mocks__/schema/organisationUnitsSchema.json b/src/__mocks__/schema/organisationUnitsSchema.json new file mode 100644 index 00000000..35a8d603 --- /dev/null +++ b/src/__mocks__/schema/organisationUnitsSchema.json @@ -0,0 +1,1798 @@ +{ + "singular": "organisationUnit", + "plural": "organisationUnits", + "name": "organisationUnit", + "displayName": "Organisation Unit", + "shareable": false, + "dataShareable": false, + "authorities": [ + { + "type": "CREATE", + "authorities": ["F_ORGANISATIONUNIT_ADD"] + }, + { + "type": "DELETE", + "authorities": ["F_ORGANISATIONUNIT_DELETE"] + } + ], + "properties": { + "parent": { + "klass": "org.hisp.dhis.organisationunit.OrganisationUnit", + "propertyType": "REFERENCE", + "name": "parent", + "fieldName": "parent", + "persisted": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": true, + "nameableObject": true, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 255, + "cascade": "none", + "manyToMany": false, + "oneToOne": false, + "manyToOne": true, + "oneToMany": false, + "owningRole": "org.hisp.dhis.organisationunit.OrganisationUnit.parent", + "href": "https://debug.dhis2.org/dev/api/42/schemas/organisationUnit", + "relativeApiEndpoint": "/organisationUnits", + "apiEndpoint": "https://debug.dhis2.org/dev/api/42/organisationUnits", + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "type": { + "klass": "java.lang.String", + "propertyType": "TEXT", + "name": "type", + "fieldName": "type", + "persisted": false, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "max": 2147483647, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "path": { + "klass": "java.lang.String", + "propertyType": "TEXT", + "name": "path", + "fieldName": "path", + "persisted": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": true, + "required": false, + "length": 255, + "max": 255, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "lastUpdated": { + "klass": "java.util.Date", + "propertyType": "DATE", + "name": "lastUpdated", + "fieldName": "lastUpdated", + "persisted": true, + "description": "The date this object was last updated.", + "attribute": true, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 255, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "children": { + "klass": "java.util.Set", + "propertyType": "COLLECTION", + "itemKlass": "org.hisp.dhis.organisationunit.OrganisationUnit", + "itemPropertyType": "REFERENCE", + "name": "child", + "fieldName": "children", + "persisted": true, + "collectionName": "children", + "collectionWrapping": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": true, + "ordered": false, + "owner": false, + "identifiableObject": true, + "nameableObject": true, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "max": 1.7976931348623157e308, + "min": 0, + "cascade": "none", + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": true, + "inverseRole": "org.hisp.dhis.organisationunit.OrganisationUnit.children", + "href": "https://debug.dhis2.org/dev/api/42/schemas/organisationUnit", + "relativeApiEndpoint": "/organisationUnits", + "apiEndpoint": "https://debug.dhis2.org/dev/api/42/organisationUnits", + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "translations": { + "klass": "java.util.Set", + "propertyType": "COLLECTION", + "itemKlass": "org.hisp.dhis.translation.Translation", + "itemPropertyType": "COMPLEX", + "name": "translation", + "fieldName": "translations", + "persisted": true, + "collectionName": "translations", + "collectionWrapping": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": true, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 255, + "max": 255, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "FALSE", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "uid": { + "klass": "java.lang.String", + "propertyType": "IDENTIFIER", + "name": "id", + "fieldName": "uid", + "persisted": true, + "description": "The Unique Identifier for this Object.", + "attribute": true, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": true, + "required": false, + "length": 11, + "max": 11, + "min": 11, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "href": { + "klass": "java.lang.String", + "propertyType": "URL", + "name": "href", + "fieldName": "href", + "persisted": false, + "attribute": true, + "simple": true, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "max": 1.7976931348623157e308, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "ancestors": { + "klass": "java.util.List", + "propertyType": "COLLECTION", + "itemKlass": "org.hisp.dhis.organisationunit.OrganisationUnit", + "itemPropertyType": "REFERENCE", + "name": "organisationUnit", + "fieldName": "ancestors", + "persisted": false, + "collectionName": "ancestors", + "collectionWrapping": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": true, + "ordered": true, + "owner": false, + "identifiableObject": true, + "nameableObject": true, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": false, + "unique": false, + "required": false, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "href": "https://debug.dhis2.org/dev/api/42/schemas/organisationUnit", + "relativeApiEndpoint": "/organisationUnits", + "apiEndpoint": "https://debug.dhis2.org/dev/api/42/organisationUnits", + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "groups": { + "klass": "java.util.Set", + "propertyType": "COLLECTION", + "itemKlass": "org.hisp.dhis.organisationunit.OrganisationUnitGroup", + "itemPropertyType": "REFERENCE", + "name": "organisationUnitGroup", + "fieldName": "groups", + "persisted": true, + "collectionName": "organisationUnitGroups", + "collectionWrapping": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": true, + "ordered": false, + "owner": false, + "identifiableObject": true, + "nameableObject": true, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "max": 1.7976931348623157e308, + "min": 0, + "cascade": "none", + "manyToMany": true, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "owningRole": "org.hisp.dhis.organisationunit.OrganisationUnitGroup.members", + "inverseRole": "org.hisp.dhis.organisationunit.OrganisationUnit.groups", + "href": "https://debug.dhis2.org/dev/api/42/schemas/organisationUnitGroup", + "relativeApiEndpoint": "/organisationUnitGroups", + "apiEndpoint": "https://debug.dhis2.org/dev/api/42/organisationUnitGroups", + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "displayDescription": { + "klass": "java.lang.String", + "propertyType": "TEXT", + "name": "displayDescription", + "fieldName": "displayDescription", + "persisted": false, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": false, + "unique": false, + "required": false, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "image": { + "klass": "org.hisp.dhis.fileresource.FileResource", + "propertyType": "REFERENCE", + "name": "image", + "fieldName": "image", + "persisted": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": true, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 255, + "cascade": "none", + "manyToMany": false, + "oneToOne": false, + "manyToOne": true, + "oneToMany": false, + "owningRole": "org.hisp.dhis.organisationunit.OrganisationUnit.image", + "href": "https://debug.dhis2.org/dev/api/42/schemas/fileResource", + "relativeApiEndpoint": "/fileResources", + "apiEndpoint": "https://debug.dhis2.org/dev/api/42/fileResources", + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "lastUpdatedBy": { + "klass": "org.hisp.dhis.user.User", + "propertyType": "REFERENCE", + "name": "lastUpdatedBy", + "fieldName": "lastUpdatedBy", + "persisted": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": true, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 255, + "cascade": "none", + "manyToMany": false, + "oneToOne": false, + "manyToOne": true, + "oneToMany": false, + "owningRole": "org.hisp.dhis.organisationunit.OrganisationUnit.lastUpdatedBy", + "href": "https://debug.dhis2.org/dev/api/42/schemas/user", + "relativeApiEndpoint": "/users", + "apiEndpoint": "https://debug.dhis2.org/dev/api/42/users", + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": true + }, + "hierarchyLevel": { + "klass": "java.lang.Integer", + "propertyType": "INTEGER", + "name": "level", + "fieldName": "hierarchyLevel", + "persisted": true, + "attribute": true, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 2147483647, + "max": 2147483647, + "min": -2147483648, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "created": { + "klass": "java.util.Date", + "propertyType": "DATE", + "name": "created", + "fieldName": "created", + "persisted": true, + "description": "The date this object was created.", + "attribute": true, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 255, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "attributeValues": { + "klass": "java.util.Set", + "propertyType": "COLLECTION", + "itemKlass": "org.hisp.dhis.attribute.AttributeValue", + "itemPropertyType": "COMPLEX", + "name": "attributeValue", + "fieldName": "attributeValues", + "persisted": true, + "collectionName": "attributeValues", + "collectionWrapping": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": true, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": true, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 255, + "max": 255, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "sharing": { + "klass": "org.hisp.dhis.user.sharing.Sharing", + "propertyType": "COMPLEX", + "name": "sharing", + "fieldName": "sharing", + "persisted": false, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "max": 1.7976931348623157e308, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "FALSE", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "displayFormName": { + "klass": "java.lang.String", + "propertyType": "TEXT", + "name": "displayFormName", + "fieldName": "displayFormName", + "persisted": false, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": false, + "unique": false, + "required": false, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "users": { + "klass": "java.util.Set", + "propertyType": "COLLECTION", + "itemKlass": "org.hisp.dhis.user.User", + "itemPropertyType": "REFERENCE", + "name": "userItem", + "fieldName": "users", + "persisted": true, + "collectionName": "users", + "collectionWrapping": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": true, + "ordered": false, + "owner": false, + "identifiableObject": true, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "max": 1.7976931348623157e308, + "min": 0, + "cascade": "none", + "manyToMany": true, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "owningRole": "org.hisp.dhis.user.User.organisationUnits", + "inverseRole": "org.hisp.dhis.organisationunit.OrganisationUnit.users", + "href": "https://debug.dhis2.org/dev/api/42/schemas/user", + "relativeApiEndpoint": "/users", + "apiEndpoint": "https://debug.dhis2.org/dev/api/42/users", + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "phoneNumber": { + "klass": "java.lang.String", + "propertyType": "PHONENUMBER", + "name": "phoneNumber", + "fieldName": "phoneNumber", + "persisted": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 150, + "max": 150, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "name": { + "klass": "java.lang.String", + "propertyType": "TEXT", + "name": "name", + "fieldName": "name", + "persisted": true, + "description": "The name of this Object. Required and unique.", + "attribute": true, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": true, + "length": 230, + "max": 230, + "min": 1, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": true, + "translationKey": "NAME", + "i18nTranslationKey": "name", + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "dataSets": { + "klass": "java.util.Set", + "propertyType": "COLLECTION", + "itemKlass": "org.hisp.dhis.dataset.DataSet", + "itemPropertyType": "REFERENCE", + "name": "dataSet", + "fieldName": "dataSets", + "persisted": true, + "collectionName": "dataSets", + "collectionWrapping": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": true, + "ordered": false, + "owner": false, + "identifiableObject": true, + "nameableObject": true, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "max": 1.7976931348623157e308, + "min": 0, + "cascade": "none", + "manyToMany": true, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "owningRole": "org.hisp.dhis.dataset.DataSet.sources", + "inverseRole": "org.hisp.dhis.organisationunit.OrganisationUnit.dataSets", + "href": "https://debug.dhis2.org/dev/api/42/schemas/dataSet", + "relativeApiEndpoint": "/dataSets", + "apiEndpoint": "https://debug.dhis2.org/dev/api/42/dataSets", + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "legendSets": { + "klass": "java.util.List", + "propertyType": "COLLECTION", + "itemKlass": "org.hisp.dhis.legend.LegendSet", + "itemPropertyType": "REFERENCE", + "name": "legendSets", + "fieldName": "legendSets", + "persisted": false, + "collectionName": "legendSets", + "collectionWrapping": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": true, + "ordered": true, + "owner": false, + "identifiableObject": true, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "max": 1.7976931348623157e308, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "href": "https://debug.dhis2.org/dev/api/42/schemas/legendSet", + "relativeApiEndpoint": "/legendSets", + "apiEndpoint": "https://debug.dhis2.org/dev/api/42/legendSets", + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "programs": { + "klass": "java.util.Set", + "propertyType": "COLLECTION", + "itemKlass": "org.hisp.dhis.program.Program", + "itemPropertyType": "REFERENCE", + "name": "program", + "fieldName": "programs", + "persisted": true, + "collectionName": "programs", + "collectionWrapping": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": true, + "ordered": false, + "owner": false, + "identifiableObject": true, + "nameableObject": true, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "max": 1.7976931348623157e308, + "min": 0, + "cascade": "none", + "manyToMany": true, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "owningRole": "org.hisp.dhis.program.Program.organisationUnits", + "inverseRole": "org.hisp.dhis.organisationunit.OrganisationUnit.programs", + "href": "https://debug.dhis2.org/dev/api/42/schemas/program", + "relativeApiEndpoint": "/programs", + "apiEndpoint": "https://debug.dhis2.org/dev/api/42/programs", + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "shortName": { + "klass": "java.lang.String", + "propertyType": "TEXT", + "name": "shortName", + "fieldName": "shortName", + "persisted": true, + "attribute": true, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": true, + "length": 50, + "max": 50, + "min": 1, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": true, + "translationKey": "SHORT_NAME", + "i18nTranslationKey": "short_name", + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "favorite": { + "klass": "java.lang.Boolean", + "propertyType": "BOOLEAN", + "name": "favorite", + "fieldName": "favorite", + "persisted": false, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": false, + "unique": false, + "required": false, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "dimensionItemType": { + "klass": "org.hisp.dhis.common.DimensionItemType", + "propertyType": "CONSTANT", + "name": "dimensionItemType", + "fieldName": "dimensionItemType", + "persisted": false, + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "constants": [ + "DATA_ELEMENT", + "DATA_ELEMENT_OPERAND", + "INDICATOR", + "REPORTING_RATE", + "PROGRAM_DATA_ELEMENT", + "PROGRAM_ATTRIBUTE", + "PROGRAM_INDICATOR", + "PERIOD", + "ORGANISATION_UNIT", + "CATEGORY_OPTION", + "OPTION_GROUP", + "DATA_ELEMENT_GROUP", + "ORGANISATION_UNIT_GROUP", + "CATEGORY_OPTION_GROUP", + "EXPRESSION_DIMENSION_ITEM", + "SUBEXPRESSION_DIMENSION_ITEM" + ], + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "favorites": { + "klass": "java.util.Set", + "propertyType": "COLLECTION", + "itemKlass": "java.lang.String", + "itemPropertyType": "TEXT", + "name": "favorite", + "fieldName": "favorites", + "persisted": false, + "collectionName": "favorites", + "collectionWrapping": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": true, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "max": 1.7976931348623157e308, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "aggregationType": { + "klass": "org.hisp.dhis.analytics.AggregationType", + "propertyType": "CONSTANT", + "name": "aggregationType", + "fieldName": "aggregationType", + "persisted": false, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "constants": [ + "SUM", + "AVERAGE", + "AVERAGE_SUM_ORG_UNIT", + "LAST", + "LAST_AVERAGE_ORG_UNIT", + "LAST_LAST_ORG_UNIT", + "LAST_IN_PERIOD", + "LAST_IN_PERIOD_AVERAGE_ORG_UNIT", + "FIRST", + "FIRST_AVERAGE_ORG_UNIT", + "FIRST_FIRST_ORG_UNIT", + "COUNT", + "STDDEV", + "VARIANCE", + "MIN", + "MAX", + "MIN_SUM_ORG_UNIT", + "MAX_SUM_ORG_UNIT", + "NONE", + "CUSTOM", + "DEFAULT" + ], + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "access": { + "klass": "org.hisp.dhis.security.acl.Access", + "propertyType": "COMPLEX", + "name": "access", + "fieldName": "access", + "persisted": false, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": true, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "max": 1.7976931348623157e308, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "FALSE", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "code": { + "klass": "java.lang.String", + "propertyType": "IDENTIFIER", + "name": "code", + "fieldName": "code", + "persisted": true, + "description": "The unique code for this Object.", + "attribute": true, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": true, + "required": false, + "length": 50, + "max": 50, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "displayName": { + "klass": "java.lang.String", + "propertyType": "TEXT", + "name": "displayName", + "fieldName": "displayName", + "persisted": false, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": false, + "unique": false, + "required": false, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "contactPerson": { + "klass": "java.lang.String", + "propertyType": "TEXT", + "name": "contactPerson", + "fieldName": "contactPerson", + "persisted": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 255, + "max": 255, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "description": { + "klass": "java.lang.String", + "propertyType": "TEXT", + "name": "description", + "fieldName": "description", + "persisted": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 2147483647, + "max": 2147483647, + "min": 1, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": true, + "translationKey": "DESCRIPTION", + "i18nTranslationKey": "description", + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "displayShortName": { + "klass": "java.lang.String", + "propertyType": "TEXT", + "name": "displayShortName", + "fieldName": "displayShortName", + "persisted": false, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": false, + "unique": false, + "required": false, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "queryMods": { + "klass": "org.hisp.dhis.common.QueryModifiers", + "propertyType": "COMPLEX", + "name": "queryMods", + "fieldName": "queryMods", + "persisted": false, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "max": 1.7976931348623157e308, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "formName": { + "klass": "java.lang.String", + "propertyType": "TEXT", + "name": "formName", + "fieldName": "formName", + "persisted": false, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "max": 2147483647, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "openingDate": { + "klass": "java.util.Date", + "propertyType": "DATE", + "name": "openingDate", + "fieldName": "openingDate", + "persisted": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": true, + "length": 255, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "email": { + "klass": "java.lang.String", + "propertyType": "EMAIL", + "name": "email", + "fieldName": "email", + "persisted": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 150, + "max": 150, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "address": { + "klass": "java.lang.String", + "propertyType": "TEXT", + "name": "address", + "fieldName": "address", + "persisted": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 255, + "max": 255, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "dimensionItem": { + "klass": "java.lang.String", + "propertyType": "TEXT", + "name": "dimensionItem", + "fieldName": "dimensionItem", + "persisted": false, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": false, + "unique": false, + "required": false, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "memberCount": { + "klass": "java.lang.Integer", + "propertyType": "INTEGER", + "name": "memberCount", + "fieldName": "memberCount", + "persisted": false, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "max": 2147483647, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "leaf": { + "klass": "java.lang.Boolean", + "propertyType": "BOOLEAN", + "name": "leaf", + "fieldName": "leaf", + "persisted": false, + "attribute": true, + "simple": true, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": false, + "unique": false, + "required": false, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "url": { + "klass": "java.lang.String", + "propertyType": "URL", + "name": "url", + "fieldName": "url", + "persisted": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 255, + "max": 255, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "closedDate": { + "klass": "java.util.Date", + "propertyType": "DATE", + "name": "closedDate", + "fieldName": "closedDate", + "persisted": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 255, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "createdBy": { + "klass": "org.hisp.dhis.user.User", + "propertyType": "REFERENCE", + "name": "createdBy", + "fieldName": "createdBy", + "persisted": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": true, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 255, + "cascade": "none", + "manyToMany": false, + "oneToOne": false, + "manyToOne": true, + "oneToMany": false, + "owningRole": "org.hisp.dhis.organisationunit.OrganisationUnit.createdBy", + "href": "https://debug.dhis2.org/dev/api/42/schemas/user", + "relativeApiEndpoint": "/users", + "apiEndpoint": "https://debug.dhis2.org/dev/api/42/users", + "translatable": false, + "gistPreferences": { + "included": "FALSE", + "transformation": "AUTO" + }, + "propertyTransformer": true + }, + "legendSet": { + "klass": "org.hisp.dhis.legend.LegendSet", + "propertyType": "REFERENCE", + "name": "legendSet", + "fieldName": "legendSet", + "persisted": false, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": true, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": false, + "unique": false, + "required": false, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "href": "https://debug.dhis2.org/dev/api/42/schemas/legendSet", + "relativeApiEndpoint": "/legendSets", + "apiEndpoint": "https://debug.dhis2.org/dev/api/42/legendSets", + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "comment": { + "klass": "java.lang.String", + "propertyType": "TEXT", + "name": "comment", + "fieldName": "comment", + "persisted": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": true, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 2147483647, + "max": 2147483647, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "geometry": { + "klass": "org.locationtech.jts.geom.Geometry", + "propertyType": "COMPLEX", + "name": "geometry", + "fieldName": "geometry", + "persisted": true, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": false, + "ordered": false, + "owner": true, + "identifiableObject": false, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "length": 131072, + "max": 131072, + "min": 0, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "translatable": false, + "gistPreferences": { + "included": "FALSE", + "transformation": "AUTO" + }, + "propertyTransformer": false + }, + "user": { + "klass": "org.hisp.dhis.user.User", + "propertyType": "REFERENCE", + "name": "user", + "fieldName": "user", + "persisted": false, + "namespace": "http://dhis2.org/schema/dxf/2.0", + "attribute": false, + "simple": false, + "collection": false, + "ordered": false, + "owner": false, + "identifiableObject": true, + "nameableObject": false, + "embeddedObject": false, + "analyticalObject": false, + "readable": true, + "writable": true, + "unique": false, + "required": false, + "manyToMany": false, + "oneToOne": false, + "manyToOne": false, + "oneToMany": false, + "href": "https://debug.dhis2.org/dev/api/42/schemas/user", + "relativeApiEndpoint": "/users", + "apiEndpoint": "https://debug.dhis2.org/dev/api/42/users", + "translatable": false, + "gistPreferences": { + "included": "AUTO", + "transformation": "AUTO" + }, + "propertyTransformer": true + } + }, + "translatable": true +} diff --git a/src/app/LoadApp.spec.tsx b/src/app/LoadApp.spec.tsx index 6d20324f..7e481dee 100644 --- a/src/app/LoadApp.spec.tsx +++ b/src/app/LoadApp.spec.tsx @@ -32,7 +32,6 @@ describe('LoadApp', () => { } beforeEach(async () => { - // eslint-disable-next-line @typescript-eslint/no-extra-semi ;(useSetSchemas as jest.Mock).mockImplementation(() => setSchemaMock) ;(useSetSystemSettings as jest.Mock).mockImplementation( () => setSystemSettingsMock @@ -57,7 +56,7 @@ describe('LoadApp', () => { expect(setSchemaMock.mock.lastCall).toMatchSnapshot() }) - it('should set the current useer removing any duplicate authorities', async () => { + it('should set the current user removing any duplicate authorities', async () => { expect(setUserMock.mock.lastCall[0]).toEqual({ name: 'dhis2 user', authorities: new Set(['auth1', 'auth2-duplicated', 'auth3']), diff --git a/src/app/layout/Breadcrumb.module.css b/src/app/layout/Breadcrumb.module.css index 1d97002b..0dc3757f 100644 --- a/src/app/layout/Breadcrumb.module.css +++ b/src/app/layout/Breadcrumb.module.css @@ -1,4 +1,3 @@ - .breadcrumbWrapper { margin-bottom: 8px; } @@ -11,7 +10,7 @@ } span.breadcrumbItem { - cursor: pointer + cursor: pointer; } .breadcrumbItem:hover { diff --git a/src/app/layout/Breadcrumb.spec.tsx b/src/app/layout/Breadcrumb.spec.tsx index bbcbe628..03ce6aa6 100644 --- a/src/app/layout/Breadcrumb.spec.tsx +++ b/src/app/layout/Breadcrumb.spec.tsx @@ -76,22 +76,20 @@ describe('BreadcrumbItem', () => { }) }) describe('Breadcrumbs', () => { - it('should render crumb components in handle ', () => { + it('should render crumb components in handle', () => { const { getByText } = render(, { wrapper: HashRouter }) expect(getByText('Crumb 1')).toBeDefined() expect(getByText('Crumb 2')).toBeDefined() - }), - it('should not crash when no crumb components are in handle ', () => { - mockedUseMatches.mockReturnValue([ - mockHandle({ hideSidebar: true }), - ]) + }) + it('should not crash when no crumb components are in handle ', () => { + mockedUseMatches.mockReturnValue([mockHandle({ hideSidebar: true })]) - const { queryByText } = render() + const { queryByText } = render() - expect(queryByText('Crumb 1')).not.toBeInTheDocument() - expect(queryByText('Crumb 2')).not.toBeInTheDocument() - }) + expect(queryByText('Crumb 1')).not.toBeInTheDocument() + expect(queryByText('Crumb 2')).not.toBeInTheDocument() + }) describe('with BreadcrumbItem', () => { beforeEach(() => { diff --git a/src/app/routes/DefaultErrorRoute.tsx b/src/app/routes/DefaultErrorRoute.tsx index 2446e4f4..bef818c9 100644 --- a/src/app/routes/DefaultErrorRoute.tsx +++ b/src/app/routes/DefaultErrorRoute.tsx @@ -15,7 +15,7 @@ export const DefaultErrorRoute = () => { if (isRouteError) { title = error.statusText - message = error?.error?.message + message = error?.data?.message } return ( diff --git a/src/app/routes/Router.tsx b/src/app/routes/Router.tsx index 15798886..df1ddd24 100644 --- a/src/app/routes/Router.tsx +++ b/src/app/routes/Router.tsx @@ -6,8 +6,6 @@ import { Navigate, Route, createRoutesFromElements, - LazyRouteFunction, - RouteObject, useParams, } from 'react-router-dom' import { QueryParamProvider } from 'use-query-params' @@ -33,10 +31,24 @@ import { LegacyAppRedirect } from './LegacyAppRedirect' // see https://reactrouter.com/en/main/route/lazy#multiple-routes-in-a-single-file // Overviews are small, and the AllOverview would load all the other overviews anyway, // so it's propbably better to load them all at once + +// function foo(returnString: T): T extends true ? string : number; +// function foo(returnString: T): string | number { +// return returnString ? String(Math.random()) : Math.random(); +// } + +// function getStatsById(userId: string, timeWindow: TimeWindow, convertJSONOutput: true): Promise; +// function getStatsById(userId: string, timeWindow: TimeWindow, convertJSONOutput: false): Promise; +// function getStatsById( +// userId: string, +// timeWindow: TimeWindow = TimeWindow.Alltime, +// convertJSONOutput: boolean = true +// ): Promise + function createOverviewLazyRouteFunction( componentName: string, //keyof typeof import('../../pages/overview/'), section?: OverviewSection -): LazyRouteFunction { +) { return async () => { const routeComponent = await import(`../../pages/overview/`) const name = componentName as keyof typeof routeComponent @@ -56,7 +68,7 @@ function createOverviewLazyRouteFunction( function createSectionLazyRouteFunction( section: Section, componentFileName: string -): LazyRouteFunction { +) { return async () => { try { return await import( diff --git a/src/app/sidebar/Sidebar.spec.tsx b/src/app/sidebar/Sidebar.spec.tsx index 67c9707a..eee192c2 100644 --- a/src/app/sidebar/Sidebar.spec.tsx +++ b/src/app/sidebar/Sidebar.spec.tsx @@ -80,52 +80,56 @@ describe('Sidebar', () => { }) describe('searching', () => { - it('should filter the list when a search string is entered', () => { + it('should filter the list when a search string is entered', async () => { + const user = userEvent.setup() const { getByPlaceholderText, getByText, queryByText } = renderSideBar() expect(queryByText('Data element group')).toBeNull() - userEvent.type(getByPlaceholderText(/Search/), 'elements') + await user.type(getByPlaceholderText(/Search/), 'elements') expect(getByText('Data elements')).toBeDefined() expect(getByText('Overview')).toBeDefined() expect(getByText('Data element group')).toBeDefined() expect(getByText('Data element group set')).toBeDefined() }) - it('should allow searching for a match in a subcategory', () => { + it('should allow searching for a match in a subcategory', async () => { + const user = userEvent.setup() const { getByPlaceholderText, getByText, queryByText } = renderSideBar() expect(queryByText('Data element group')).toBeNull() - userEvent.type(getByPlaceholderText(/Search/), 'group') + await user.type(getByPlaceholderText(/Search/), 'group') expect(queryByText('Overview')).toBeNull() expect(getByText('Data element group')).toBeDefined() expect(getByText('Data element group set')).toBeDefined() }) describe('when no match', () => { - it('should display an appropriate message', () => { + it('should display an appropriate message', async () => { + const user = userEvent.setup() const { getByPlaceholderText, getByText, queryByText } = renderSideBar() expect(queryByText('Data element group')).toBeNull() - userEvent.type( + await user.type( getByPlaceholderText(/Search/), 'something not in list' ) expect(getByText(/No menu items found for/)).toBeDefined() }) - it('should still display "MetaData Overview"', () => { + it('should still display "MetaData Overview"', async () => { + const user = userEvent.setup() const { getByPlaceholderText, getByText, queryByText } = renderSideBar() expect(queryByText('Data element group')).toBeNull() - userEvent.type( + await user.type( getByPlaceholderText(/Search/), 'something not in list' ) @@ -135,13 +139,14 @@ describe('Sidebar', () => { }) }) - it('should allow tabbing through the menu', () => { + it('should allow tabbing through the menu', async () => { + const user = userEvent.setup() const { getByPlaceholderText, getByText } = renderSideBar() getByPlaceholderText(/Search/).focus() - userEvent.tab() + await user.tab() expect(getByText('Metadata Overview')).toHaveFocus() - userEvent.tab() + await user.tab() expect(getByText('Categories').parentElement).toHaveFocus() }) diff --git a/src/components/ColorAndIconPicker/IconPickerModal.module.css b/src/components/ColorAndIconPicker/IconPickerModal.module.css index 785346f4..315f3b18 100644 --- a/src/components/ColorAndIconPicker/IconPickerModal.module.css +++ b/src/components/ColorAndIconPicker/IconPickerModal.module.css @@ -25,7 +25,8 @@ cursor: pointer; } -.active, .iconContainer:hover { +.active, +.iconContainer:hover { outline: var(--colors-blue300) solid 3px; } diff --git a/src/components/SearchableSingleSelect/SearchableSingleSelect.module.css b/src/components/SearchableSingleSelect/SearchableSingleSelect.module.css index 80f24c0c..d78ac769 100644 --- a/src/components/SearchableSingleSelect/SearchableSingleSelect.module.css +++ b/src/components/SearchableSingleSelect/SearchableSingleSelect.module.css @@ -43,7 +43,7 @@ position: sticky; top: 0; padding: var(--spacers-dp16); - box-shadow: 0 0 4px rgba(0,0,0,0.4); + box-shadow: 0 0 4px rgba(0, 0, 0, 0.4); background: var(--colors-white); } diff --git a/src/components/form/DefaultFormContents.tsx b/src/components/form/DefaultFormContents.tsx index c2036901..c200b1e4 100644 --- a/src/components/form/DefaultFormContents.tsx +++ b/src/components/form/DefaultFormContents.tsx @@ -1,12 +1,12 @@ import i18n from '@dhis2/d2-i18n' -import { NoticeBox } from '@dhis2/ui' -import React, { useEffect, useRef } from 'react' +import React from 'react' import { useFormState } from 'react-final-form' import { useNavigate } from 'react-router-dom' import { getSectionPath } from '../../lib' import { ModelSection } from '../../types' import { StandardFormSection, StandardFormActions } from '../standardForm' import classes from './DefaultFormContents.module.css' +import { DefaultFormErrorNotice } from './DefaultFormErrorNotice' export function DefaultEditFormContents({ children, @@ -15,37 +15,22 @@ export function DefaultEditFormContents({ children: React.ReactNode section: ModelSection }) { - const { submitting, submitError } = useFormState({ - subscription: { submitting: true, submitError: true }, + const { submitting } = useFormState({ + subscription: { submitting: true }, }) - - const formErrorRef = useRef(null) const navigate = useNavigate() const listPath = `/${getSectionPath(section)}` - useEffect(() => { - if (submitError) { - formErrorRef.current?.scrollIntoView({ behavior: 'smooth' }) - } - }, [submitError]) return ( <> -
{children}
- {submitError && ( +
+ {children} + -
- - {submitError} - -
+
- )} +
(null) const navigate = useNavigate() const listPath = `/${getSectionPath(section)}` - useEffect(() => { - if (submitError) { - formErrorRef.current?.scrollIntoView({ behavior: 'smooth' }) - } - }, [submitError]) return (
{children} - {submitError && ( - -
- - {submitError} - -
-
- )} + + + , + keyof typeof formStateSubscriptions +> + +export function DefaultFormErrorNotice() { + const partialFormState: FormStateErrors = useFormState({ + subscription: formStateSubscriptions, + }) + // only show after trying to submit + if ( + !partialFormState.submitFailed || + (partialFormState.submitFailed && partialFormState.dirtySinceLastSubmit) + ) { + return null + } + + if (partialFormState.hasValidationErrors) { + return + } + + if (partialFormState.hasSubmitErrors) { + return + } + return null +} + +const ValidationErrors = ({ + formStateErrors, +}: { + formStateErrors: FormStateErrors +}) => { + const ref = useRef(null) + useEffect(() => { + if (ref.current) { + ref.current.scrollIntoView({ behavior: 'smooth' }) + } + }, []) + return ( +
+ +

+ {i18n.t( + 'Some fields have validation errors. Please fix them before saving.' + )} +

+ {formStateErrors.errors && ( + + )} +
+
+ ) +} + +const ErrorList = ({ errors }: { errors: Record }) => { + const labels = getFieldLabelsBestEffort() + + return ( +
    + {Object.entries(errors).map(([key, value]) => { + return ( +
  • + + {labels.get(key) || key}: + + {value} +
  • + ) + })} +
+ ) +} + +const ServerSubmitError = ({ + formStateErrors, +}: { + formStateErrors: FormStateErrors +}) => { + const ref = useRef(null) + useEffect(() => { + if (ref.current) { + ref.current.scrollIntoView({ behavior: 'smooth' }) + } + }, []) + return ( +
+ +

{formStateErrors.submitError}

+
+
+ ) +} + +/** + * We don't have a good way to get the translated labels, so for now + * we get these from the DOM. This is a best-effort approach. + * TODO: Find a better way to get the labels, eg. by wrapping Field components + * in a generic component that can register fields with metadata such as labels. + */ +const getFieldLabelsBestEffort = () => { + const labels = Array.from(document.getElementsByTagName('label')) + .filter((elem) => elem.htmlFor) + .map((elem) => { + const fieldName = elem.htmlFor + const label = elem.firstChild?.textContent + ?.replace('(required)', '') + .trim() + return [fieldName, label] as const + }) + return new Map(labels) +} diff --git a/src/components/form/helpers/HorizontalFieldGroup.module.css b/src/components/form/helpers/HorizontalFieldGroup.module.css index a5611f9b..8479e4e0 100644 --- a/src/components/form/helpers/HorizontalFieldGroup.module.css +++ b/src/components/form/helpers/HorizontalFieldGroup.module.css @@ -1,6 +1,4 @@ - .horizontalField div { display: flex; gap: var(--spacers-dp16); } - diff --git a/src/components/loading/Loader.module.css b/src/components/loading/Loader.module.css index 8eca75f2..c3531c39 100644 --- a/src/components/loading/Loader.module.css +++ b/src/components/loading/Loader.module.css @@ -1,4 +1,3 @@ - .loadingSpinner { margin: var(--spacers-dp8) auto; } diff --git a/src/components/metadataFormControls/ModelTransfer/ModelTransfer.module.css b/src/components/metadataFormControls/ModelTransfer/ModelTransfer.module.css index 0579f41d..ec1aea1e 100644 --- a/src/components/metadataFormControls/ModelTransfer/ModelTransfer.module.css +++ b/src/components/metadataFormControls/ModelTransfer/ModelTransfer.module.css @@ -1,5 +1,3 @@ - - .modelTransferField { width: 100%; } diff --git a/src/components/metadataFormControls/ModelTransfer/ModelTransfer.tsx b/src/components/metadataFormControls/ModelTransfer/ModelTransfer.tsx index 045ae1e9..8629c43a 100644 --- a/src/components/metadataFormControls/ModelTransfer/ModelTransfer.tsx +++ b/src/components/metadataFormControls/ModelTransfer/ModelTransfer.tsx @@ -1,6 +1,7 @@ import { Transfer, TransferProps } from '@dhis2/ui' import React, { forwardRef, + RefAttributes, useImperativeHandle, useMemo, useState, @@ -44,12 +45,12 @@ type ModelTransferProps = Omit< > & OwnProps -export const ModelTransfer = forwardRef(function ModelTransfer< - TModel extends DisplayableModel ->( +type ImperativeRef = { refetch: () => void } + +const BaseModelTransfer = ( { selected, onChange, query, ...transferProps }: ModelTransferProps, - ref: React.Ref<{ refetch: () => void }> -) { + ref: React.Ref +) => { const queryFn = useBoundResourceQueryFn() const [searchTerm, setSearchTerm] = useState('') @@ -125,4 +126,15 @@ export const ModelTransfer = forwardRef(function ModelTransfer< onChange={handleOnChange} /> ) -}) +} + +// this is needed to support generics with ref-forwarding +interface ModelTransferWithForwardedRef + extends React.FC> { + ( + props: ModelTransferProps & RefAttributes + ): React.ReactNode +} + +export const ModelTransfer: ModelTransferWithForwardedRef = + forwardRef(BaseModelTransfer) diff --git a/src/components/metadataFormControls/ModelTransfer/ModelTransferField.tsx b/src/components/metadataFormControls/ModelTransfer/ModelTransferField.tsx index 9ba6ca7d..2a04a0a7 100644 --- a/src/components/metadataFormControls/ModelTransfer/ModelTransferField.tsx +++ b/src/components/metadataFormControls/ModelTransfer/ModelTransferField.tsx @@ -1,5 +1,5 @@ import i18n from '@dhis2/d2-i18n' -import { ButtonStrip, Button, Field, TransferProps } from '@dhis2/ui' +import { Button, ButtonStrip, Field, TransferProps } from '@dhis2/ui' import React, { useRef } from 'react' import { useField } from 'react-final-form' import { useHref } from 'react-router' @@ -9,6 +9,9 @@ import { PlainResourceQuery } from '../../../types' import { LinkButton } from '../../LinkButton' import css from './ModelTransfer.module.css' +// this currently does not need a generic, because the value of the field is not passed +// or available from props. However if it's made available, +// the generic of should be added. type ModelTransferFieldProps = { name: string query: PlainResourceQuery @@ -23,7 +26,7 @@ type ModelTransferFieldProps = { | 'filterPlaceholderPicked' > -export function ModelTransferField({ +export function ModelTransferField({ name, query, label, @@ -35,7 +38,7 @@ export function ModelTransferField({ filterPlaceholderPicked, }: ModelTransferFieldProps) { const modelName = query.resource - const { input, meta } = useField(name, { + const { input, meta } = useField(name, { multiple: true, validateFields: [], }) diff --git a/src/components/sectionList/SectionList.tsx b/src/components/sectionList/SectionList.tsx index 1abb07e7..d6c7e863 100644 --- a/src/components/sectionList/SectionList.tsx +++ b/src/components/sectionList/SectionList.tsx @@ -16,7 +16,7 @@ import { SelectedColumns } from './types' type SectionListProps = { headerColumns: SelectedColumns - onSelectAll: (checked: boolean) => void + onSelectAll?: (checked: boolean) => void allSelected?: boolean } @@ -31,13 +31,17 @@ export const SectionList = ({ - - onSelectAll(checked) - } - /> + {onSelectAll && ( + + onSelectAll!(checked) + } + /> + )} {headerColumns.length > 0 && ( diff --git a/src/components/sectionList/detailsPanel/DetailsPanel.tsx b/src/components/sectionList/detailsPanel/DetailsPanel.tsx index 52d63885..e5937a11 100644 --- a/src/components/sectionList/detailsPanel/DetailsPanel.tsx +++ b/src/components/sectionList/detailsPanel/DetailsPanel.tsx @@ -13,7 +13,7 @@ type DetailsPanelProps = { export const DetailsPanel = ({ children, onClose }: DetailsPanelProps) => { return (