@openmrs/esm-report-builder 0.1.1-pre.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +5 -0
- package/.eslintrc.js +19 -0
- package/.prettierrc +8 -0
- package/.tx/config +12 -0
- package/LICENSE +401 -0
- package/README.md +336 -0
- package/__mocks__/react-i18next.js +12 -0
- package/dist/162.js +1 -0
- package/dist/162.js.map +1 -0
- package/dist/184.js +2 -0
- package/dist/184.js.LICENSE.txt +14 -0
- package/dist/184.js.map +1 -0
- package/dist/242.js +2 -0
- package/dist/242.js.LICENSE.txt +21 -0
- package/dist/242.js.map +1 -0
- package/dist/253.js +1 -0
- package/dist/253.js.map +1 -0
- package/dist/300.js +1 -0
- package/dist/311.js +1 -0
- package/dist/311.js.map +1 -0
- package/dist/469.js +2 -0
- package/dist/469.js.LICENSE.txt +45 -0
- package/dist/469.js.map +1 -0
- package/dist/478.js +2 -0
- package/dist/478.js.LICENSE.txt +9 -0
- package/dist/478.js.map +1 -0
- package/dist/539.js +1 -0
- package/dist/539.js.map +1 -0
- package/dist/540.js +2 -0
- package/dist/540.js.LICENSE.txt +9 -0
- package/dist/540.js.map +1 -0
- package/dist/669.js +1 -0
- package/dist/669.js.map +1 -0
- package/dist/710.js +1 -0
- package/dist/710.js.map +1 -0
- package/dist/729.js +1 -0
- package/dist/729.js.map +1 -0
- package/dist/838.js +2 -0
- package/dist/838.js.LICENSE.txt +9 -0
- package/dist/838.js.map +1 -0
- package/dist/917.js +1 -0
- package/dist/917.js.map +1 -0
- package/dist/961.js +2 -0
- package/dist/961.js.LICENSE.txt +19 -0
- package/dist/961.js.map +1 -0
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -0
- package/dist/openmrs-esm-report-builder.js +1 -0
- package/dist/openmrs-esm-report-builder.js.buildmanifest.json +530 -0
- package/dist/openmrs-esm-report-builder.js.map +1 -0
- package/dist/routes.json +1 -0
- package/e2e/core/env.ts +5 -0
- package/e2e/core/global-setup.ts +34 -0
- package/e2e/core/test.ts +21 -0
- package/e2e/pages/app-shell.page.ts +34 -0
- package/e2e/pages/etl-sources.page.ts +35 -0
- package/e2e/pages/report-sections.page.ts +20 -0
- package/e2e/pages/section-preview.modal.ts +29 -0
- package/e2e/specs/etl-sources.spec.ts +51 -0
- package/e2e/specs/navigation.spec.ts +13 -0
- package/e2e/specs/section-preview-validation.spec.ts +38 -0
- package/e2e/specs/section-preview.spec.ts +94 -0
- package/e2e/support/github/Dockerfile +22 -0
- package/e2e/support/github/Dockerfile.dockerignore +13 -0
- package/e2e/support/github/docker-compose.yml +31 -0
- package/e2e/support/github/run-e2e-docker-env.sh +131 -0
- package/e2e/support/github/spa-assemble-config.json +9 -0
- package/e2e/tsconfig.json +11 -0
- package/example.env +5 -0
- package/jest.config.js +28 -0
- package/linelist_report_builder_design_spec.md +816 -0
- package/package.json +111 -0
- package/playwright.config.ts +28 -0
- package/routes.json +22 -0
- package/src/__debug__/all-designs.test.tsx +30 -0
- package/src/admin-card-link.extension.module.scss +55 -0
- package/src/admin-card-link.extension.tsx +24 -0
- package/src/components/admin/admin-page.component.tsx +75 -0
- package/src/components/admin/age-categories-page.component.tsx +109 -0
- package/src/components/admin/age-groups-page.component.tsx +146 -0
- package/src/components/admin/etl-browser/columns-tab.component.tsx +80 -0
- package/src/components/admin/etl-browser/etl-browser-page.component.tsx +309 -0
- package/src/components/admin/etl-browser/etl-browser.component.scss +424 -0
- package/src/components/admin/etl-browser/metadata-tab.component.tsx +65 -0
- package/src/components/admin/etl-browser/preview-grid.component.tsx +189 -0
- package/src/components/admin/etl-browser/relationships-tab.component.tsx +21 -0
- package/src/components/admin/etl-browser/sources-tree.component.tsx +118 -0
- package/src/components/admin/etl-browser/table-detail.component.tsx +124 -0
- package/src/components/admin/etl-browser/table-info-strip.component.tsx +51 -0
- package/src/components/admin/etl-browser/table-list.component.tsx +136 -0
- package/src/components/admin/etl-browser/use-table-preview.ts +47 -0
- package/src/components/admin/etl-sources-page.component.tsx +355 -0
- package/src/components/admin/etl-tasks-page.component.scss +370 -0
- package/src/components/admin/etl-tasks-page.component.tsx +768 -0
- package/src/components/admin/report-categories-page.component.tsx +267 -0
- package/src/components/admin/report-library-page.component.tsx +551 -0
- package/src/components/ai-support/ai-assist-button.component.tsx +30 -0
- package/src/components/ai-support/ai-assist-modal.component.tsx +81 -0
- package/src/components/ai-support/ai.service.ts +21 -0
- package/src/components/ai-support/ai.types.ts +12 -0
- package/src/components/app-shell/report-builder-shell.component.tsx +242 -0
- package/src/components/app-shell/report-builder-shell.scss +18 -0
- package/src/components/dashboards/dashboard-config.schema.ts +97 -0
- package/src/components/dashboards/dashboard-form-modal.component.tsx +150 -0
- package/src/components/dashboards/dashboards-admin.scss +62 -0
- package/src/components/dashboards/dashboards-page.component.tsx +153 -0
- package/src/components/dashboards/dashboards-table.component.tsx +130 -0
- package/src/components/dashboards/sections/dashboard-autoinclude.section.tsx +75 -0
- package/src/components/dashboards/sections/dashboard-basics.section.tsx +80 -0
- package/src/components/dashboards/sections/dashboard-json.section.tsx +79 -0
- package/src/components/dashboards/sections/dashboard-sections-editor.section.tsx +130 -0
- package/src/components/dashboards/sections/dashboard-widgets-editor.section.tsx +184 -0
- package/src/components/data-themes/data-theme-form.component.tsx +59 -0
- package/src/components/data-themes/data-theme-modal.component.tsx +349 -0
- package/src/components/data-themes/data-themes-page.component.tsx +139 -0
- package/src/components/data-themes/data-themes-table.component.tsx +98 -0
- package/src/components/data-themes/icon-registry.ts +35 -0
- package/src/components/data-themes/sections/data-theme-basics.section.tsx +63 -0
- package/src/components/data-themes/sections/data-theme-condition-columns.section.tsx +397 -0
- package/src/components/data-themes/sections/data-theme-fields-editor.section.tsx +125 -0
- package/src/components/data-themes/sections/data-theme-metadata.section.tsx +245 -0
- package/src/components/data-themes/sections/data-theme-preview.section.tsx +115 -0
- package/src/components/data-themes/sections/data-theme-source.section.tsx +184 -0
- package/src/components/data-visualizer/components/cqi-components/cqi-data-table.component.tsx +214 -0
- package/src/components/data-visualizer/components/cqi-components/cqi-elements.ts +203 -0
- package/src/components/data-visualizer/components/cqi-components/detail.component.tsx +110 -0
- package/src/components/data-visualizer/components/cqi-components/detail.scss +22 -0
- package/src/components/data-visualizer/components/data-table/data-table.component.tsx +208 -0
- package/src/components/data-visualizer/components/data-table/data-tables.scss +206 -0
- package/src/components/data-visualizer/components/empty-state/empty-state-illustration.component.tsx +53 -0
- package/src/components/data-visualizer/components/header/header.component.tsx +43 -0
- package/src/components/data-visualizer/components/header/header.scss +71 -0
- package/src/components/data-visualizer/components/model/confirm.component.tsx +40 -0
- package/src/components/data-visualizer/components/panel/panel.component.tsx +20 -0
- package/src/components/data-visualizer/components/panel/panel.scss +25 -0
- package/src/components/data-visualizer/components/popover/modifier-panel.tsx +53 -0
- package/src/components/data-visualizer/constants.ts +445 -0
- package/src/components/data-visualizer/data-visualizer-illustration.component.tsx +31 -0
- package/src/components/data-visualizer/data-visualizer.component.tsx +1935 -0
- package/src/components/data-visualizer/data-visualizer.resource.ts +462 -0
- package/src/components/data-visualizer/data-visualizer.scss +449 -0
- package/src/components/data-visualizer/declarations.d.ts +131 -0
- package/src/components/data-visualizer/parameter-inputs/boolean-parameter-input.component.tsx +34 -0
- package/src/components/data-visualizer/parameter-inputs/concept-parameter-input.component.tsx +81 -0
- package/src/components/data-visualizer/parameter-inputs/date-parameter-input.component.tsx +110 -0
- package/src/components/data-visualizer/parameter-inputs/date-range-input.component.scss +47 -0
- package/src/components/data-visualizer/parameter-inputs/date-range-input.component.tsx +228 -0
- package/src/components/data-visualizer/parameter-inputs/identifier-type-parameter-input.component.tsx +69 -0
- package/src/components/data-visualizer/parameter-inputs/list-parameter-input.component.tsx +73 -0
- package/src/components/data-visualizer/parameter-inputs/location-parameter-input.component.tsx +81 -0
- package/src/components/data-visualizer/parameter-inputs/number-parameter-input.component.tsx +40 -0
- package/src/components/data-visualizer/parameter-inputs/person-attribute-parameter-input.component.tsx +71 -0
- package/src/components/data-visualizer/parameter-inputs/text-parameter-input.component.tsx +52 -0
- package/src/components/data-visualizer/report-parameter-modal.component.tsx +383 -0
- package/src/components/data-visualizer/types.ts +206 -0
- package/src/components/etl-monitor/builder/builder-state-machine.ts +381 -0
- package/src/components/etl-monitor/builder/design-registry.tsx +139 -0
- package/src/components/etl-monitor/builder/etl-monitor-builder-context.tsx +702 -0
- package/src/components/etl-monitor/builder/etl-monitor-builder-modal.component.tsx +461 -0
- package/src/components/etl-monitor/builder/etl-monitor-builder-modal.scss +256 -0
- package/src/components/etl-monitor/builder/etl-monitor-builder-page.component.tsx +387 -0
- package/src/components/etl-monitor/builder/etl-monitor-builder-page.scss +976 -0
- package/src/components/etl-monitor/builder/generated-config-panel.component.tsx +168 -0
- package/src/components/etl-monitor/builder/generated-config-panel.scss +198 -0
- package/src/components/etl-monitor/builder/index.ts +5 -0
- package/src/components/etl-monitor/builder/monitor-preview.tsx +124 -0
- package/src/components/etl-monitor/builder/steps/data-source-step.component.tsx +667 -0
- package/src/components/etl-monitor/builder/steps/data-source-step.scss +284 -0
- package/src/components/etl-monitor/builder/steps/design-samples.ts +278 -0
- package/src/components/etl-monitor/builder/steps/design-step.component.tsx +299 -0
- package/src/components/etl-monitor/builder/steps/design-step.scss +479 -0
- package/src/components/etl-monitor/builder/steps/fields-step.component.tsx +859 -0
- package/src/components/etl-monitor/builder/steps/fields-step.scss +459 -0
- package/src/components/etl-monitor/builder/steps/general-step.component.tsx +288 -0
- package/src/components/etl-monitor/builder/steps/general-step.scss +103 -0
- package/src/components/etl-monitor/builder/steps/index.ts +5 -0
- package/src/components/etl-monitor/builder/steps/preview-step.component.tsx +245 -0
- package/src/components/etl-monitor/builder/steps/preview-step.scss +236 -0
- package/src/components/etl-monitor/etl-monitor-card-shell.component.tsx +154 -0
- package/src/components/etl-monitor/etl-monitor-card-shell.scss +103 -0
- package/src/components/etl-monitor/etl-monitor-dashboard.component.tsx +227 -0
- package/src/components/etl-monitor/etl-monitor-dashboard.scss +148 -0
- package/src/components/etl-monitor/etl-monitor-status-card.component.tsx +192 -0
- package/src/components/etl-monitor/etl-monitors-page.component.tsx +621 -0
- package/src/components/etl-monitor/renderers/DetailsRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/ErrorLogRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/EtlMonitorWidget.tsx +97 -0
- package/src/components/etl-monitor/renderers/MetricsGridRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/MonitorRenderer.tsx +175 -0
- package/src/components/etl-monitor/renderers/ProgressRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/StatusCardRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/SummaryCardRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/TableRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/component-icons.tsx +33 -0
- package/src/components/etl-monitor/renderers/components/details-renderer.tsx +195 -0
- package/src/components/etl-monitor/renderers/components/error-log-renderer.tsx +104 -0
- package/src/components/etl-monitor/renderers/components/index.ts +6 -0
- package/src/components/etl-monitor/renderers/components/log-renderer.tsx +86 -0
- package/src/components/etl-monitor/renderers/components/metrics-grid-renderer.tsx +133 -0
- package/src/components/etl-monitor/renderers/components/progress-renderer.tsx +188 -0
- package/src/components/etl-monitor/renderers/components/status-card-renderer.tsx +247 -0
- package/src/components/etl-monitor/renderers/components/summary-card-renderer.tsx +160 -0
- package/src/components/etl-monitor/renderers/components/table-renderer.tsx +175 -0
- package/src/components/etl-monitor/renderers/components/time-series-renderer.tsx +310 -0
- package/src/components/etl-monitor/renderers/data-transformer.ts +361 -0
- package/src/components/etl-monitor/renderers/index.ts +11 -0
- package/src/components/etl-monitor/renderers/legacy-monitor-renderer.tsx +69 -0
- package/src/components/etl-monitor/renderers/monitor-renderer.tsx +6 -0
- package/src/components/etl-monitor/renderers/monitor-renderers.scss +1621 -0
- package/src/components/etl-monitor/renderers/monitor-widget-card.component.tsx +54 -0
- package/src/components/etl-monitor/renderers/monitor-widget-card.scss +16 -0
- package/src/components/etl-monitor/renderers/v2-monitor-renderer.tsx +227 -0
- package/src/components/import-export/artifact-groups.ts +153 -0
- package/src/components/import-export/export-report-modal.component.tsx +265 -0
- package/src/components/import-export/import-export-page.component.tsx +610 -0
- package/src/components/import-export/import-export.styles.scss +825 -0
- package/src/components/import-export/import-package-modal.component.tsx +401 -0
- package/src/components/import-export/index.ts +3 -0
- package/src/components/indicators/README.md +24 -0
- package/src/components/indicators/base-indicator-basic-fields.component.tsx +18 -0
- package/src/components/indicators/base-indicator-basics.section.tsx +54 -0
- package/src/components/indicators/base-indicator-countby.section.tsx +25 -0
- package/src/components/indicators/base-indicator-criteria.section.tsx +83 -0
- package/src/components/indicators/base-indicator-details-form.component.tsx +80 -0
- package/src/components/indicators/base-indicator-theme-unit-fields.component.tsx +39 -0
- package/src/components/indicators/create-base-indicator-modal.component.tsx +623 -0
- package/src/components/indicators/create-composite-base-indicator-modal.component.tsx +295 -0
- package/src/components/indicators/create-custom-indicator-modal.component.tsx +548 -0
- package/src/components/indicators/create-final-indicator-modal.component.tsx +285 -0
- package/src/components/indicators/custom-condition-input.component.tsx +310 -0
- package/src/components/indicators/diagnosis-filters-form.component.tsx +101 -0
- package/src/components/indicators/disaggregation-panel.component.tsx +93 -0
- package/src/components/indicators/handler/concept-search-multiselect.component.tsx +153 -0
- package/src/components/indicators/handler/question-answer-concept-search.component.tsx +336 -0
- package/src/components/indicators/indicator-run-preview-modal.component.tsx +391 -0
- package/src/components/indicators/indicator-search-select.component.tsx +297 -0
- package/src/components/indicators/indicator-status-tag.component.tsx +9 -0
- package/src/components/indicators/indicators-page.component.tsx +673 -0
- package/src/components/indicators/indicators-page.scss +121 -0
- package/src/components/indicators/indicators-table.component.tsx +188 -0
- package/src/components/indicators/preview-table.component.tsx +31 -0
- package/src/components/indicators/sections/composite-indicator-basics.section.tsx +36 -0
- package/src/components/indicators/sections/composite-indicator-picker.section.tsx +116 -0
- package/src/components/indicators/sections/composite-indicator-sql-preview.section.tsx +31 -0
- package/src/components/indicators/sections/custom-indicator-basics.section.tsx +65 -0
- package/src/components/indicators/sections/custom-indicator-disaggregation.section.tsx +93 -0
- package/src/components/indicators/sections/custom-indicator-filters.section.tsx +203 -0
- package/src/components/indicators/sections/custom-indicator-population.section.tsx +107 -0
- package/src/components/indicators/sections/custom-indicator-sql-preview.section.tsx +108 -0
- package/src/components/indicators/sections/final-indicator-basics.section.tsx +46 -0
- package/src/components/indicators/sections/final-indicator-disaggregation.section.tsx +47 -0
- package/src/components/indicators/sections/final-indicator-picker.section.tsx +60 -0
- package/src/components/indicators/sections/final-indicator-preview.section.tsx +20 -0
- package/src/components/indicators/sections/final-indicator-results-preview.section.tsx +65 -0
- package/src/components/indicators/sections/indicator-basics.section.tsx +40 -0
- package/src/components/indicators/sections/indicator-conditions.section.tsx +279 -0
- package/src/components/indicators/sections/indicator-sql-preview.section.tsx +63 -0
- package/src/components/indicators/sections/indicator-theme.section.tsx +48 -0
- package/src/components/indicators/sql-preview.component.tsx +19 -0
- package/src/components/indicators/tag-input.component.tsx +177 -0
- package/src/components/indicators/types/base-indicator-form.types.ts +17 -0
- package/src/components/indicators/types/base-indicator-theme.constants.ts +8 -0
- package/src/components/indicators/types/composite-indicator.types.ts +27 -0
- package/src/components/indicators/types/condition-ui.types.ts +11 -0
- package/src/components/indicators/types/custom-indicator.types.ts +161 -0
- package/src/components/indicators/types/data-theme-config.types.ts +88 -0
- package/src/components/indicators/types/indicator-types.ts +57 -0
- package/src/components/indicators/types/sql-builders.ts +43 -0
- package/src/components/indicators/utils/composite-indicator-sql.utils.test.ts +143 -0
- package/src/components/indicators/utils/composite-indicator-sql.utils.ts +426 -0
- package/src/components/indicators/utils/concept-preload.utils.ts +21 -0
- package/src/components/indicators/utils/custom-indicator-interpreter.test.ts +493 -0
- package/src/components/indicators/utils/custom-indicator-interpreter.ts +702 -0
- package/src/components/indicators/utils/final-indicator-sql.utils.ts +190 -0
- package/src/components/indicators/utils/indicator-conditions-hydration.utils.ts +254 -0
- package/src/components/indicators/utils/indicator-sql-resolution.utils.ts +204 -0
- package/src/components/indicators/utils/indicator-sql.utils.ts +721 -0
- package/src/components/indicators/utils/population-sql.compiler.test.ts +999 -0
- package/src/components/indicators/utils/population-sql.compiler.ts +858 -0
- package/src/components/landing/landing-action-item.component.tsx +50 -0
- package/src/components/landing/landing-action-list.component.tsx +12 -0
- package/src/components/landing/landing-activity-list.component.tsx +47 -0
- package/src/components/landing/landing-footer-grid.component.tsx +45 -0
- package/src/components/landing/landing-hero.component.tsx +18 -0
- package/src/components/landing/landing-section-card.component.tsx +33 -0
- package/src/components/landing/report-builder-landing-page.component.tsx +186 -0
- package/src/components/landing/report-builder-landing-page.scss +131 -0
- package/src/components/legacy-reports/legacy-report-detail-page.component.tsx +300 -0
- package/src/components/legacy-reports/legacy-report-editor-page.component.tsx +324 -0
- package/src/components/legacy-reports/legacy-report-upload-modal.component.tsx +307 -0
- package/src/components/legacy-reports/legacy-reports-page.component.tsx +206 -0
- package/src/components/legacy-reports/legacy-reports-table.component.tsx +154 -0
- package/src/components/legacy-reports/tabs/legacy-report-datasets-tab.component.tsx +344 -0
- package/src/components/legacy-reports/tabs/legacy-report-dimensions-tab.component.tsx +590 -0
- package/src/components/legacy-reports/tabs/legacy-report-indicators-tab.component.tsx +490 -0
- package/src/components/legacy-reports/tabs/legacy-report-json-preview-tab.component.tsx +272 -0
- package/src/components/legacy-reports/tabs/legacy-report-overview-tab.component.tsx +218 -0
- package/src/components/legacy-reports/tabs/legacy-report-parameters-tab.component.tsx +279 -0
- package/src/components/linelist/definition/indicator-to-sql.utils.ts +281 -0
- package/src/components/linelist/definition/linelist-definition-editor.component.tsx +1676 -0
- package/src/components/linelist/definition/linelist-definition-editor.scss +461 -0
- package/src/components/linelist/definition/linelist-definition.types.ts +108 -0
- package/src/components/linelist/definition/panels/column-properties-panel.component.tsx +328 -0
- package/src/components/linelist/definition/panels/column-selector-panel.component.tsx +1082 -0
- package/src/components/linelist/definition/panels/column-selector-panel.scss +100 -0
- package/src/components/linelist/definition/panels/custom-sql-column-modal.component.tsx +248 -0
- package/src/components/linelist/definition/panels/encounter-diagnosis-column-modal.component.tsx +300 -0
- package/src/components/linelist/definition/panels/encounter-diagnosis-column-modal.scss +21 -0
- package/src/components/linelist/definition/panels/multi-datasource-selector.component.tsx +332 -0
- package/src/components/linelist/definition/panels/multi-datasource-selector.scss +161 -0
- package/src/components/linelist/definition/panels/observation-column-modal.component.tsx +450 -0
- package/src/components/linelist/definition/panels/observation-column-modal.scss +29 -0
- package/src/components/linelist/definition/panels/parameter-panel.component.tsx +659 -0
- package/src/components/linelist/definition/panels/parameter-panel.scss +64 -0
- package/src/components/linelist/definition/panels/population-source-selector.component.tsx +407 -0
- package/src/components/linelist/definition/panels/population-source-selector.scss +187 -0
- package/src/components/linelist/design/panels/column-category-selector.component.tsx +433 -0
- package/src/components/linelist/design/panels/column-category-selector.scss +329 -0
- package/src/components/linelist/design/panels/column-debug-panel.component.tsx +197 -0
- package/src/components/linelist/design/panels/column-debug-panel.scss +141 -0
- package/src/components/linelist/design/panels/data-catalogue.component.tsx +1062 -0
- package/src/components/linelist/design/panels/data-catalogue.scss +263 -0
- package/src/components/linelist/design/panels/display-settings-panel.component.tsx +405 -0
- package/src/components/linelist/design/panels/display-settings-panel.scss +78 -0
- package/src/components/linelist/design/panels/filtermap-editor.component.tsx +434 -0
- package/src/components/linelist/design/panels/filtermap-editor.scss +176 -0
- package/src/components/linelist/design/panels/json-preview.component.tsx +114 -0
- package/src/components/linelist/design/panels/json-preview.scss +85 -0
- package/src/components/linelist/design/panels/query-config-panel.component.tsx +1137 -0
- package/src/components/linelist/design/panels/query-config-panel.scss +342 -0
- package/src/components/linelist/design/panels/sort-config-panel.component.tsx +330 -0
- package/src/components/linelist/design/panels/sort-config-panel.scss +77 -0
- package/src/components/linelist/design/panels/sql-builder-panel.component.tsx +475 -0
- package/src/components/linelist/design/panels/sql-builder-panel.scss +226 -0
- package/src/components/linelist/design/panels/transformation-panel.component.tsx +687 -0
- package/src/components/linelist/design/panels/transformation-panel.scss +81 -0
- package/src/components/linelist/design/panels/visual-filter-panel.component.tsx +595 -0
- package/src/components/linelist/design/panels/visual-filter-panel.scss +76 -0
- package/src/components/linelist/linelist-dashboard.page.component.tsx +756 -0
- package/src/components/linelist/linelist-dashboard.page.scss +240 -0
- package/src/components/linelist/linelist-editor.page.component.tsx +134 -0
- package/src/components/linelist/linelist-editor.page.scss +28 -0
- package/src/components/linelist/linelist-run-report.page.component.tsx +715 -0
- package/src/components/linelist/linelist-run-report.page.scss +136 -0
- package/src/components/linelist/modals/linelist-report-builder-modal.component.tsx +1454 -0
- package/src/components/linelist/modals/linelist-report-builder-modal.scss +164 -0
- package/src/components/linelist/modals/preview-parameter-modal.component.tsx +361 -0
- package/src/components/report/dashboard/reports-table.component.tsx +186 -0
- package/src/components/report/definition/panels/properties-panel.component.tsx +38 -0
- package/src/components/report/definition/panels/report-structure-panel.component.tsx +61 -0
- package/src/components/report/definition/panels/selection-panel.component.tsx +58 -0
- package/src/components/report/definition/report-definition-editor.component.tsx +99 -0
- package/src/components/report/definition/report-definition.types.ts +66 -0
- package/src/components/report/design/panels/IndicatorPropertiesPanel.scss +33 -0
- package/src/components/report/design/panels/IndicatorPropertiesPanel.tsx +389 -0
- package/src/components/report/design/panels/JsonPreviewPanel.scss +32 -0
- package/src/components/report/design/panels/JsonPreviewPanel.tsx +104 -0
- package/src/components/report/design/panels/mapping-preview-panel.component.tsx +82 -0
- package/src/components/report/design/panels/mapping-preview-panel.scss +55 -0
- package/src/components/report/design/panels/template-structure-panel.component.tsx +296 -0
- package/src/components/report/design/panels/template-structure-panel.scss +81 -0
- package/src/components/report/design/report-design-editor.component.tsx +1170 -0
- package/src/components/report/design/report-design.types.ts +48 -0
- package/src/components/report/design/report-design.utils.ts +86 -0
- package/src/components/report/panels/report-detail.component.tsx +71 -0
- package/src/components/report/panels/report-panel-shell.component.tsx +60 -0
- package/src/components/report/report-dashboard.page.component.tsx +554 -0
- package/src/components/report/report-editor.page.component.tsx +590 -0
- package/src/components/report/report.routes.tsx +32 -0
- package/src/components/report-sections/create-report-section-modal.component.tsx +388 -0
- package/src/components/report-sections/hooks/useAgeCategories.ts +25 -0
- package/src/components/report-sections/hooks/useSectionEditorState.ts +449 -0
- package/src/components/report-sections/panels/Dhis2MappingPanel.tsx +157 -0
- package/src/components/report-sections/panels/DisaggregationPanel.tsx +97 -0
- package/src/components/report-sections/panels/IndicatorPickerPanel.tsx +201 -0
- package/src/components/report-sections/panels/SectionBasicsPanel.tsx +27 -0
- package/src/components/report-sections/report-section-preview-modal.component.tsx +548 -0
- package/src/components/report-sections/report-sections-page.component.tsx +325 -0
- package/src/components/report-sections/section-disaggregation.utils.ts +637 -0
- package/src/components/report-sections/section-types.ts +55 -0
- package/src/components/report-sections/section-utils.ts +50 -0
- package/src/components/report-sections/sections-page.scss +79 -0
- package/src/components/run-reports/run-reports-page.component.tsx +8 -0
- package/src/components/security/access-denied-page.component.tsx +69 -0
- package/src/components/security/access-denied-page.scss +39 -0
- package/src/components/security/privilege-route.component.test.tsx +79 -0
- package/src/components/security/privilege-route.component.tsx +39 -0
- package/src/components/shared/compile-setup-modal.component.tsx +182 -0
- package/src/components/shared/concept-selector.component.tsx +245 -0
- package/src/components/shared/concept-selector.scss +121 -0
- package/src/components/shared/header/builder-header-actions.component.tsx +38 -0
- package/src/components/shared/header/header.component.tsx +85 -0
- package/src/components/shared/header/header.scss +150 -0
- package/src/components/shared/header/illustration.component.tsx +34 -0
- package/src/components/shared/indicator-properties-panel/IndicatorPropertiesPanel.scss +33 -0
- package/src/components/shared/indicator-properties-panel/IndicatorPropertiesPanel.tsx +389 -0
- package/src/components/shared/json-preview-panel/JsonPreviewPanel.scss +32 -0
- package/src/components/shared/json-preview-panel/JsonPreviewPanel.tsx +104 -0
- package/src/components/shared/mapping-preview-panel/mapping-preview-panel.component.tsx +82 -0
- package/src/components/shared/mapping-preview-panel/mapping-preview-panel.scss +55 -0
- package/src/components/shared/preview/query-results-preview.component.tsx +204 -0
- package/src/components/shared/template-structure-panel/template-structure-panel.component.tsx +296 -0
- package/src/components/shared/template-structure-panel/template-structure-panel.scss +81 -0
- package/src/config-schema.ts +43 -0
- package/src/constants/privileges.test.ts +53 -0
- package/src/constants/privileges.ts +118 -0
- package/src/features/dashboards/DashboardRendererPage.tsx +174 -0
- package/src/features/dashboards/DashboardsPage.tsx +164 -0
- package/src/features/dashboards/EtlDashboardPage.tsx +32 -0
- package/src/features/dashboards/components/DashboardEmptyState.tsx +41 -0
- package/src/features/dashboards/components/DashboardGrid.tsx +48 -0
- package/src/features/dashboards/components/DashboardHeader.tsx +58 -0
- package/src/features/dashboards/components/DashboardSection.tsx +46 -0
- package/src/features/dashboards/components/ReportLaunchCard.tsx +51 -0
- package/src/features/dashboards/components/WidgetSlotDispatcher.tsx +61 -0
- package/src/features/dashboards/components/WidgetUnavailableCard.tsx +36 -0
- package/src/features/dashboards/dashboards.scss +196 -0
- package/src/features/dashboards/hooks/useDashboard.ts +61 -0
- package/src/features/dashboards/hooks/useDashboardWidgets.ts +74 -0
- package/src/features/dashboards/hooks/useDashboards.ts +56 -0
- package/src/features/dashboards/hooks/useMonitorDataMap.ts +84 -0
- package/src/features/dashboards/index.ts +11 -0
- package/src/features/dashboards/utils/dashboard-config.util.test.ts +255 -0
- package/src/features/dashboards/utils/dashboard-config.util.ts +382 -0
- package/src/features/report-visualizer/ReportVisualizerPage.tsx +448 -0
- package/src/features/report-visualizer/components/Export/ExportMenu.tsx +141 -0
- package/src/features/report-visualizer/components/Export/index.ts +2 -0
- package/src/features/report-visualizer/components/ReportExplorer/QuickFilters.tsx +152 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportCategoryFilter.tsx +54 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportExplorerPanel.tsx +201 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportExplorerRail.tsx +202 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportList.tsx +287 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportSearch.tsx +151 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportTagFilter.tsx +100 -0
- package/src/features/report-visualizer/components/ReportExplorer/RunReportButton.tsx +42 -0
- package/src/features/report-visualizer/components/ReportExplorer/RuntimeParameterForm.tsx +259 -0
- package/src/features/report-visualizer/components/ReportExplorer/index.ts +8 -0
- package/src/features/report-visualizer/components/ReportWorkspace/ReportLayer.tsx +33 -0
- package/src/features/report-visualizer/components/ReportWorkspace/ReportSummary.tsx +88 -0
- package/src/features/report-visualizer/components/ReportWorkspace/ReportViewTabs.tsx +72 -0
- package/src/features/report-visualizer/components/ReportWorkspace/ReportWorkspaceHeader.tsx +92 -0
- package/src/features/report-visualizer/components/ReportWorkspace/ReportWorkspacePanel.tsx +242 -0
- package/src/features/report-visualizer/components/ReportWorkspace/index.ts +5 -0
- package/src/features/report-visualizer/components/TableView/ColumnVisibilityMenu.tsx +206 -0
- package/src/features/report-visualizer/components/TableView/ReportTable.tsx +253 -0
- package/src/features/report-visualizer/components/TableView/index.ts +2 -0
- package/src/features/report-visualizer/hooks/index.ts +4 -0
- package/src/features/report-visualizer/hooks/useExplorerPreferences.ts +103 -0
- package/src/features/report-visualizer/hooks/useReportCapabilities.ts +112 -0
- package/src/features/report-visualizer/hooks/useReportParameters.ts +152 -0
- package/src/features/report-visualizer/hooks/useReports.ts +135 -0
- package/src/features/report-visualizer/index.ts +6 -0
- package/src/features/report-visualizer/report-visualizer.scss +593 -0
- package/src/features/report-visualizer/types/index.ts +1 -0
- package/src/features/report-visualizer/types/report-visualizer.types.ts +104 -0
- package/src/features/report-visualizer/utils/status-colors.ts +117 -0
- package/src/globals.d.ts +14 -0
- package/src/hooks/address-template.ts +86 -0
- package/src/hooks/concept.ts +112 -0
- package/src/hooks/indicator/index.ts +1 -0
- package/src/hooks/indicator/useIndicatorsByTheme.ts +41 -0
- package/src/hooks/openmrs-reference-data.ts +432 -0
- package/src/hooks/theme/index.ts +4 -0
- package/src/hooks/theme/useDataTheme.ts +61 -0
- package/src/hooks/theme/useDataThemes.ts +28 -0
- package/src/hooks/theme/useMambaTableMeta.ts +34 -0
- package/src/hooks/theme/useMambaTables.ts +95 -0
- package/src/hooks/use-report-builder-privileges.test.tsx +98 -0
- package/src/hooks/use-report-builder-privileges.ts +58 -0
- package/src/index.ts +29 -0
- package/src/resources/address-template/address-template.api.ts +180 -0
- package/src/resources/agegroup/agegroups.api.ts +58 -0
- package/src/resources/concept/concept.api.ts +116 -0
- package/src/resources/concepts/concept-mapper.ts +21 -0
- package/src/resources/concepts/concept-types.ts +31 -0
- package/src/resources/concepts/concepts.resource.ts +44 -0
- package/src/resources/concepts/useConceptSearch.ts +41 -0
- package/src/resources/dashboard/dashboard.api.ts +107 -0
- package/src/resources/etl-monitor/etl-monitor-test.api.ts +409 -0
- package/src/resources/etl-monitor/etl-monitor.api.ts +381 -0
- package/src/resources/etl-source/etl-source.api.ts +65 -0
- package/src/resources/etl-task/etl-task.api.ts +96 -0
- package/src/resources/etl-task/etl-task.types.ts +31 -0
- package/src/resources/indicator/indicators.api.ts +125 -0
- package/src/resources/legacy-reports/legacy-reports.api.ts +144 -0
- package/src/resources/linelist/linelist-reports.api.ts +616 -0
- package/src/resources/location/location.api.ts +135 -0
- package/src/resources/openmrs-api.ts +40 -0
- package/src/resources/patient-identifier-type/patient-identifier-type.api.ts +65 -0
- package/src/resources/person-attribute-type/person-attribute-type.api.ts +71 -0
- package/src/resources/preview/sql-preview.api.ts +54 -0
- package/src/resources/report/reports.api.ts +140 -0
- package/src/resources/report-category/report-category.api.ts +41 -0
- package/src/resources/report-import-export/import-export-api.ts +164 -0
- package/src/resources/report-library/report-library.api.ts +63 -0
- package/src/resources/report-section/report-sections.api.ts +73 -0
- package/src/resources/report-section/section-preview.api.ts +25 -0
- package/src/resources/theme/data-theme.api.ts +88 -0
- package/src/resources/theme/etl-schema.api.ts +101 -0
- package/src/resources/theme/etl-table-meta.api.ts +45 -0
- package/src/root.component.tsx +20 -0
- package/src/routes/report-builder.routes.tsx +160 -0
- package/src/routes/report-builder.scss +56 -0
- package/src/routes.json +28 -0
- package/src/sample-template.ts +121 -0
- package/src/template-utils.ts +110 -0
- package/src/types/carbon-react-inert.d.ts +13 -0
- package/src/types/condition-operators.ts +63 -0
- package/src/types/dashboard/dashboard.types.ts +137 -0
- package/src/types/dashboard/index.ts +4 -0
- package/src/types/etl/etl-types.ts +238 -0
- package/src/types/etl-monitor/etl-monitor-builder.types.ts +555 -0
- package/src/types/etl-monitor/etl-monitor-v2.types.ts +397 -0
- package/src/types/etl-monitor/etl-monitor.types.ts +188 -0
- package/src/types/etl-monitor/index.ts +6 -0
- package/src/types/linelist/compile-config.ts +455 -0
- package/src/types/linelist-types.ts +2059 -0
- package/src/types/theme/data-theme.types.ts +88 -0
- package/src/utils/api-error.utils.test.ts +151 -0
- package/src/utils/api-error.utils.ts +131 -0
- package/src/utils/config-enhancer.ts +62 -0
- package/src/utils/etl-browser/etl-browser.util.test.ts +145 -0
- package/src/utils/etl-browser/export-csv.util.ts +43 -0
- package/src/utils/etl-browser/group-tables.util.ts +84 -0
- package/src/utils/etl-browser/index.ts +4 -0
- package/src/utils/etl-browser/summarize-columns.util.ts +27 -0
- package/src/utils/etl-browser/table-sql.util.ts +20 -0
- package/src/utils/etl-monitor/config-v2-adapter.util.ts +460 -0
- package/src/utils/etl-monitor/endpoint-config-normalizer.util.ts +383 -0
- package/src/utils/etl-monitor/index.ts +10 -0
- package/src/utils/etl-monitor/jsonpath-resolver.util.ts +118 -0
- package/src/utils/etl-monitor/normalization-examples.ts +0 -0
- package/src/utils/etl-monitor/schema-inspector.util.ts +76 -0
- package/src/utils/etl-monitor/semantic-type-detector.util.ts +76 -0
- package/src/utils/etl-monitor/status-mapper.util.ts +105 -0
- package/src/utils/etl-monitor/value-formatters.util.ts +167 -0
- package/src/utils/etl-task/etl-task-card.util.test.ts +239 -0
- package/src/utils/etl-task/etl-task-card.util.ts +276 -0
- package/src/utils/etl-task/index.ts +1 -0
- package/src/utils/html-entities.utils.ts +34 -0
- package/src/utils/parameter-resolution.ts +218 -0
- package/src/views/etl-monitor-builder/add-monitor-modal.component.scss +0 -0
- package/src/views/etl-monitor-builder/add-monitor-modal.component.tsx +210 -0
- package/src/views/etl-monitor-builder/etl-monitor-builder.component.scss +157 -0
- package/src/views/etl-monitor-builder/etl-monitor-builder.component.tsx +252 -0
- package/src/views/etl-monitor-builder/etl-monitor-builder.store.ts +126 -0
- package/tools/scss-stub.js +12 -0
- package/tools/setup-tests.ts +1 -0
- package/translations/en.json +65 -0
- package/tsconfig.json +43 -0
- package/webpack.config.js +30 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
DataTable,
|
|
4
|
+
Pagination,
|
|
5
|
+
Table,
|
|
6
|
+
TableBody,
|
|
7
|
+
TableCell,
|
|
8
|
+
TableContainer,
|
|
9
|
+
TableHead,
|
|
10
|
+
TableHeader,
|
|
11
|
+
TableRow,
|
|
12
|
+
TableToolbar,
|
|
13
|
+
TableToolbarContent,
|
|
14
|
+
TableToolbarSearch,
|
|
15
|
+
Tile,
|
|
16
|
+
} from "@carbon/react";
|
|
17
|
+
import {
|
|
18
|
+
isDesktop,
|
|
19
|
+
useLayoutType,
|
|
20
|
+
usePagination,
|
|
21
|
+
} from "@openmrs/esm-framework";
|
|
22
|
+
import { DocumentDownload } from "@carbon/react/icons";
|
|
23
|
+
import React, { useEffect, useState } from "react";
|
|
24
|
+
import { useTranslation } from "react-i18next";
|
|
25
|
+
import styles from "./data-tables.scss";
|
|
26
|
+
import { saveAs } from "file-saver";
|
|
27
|
+
import type { ReportType } from "../../types";
|
|
28
|
+
|
|
29
|
+
type FilterProps = {
|
|
30
|
+
rowIds: Array<string>;
|
|
31
|
+
headers: any;
|
|
32
|
+
cellsById: any;
|
|
33
|
+
inputValue: string;
|
|
34
|
+
getCellId: (row, key) => string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
interface ListProps {
|
|
38
|
+
columns: any;
|
|
39
|
+
data: any;
|
|
40
|
+
report: {
|
|
41
|
+
type: ReportType;
|
|
42
|
+
name: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const DataList: React.FC<ListProps> = ({ columns, data, report }) => {
|
|
47
|
+
const { t } = useTranslation();
|
|
48
|
+
const layout = useLayoutType();
|
|
49
|
+
const isTablet = useLayoutType() === "tablet";
|
|
50
|
+
const responsiveSize = isTablet ? "lg" : "sm";
|
|
51
|
+
const [allRows, setAllRows] = useState([]);
|
|
52
|
+
const [list] = useState(data);
|
|
53
|
+
const pageSizes = [10, 20, 30, 40, 50];
|
|
54
|
+
const [currentPageSize, setPageSize] = useState(10);
|
|
55
|
+
const {
|
|
56
|
+
goTo,
|
|
57
|
+
results: paginatedList,
|
|
58
|
+
currentPage,
|
|
59
|
+
} = usePagination(data, currentPageSize);
|
|
60
|
+
|
|
61
|
+
const handleFilter = ({
|
|
62
|
+
rowIds,
|
|
63
|
+
headers,
|
|
64
|
+
cellsById,
|
|
65
|
+
inputValue,
|
|
66
|
+
getCellId,
|
|
67
|
+
}: FilterProps): Array<string> => {
|
|
68
|
+
return rowIds.filter((rowId) =>
|
|
69
|
+
headers.some(({ key }) => {
|
|
70
|
+
const cellId = getCellId(rowId, key);
|
|
71
|
+
const filterableValue = cellsById[cellId].value;
|
|
72
|
+
const filterTerm = inputValue.toLowerCase();
|
|
73
|
+
|
|
74
|
+
if (typeof filterableValue === "boolean") {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return ("" + filterableValue).toLowerCase().includes(filterTerm);
|
|
79
|
+
})
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
const rows: Array<Record<string, string>> = [];
|
|
85
|
+
|
|
86
|
+
paginatedList.map((item: any, index) => {
|
|
87
|
+
return rows.push({ ...item, id: index++ });
|
|
88
|
+
});
|
|
89
|
+
setAllRows(rows);
|
|
90
|
+
}, [paginatedList, allRows]);
|
|
91
|
+
|
|
92
|
+
const handleReportDownload = (documentType: string) => {
|
|
93
|
+
const currentDate = new Date();
|
|
94
|
+
const filename = `${report.name}_${currentDate
|
|
95
|
+
.toISOString()
|
|
96
|
+
.replace(/:/g, "-")}`;
|
|
97
|
+
const csvString = convertToCSV(list, columns);
|
|
98
|
+
|
|
99
|
+
if (documentType === "csv") {
|
|
100
|
+
const blob = new Blob([csvString], { type: "text/csv;charset=utf-8" });
|
|
101
|
+
saveAs(blob, `${filename}.csv`);
|
|
102
|
+
} else if (documentType === "json") {
|
|
103
|
+
const jsonBlob = new Blob([csvString], { type: "application/json" });
|
|
104
|
+
saveAs(jsonBlob, `${filename}.json`);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const convertToCSV = (data, columns) => {
|
|
109
|
+
const header = columns.map((col) => col.header).join(",");
|
|
110
|
+
const rows = data.map((row) =>
|
|
111
|
+
columns.map((col) => JSON.stringify(row[col.key])).join(",")
|
|
112
|
+
);
|
|
113
|
+
return [header, ...rows].join("\n");
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<DataTable
|
|
118
|
+
data-floating-menu-container
|
|
119
|
+
rows={allRows}
|
|
120
|
+
headers={columns}
|
|
121
|
+
filterRows={handleFilter}
|
|
122
|
+
overflowMenuOnHover={isDesktop(layout)}
|
|
123
|
+
size={isTablet ? "lg" : "sm"}
|
|
124
|
+
useZebraStyles
|
|
125
|
+
>
|
|
126
|
+
{({ rows, headers, getHeaderProps, getTableProps, onInputChange }) => (
|
|
127
|
+
<div>
|
|
128
|
+
<TableContainer className={styles.tableContainer}>
|
|
129
|
+
<div className={styles.toolbarWrapper}>
|
|
130
|
+
<TableToolbar size={responsiveSize}>
|
|
131
|
+
<TableToolbarContent className={styles.toolbarContent}>
|
|
132
|
+
<TableToolbarSearch
|
|
133
|
+
className={styles.searchbox}
|
|
134
|
+
expanded
|
|
135
|
+
onChange={onInputChange}
|
|
136
|
+
placeholder={t("searchThisList", "Search this list")}
|
|
137
|
+
size={responsiveSize}
|
|
138
|
+
/>
|
|
139
|
+
{report.type === "dynamic" ? (
|
|
140
|
+
<Button
|
|
141
|
+
size="sm"
|
|
142
|
+
kind="tertiary"
|
|
143
|
+
onClick={() => handleReportDownload("csv")}
|
|
144
|
+
className={styles.actionButton}
|
|
145
|
+
>
|
|
146
|
+
<DocumentDownload />
|
|
147
|
+
<span>Download Report</span>
|
|
148
|
+
</Button>
|
|
149
|
+
) : null}
|
|
150
|
+
</TableToolbarContent>
|
|
151
|
+
</TableToolbar>
|
|
152
|
+
</div>
|
|
153
|
+
<Table {...getTableProps()}>
|
|
154
|
+
<TableHead>
|
|
155
|
+
<TableRow>
|
|
156
|
+
{headers.map((header) => (
|
|
157
|
+
<TableHeader {...getHeaderProps({ header })}>
|
|
158
|
+
{header.header}
|
|
159
|
+
</TableHeader>
|
|
160
|
+
))}
|
|
161
|
+
</TableRow>
|
|
162
|
+
</TableHead>
|
|
163
|
+
<TableBody>
|
|
164
|
+
{rows.map((row) => (
|
|
165
|
+
<TableRow key={row.id}>
|
|
166
|
+
{row.cells.map((cell) => (
|
|
167
|
+
<TableCell key={cell.id}>{cell.value}</TableCell>
|
|
168
|
+
))}
|
|
169
|
+
</TableRow>
|
|
170
|
+
))}
|
|
171
|
+
</TableBody>
|
|
172
|
+
</Table>
|
|
173
|
+
{rows.length === 0 ? (
|
|
174
|
+
<div className={styles.tileContainer}>
|
|
175
|
+
<Tile className={styles.tile}>
|
|
176
|
+
<div className={styles.tileContent}>
|
|
177
|
+
<p className={styles.content}>
|
|
178
|
+
{t("No data", "No data to display")}
|
|
179
|
+
</p>
|
|
180
|
+
</div>
|
|
181
|
+
</Tile>
|
|
182
|
+
</div>
|
|
183
|
+
) : null}
|
|
184
|
+
<Pagination
|
|
185
|
+
forwardText="Next page"
|
|
186
|
+
backwardText="Previous page"
|
|
187
|
+
page={currentPage}
|
|
188
|
+
pageSize={currentPageSize}
|
|
189
|
+
pageSizes={pageSizes}
|
|
190
|
+
totalItems={data?.length}
|
|
191
|
+
className={styles.pagination}
|
|
192
|
+
onChange={({ pageSize, page }) => {
|
|
193
|
+
if (pageSize !== currentPageSize) {
|
|
194
|
+
setPageSize(pageSize);
|
|
195
|
+
}
|
|
196
|
+
if (page !== currentPage) {
|
|
197
|
+
goTo(page);
|
|
198
|
+
}
|
|
199
|
+
}}
|
|
200
|
+
/>
|
|
201
|
+
</TableContainer>
|
|
202
|
+
</div>
|
|
203
|
+
)}
|
|
204
|
+
</DataTable>
|
|
205
|
+
);
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
export default DataList;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
@use '@carbon/styles/scss/colors';
|
|
2
|
+
@use '@carbon/styles/scss/spacing';
|
|
3
|
+
@use '@carbon/styles/scss/type';
|
|
4
|
+
.widgetContainer {
|
|
5
|
+
background-color: colors.$white-0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.widgetHeaderContainer {
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
align-items: center;
|
|
12
|
+
padding: spacing.$spacing-04 0 spacing.$spacing-04 spacing.$spacing-05;
|
|
13
|
+
h4 {
|
|
14
|
+
&::after {
|
|
15
|
+
content: '';
|
|
16
|
+
display: block;
|
|
17
|
+
width: 2rem;
|
|
18
|
+
padding-top: 0.188rem;
|
|
19
|
+
border-bottom: 0.375rem solid var(--brand-01);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.toggleButtons {
|
|
25
|
+
width: fit-content;
|
|
26
|
+
margin: 0 spacing.$spacing-03;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.searchField {
|
|
30
|
+
width: 100%;
|
|
31
|
+
max-width: 250px;
|
|
32
|
+
border: 0 !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.container {
|
|
36
|
+
margin-top: 16px;
|
|
37
|
+
margin-left: inherit;
|
|
38
|
+
width: 100%;
|
|
39
|
+
overflow-y: hidden;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.tabContainer {
|
|
43
|
+
margin-top: 16px;
|
|
44
|
+
padding-left: 1rem;
|
|
45
|
+
background-color: colors.$white-0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.searchbox {
|
|
49
|
+
max-width: 16rem;
|
|
50
|
+
input:focus {
|
|
51
|
+
outline: 2px solid colors.$orange-40 !important;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.tabContainer li button {
|
|
56
|
+
width: 100% !important;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.tileContainer {
|
|
60
|
+
background-color: colors.$white-0;
|
|
61
|
+
border-top: 1px solid colors.$gray-20;
|
|
62
|
+
padding: 5rem 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.tile {
|
|
66
|
+
margin: auto;
|
|
67
|
+
width: fit-content;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.tileContent {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
align-items: center;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.menuItem {
|
|
77
|
+
max-width: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.radioButtonGroup {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
align-items: flex-start;
|
|
84
|
+
margin-top: spacing.$spacing-03;
|
|
85
|
+
min-height: spacing.$spacing-10;
|
|
86
|
+
width: 100%;
|
|
87
|
+
@include type.type-style('body-compact-01');
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.radioButton {
|
|
91
|
+
padding: spacing.$spacing-02 spacing.$spacing-02;
|
|
92
|
+
margin: spacing.$spacing-03 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.sectionTitle {
|
|
96
|
+
@include type.type-style('heading-compact-02');
|
|
97
|
+
color: colors.$gray-70;
|
|
98
|
+
margin-bottom: spacing.$spacing-04;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.modalBody {
|
|
102
|
+
padding-bottom: spacing.$spacing-05;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.tabContainer div[role='tabpanel'] {
|
|
106
|
+
padding: 0 !important;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.tabContainer li button {
|
|
110
|
+
width: 100% !important;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.tableContainer {
|
|
114
|
+
margin: 0;
|
|
115
|
+
padding: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.search {
|
|
119
|
+
max-width: 16rem;
|
|
120
|
+
input {
|
|
121
|
+
background-color: colors.$white-0 !important;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.toolbarWrapper {
|
|
126
|
+
position: relative;
|
|
127
|
+
display: flex;
|
|
128
|
+
justify-content: flex-end;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.tableContainer {
|
|
132
|
+
padding: 0;
|
|
133
|
+
:global(.cds--data-table-content) {
|
|
134
|
+
border: 1px solid colors.$gray-20;
|
|
135
|
+
border-bottom: none;
|
|
136
|
+
overflow-x: auto;
|
|
137
|
+
display: block;
|
|
138
|
+
}
|
|
139
|
+
:global(.cds--table-toolbar) {
|
|
140
|
+
position: relative;
|
|
141
|
+
height: 2rem;
|
|
142
|
+
min-height: 0;
|
|
143
|
+
overflow: visible;
|
|
144
|
+
top: 0;
|
|
145
|
+
}
|
|
146
|
+
&:global(.cds--data-table-container) {
|
|
147
|
+
margin: 0 1rem;
|
|
148
|
+
padding: 0;
|
|
149
|
+
}
|
|
150
|
+
a {
|
|
151
|
+
text-decoration: none;
|
|
152
|
+
}
|
|
153
|
+
tr {
|
|
154
|
+
width: spacing.$spacing-01;
|
|
155
|
+
}
|
|
156
|
+
.cds--table-sort__description {
|
|
157
|
+
display: none;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.toolbarAction {
|
|
162
|
+
max-width: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.patientListDownload {
|
|
166
|
+
margin-top: 10px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.redCell {
|
|
170
|
+
background-color: colors.$red-40 !important;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.grayCell {
|
|
174
|
+
background-color: colors.$gray-30 !important;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.greenCell {
|
|
178
|
+
background-color: colors.$green-30 !important;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.yellowCell {
|
|
182
|
+
background-color: colors.$yellow-20 !important;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.cellStyling {
|
|
186
|
+
border-right: 1px solid colors.$gray-20;
|
|
187
|
+
border-left: 1px solid colors.$gray-20;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.tableHeaderStyle {
|
|
191
|
+
font-weight: 600;
|
|
192
|
+
font-size: 12px;
|
|
193
|
+
line-height: 1px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.tableHeaderFlag {
|
|
197
|
+
writing-mode: vertical-lr;
|
|
198
|
+
transform: rotate(180deg);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.actionButton {
|
|
202
|
+
margin-left: 1rem;
|
|
203
|
+
svg {
|
|
204
|
+
margin-right: 0.5rem;
|
|
205
|
+
}
|
|
206
|
+
}
|
package/src/components/data-visualizer/components/empty-state/empty-state-illustration.component.tsx
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
const EmptyStateIllustration = () => {
|
|
4
|
+
return (
|
|
5
|
+
<svg width={64} height={64} viewBox="0 0 64 64">
|
|
6
|
+
<title>Empty data illustration</title>
|
|
7
|
+
<g fill="none" fillRule="evenodd">
|
|
8
|
+
<path
|
|
9
|
+
d="M38.133 13.186H21.947c-.768.001-1.39.623-1.39 1.391V50.55l-.186.057-3.97 1.216a.743.743 0 01-.927-.493L3.664 12.751a.742.742 0 01.492-.926l6.118-1.874 17.738-5.43 6.119-1.873a.741.741 0 01.926.492L38.076 13l.057.186z"
|
|
10
|
+
fill="#F4F4F4"
|
|
11
|
+
/>
|
|
12
|
+
<path
|
|
13
|
+
d="M41.664 13L38.026 1.117A1.576 1.576 0 0036.056.07l-8.601 2.633-17.737 5.43-8.603 2.634a1.578 1.578 0 00-1.046 1.97l12.436 40.616a1.58 1.58 0 001.969 1.046l5.897-1.805.185-.057v-.194l-.185.057-5.952 1.822a1.393 1.393 0 01-1.737-.923L.247 12.682a1.39 1.39 0 01.923-1.738L9.772 8.31 27.51 2.881 36.112.247a1.393 1.393 0 011.737.923L41.47 13l.057.186h.193l-.057-.185z"
|
|
14
|
+
fill="#8D8D8D"
|
|
15
|
+
/>
|
|
16
|
+
<path
|
|
17
|
+
d="M11.378 11.855a.836.836 0 01-.798-.59L9.385 7.361a.835.835 0 01.554-1.042l16.318-4.996a.836.836 0 011.042.554l1.195 3.902a.836.836 0 01-.554 1.043l-16.318 4.995a.831.831 0 01-.244.037z"
|
|
18
|
+
fill="#C6C6C6"
|
|
19
|
+
/>
|
|
20
|
+
<circle fill="#C6C6C6" cx={17.636} cy={2.314} r={1.855} />
|
|
21
|
+
<circle
|
|
22
|
+
fill="#FFF"
|
|
23
|
+
fillRule="nonzero"
|
|
24
|
+
cx={17.636}
|
|
25
|
+
cy={2.314}
|
|
26
|
+
r={1.175}
|
|
27
|
+
/>
|
|
28
|
+
<path
|
|
29
|
+
d="M55.893 53.995H24.544a.79.79 0 01-.788-.789V15.644a.79.79 0 01.788-.788h31.349a.79.79 0 01.788.788v37.562a.79.79 0 01-.788.789z"
|
|
30
|
+
fill="#F4F4F4"
|
|
31
|
+
/>
|
|
32
|
+
<path
|
|
33
|
+
d="M41.47 13H21.948a1.579 1.579 0 00-1.576 1.577V52.4l.185-.057V14.577c.001-.768.623-1.39 1.391-1.39h19.581L41.471 13zm17.02 0H21.947a1.579 1.579 0 00-1.576 1.577v42.478c0 .87.706 1.576 1.576 1.577H58.49a1.579 1.579 0 001.576-1.577V14.577a1.579 1.579 0 00-1.576-1.576zm1.39 44.055c0 .768-.622 1.39-1.39 1.392H21.947c-.768-.001-1.39-.624-1.39-1.392V14.577c0-.768.622-1.39 1.39-1.39H58.49c.768 0 1.39.622 1.39 1.39v42.478z"
|
|
34
|
+
fill="#8D8D8D"
|
|
35
|
+
/>
|
|
36
|
+
<path
|
|
37
|
+
d="M48.751 17.082H31.686a.836.836 0 01-.835-.835v-4.081c0-.46.374-.834.835-.835H48.75c.461 0 .834.374.835.835v4.08c0 .462-.374.835-.835.836z"
|
|
38
|
+
fill="#C6C6C6"
|
|
39
|
+
/>
|
|
40
|
+
<circle fill="#C6C6C6" cx={40.218} cy={9.755} r={1.855} />
|
|
41
|
+
<circle
|
|
42
|
+
fill="#FFF"
|
|
43
|
+
fillRule="nonzero"
|
|
44
|
+
cx={40.218}
|
|
45
|
+
cy={9.755}
|
|
46
|
+
r={1.13}
|
|
47
|
+
/>
|
|
48
|
+
</g>
|
|
49
|
+
</svg>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default EmptyStateIllustration;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { JSX } from "react";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
import { Calendar, Location } from "@carbon/react/icons";
|
|
4
|
+
import { formatDate, useSession } from "@openmrs/esm-framework";
|
|
5
|
+
import styles from "./header.scss";
|
|
6
|
+
|
|
7
|
+
const Header: React.FC<{
|
|
8
|
+
title?: string;
|
|
9
|
+
illustrationComponent: JSX.Element;
|
|
10
|
+
}> = ({ title, illustrationComponent }) => {
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
const userSession = useSession();
|
|
13
|
+
const userLocation = userSession?.sessionLocation?.display;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
<div className={styles.header}>
|
|
18
|
+
<div className={styles["left-justified-items"]}>
|
|
19
|
+
{illustrationComponent}
|
|
20
|
+
<div className={styles["page-labels"]}>
|
|
21
|
+
<p>{t("home", "Home")}</p>
|
|
22
|
+
<p className={styles["page-name"]}>
|
|
23
|
+
{title ?? t("dataVisualizer", "Data visualizer")}
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div className={styles["right-justified-items"]}>
|
|
28
|
+
<div className={styles["date-and-location"]}>
|
|
29
|
+
<Location size={16} />
|
|
30
|
+
<span className={styles.value}>{userLocation}</span>
|
|
31
|
+
<span className={styles.middot}>·</span>
|
|
32
|
+
<Calendar size={16} />
|
|
33
|
+
<span className={styles.value}>
|
|
34
|
+
{formatDate(new Date(), { mode: "standard" })}
|
|
35
|
+
</span>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default Header;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@use '@carbon/styles/scss/colors';
|
|
2
|
+
@use '@carbon/styles/scss/type';
|
|
3
|
+
@use '@carbon/styles/scss/spacing';
|
|
4
|
+
|
|
5
|
+
.header {
|
|
6
|
+
@include type.type-style('body-compact-02');
|
|
7
|
+
color: colors.$gray-70;
|
|
8
|
+
height: spacing.$spacing-12;
|
|
9
|
+
background-color: colors.$white-0;
|
|
10
|
+
border-bottom: 1px solid colors.$gray-20;
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: space-between;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.left-justified-items {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: row;
|
|
18
|
+
align-items: center;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.right-justified-items {
|
|
23
|
+
@include type.type-style('body-compact-02');
|
|
24
|
+
color: colors.$gray-70;
|
|
25
|
+
margin: 0.5rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.page-name {
|
|
29
|
+
@include type.type-style('heading-04');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.page-labels {
|
|
33
|
+
p:first-of-type {
|
|
34
|
+
margin-bottom: 0.25rem;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.date-and-location {
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: flex-end;
|
|
41
|
+
align-items: center;
|
|
42
|
+
margin-right: 1rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.value {
|
|
46
|
+
margin-left: 0.25rem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.middot {
|
|
50
|
+
margin: 0 0.5rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.view {
|
|
54
|
+
@include type.type-style('label-01');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.dropdown {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: flex-end;
|
|
61
|
+
margin-top: 0.25rem;
|
|
62
|
+
|
|
63
|
+
:global(.cds--dropdown__wrapper--inline) {
|
|
64
|
+
align-items: center;
|
|
65
|
+
display: flex;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:global(.cds--list-box__menu) {
|
|
69
|
+
left: -10.15rem;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
import { Button } from "@carbon/react";
|
|
4
|
+
|
|
5
|
+
interface ConfirmPromptProps {
|
|
6
|
+
close: () => {};
|
|
7
|
+
submit: () => {};
|
|
8
|
+
report: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const ConfirmPrompt: React.FC<ConfirmPromptProps> = ({
|
|
12
|
+
close,
|
|
13
|
+
submit,
|
|
14
|
+
report,
|
|
15
|
+
}) => {
|
|
16
|
+
const { t } = useTranslation();
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
<div className="cds--modal-header">
|
|
21
|
+
<h3 className="cds--modal-header__heading">Send Report to DHIS2</h3>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div className="cds--modal-content">
|
|
25
|
+
Are you sure you want to send {`${report}`} to DHIS2?
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div className="cds--modal-footer">
|
|
29
|
+
<Button kind="secondary" onClick={close}>
|
|
30
|
+
{t("close", "Cancel")}
|
|
31
|
+
</Button>
|
|
32
|
+
<Button kind="primary" onClick={submit}>
|
|
33
|
+
{t("close", "Submit Report")}
|
|
34
|
+
</Button>
|
|
35
|
+
</div>
|
|
36
|
+
</>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default ConfirmPrompt;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styles from "./panel.scss";
|
|
3
|
+
|
|
4
|
+
interface PanelProps {
|
|
5
|
+
heading: string;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Panel: React.FC<PanelProps> = ({ heading, children }) => {
|
|
10
|
+
return (
|
|
11
|
+
<div className={styles.panel}>
|
|
12
|
+
<div className={styles.heading}>
|
|
13
|
+
<span>{heading}</span>
|
|
14
|
+
</div>
|
|
15
|
+
{children}
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default Panel;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@use '@carbon/styles/scss/colors';
|
|
2
|
+
@use '@carbon/styles/scss/type';
|
|
3
|
+
|
|
4
|
+
.panel {
|
|
5
|
+
background-color: colors.$white-0;
|
|
6
|
+
border: 1px solid colors.$gray-20;
|
|
7
|
+
border-radius: 0.25rem;
|
|
8
|
+
box-shadow: 0 1px 1px rgba(0,0,0,.05);
|
|
9
|
+
width: 50%;
|
|
10
|
+
min-height: 15rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.panel .heading {
|
|
14
|
+
background-color: colors.$gray-20;
|
|
15
|
+
border-color: colors.$gray-20;
|
|
16
|
+
@include type.type-style('heading-compact-01');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.heading {
|
|
20
|
+
border-bottom: 1px solid transparent;
|
|
21
|
+
border-top-left-radius: 0.25rem;
|
|
22
|
+
border-top-right-radius: 0.25rem;
|
|
23
|
+
padding: 0.625rem 1rem;
|
|
24
|
+
}
|
|
25
|
+
|