@openmrs/esm-reports-app 4.0.6-pre.161
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 +36 -0
- package/README.md +23 -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/156.js +1 -0
- package/dist/156.js.map +1 -0
- package/dist/202.js +2 -0
- package/dist/202.js.LICENSE.txt +35 -0
- package/dist/202.js.map +1 -0
- package/dist/216.js +1 -0
- package/dist/216.js.map +1 -0
- package/dist/297.js +2 -0
- package/dist/297.js.LICENSE.txt +32 -0
- package/dist/297.js.map +1 -0
- package/dist/300.js +1 -0
- package/dist/304.js +1 -0
- package/dist/304.js.map +1 -0
- package/dist/322.js +1 -0
- package/dist/322.js.map +1 -0
- package/dist/336.js +1 -0
- package/dist/336.js.map +1 -0
- package/dist/353.js +1 -0
- package/dist/353.js.map +1 -0
- package/dist/367.js +2 -0
- package/dist/367.js.LICENSE.txt +5 -0
- package/dist/367.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/549.js +1 -0
- package/dist/549.js.map +1 -0
- package/dist/553.js +2 -0
- package/dist/553.js.LICENSE.txt +14 -0
- package/dist/553.js.map +1 -0
- package/dist/640.js +1 -0
- package/dist/640.js.map +1 -0
- package/dist/699.js +1 -0
- package/dist/699.js.map +1 -0
- package/dist/855.js +2 -0
- package/dist/855.js.LICENSE.txt +9 -0
- package/dist/855.js.map +1 -0
- package/dist/926.js +1 -0
- package/dist/926.js.map +1 -0
- package/dist/947.js +1 -0
- package/dist/947.js.map +1 -0
- package/dist/972.js +2 -0
- package/dist/972.js.LICENSE.txt +14 -0
- package/dist/972.js.map +1 -0
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -0
- package/dist/openmrs-esm-reports-app.js +1 -0
- package/dist/openmrs-esm-reports-app.js.buildmanifest.json +657 -0
- package/dist/openmrs-esm-reports-app.js.map +1 -0
- package/dist/routes.json +1 -0
- package/jest.config.js +3 -0
- package/package.json +57 -0
- package/src/components/edit-scheduled-report/edit-scheduled-report-form.component.tsx +149 -0
- package/src/components/edit-scheduled-report/edit-scheduled-report-form.scss +60 -0
- package/src/components/next-report-execution.component.tsx +31 -0
- package/src/components/overlay.component.tsx +53 -0
- package/src/components/overlay.scss +95 -0
- package/src/components/overview.component.tsx +356 -0
- package/src/components/pagination-constants.ts +3 -0
- package/src/components/report-overview-button.component.tsx +27 -0
- package/src/components/report-parameter-input.component.tsx +121 -0
- package/src/components/report-schedule-description.component.tsx +21 -0
- package/src/components/report-status.component.tsx +68 -0
- package/src/components/report-statuses-constants.ts +11 -0
- package/src/components/reports.resource.tsx +224 -0
- package/src/components/reports.scss +90 -0
- package/src/components/run-report/cancel-report-modal.component.tsx +129 -0
- package/src/components/run-report/run-report-form.component.tsx +241 -0
- package/src/components/run-report/run-report-form.scss +87 -0
- package/src/components/scheduled-overview-cell-content.component.tsx +85 -0
- package/src/components/scheduled-overview.component.tsx +118 -0
- package/src/components/scheduled-report-status.component.tsx +25 -0
- package/src/components/simple-cron-editor/commons.ts +47 -0
- package/src/components/simple-cron-editor/cron-date-picker.component.tsx +67 -0
- package/src/components/simple-cron-editor/cron-day-of-month-select.component.tsx +74 -0
- package/src/components/simple-cron-editor/cron-day-of-week-select.component.tsx +67 -0
- package/src/components/simple-cron-editor/cron-time-picker.component.tsx +60 -0
- package/src/components/simple-cron-editor/simple-cron-editor.component.tsx +342 -0
- package/src/components/simple-cron-editor/simple-cron-editor.scss +34 -0
- package/src/constants.ts +3 -0
- package/src/declarations.d.ts +6 -0
- package/src/hooks/useOverlay.tsx +45 -0
- package/src/index.ts +73 -0
- package/src/reports-link.tsx +22 -0
- package/src/reports.component.tsx +21 -0
- package/src/root.scss +15 -0
- package/src/routes.json +40 -0
- package/src/setup-tests.ts +1 -0
- package/src/types/report-definition.ts +12 -0
- package/src/types/report-design.ts +4 -0
- package/src/types/report-request.ts +8 -0
- package/src/utils/openmrs-cron-utils.ts +26 -0
- package/src/utils/time-utils.ts +43 -0
- package/translations/en.json +86 -0
- package/tsconfig.json +5 -0
- package/webpack.config.js +1 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const TIME_PATTERN = '^(2[0-3]|[0-1]?[0-9]):([0-5][0-9])$';
|
|
2
|
+
export const TIME_PATTERN_REG_EXP = new RegExp(TIME_PATTERN);
|
|
3
|
+
|
|
4
|
+
export interface Time {
|
|
5
|
+
hours: number;
|
|
6
|
+
minutes: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function parseTime(text: string): Time | null {
|
|
10
|
+
if (!text || !TIME_PATTERN_REG_EXP.test(text)) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const parts = text.split(':');
|
|
15
|
+
const hours = parseInt(parts[0], 10);
|
|
16
|
+
const minutes = parseInt(parts[1], 10);
|
|
17
|
+
|
|
18
|
+
if (hours > 23 || minutes > 59) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return { hours, minutes };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function to24HTime(date: Date | Time): string {
|
|
26
|
+
if (!date) {
|
|
27
|
+
return '';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
let hours: number, minutes: number;
|
|
31
|
+
if ('getHours' in date) {
|
|
32
|
+
hours = date.getHours();
|
|
33
|
+
minutes = date.getMinutes();
|
|
34
|
+
} else {
|
|
35
|
+
({ hours, minutes } = date);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (hours > 23 || minutes > 59) {
|
|
39
|
+
return '';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`;
|
|
43
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"actions": "Actions",
|
|
3
|
+
"at": "at",
|
|
4
|
+
"cancel": "Cancel",
|
|
5
|
+
"cancelReport": "Cancel report",
|
|
6
|
+
"cancelReportModalText": "Are you sure you want to cancel this report?",
|
|
7
|
+
"canceling": "Canceling",
|
|
8
|
+
"close": "Close",
|
|
9
|
+
"completed": "Completed",
|
|
10
|
+
"completedAndPreserved": "Completed and Preserved",
|
|
11
|
+
"date": "Date",
|
|
12
|
+
"dateRequired": "Required",
|
|
13
|
+
"dayOfMonthRequired": "Required",
|
|
14
|
+
"dayOfMonth_firstDay": "First day",
|
|
15
|
+
"dayOfMonth_lastDay": "Last day",
|
|
16
|
+
"dayOfWeekRequired": "Required",
|
|
17
|
+
"dayOfWeek_friday": "Friday",
|
|
18
|
+
"dayOfWeek_monday": "Monday",
|
|
19
|
+
"dayOfWeek_saturday": "Saturday",
|
|
20
|
+
"dayOfWeek_sunday": "Sunday",
|
|
21
|
+
"dayOfWeek_thursday": "Thursday",
|
|
22
|
+
"dayOfWeek_tuesday": "Tuesday",
|
|
23
|
+
"dayOfWeek_wednesday": "Wednesday",
|
|
24
|
+
"delete": "Delete",
|
|
25
|
+
"deleteReport": "Delete report",
|
|
26
|
+
"deleteReportModalText": "Are you sure you want to delete this report?",
|
|
27
|
+
"deleteReportScheduleModalText": "Are you sure you want to delete this schedule?",
|
|
28
|
+
"deleteSchedule": "Delete Schedule",
|
|
29
|
+
"deleting": "Deleting",
|
|
30
|
+
"download": "Download",
|
|
31
|
+
"downloadReport": "Download report(s)",
|
|
32
|
+
"downloadReports": "Download reports",
|
|
33
|
+
"edit": "Edit",
|
|
34
|
+
"failed": "Failed",
|
|
35
|
+
"nextPage": "Next page",
|
|
36
|
+
"nextRun": "Next run",
|
|
37
|
+
"no": "No",
|
|
38
|
+
"notATimeText": "hh:mm 24-hr pattern required",
|
|
39
|
+
"notScheduled": "Not Scheduled",
|
|
40
|
+
"on": "on",
|
|
41
|
+
"outputFormat": "Output format",
|
|
42
|
+
"parameters": "Parameters",
|
|
43
|
+
"preserve": "Preserve",
|
|
44
|
+
"preserveReport": "Preserve report",
|
|
45
|
+
"previousPage": "Previous page",
|
|
46
|
+
"queued": "Queued",
|
|
47
|
+
"reportCancelingErrorMsg": "Error during report canceling",
|
|
48
|
+
"reportCancelledSuccessfully": "Report cancelled successfully",
|
|
49
|
+
"reportDeletedSuccessfully": "Report deleted successfully",
|
|
50
|
+
"reportDeletingErrorMsg": "Error during report deleting",
|
|
51
|
+
"reportDownloadedSuccessfully": "Report(s) downloaded successfully",
|
|
52
|
+
"reportDownloadError": "Error during report(s) downloading",
|
|
53
|
+
"reportName": "Report Name",
|
|
54
|
+
"reportPreservedSuccessfully": "Report preserved successfully",
|
|
55
|
+
"reportPreservingErrorMsg": "Error during report preserving",
|
|
56
|
+
"reportRanSuccessfullyMsg": "Report ran successfully",
|
|
57
|
+
"reportRunning": "Report running",
|
|
58
|
+
"reportRunningErrorMsg": "Error while running the report",
|
|
59
|
+
"reportSchedule": "Report schedule",
|
|
60
|
+
"reportScheduleDeletedSuccessfully": "Report schedule deleted successfully",
|
|
61
|
+
"reportScheduleDeletingErrorMsg": "Error during report schedule deleting",
|
|
62
|
+
"reportScheduled": "Report scheduled",
|
|
63
|
+
"reportScheduledErrorMsg": "Failed to schedule a report",
|
|
64
|
+
"reportScheduledSuccessfullyMsg": "Report scheduled successfully",
|
|
65
|
+
"reports": "Reports",
|
|
66
|
+
"requestedBy": "Requested by",
|
|
67
|
+
"requestedOn": "Requested on",
|
|
68
|
+
"run": "Run",
|
|
69
|
+
"runReport": "Run report",
|
|
70
|
+
"runReports": "Run reports",
|
|
71
|
+
"running": "Running",
|
|
72
|
+
"save": "Save",
|
|
73
|
+
"schedule": "Schedule",
|
|
74
|
+
"scheduleCompleted": "Schedule Completed",
|
|
75
|
+
"scheduleReport": "Schedule report",
|
|
76
|
+
"scheduleType_advanced": "Advanced",
|
|
77
|
+
"scheduleType_everyDay": "Every day",
|
|
78
|
+
"scheduleType_everyMonth": "Every month",
|
|
79
|
+
"scheduleType_everyWeek": "Every week",
|
|
80
|
+
"scheduleType_once": "Once",
|
|
81
|
+
"scheduled": "Scheduled",
|
|
82
|
+
"scheduledReports": "Scheduled Reports",
|
|
83
|
+
"selectReport": "Select report",
|
|
84
|
+
"status": "Status",
|
|
85
|
+
"yes": "Yes"
|
|
86
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("openmrs/default-webpack-config");
|