@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.
- package/.turbo/turbo-build.log +93 -0
- package/README.md +12 -0
- package/dist/126.js +1 -0
- package/dist/126.js.map +1 -0
- package/dist/144.js +2 -0
- package/dist/144.js.LICENSE.txt +19 -0
- package/dist/144.js.map +1 -0
- package/dist/300.js +1 -0
- package/dist/345.js +1 -0
- package/dist/345.js.map +1 -0
- package/dist/357.js +2 -0
- package/dist/357.js.LICENSE.txt +9 -0
- package/dist/357.js.map +1 -0
- package/dist/372.js +1 -0
- package/dist/372.js.map +1 -0
- package/dist/41.js +2 -0
- package/dist/41.js.LICENSE.txt +9 -0
- package/dist/41.js.map +1 -0
- package/dist/454.js +2 -0
- package/dist/454.js.LICENSE.txt +10 -0
- package/dist/454.js.map +1 -0
- package/dist/495.js +1 -0
- package/dist/495.js.map +1 -0
- package/dist/814.js +1 -0
- package/dist/814.js.map +1 -0
- package/dist/831.js +2 -0
- package/dist/831.js.LICENSE.txt +5 -0
- package/dist/831.js.map +1 -0
- package/dist/876.js +2 -0
- package/dist/876.js.LICENSE.txt +9 -0
- package/dist/876.js.map +1 -0
- package/dist/913.js +2 -0
- package/dist/913.js.LICENSE.txt +32 -0
- package/dist/913.js.map +1 -0
- package/dist/kenyaemr-esm-admin-app.js +1 -0
- package/dist/kenyaemr-esm-admin-app.js.buildmanifest.json +432 -0
- package/dist/kenyaemr-esm-admin-app.js.map +1 -0
- package/dist/main.js +2 -0
- package/dist/main.js.LICENSE.txt +30 -0
- package/dist/main.js.map +1 -0
- package/dist/routes.json +1 -0
- package/jest.config.js +8 -0
- package/package.json +54 -0
- package/src/components/confirm-modal/confirmation-operation-modal.component.tsx +43 -0
- package/src/components/confirm-modal/confirmation-operation.test.tsx +69 -0
- package/src/components/dashboard/dashboard.component.tsx +117 -0
- package/src/components/dashboard/dashboard.scss +38 -0
- package/src/components/empty-state/empty-state-log.components.tsx +20 -0
- package/src/components/empty-state/empty-state-log.scss +28 -0
- package/src/components/empty-state/empty-state-log.test.tsx +24 -0
- package/src/components/header/header-illustration.component.tsx +13 -0
- package/src/components/header/header.component.tsx +28 -0
- package/src/components/header/header.scss +19 -0
- package/src/components/logs-table/operation-log-resource.ts +34 -0
- package/src/components/logs-table/operation-log-table.component.tsx +120 -0
- package/src/components/logs-table/operation-log.scss +10 -0
- package/src/components/logs-table/operation-log.test.tsx +47 -0
- package/src/config-schema.ts +5 -0
- package/src/constants.ts +2 -0
- package/src/declarations.d.ts +6 -0
- package/src/index.ts +18 -0
- package/src/root.component.tsx +16 -0
- package/src/root.scss +7 -0
- package/src/routes.json +22 -0
- package/src/setup-tests.ts +1 -0
- package/src/types/index.ts +6 -0
- package/translations/en.json +26 -0
- package/tsconfig.json +5 -0
- 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
|
+
});
|
package/src/constants.ts
ADDED
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
package/src/routes.json
ADDED
|
@@ -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,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 @@
|
|
|
1
|
+
module.exports = require('openmrs/default-webpack-config');
|