@kenyaemr/esm-admin-app 5.3.7

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 (69) hide show
  1. package/.turbo/turbo-build.log +93 -0
  2. package/README.md +12 -0
  3. package/dist/126.js +1 -0
  4. package/dist/126.js.map +1 -0
  5. package/dist/144.js +2 -0
  6. package/dist/144.js.LICENSE.txt +19 -0
  7. package/dist/144.js.map +1 -0
  8. package/dist/300.js +1 -0
  9. package/dist/345.js +1 -0
  10. package/dist/345.js.map +1 -0
  11. package/dist/357.js +2 -0
  12. package/dist/357.js.LICENSE.txt +9 -0
  13. package/dist/357.js.map +1 -0
  14. package/dist/372.js +1 -0
  15. package/dist/372.js.map +1 -0
  16. package/dist/41.js +2 -0
  17. package/dist/41.js.LICENSE.txt +9 -0
  18. package/dist/41.js.map +1 -0
  19. package/dist/454.js +2 -0
  20. package/dist/454.js.LICENSE.txt +10 -0
  21. package/dist/454.js.map +1 -0
  22. package/dist/495.js +1 -0
  23. package/dist/495.js.map +1 -0
  24. package/dist/814.js +1 -0
  25. package/dist/814.js.map +1 -0
  26. package/dist/831.js +2 -0
  27. package/dist/831.js.LICENSE.txt +5 -0
  28. package/dist/831.js.map +1 -0
  29. package/dist/876.js +2 -0
  30. package/dist/876.js.LICENSE.txt +9 -0
  31. package/dist/876.js.map +1 -0
  32. package/dist/913.js +2 -0
  33. package/dist/913.js.LICENSE.txt +32 -0
  34. package/dist/913.js.map +1 -0
  35. package/dist/kenyaemr-esm-admin-app.js +1 -0
  36. package/dist/kenyaemr-esm-admin-app.js.buildmanifest.json +432 -0
  37. package/dist/kenyaemr-esm-admin-app.js.map +1 -0
  38. package/dist/main.js +2 -0
  39. package/dist/main.js.LICENSE.txt +30 -0
  40. package/dist/main.js.map +1 -0
  41. package/dist/routes.json +1 -0
  42. package/jest.config.js +8 -0
  43. package/package.json +54 -0
  44. package/src/components/confirm-modal/confirmation-operation-modal.component.tsx +43 -0
  45. package/src/components/confirm-modal/confirmation-operation.test.tsx +69 -0
  46. package/src/components/dashboard/dashboard.component.tsx +117 -0
  47. package/src/components/dashboard/dashboard.scss +38 -0
  48. package/src/components/empty-state/empty-state-log.components.tsx +20 -0
  49. package/src/components/empty-state/empty-state-log.scss +28 -0
  50. package/src/components/empty-state/empty-state-log.test.tsx +24 -0
  51. package/src/components/header/header-illustration.component.tsx +13 -0
  52. package/src/components/header/header.component.tsx +28 -0
  53. package/src/components/header/header.scss +19 -0
  54. package/src/components/logs-table/operation-log-resource.ts +34 -0
  55. package/src/components/logs-table/operation-log-table.component.tsx +120 -0
  56. package/src/components/logs-table/operation-log.scss +10 -0
  57. package/src/components/logs-table/operation-log.test.tsx +47 -0
  58. package/src/config-schema.ts +5 -0
  59. package/src/constants.ts +2 -0
  60. package/src/declarations.d.ts +6 -0
  61. package/src/index.ts +18 -0
  62. package/src/root.component.tsx +16 -0
  63. package/src/root.scss +7 -0
  64. package/src/routes.json +22 -0
  65. package/src/setup-tests.ts +1 -0
  66. package/src/types/index.ts +6 -0
  67. package/translations/en.json +26 -0
  68. package/tsconfig.json +5 -0
  69. package/webpack.config.js +1 -0
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
+ import '@testing-library/jest-dom';
4
+ import LogTable from './operation-log-table.component';
5
+ import { ETLResponse } from '../../types';
6
+
7
+ describe('LogTable Component', () => {
8
+ const mockLogData: ETLResponse[] = [
9
+ {
10
+ script_name: 'Initial Population of Tables',
11
+ start_time: '2024-11-28T09:30:12',
12
+ stop_time: '2024-11-28T09:33:15',
13
+ status: 'Success',
14
+ },
15
+ {
16
+ script_name: 'Initial Creation of Tables',
17
+ start_time: '2024-11-28T09:30:12',
18
+ stop_time: '2024-11-28T09:33:15',
19
+ status: 'Failed',
20
+ },
21
+ ];
22
+
23
+ it('renders the table with correct headers and rows', () => {
24
+ render(<LogTable logData={mockLogData} isLoading={false} />);
25
+
26
+ const headers = ['Procedure', 'Start time', 'End time', 'Completion status'];
27
+ headers.forEach((header) => {
28
+ expect(screen.getByText(header)).toBeInTheDocument();
29
+ });
30
+
31
+ const rows = screen.getAllByRole('row');
32
+ expect(rows.length).toBe(3);
33
+ });
34
+
35
+ it('displays "No ETL Operation logs found" when logData is empty', () => {
36
+ render(<LogTable logData={[]} isLoading={false} />);
37
+
38
+ expect(screen.getByText('No ETL Operation logs found')).toBeInTheDocument();
39
+ });
40
+
41
+ it('shows skeleton loading state when isLoading is true', () => {
42
+ render(<LogTable logData={[]} isLoading={true} />);
43
+
44
+ const skeleton = screen.getByLabelText('etl table');
45
+ expect(skeleton).toBeInTheDocument();
46
+ });
47
+ });
@@ -0,0 +1,5 @@
1
+ import { Type } from '@openmrs/esm-framework';
2
+
3
+ export const configSchema = {};
4
+
5
+ export interface ConfigObject {}
@@ -0,0 +1,2 @@
1
+ export const moduleName = '@kenyaemr/esm-admin-app';
2
+ export const etlBasePath = `${window.spaBase}/admin`;
@@ -0,0 +1,6 @@
1
+ declare module '@carbon/react';
2
+ declare module '*.css';
3
+ declare module '*.scss';
4
+ declare module '*.png';
5
+
6
+ declare type SideNavProps = object;
package/src/index.ts ADDED
@@ -0,0 +1,18 @@
1
+ import { getAsyncLifecycle, defineConfigSchema, getSyncLifecycle, registerBreadcrumbs } from '@openmrs/esm-framework';
2
+ import { configSchema } from './config-schema';
3
+ import { moduleName } from './constants';
4
+ import OperationConfirmation from './components/confirm-modal/confirmation-operation-modal.component';
5
+
6
+ const options = {
7
+ featureName: 'esm-admin-app',
8
+ moduleName,
9
+ };
10
+
11
+ export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
12
+
13
+ export function startupApp() {
14
+ defineConfigSchema(moduleName, configSchema);
15
+ }
16
+
17
+ export const root = getAsyncLifecycle(() => import('./root.component'), options);
18
+ export const operationConfirmationModal = getSyncLifecycle(OperationConfirmation, options);
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { BrowserRouter, Route, Routes } from 'react-router-dom';
3
+ import { etlBasePath } from './constants';
4
+ import Dashboard from './components/dashboard/dashboard.component';
5
+
6
+ const Root: React.FC = () => {
7
+ return (
8
+ <BrowserRouter basename={etlBasePath}>
9
+ <Routes>
10
+ <Route path="/" element={<Dashboard />} />
11
+ </Routes>
12
+ </BrowserRouter>
13
+ );
14
+ };
15
+
16
+ export default Root;
package/src/root.scss ADDED
@@ -0,0 +1,7 @@
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+ @use '@carbon/colors';
4
+
5
+ .container {
6
+ padding: layout.$spacing-07;
7
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json.openmrs.org/routes.schema.json",
3
+ "backendDependencies": {
4
+ "kenyaemrCharts": "^1.6.7"
5
+ },
6
+ "extensions": [
7
+ ],
8
+ "modals": [
9
+ {
10
+ "component": "operationConfirmationModal",
11
+ "name": "operation-confirmation-modal"
12
+ }
13
+ ],
14
+ "pages": [
15
+ {
16
+ "component": "root",
17
+ "route": "admin",
18
+ "online": true,
19
+ "offline": true
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom/extend-expect';
@@ -0,0 +1,6 @@
1
+ export interface ETLResponse {
2
+ script_name: string;
3
+ start_time: string;
4
+ stop_time: string;
5
+ status: string;
6
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "completionStatus": "Completion status",
3
+ "confirmation": "Confirmation",
4
+ "endTime": "End time",
5
+ "etlAdministration": "ETL Administration",
6
+ "etlOperation": "ETL operations",
7
+ "etlOperationLog": "ETL Operations Log",
8
+ "etlsOperationsLoading": "Please wait {{currentOperation}} is in progress...",
9
+ "home": "Home",
10
+ "noRecordsFound": "No ETL Operation logs found",
11
+ "noRespond": "No",
12
+ "operationError": "{{operationName}} failed",
13
+ "operationErrorSubtitle": "An error occurred during the operation.",
14
+ "operationsConfirmationMessages": "Do you want to {{operationTypeOrName}}?",
15
+ "operationSuccess": "{{operationName}} successfully {{operationType}}",
16
+ "operationSuccessSubtitle": "The operation completed successfully.",
17
+ "procedure": "Procedure",
18
+ "recreated": "recreated",
19
+ "recreateDatatools": "Recreate datatools",
20
+ "recreateTables": "Recreate tables",
21
+ "refreshDwapi": "Refresh DWAPI tables",
22
+ "refreshed": "refreshed",
23
+ "refreshTables": "Refresh tables",
24
+ "startTime": "Start time",
25
+ "yesRespond": "Yes"
26
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "include": ["src/**/*"],
4
+ "exclude": ["src/**/*.test.tsx"]
5
+ }
@@ -0,0 +1 @@
1
+ module.exports = require('openmrs/default-webpack-config');