@epcare/esm-report-builder 0.1.1-pre.13

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.
Files changed (222) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +19 -0
  3. package/.prettierrc +8 -0
  4. package/LICENSE +401 -0
  5. package/README.md +317 -0
  6. package/dist/184.js +2 -0
  7. package/dist/184.js.LICENSE.txt +14 -0
  8. package/dist/184.js.map +1 -0
  9. package/dist/211.js +1 -0
  10. package/dist/211.js.map +1 -0
  11. package/dist/300.js +1 -0
  12. package/dist/311.js +1 -0
  13. package/dist/311.js.map +1 -0
  14. package/dist/44.js +2 -0
  15. package/dist/44.js.LICENSE.txt +30 -0
  16. package/dist/44.js.map +1 -0
  17. package/dist/478.js +2 -0
  18. package/dist/478.js.LICENSE.txt +9 -0
  19. package/dist/478.js.map +1 -0
  20. package/dist/535.js +1 -0
  21. package/dist/535.js.map +1 -0
  22. package/dist/540.js +2 -0
  23. package/dist/540.js.LICENSE.txt +9 -0
  24. package/dist/540.js.map +1 -0
  25. package/dist/710.js +1 -0
  26. package/dist/710.js.map +1 -0
  27. package/dist/729.js +1 -0
  28. package/dist/729.js.map +1 -0
  29. package/dist/872.js +1 -0
  30. package/dist/872.js.map +1 -0
  31. package/dist/917.js +1 -0
  32. package/dist/917.js.map +1 -0
  33. package/dist/961.js +2 -0
  34. package/dist/961.js.LICENSE.txt +19 -0
  35. package/dist/961.js.map +1 -0
  36. package/dist/972.js +2 -0
  37. package/dist/972.js.LICENSE.txt +21 -0
  38. package/dist/972.js.map +1 -0
  39. package/dist/main.js +1 -0
  40. package/dist/main.js.map +1 -0
  41. package/dist/openmrs-esm-report-builder.js +1 -0
  42. package/dist/openmrs-esm-report-builder.js.buildmanifest.json +482 -0
  43. package/dist/openmrs-esm-report-builder.js.map +1 -0
  44. package/dist/routes.json +1 -0
  45. package/e2e/core/env.ts +5 -0
  46. package/e2e/core/global-setup.ts +34 -0
  47. package/e2e/core/test.ts +21 -0
  48. package/e2e/pages/app-shell.page.ts +34 -0
  49. package/e2e/pages/etl-sources.page.ts +35 -0
  50. package/e2e/pages/report-sections.page.ts +20 -0
  51. package/e2e/pages/section-preview.modal.ts +29 -0
  52. package/e2e/specs/etl-sources.spec.ts +51 -0
  53. package/e2e/specs/navigation.spec.ts +13 -0
  54. package/e2e/specs/section-preview-validation.spec.ts +38 -0
  55. package/e2e/specs/section-preview.spec.ts +94 -0
  56. package/e2e/tsconfig.json +11 -0
  57. package/example.env +5 -0
  58. package/jest.config.js +28 -0
  59. package/package.json +102 -0
  60. package/playwright.config.ts +28 -0
  61. package/src/admin-card-link.extension.module.scss +55 -0
  62. package/src/admin-card-link.extension.tsx +24 -0
  63. package/src/components/admin/admin-page.component.tsx +31 -0
  64. package/src/components/admin/age-categories-page.component.tsx +109 -0
  65. package/src/components/admin/age-groups-page.component.tsx +146 -0
  66. package/src/components/admin/etl-sources-page.component.tsx +344 -0
  67. package/src/components/admin/report-categories-page.component.tsx +256 -0
  68. package/src/components/admin/report-library-page.component.tsx +540 -0
  69. package/src/components/ai-support/ai-assist-button.component.tsx +30 -0
  70. package/src/components/ai-support/ai-assist-modal.component.tsx +81 -0
  71. package/src/components/ai-support/ai.service.ts +21 -0
  72. package/src/components/ai-support/ai.types.ts +12 -0
  73. package/src/components/app-shell/report-builder-shell.component.tsx +120 -0
  74. package/src/components/app-shell/report-builder-shell.scss +15 -0
  75. package/src/components/data-themes/data-theme-form.component.tsx +59 -0
  76. package/src/components/data-themes/data-theme-modal.component.tsx +349 -0
  77. package/src/components/data-themes/data-themes-page.component.tsx +132 -0
  78. package/src/components/data-themes/data-themes-table.component.tsx +91 -0
  79. package/src/components/data-themes/icon-registry.ts +35 -0
  80. package/src/components/data-themes/sections/data-theme-basics.section.tsx +63 -0
  81. package/src/components/data-themes/sections/data-theme-condition-columns.section.tsx +397 -0
  82. package/src/components/data-themes/sections/data-theme-fields-editor.section.tsx +125 -0
  83. package/src/components/data-themes/sections/data-theme-metadata.section.tsx +245 -0
  84. package/src/components/data-themes/sections/data-theme-preview.section.tsx +115 -0
  85. package/src/components/data-themes/sections/data-theme-source.section.tsx +184 -0
  86. package/src/components/indicators/README.md +24 -0
  87. package/src/components/indicators/base-indicator-basic-fields.component.tsx +18 -0
  88. package/src/components/indicators/base-indicator-basics.section.tsx +54 -0
  89. package/src/components/indicators/base-indicator-countby.section.tsx +25 -0
  90. package/src/components/indicators/base-indicator-criteria.section.tsx +83 -0
  91. package/src/components/indicators/base-indicator-details-form.component.tsx +80 -0
  92. package/src/components/indicators/base-indicator-theme-unit-fields.component.tsx +39 -0
  93. package/src/components/indicators/create-base-indicator-modal.component.tsx +501 -0
  94. package/src/components/indicators/create-composite-base-indicator-modal.component.tsx +297 -0
  95. package/src/components/indicators/create-final-indicator-modal.component.tsx +260 -0
  96. package/src/components/indicators/diagnosis-filters-form.component.tsx +101 -0
  97. package/src/components/indicators/disaggregation-panel.component.tsx +93 -0
  98. package/src/components/indicators/handler/concept-search-multiselect.component.tsx +153 -0
  99. package/src/components/indicators/handler/question-answer-concept-search.component.tsx +336 -0
  100. package/src/components/indicators/indicator-status-tag.component.tsx +9 -0
  101. package/src/components/indicators/indicators-page.component.tsx +481 -0
  102. package/src/components/indicators/indicators-page.scss +121 -0
  103. package/src/components/indicators/indicators-table.component.tsx +166 -0
  104. package/src/components/indicators/preview-table.component.tsx +31 -0
  105. package/src/components/indicators/sections/composite-indicator-basics.section.tsx +36 -0
  106. package/src/components/indicators/sections/composite-indicator-picker.section.tsx +161 -0
  107. package/src/components/indicators/sections/composite-indicator-sql-preview.section.tsx +31 -0
  108. package/src/components/indicators/sections/final-indicator-basics.section.tsx +46 -0
  109. package/src/components/indicators/sections/final-indicator-disaggregation.section.tsx +47 -0
  110. package/src/components/indicators/sections/final-indicator-picker.section.tsx +92 -0
  111. package/src/components/indicators/sections/final-indicator-preview.section.tsx +20 -0
  112. package/src/components/indicators/sections/final-indicator-results-preview.section.tsx +65 -0
  113. package/src/components/indicators/sections/indicator-basics.section.tsx +40 -0
  114. package/src/components/indicators/sections/indicator-conditions.section.tsx +194 -0
  115. package/src/components/indicators/sections/indicator-sql-preview.section.tsx +26 -0
  116. package/src/components/indicators/sections/indicator-theme.section.tsx +48 -0
  117. package/src/components/indicators/sql-preview.component.tsx +19 -0
  118. package/src/components/indicators/types/base-indicator-form.types.ts +17 -0
  119. package/src/components/indicators/types/base-indicator-theme.constants.ts +8 -0
  120. package/src/components/indicators/types/composite-indicator.types.ts +21 -0
  121. package/src/components/indicators/types/condition-ui.types.ts +11 -0
  122. package/src/components/indicators/types/data-theme-config.types.ts +88 -0
  123. package/src/components/indicators/types/indicator-types.ts +56 -0
  124. package/src/components/indicators/types/sql-builders.ts +43 -0
  125. package/src/components/indicators/utils/composite-indicator-sql.utils.ts +206 -0
  126. package/src/components/indicators/utils/concept-preload.utils.ts +21 -0
  127. package/src/components/indicators/utils/final-indicator-sql.utils.ts +124 -0
  128. package/src/components/indicators/utils/indicator-conditions-hydration.utils.ts +254 -0
  129. package/src/components/indicators/utils/indicator-sql.utils.ts +185 -0
  130. package/src/components/landing/landing-action-item.component.tsx +50 -0
  131. package/src/components/landing/landing-action-list.component.tsx +12 -0
  132. package/src/components/landing/landing-activity-list.component.tsx +47 -0
  133. package/src/components/landing/landing-footer-grid.component.tsx +45 -0
  134. package/src/components/landing/landing-hero.component.tsx +18 -0
  135. package/src/components/landing/landing-section-card.component.tsx +33 -0
  136. package/src/components/landing/report-builder-landing-page.component.tsx +103 -0
  137. package/src/components/landing/report-builder-landing-page.scss +131 -0
  138. package/src/components/report/dashboard/reports-table.component.tsx +145 -0
  139. package/src/components/report/definition/panels/properties-panel.component.tsx +38 -0
  140. package/src/components/report/definition/panels/report-structure-panel.component.tsx +61 -0
  141. package/src/components/report/definition/panels/selection-panel.component.tsx +58 -0
  142. package/src/components/report/definition/report-definition-editor.component.tsx +99 -0
  143. package/src/components/report/definition/report-definition.types.ts +66 -0
  144. package/src/components/report/design/panels/IndicatorPropertiesPanel.scss +33 -0
  145. package/src/components/report/design/panels/IndicatorPropertiesPanel.tsx +389 -0
  146. package/src/components/report/design/panels/JsonPreviewPanel.scss +32 -0
  147. package/src/components/report/design/panels/JsonPreviewPanel.tsx +104 -0
  148. package/src/components/report/design/panels/mapping-preview-panel.component.tsx +82 -0
  149. package/src/components/report/design/panels/mapping-preview-panel.scss +55 -0
  150. package/src/components/report/design/panels/template-structure-panel.component.tsx +296 -0
  151. package/src/components/report/design/panels/template-structure-panel.scss +81 -0
  152. package/src/components/report/design/report-design-editor.component.tsx +894 -0
  153. package/src/components/report/design/report-design.types.ts +43 -0
  154. package/src/components/report/design/report-design.utils.ts +86 -0
  155. package/src/components/report/panels/report-detail.component.tsx +71 -0
  156. package/src/components/report/panels/report-panel-shell.component.tsx +60 -0
  157. package/src/components/report/report-dashboard.page.component.tsx +75 -0
  158. package/src/components/report/report-editor.page.component.tsx +466 -0
  159. package/src/components/report/report.routes.tsx +30 -0
  160. package/src/components/report-sections/create-report-section-modal.component.tsx +278 -0
  161. package/src/components/report-sections/hooks/useAgeCategories.ts +25 -0
  162. package/src/components/report-sections/hooks/useSectionEditorState.ts +306 -0
  163. package/src/components/report-sections/panels/Dhis2MappingPanel.tsx +157 -0
  164. package/src/components/report-sections/panels/DisaggregationPanel.tsx +97 -0
  165. package/src/components/report-sections/panels/IndicatorPickerPanel.tsx +143 -0
  166. package/src/components/report-sections/panels/SectionBasicsPanel.tsx +27 -0
  167. package/src/components/report-sections/report-section-preview-modal.component.tsx +418 -0
  168. package/src/components/report-sections/report-sections-page.component.tsx +313 -0
  169. package/src/components/report-sections/section-types.ts +55 -0
  170. package/src/components/report-sections/section-utils.ts +46 -0
  171. package/src/components/report-sections/sections-page.scss +79 -0
  172. package/src/components/run-reports/run-reports-page.component.tsx +23 -0
  173. package/src/components/shared/header/builder-header-actions.component.tsx +38 -0
  174. package/src/components/shared/header/header.component.tsx +85 -0
  175. package/src/components/shared/header/header.scss +150 -0
  176. package/src/components/shared/header/illustration.component.tsx +34 -0
  177. package/src/components/shared/indicator-properties-panel/IndicatorPropertiesPanel.scss +33 -0
  178. package/src/components/shared/indicator-properties-panel/IndicatorPropertiesPanel.tsx +389 -0
  179. package/src/components/shared/json-preview-panel/JsonPreviewPanel.scss +32 -0
  180. package/src/components/shared/json-preview-panel/JsonPreviewPanel.tsx +104 -0
  181. package/src/components/shared/mapping-preview-panel/mapping-preview-panel.component.tsx +82 -0
  182. package/src/components/shared/mapping-preview-panel/mapping-preview-panel.scss +55 -0
  183. package/src/components/shared/preview/query-results-preview.component.tsx +204 -0
  184. package/src/components/shared/template-structure-panel/template-structure-panel.component.tsx +296 -0
  185. package/src/components/shared/template-structure-panel/template-structure-panel.scss +81 -0
  186. package/src/config-schema.ts +23 -0
  187. package/src/globals.d.ts +14 -0
  188. package/src/hooks/theme/useDataThemes.ts +28 -0
  189. package/src/hooks/theme/useMambaTableMeta.ts +34 -0
  190. package/src/hooks/theme/useMambaTables.ts +63 -0
  191. package/src/index.ts +23 -0
  192. package/src/resources/agegroup/agegroups.api.ts +58 -0
  193. package/src/resources/concepts/concept-mapper.ts +21 -0
  194. package/src/resources/concepts/concept-types.ts +31 -0
  195. package/src/resources/concepts/concepts.resource.ts +44 -0
  196. package/src/resources/concepts/useConceptSearch.ts +41 -0
  197. package/src/resources/etl-source/etl-source.api.ts +65 -0
  198. package/src/resources/indicator/indicators.api.ts +125 -0
  199. package/src/resources/openmrs-api.ts +24 -0
  200. package/src/resources/preview/sql-preview.api.ts +54 -0
  201. package/src/resources/report/reports.api.ts +117 -0
  202. package/src/resources/report-category/report-category.api.ts +41 -0
  203. package/src/resources/report-library/report-library.api.ts +63 -0
  204. package/src/resources/report-section/report-sections.api.ts +73 -0
  205. package/src/resources/report-section/section-preview.api.ts +21 -0
  206. package/src/resources/theme/data-theme.api.ts +88 -0
  207. package/src/resources/theme/mamba-schema.api.ts +31 -0
  208. package/src/resources/theme/mamba-table-meta.api.ts +45 -0
  209. package/src/root.component.tsx +20 -0
  210. package/src/routes/report-builder.routes.tsx +66 -0
  211. package/src/routes/report-builder.scss +56 -0
  212. package/src/routes.json +21 -0
  213. package/src/sample-template.ts +121 -0
  214. package/src/template-utils.ts +110 -0
  215. package/src/types/carbon-react-inert.d.ts +13 -0
  216. package/src/types/condition-operators.ts +49 -0
  217. package/src/types/theme/data-theme.types.ts +88 -0
  218. package/src/utils/html-entities.utils.ts +23 -0
  219. package/tools/setup-tests.ts +1 -0
  220. package/translations/en.json +4 -0
  221. package/tsconfig.json +43 -0
  222. package/webpack.config.js +14 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openmrs-esm-report-builder.js","mappings":"sDACIA,EADAC,ECAAC,EACAC,ECDAC,EAIAC,EAIAC,EAIAC,EAIAC,EAGAC,EAIAC,EAuBAC,EAMAC,EAUAC,EAMAC,EAWAC,EA0BAC,EAgBAC,EACAC,EASAC,EAgBAC,E,eCnJJ,IAAIC,EAAY,CACf,UAAW,IACHC,EAAoBC,EAAE,KAAKC,KAAK,IAAM,IAASF,EAAoB,QAGxEb,EAAM,CAACgB,EAAQC,KAClBJ,EAAoBK,EAAID,EACxBA,EACCJ,EAAoBM,EAAEP,EAAWI,GAC9BJ,EAAUI,KACVI,QAAQC,UAAUN,KAAK,KACxB,MAAM,IAAIO,MAAM,WAAaN,EAAS,oCAGzCH,EAAoBK,OAAIK,EACjBN,GAEJO,EAAO,CAACC,EAAYC,KACvB,GAAKb,EAAoBc,EAAzB,CACA,IAAIC,EAAO,UACPC,EAAWhB,EAAoBc,EAAEC,GACrC,GAAGC,GAAYA,IAAaJ,EAAY,MAAM,IAAIH,MAAM,mGAExD,OADAT,EAAoBc,EAAEC,GAAQH,EACvBZ,EAAoBiB,EAAEF,EAAMF,EALD,GASnCb,EAAoBkB,EAAEC,EAAS,CAC9BhC,IAAK,IAAM,EACXwB,KAAM,IAAM,G,GC5BTS,EAA2B,CAAC,EAGhC,SAASpB,EAAoBqB,GAE5B,IAA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K,EAAoB,M","sources":["webpack://@epcare/esm-report-builder/webpack/runtime/create fake namespace object","webpack://@epcare/esm-report-builder/webpack/runtime/load script","webpack://@epcare/esm-report-builder/webpack/runtime/consumes","webpack://@epcare/esm-report-builder/webpack/container-entry","webpack://@epcare/esm-report-builder/webpack/bootstrap","webpack://@epcare/esm-report-builder/webpack/runtime/compat get default export","webpack://@epcare/esm-report-builder/webpack/runtime/define property getters","webpack://@epcare/esm-report-builder/webpack/runtime/ensure chunk","webpack://@epcare/esm-report-builder/webpack/runtime/get javascript chunk filename","webpack://@epcare/esm-report-builder/webpack/runtime/global","webpack://@epcare/esm-report-builder/webpack/runtime/hasOwnProperty shorthand","webpack://@epcare/esm-report-builder/webpack/runtime/make namespace object","webpack://@epcare/esm-report-builder/webpack/runtime/sharing","webpack://@epcare/esm-report-builder/webpack/runtime/publicPath","webpack://@epcare/esm-report-builder/webpack/runtime/jsonp chunk loading","webpack://@epcare/esm-report-builder/webpack/runtime/nonce","webpack://@epcare/esm-report-builder/webpack/startup"],"names":["leafPrototypes","getProto","inProgress","dataWebpackPrefix","parseVersion","versionLt","rangeToString","satisfy","exists","get","eagerOnly","findSingletonVersionKey","getInvalidSingletonVersionMessage","fail","warn","useFallback","loadSingletonVersion","installedModules","moduleToHandlerMapping","chunkMapping","startedInstallModules","moduleMap","__webpack_require__","e","then","module","getScope","R","o","Promise","resolve","Error","undefined","init","shareScope","initScope","S","name","oldScope","I","d","exports","__webpack_module_cache__","moduleId","cachedModule","id","__webpack_modules__","call","m","c","n","getter","__esModule","a","Object","getPrototypeOf","obj","t","value","mode","this","ns","create","r","def","current","indexOf","getOwnPropertyNames","forEach","key","definition","defineProperty","enumerable","f","chunkId","all","keys","reduce","promises","u","g","globalThis","Function","window","prop","prototype","hasOwnProperty","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","i","length","s","getAttribute","createElement","charset","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","timeout","doneFns","parentNode","removeChild","fn","setTimeout","bind","type","target","head","appendChild","Symbol","toStringTag","initPromises","initTokens","initToken","scope","uniqueName","register","version","factory","eager","versions","activeVersion","loaded","from","scriptUrl","importScripts","location","currentScript","tagName","toUpperCase","test","replace","p","str","split","map","exec","apply","b","range","pop","entry","filtered","requiredVersion","msg","console","scopeName","fallback","failAsNotExist","promise","consumes","onFactory","onError","error","installedChunks","j","installedChunkData","reject","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""}
@@ -0,0 +1 @@
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","pages":[{"component":"root","route":"report-builder","online":true,"offline":false,"order":1}],"extensions":[{"name":"system-administration-report-builder-card-link","slot":"system-admin-page-card-link-slot","component":"reportBuilderAdminLink","online":true,"offline":false}],"version":"0.1.1-pre.13"}
@@ -0,0 +1,5 @@
1
+ export const e2eBaseUrl = (process.env.E2E_BASE_URL || 'http://localhost:8080/openmrs').replace(/\/$/, '');
2
+ export const playwrightBaseUrl = process.env.PLAYWRIGHT_BASE_URL || `${e2eBaseUrl}/spa/report-builder`;
3
+ export const username = process.env.E2E_USERNAME || 'admin';
4
+ export const password = process.env.E2E_PASSWORD || 'Admin123';
5
+ export const loginLocation = process.env.E2E_LOGIN_LOCATION || '8d6c993e-c2cc-11de-8d13-0010c6dffd0f';
@@ -0,0 +1,34 @@
1
+ import { request, type FullConfig } from '@playwright/test';
2
+ import fs from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { e2eBaseUrl, loginLocation, password, username } from './env';
5
+
6
+ async function globalSetup(config: FullConfig) {
7
+ const storageStatePath = config.projects[0]?.use?.storageState as string | undefined;
8
+ if (!storageStatePath) return;
9
+
10
+ const requestContext = await request.newContext({ baseURL: e2eBaseUrl });
11
+
12
+ const authHeader = `Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`;
13
+ const response = await requestContext.post('/ws/rest/v1/session', {
14
+ headers: {
15
+ Authorization: authHeader,
16
+ 'Content-Type': 'application/x-www-form-urlencoded',
17
+ },
18
+ form: {
19
+ sessionLocation: loginLocation,
20
+ },
21
+ failOnStatusCode: false,
22
+ });
23
+
24
+ if (!response.ok()) {
25
+ throw new Error(`E2E authentication failed with status ${response.status()}. Check E2E_* variables and backend availability.`);
26
+ }
27
+
28
+ const state = await requestContext.storageState();
29
+ await fs.mkdir(path.dirname(storageStatePath), { recursive: true });
30
+ await fs.writeFile(storageStatePath, JSON.stringify(state, null, 2));
31
+ await requestContext.dispose();
32
+ }
33
+
34
+ export default globalSetup;
@@ -0,0 +1,21 @@
1
+ import { test as base, expect } from '@playwright/test';
2
+ import { AppShellPage } from '../pages/app-shell.page';
3
+ import { ETLSourcesPage } from '../pages/etl-sources.page';
4
+ import { ReportSectionsPage } from '../pages/report-sections.page';
5
+ import { SectionPreviewModal } from '../pages/section-preview.modal';
6
+
7
+ type Fixtures = {
8
+ appShell: AppShellPage;
9
+ etlSourcesPage: ETLSourcesPage;
10
+ reportSectionsPage: ReportSectionsPage;
11
+ sectionPreviewModal: SectionPreviewModal;
12
+ };
13
+
14
+ export const test = base.extend<Fixtures>({
15
+ appShell: async ({ page }, use) => use(new AppShellPage(page)),
16
+ etlSourcesPage: async ({ page }, use) => use(new ETLSourcesPage(page)),
17
+ reportSectionsPage: async ({ page }, use) => use(new ReportSectionsPage(page)),
18
+ sectionPreviewModal: async ({ page }, use) => use(new SectionPreviewModal(page)),
19
+ });
20
+
21
+ export { expect };
@@ -0,0 +1,34 @@
1
+ import type { Page } from '@playwright/test';
2
+
3
+ export class AppShellPage {
4
+ constructor(private readonly page: Page) {}
5
+
6
+ async goto(path = '/') {
7
+ await this.page.goto(path);
8
+ }
9
+
10
+ async openHome() {
11
+ await this.page.getByRole('link', { name: 'Home' }).click();
12
+ }
13
+
14
+ async openReports() {
15
+ await this.page.getByRole('link', { name: 'Reports' }).click();
16
+ }
17
+
18
+ async openSections() {
19
+ await this.page.getByRole('link', { name: 'Sections' }).click();
20
+ }
21
+
22
+ async openIndicators() {
23
+ await this.page.getByRole('link', { name: 'Indicators' }).click();
24
+ }
25
+
26
+ async openAdminMenu() {
27
+ await this.page.getByText('Admin', { exact: true }).click();
28
+ }
29
+
30
+ async openAdminTile(name: string) {
31
+ await this.openAdminMenu();
32
+ await this.page.getByText(name, { exact: true }).click();
33
+ }
34
+ }
@@ -0,0 +1,35 @@
1
+ import type { Page } from '@playwright/test';
2
+ import { expect } from '@playwright/test';
3
+
4
+ export class ETLSourcesPage {
5
+ constructor(private readonly page: Page) {}
6
+
7
+ async goto() {
8
+ await this.page.goto('/admin/etl-sources');
9
+ }
10
+
11
+ async expectLoaded() {
12
+ await expect(this.page.getByRole('heading', { name: 'ETL Sources' })).toBeVisible();
13
+ }
14
+
15
+ async clickNew() {
16
+ await this.page.getByTestId('etl-source-new').click();
17
+ }
18
+
19
+ async fillForm(data: { name: string; code?: string; schemaName?: string; sourceType?: string; description?: string; tablePatterns?: string }) {
20
+ await this.page.locator('[data-testid="etl-source-name"] input').fill(data.name);
21
+ if (data.code !== undefined) await this.page.locator('[data-testid="etl-source-code"] input').fill(data.code);
22
+ if (data.schemaName !== undefined) await this.page.locator('[data-testid="etl-source-schema"] input').fill(data.schemaName);
23
+ if (data.sourceType !== undefined) await this.page.locator('[data-testid="etl-source-type"] input').fill(data.sourceType);
24
+ if (data.description !== undefined) await this.page.locator('[data-testid="etl-source-description"] textarea').fill(data.description);
25
+ if (data.tablePatterns !== undefined) await this.page.locator('[data-testid="etl-source-table-patterns"] textarea').fill(data.tablePatterns);
26
+ }
27
+
28
+ async save() {
29
+ await this.page.getByRole('button', { name: 'Save' }).click();
30
+ }
31
+
32
+ row(name: string) {
33
+ return this.page.getByRole('row').filter({ hasText: name });
34
+ }
35
+ }
@@ -0,0 +1,20 @@
1
+ import type { Page } from '@playwright/test';
2
+ import { expect } from '@playwright/test';
3
+
4
+ export class ReportSectionsPage {
5
+ constructor(private readonly page: Page) {}
6
+
7
+ async goto() {
8
+ await this.page.goto('/sections');
9
+ }
10
+
11
+ async expectLoaded() {
12
+ await expect(this.page.getByRole('heading', { name: 'Sections' })).toBeVisible();
13
+ }
14
+
15
+ async openPreviewFor(sectionName: string) {
16
+ const row = this.page.getByTestId(`section-row-${sectionName.replace(/\s+/g, '-')}`);
17
+ await row.getByLabel('Actions').click();
18
+ await this.page.getByText('Preview', { exact: true }).click();
19
+ }
20
+ }
@@ -0,0 +1,29 @@
1
+ import type { Page } from '@playwright/test';
2
+ import { expect } from '@playwright/test';
3
+
4
+ export class SectionPreviewModal {
5
+ constructor(private readonly page: Page) {}
6
+
7
+ async expectOpen() {
8
+ await expect(this.page.getByRole('dialog')).toBeVisible();
9
+ }
10
+
11
+ async fillPreviewRequest(data: { startDate: string; endDate: string; indicatorUuid?: string; maxRows?: number }) {
12
+ await this.page.locator('[data-testid="section-preview-startdate"] input').fill(data.startDate);
13
+ await this.page.locator('[data-testid="section-preview-enddate"] input').fill(data.endDate);
14
+ if (data.indicatorUuid !== undefined) await this.page.locator('[data-testid="section-preview-indicatoruuid"] input').fill(data.indicatorUuid);
15
+ if (data.maxRows !== undefined) await this.page.locator('[data-testid="section-preview-maxrows"] input').fill(String(data.maxRows));
16
+ }
17
+
18
+ async run() {
19
+ await this.page.getByTestId('section-preview-run').click();
20
+ }
21
+
22
+ async expectMatrixVisible() {
23
+ await expect(this.page.getByTestId('section-preview-matrix')).toBeVisible();
24
+ }
25
+
26
+ async expectError(message: string) {
27
+ await expect(this.page.getByText(message)).toBeVisible();
28
+ }
29
+ }
@@ -0,0 +1,51 @@
1
+ import { test, expect } from '../core/test';
2
+
3
+ test.describe('ETL Sources', () => {
4
+ test('creates an ETL source and sends the expected payload', async ({ page, etlSourcesPage }) => {
5
+ await page.route('**/ws/rest/v1/reportbuilder/etlsource**', async (route) => {
6
+ const request = route.request();
7
+
8
+ if (request.method() === 'GET') {
9
+ await route.fulfill({
10
+ status: 200,
11
+ contentType: 'application/json',
12
+ body: JSON.stringify({ results: [] }),
13
+ });
14
+ return;
15
+ }
16
+
17
+ if (request.method() === 'POST') {
18
+ const body = request.postDataJSON();
19
+ expect(body).toMatchObject({
20
+ name: 'E2E Source',
21
+ code: 'E2E_SRC',
22
+ schemaName: 'reporting',
23
+ sourceType: 'mysql',
24
+ active: true,
25
+ });
26
+
27
+ await route.fulfill({
28
+ status: 201,
29
+ contentType: 'application/json',
30
+ body: JSON.stringify({ uuid: 'etl-1', ...body }),
31
+ });
32
+ return;
33
+ }
34
+
35
+ await route.continue();
36
+ });
37
+
38
+ await etlSourcesPage.goto();
39
+ await etlSourcesPage.expectLoaded();
40
+ await etlSourcesPage.clickNew();
41
+ await etlSourcesPage.fillForm({
42
+ name: 'E2E Source',
43
+ code: 'E2E_SRC',
44
+ schemaName: 'reporting',
45
+ sourceType: 'mysql',
46
+ description: 'Created from Playwright',
47
+ tablePatterns: 'encounter_%',
48
+ });
49
+ await etlSourcesPage.save();
50
+ });
51
+ });
@@ -0,0 +1,13 @@
1
+ import { test } from '../core/test';
2
+
3
+ test.describe('report builder navigation', () => {
4
+ test('loads the sections page', async ({ reportSectionsPage }) => {
5
+ await reportSectionsPage.goto();
6
+ await reportSectionsPage.expectLoaded();
7
+ });
8
+
9
+ test('loads the ETL Sources page', async ({ etlSourcesPage }) => {
10
+ await etlSourcesPage.goto();
11
+ await etlSourcesPage.expectLoaded();
12
+ });
13
+ });
@@ -0,0 +1,38 @@
1
+ import { test } from '../core/test';
2
+
3
+ const sectionUuid = '4278ebf9-47ab-40b8-aeca-df3e4a050c79';
4
+
5
+ test.describe('section preview validation', () => {
6
+ test('shows a validation error when dates are missing', async ({ page, reportSectionsPage, sectionPreviewModal }) => {
7
+ await page.route('**/ws/rest/v1/reportbuilder/section?**', async (route) => {
8
+ await route.fulfill({
9
+ status: 200,
10
+ contentType: 'application/json',
11
+ body: JSON.stringify({ results: [{ uuid: sectionUuid, name: 'Monthly HTS Summary', configJson: '{}' }] }),
12
+ });
13
+ });
14
+
15
+ await page.route(`**/ws/rest/v1/reportbuilder/section/${sectionUuid}**`, async (route) => {
16
+ await route.fulfill({
17
+ status: 200,
18
+ contentType: 'application/json',
19
+ body: JSON.stringify({ uuid: sectionUuid, name: 'Monthly HTS Summary', configJson: '{}' }),
20
+ });
21
+ });
22
+
23
+ await page.route('**/ws/rest/v1/reportbuilder/indicator**', async (route) => {
24
+ await route.fulfill({
25
+ status: 200,
26
+ contentType: 'application/json',
27
+ body: JSON.stringify({ results: [] }),
28
+ });
29
+ });
30
+
31
+ await reportSectionsPage.goto();
32
+ await reportSectionsPage.expectLoaded();
33
+ await reportSectionsPage.openPreviewFor('Monthly HTS Summary');
34
+ await sectionPreviewModal.expectOpen();
35
+ await sectionPreviewModal.run();
36
+ await sectionPreviewModal.expectError('Start date and End date are required.');
37
+ });
38
+ });
@@ -0,0 +1,94 @@
1
+ import { test, expect } from '../core/test';
2
+
3
+ const sectionUuid = '4278ebf9-47ab-40b8-aeca-df3e4a050c79';
4
+ const indicatorUuid = '2b9c6c8e-1234-4d9f-8abc-1234567890ab';
5
+
6
+ test.describe('section preview', () => {
7
+ test('submits preview payload and renders the matrix', async ({ page, reportSectionsPage, sectionPreviewModal }) => {
8
+ await page.route('**/ws/rest/v1/reportbuilder/section?**', async (route) => {
9
+ await route.fulfill({
10
+ status: 200,
11
+ contentType: 'application/json',
12
+ body: JSON.stringify({
13
+ results: [
14
+ {
15
+ uuid: sectionUuid,
16
+ name: 'Monthly HTS Summary',
17
+ code: 'HTS_MONTHLY',
18
+ configJson: JSON.stringify({ indicators: [{ uuid: indicatorUuid }] }),
19
+ },
20
+ ],
21
+ }),
22
+ });
23
+ });
24
+
25
+ await page.route(`**/ws/rest/v1/reportbuilder/section/${sectionUuid}**`, async (route) => {
26
+ await route.fulfill({
27
+ status: 200,
28
+ contentType: 'application/json',
29
+ body: JSON.stringify({
30
+ uuid: sectionUuid,
31
+ name: 'Monthly HTS Summary',
32
+ code: 'HTS_MONTHLY',
33
+ configJson: JSON.stringify({ indicators: [{ uuid: indicatorUuid }] }),
34
+ }),
35
+ });
36
+ });
37
+
38
+ await page.route('**/ws/rest/v1/reportbuilder/indicator**', async (route) => {
39
+ await route.fulfill({
40
+ status: 200,
41
+ contentType: 'application/json',
42
+ body: JSON.stringify({ results: [] }),
43
+ });
44
+ });
45
+
46
+ await page.route('**/ws/rest/v1/reportbuilder/sectionpreview', async (route) => {
47
+ const body = route.request().postDataJSON();
48
+ expect(body).toEqual({
49
+ sectionUuid,
50
+ indicatorUuid,
51
+ startDate: '2026-01-01',
52
+ endDate: '2026-01-31',
53
+ maxRows: 100,
54
+ params: {},
55
+ });
56
+
57
+ await route.fulfill({
58
+ status: 200,
59
+ contentType: 'application/json',
60
+ body: JSON.stringify({
61
+ sectionUuid,
62
+ results: [
63
+ {
64
+ indicatorUuid,
65
+ name: 'HTS TST',
66
+ kind: 'base',
67
+ columns: ['age_group', 'gender', 'value'],
68
+ rows: [
69
+ ['0-28d', 'F', 2],
70
+ ['0-28d', 'M', 1],
71
+ ],
72
+ rowCount: 2,
73
+ truncated: false,
74
+ },
75
+ ],
76
+ }),
77
+ });
78
+ });
79
+
80
+ await reportSectionsPage.goto();
81
+ await reportSectionsPage.expectLoaded();
82
+ await reportSectionsPage.openPreviewFor('Monthly HTS Summary');
83
+ await sectionPreviewModal.expectOpen();
84
+ await sectionPreviewModal.fillPreviewRequest({
85
+ startDate: '2026-01-01',
86
+ endDate: '2026-01-31',
87
+ indicatorUuid,
88
+ maxRows: 100,
89
+ });
90
+ await sectionPreviewModal.run();
91
+ await sectionPreviewModal.expectMatrixVisible();
92
+ await expect(page.getByText('HTS TST')).toBeVisible();
93
+ });
94
+ });
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "types": ["node", "@playwright/test"],
5
+ "noEmit": true
6
+ },
7
+ "include": [
8
+ "./**/*.ts",
9
+ "../playwright.config.ts"
10
+ ]
11
+ }
package/example.env ADDED
@@ -0,0 +1,5 @@
1
+ E2E_BASE_URL=http://localhost:8080/openmrs
2
+ E2E_USERNAME=admin
3
+ E2E_PASSWORD=Admin123
4
+ E2E_LOGIN_LOCATION=8d6c993e-c2cc-11de-8d13-0010c6dffd0f
5
+ PLAYWRIGHT_BASE_URL=
package/jest.config.js ADDED
@@ -0,0 +1,28 @@
1
+ /** @type {import('jest').Config} */
2
+ module.exports = {
3
+ clearMocks: true,
4
+ transform: {
5
+ '^.+\\.[jt]sx?$': ['@swc/jest'],
6
+ },
7
+ transformIgnorePatterns: ['/node_modules/(?!@openmrs|.+\\.pnp\\.[^\\/]+$)'],
8
+ moduleDirectories: ['node_modules', '__mocks__', 'tools', 'src', __dirname],
9
+ moduleNameMapper: {
10
+ '^@resources/(.*)$': '<rootDir>/src/resources/$1',
11
+ '^@hooks/(.*)$': '<rootDir>/src/hooks/$1',
12
+ '^@types$': '<rootDir>/src/types.ts',
13
+ '^@tools/(.*)$': '<rootDir>/tools/$1',
14
+ '^@constants$': '<rootDir>/src/constants.ts',
15
+ '^@carbon/icons-react/es/(.*)$': '@carbon/icons-react/lib/$1',
16
+ '^carbon-components-react/es/(.*)$': 'carbon-components-react/lib/$1',
17
+ '@openmrs/esm-framework': '@openmrs/esm-framework/mock',
18
+ '\\.(s?css)$': 'identity-obj-proxy',
19
+ '^lodash-es/(.*)$': 'lodash/$1',
20
+ 'lodash-es': 'lodash',
21
+ '^dexie$': '<rootDir>/node_modules/dexie',
22
+ '^react-i18next$': '<rootDir>/__mocks__/react-i18next.js',
23
+ 'react-markdown': '<rootDir>/__mocks__/react-markdown.tsx',
24
+ },
25
+ setupFilesAfterEnv: ['<rootDir>/tools/setup-tests.ts'],
26
+ testEnvironment: 'jsdom',
27
+ testPathIgnorePatterns: ['<rootDir>/e2e'],
28
+ };
package/package.json ADDED
@@ -0,0 +1,102 @@
1
+ {
2
+ "name": "@epcare/esm-report-builder",
3
+ "version": "0.1.1-pre.13",
4
+ "license": "MPL-2.0",
5
+ "description": "OpenMRS ESM Report Builder",
6
+ "browser": "dist/openmrs-esm-report-builder.js",
7
+ "main": "src/index.ts",
8
+ "source": true,
9
+ "files": [
10
+ "*"
11
+ ],
12
+ "scripts": {
13
+ "start": "openmrs develop",
14
+ "serve": "webpack serve --mode=development",
15
+ "build": "webpack --mode production",
16
+ "analyze": "webpack --mode=production --env.analyze=true",
17
+ "lint": "eslint --ext js,jsx,ts,tsx .",
18
+ "typescript": "tsc",
19
+ "test": "jest --passWithNoTests",
20
+ "coverage": "jest --coverage --passWithNoTests",
21
+ "verify": "npm-run-all --parallel lint test typescript",
22
+ "e2e": "playwright test",
23
+ "e2e:ui": "playwright test --ui",
24
+ "e2e:headed": "playwright test --headed",
25
+ "e2e:install": "playwright install"
26
+ },
27
+ "dependencies": {
28
+ "@carbon/icons-react": "^11.58.0",
29
+ "@carbon/react": "^1.39.0",
30
+ "@react-aria/utils": "^3.31.0",
31
+ "@react-types/shared": "^3.32.0",
32
+ "classnames": "^2.5.1",
33
+ "dayjs": "^1.11.13",
34
+ "lodash-es": "^4.17.21",
35
+ "nanoid": "^5.1.5",
36
+ "react-ace": "^10.1.0",
37
+ "react-aria": "^3.44.0",
38
+ "react-router-dom": "^6.30.1",
39
+ "react-stately": "^3.42.0",
40
+ "sass": "^1.83.0",
41
+ "single-spa-react": "^6.0.2",
42
+ "swr": "^2.2.5",
43
+ "uuid": "^11.1.0",
44
+ "zustand": "^4.5.7"
45
+ },
46
+ "devDependencies": {
47
+ "@openmrs/esm-framework": "next",
48
+ "@openmrs/esm-styleguide": "next",
49
+ "@playwright/test": "^1.58.2",
50
+ "@swc/core": "^1.7.36",
51
+ "@swc/jest": "^0.2.36",
52
+ "@types/jest": "^29.5.12",
53
+ "@types/minimatch": "^5.1.2",
54
+ "@types/node": "^22.10.2",
55
+ "@types/react": "^18.3.2",
56
+ "@types/react-dom": "^18.3.0",
57
+ "@types/webpack-env": "^1.18.5",
58
+ "@typescript-eslint/eslint-plugin": "^7.9.0",
59
+ "@typescript-eslint/parser": "^7.9.0",
60
+ "css-loader": "^6.11.0",
61
+ "eslint": "^8.57.0",
62
+ "eslint-plugin-import": "^2.31.0",
63
+ "eslint-plugin-react-hooks": "^4.6.2",
64
+ "jest": "^29.7.0",
65
+ "jest-cli": "^29.7.0",
66
+ "jest-environment-jsdom": "^29.7.0",
67
+ "npm-run-all": "^4.1.5",
68
+ "openmrs": "next",
69
+ "prettier": "^3.4.2",
70
+ "react": "^18.3.1",
71
+ "react-dom": "^18.3.1",
72
+ "react-i18next": "^16.0.0",
73
+ "rxjs": "^6.6.7",
74
+ "single-spa": "^5.9.5",
75
+ "swc-loader": "^0.2.6",
76
+ "typescript": "5.5.4"
77
+ },
78
+ "peerDependencies": {
79
+ "@openmrs/esm-framework": "^8.0.0",
80
+ "react": "^18.0.0",
81
+ "react-dom": "^18.0.0",
82
+ "react-i18next": "^16.0.0",
83
+ "rxjs": "^6.6.7",
84
+ "single-spa": "^5.0.0"
85
+ },
86
+ "resolutions": {
87
+ "zustand": "^4.5.7"
88
+ },
89
+ "openmrs": {
90
+ "buildPath": "dist",
91
+ "rootDir": "src",
92
+ "config": {
93
+ "paths": {
94
+ "@epcare/esm-report-builder": [
95
+ "src"
96
+ ]
97
+ }
98
+ }
99
+ },
100
+ "packageManager": "yarn@4.10.3",
101
+ "stableVersion": "0.1.0"
102
+ }
@@ -0,0 +1,28 @@
1
+ import { defineConfig, devices } from '@playwright/test';
2
+
3
+ const rootBaseUrl = process.env.PLAYWRIGHT_BASE_URL
4
+ || (process.env.E2E_BASE_URL ? `${process.env.E2E_BASE_URL.replace(/\/$/, '')}/spa/report-builder` : 'http://localhost:8080/openmrs/spa/report-builder');
5
+
6
+ export default defineConfig({
7
+ testDir: './e2e/specs',
8
+ fullyParallel: true,
9
+ retries: process.env.CI ? 2 : 0,
10
+ workers: process.env.CI ? 1 : undefined,
11
+ reporter: [['list'], ['html', { open: 'never' }]],
12
+ timeout: 60_000,
13
+ expect: { timeout: 10_000 },
14
+ use: {
15
+ baseURL: rootBaseUrl,
16
+ trace: 'retain-on-failure',
17
+ screenshot: 'only-on-failure',
18
+ video: 'retain-on-failure',
19
+ storageState: 'e2e/storageState.json',
20
+ },
21
+ globalSetup: './e2e/core/global-setup.ts',
22
+ projects: [
23
+ {
24
+ name: 'chromium',
25
+ use: { ...devices['Desktop Chrome'] },
26
+ },
27
+ ],
28
+ });
@@ -0,0 +1,55 @@
1
+ .cardLink {
2
+ text-decoration: none;
3
+ }
4
+ .tile {
5
+ padding: 1rem;
6
+ min-height: 5rem;
7
+ display: block;
8
+ }
9
+ .title {
10
+ font-weight: 600;
11
+ margin-bottom: 0.25rem;
12
+ }
13
+ .description {
14
+ font-size: 0.875rem;
15
+ }
16
+
17
+ .panel {
18
+ padding: 1rem;
19
+ border-radius: 12px; // adjust to match your design
20
+ }
21
+
22
+ .panelTitle {
23
+ margin: 0 0 0.75rem 0;
24
+ }
25
+
26
+ .panelHeaderRow {
27
+ display: flex;
28
+ justify-content: space-between;
29
+ align-items: center;
30
+ gap: 1rem;
31
+ }
32
+
33
+ .subtleText {
34
+ margin: 0 0 1rem 0;
35
+ opacity: 0.8;
36
+ }
37
+
38
+ .mappingGrid {
39
+ display: grid;
40
+ grid-template-columns: 1fr 1fr;
41
+ gap: 1rem;
42
+ }
43
+
44
+ .dimensionsGrid {
45
+ margin-top: 1rem;
46
+ display: grid;
47
+ grid-template-columns: 1fr 1fr;
48
+ gap: 1rem;
49
+ }
50
+
51
+ .treeWrapper {
52
+ max-height: calc(100vh - 240px);
53
+ overflow: auto;
54
+ }
55
+