@openmrs/esm-task-list-app 1.0.0
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/.editorconfig +12 -0
- package/.eslintignore +2 -0
- package/.eslintrc +57 -0
- package/.husky/pre-commit +7 -0
- package/.husky/pre-push +6 -0
- package/.prettierignore +13 -0
- package/.turbo.json +18 -0
- package/.yarn/plugins/@yarnpkg/plugin-outdated.cjs +35 -0
- package/LICENSE +401 -0
- package/README.md +28 -0
- package/__mocks__/react-i18next.js +73 -0
- package/example.env +6 -0
- package/jest.config.js +34 -0
- package/package.json +108 -0
- package/prettier.config.js +8 -0
- package/src/config-schema.ts +13 -0
- package/src/declarations.d.ts +5 -0
- package/src/index.ts +24 -0
- package/src/launch-button/task-list-launch-button.extension.tsx +20 -0
- package/src/loader/loader.component.tsx +12 -0
- package/src/loader/loader.scss +9 -0
- package/src/routes.json +28 -0
- package/src/types.d.ts +9 -0
- package/src/workspace/add-task-form.component.tsx +551 -0
- package/src/workspace/add-task-form.scss +58 -0
- package/src/workspace/add-task-form.test.tsx +458 -0
- package/src/workspace/delete-task.modal.tsx +71 -0
- package/src/workspace/delete-task.scss +7 -0
- package/src/workspace/task-details-view.component.tsx +212 -0
- package/src/workspace/task-details-view.scss +67 -0
- package/src/workspace/task-details-view.test.tsx +411 -0
- package/src/workspace/task-list-view.component.tsx +154 -0
- package/src/workspace/task-list-view.scss +150 -0
- package/src/workspace/task-list.resource.ts +570 -0
- package/src/workspace/task-list.scss +37 -0
- package/src/workspace/task-list.workspace.tsx +88 -0
- package/tools/i18next-parser.config.js +89 -0
- package/tools/setup-tests.ts +8 -0
- package/tools/update-openmrs-deps.mjs +43 -0
- package/translations/en.json +63 -0
- package/tsconfig.json +24 -0
- package/webpack.config.js +1 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
contextSeparator: '_',
|
|
3
|
+
// Key separator used in your translation keys
|
|
4
|
+
|
|
5
|
+
createOldCatalogs: false,
|
|
6
|
+
// Save the \_old files
|
|
7
|
+
|
|
8
|
+
defaultNamespace: 'translations',
|
|
9
|
+
// Default namespace used in your i18next config
|
|
10
|
+
|
|
11
|
+
defaultValue: '',
|
|
12
|
+
// Default value to give to empty keys
|
|
13
|
+
// You may also specify a function accepting the locale, namespace, and key as arguments
|
|
14
|
+
|
|
15
|
+
indentation: 2,
|
|
16
|
+
// Indentation of the catalog files
|
|
17
|
+
|
|
18
|
+
keepRemoved: false,
|
|
19
|
+
// Keep keys from the catalog that are no longer in code
|
|
20
|
+
|
|
21
|
+
keySeparator: '.',
|
|
22
|
+
// Key separator used in your translation keys
|
|
23
|
+
// If you want to use plain english keys, separators such as `.` and `:` will conflict. You might want to set `keySeparator: false` and `namespaceSeparator: false`. That way, `t('Status: Loading...')` will not think that there are a namespace and three separator dots for instance.
|
|
24
|
+
|
|
25
|
+
// see below for more details
|
|
26
|
+
lexers: {
|
|
27
|
+
hbs: ['HandlebarsLexer'],
|
|
28
|
+
handlebars: ['HandlebarsLexer'],
|
|
29
|
+
|
|
30
|
+
htm: ['HTMLLexer'],
|
|
31
|
+
html: ['HTMLLexer'],
|
|
32
|
+
|
|
33
|
+
mjs: ['JavascriptLexer'],
|
|
34
|
+
js: ['JavascriptLexer'], // if you're writing jsx inside .js files, change this to JsxLexer
|
|
35
|
+
ts: ['JavascriptLexer'],
|
|
36
|
+
jsx: ['JsxLexer'],
|
|
37
|
+
tsx: ['JsxLexer'],
|
|
38
|
+
|
|
39
|
+
default: ['JavascriptLexer'],
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
lineEnding: 'auto',
|
|
43
|
+
// Control the line ending. See options at https://github.com/ryanve/eol
|
|
44
|
+
|
|
45
|
+
locales: ['en'],
|
|
46
|
+
// An array of the locales in your applications
|
|
47
|
+
|
|
48
|
+
namespaceSeparator: ':',
|
|
49
|
+
// Namespace separator used in your translation keys
|
|
50
|
+
// If you want to use plain english keys, separators such as `.` and `:` will conflict. You might want to set `keySeparator: false` and `namespaceSeparator: false`. That way, `t('Status: Loading...')` will not think that there are a namespace and three separator dots for instance.
|
|
51
|
+
|
|
52
|
+
output: '$NAMESPACE/$LOCALE.json',
|
|
53
|
+
// Supports $LOCALE and $NAMESPACE injection
|
|
54
|
+
// Supports JSON (.json) and YAML (.yml) file formats
|
|
55
|
+
// Where to write the locale files relative to process.cwd()
|
|
56
|
+
|
|
57
|
+
pluralSeparator: '_',
|
|
58
|
+
// Plural separator used in your translation keys
|
|
59
|
+
// If you want to use plain english keys, separators such as `_` might conflict. You might want to set `pluralSeparator` to a different string that does not occur in your keys.
|
|
60
|
+
|
|
61
|
+
input: undefined,
|
|
62
|
+
// An array of globs that describe where to look for source files
|
|
63
|
+
// relative to the location of the configuration file
|
|
64
|
+
|
|
65
|
+
sort: true,
|
|
66
|
+
// Whether or not to sort the catalog
|
|
67
|
+
|
|
68
|
+
useKeysAsDefaultValue: false,
|
|
69
|
+
// Whether to use the keys as the default value; ex. "Hello": "Hello", "World": "World"
|
|
70
|
+
// This option takes precedence over the `defaultValue` and `skipDefaultValues` options
|
|
71
|
+
// You may also specify a function accepting the locale and namespace as arguments
|
|
72
|
+
|
|
73
|
+
verbose: false,
|
|
74
|
+
// Display info about the parsing including some stats
|
|
75
|
+
|
|
76
|
+
failOnWarnings: false,
|
|
77
|
+
// Exit with an exit code of 1 on warnings
|
|
78
|
+
|
|
79
|
+
customValueTemplate: null,
|
|
80
|
+
// If you wish to customize the value output the value as an object, you can set your own format.
|
|
81
|
+
// ${defaultValue} is the default value you set in your translation function.
|
|
82
|
+
// Any other custom property will be automatically extracted.
|
|
83
|
+
//
|
|
84
|
+
// Example:
|
|
85
|
+
// {
|
|
86
|
+
// message: "${defaultValue}",
|
|
87
|
+
// description: "${maxLength}", // t('my-key', {maxLength: 150})
|
|
88
|
+
// }
|
|
89
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
|
|
3
|
+
try {
|
|
4
|
+
// NB for other places use '@openmrs/*@next'; here we want to ignore patient-common-lib
|
|
5
|
+
execSync(`yarn up --fixed '@openmrs/*@next' 'openmrs@next'`, {
|
|
6
|
+
stdio: ['ignore', 'inherit', 'inherit'],
|
|
7
|
+
windowsHide: true,
|
|
8
|
+
});
|
|
9
|
+
} catch (error) {
|
|
10
|
+
console.error(`Error while updating dependencies: ${error.message ?? error}`);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
execSync(`yarn dedupe`, {
|
|
16
|
+
stdio: ['ignore', 'inherit', 'inherit'],
|
|
17
|
+
windowsHide: true,
|
|
18
|
+
});
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.error(`Error while deduplicating dependencies: ${error.message ?? error}`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
execSync(`git diff-index --quiet HEAD --`, {
|
|
26
|
+
stdio: 'ignore',
|
|
27
|
+
windowsHide: true,
|
|
28
|
+
});
|
|
29
|
+
process.exit(0);
|
|
30
|
+
} catch (error) {
|
|
31
|
+
// git diff-index --quite HEAD --
|
|
32
|
+
// exits with status 1 if there are changes; we only need to run yarn verify if there are changes
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
execSync(`yarn verify`, {
|
|
37
|
+
stdio: ['ignore', 'inherit', 'inherit'],
|
|
38
|
+
windowsHide: true,
|
|
39
|
+
});
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.error(`Error while running yarn verify: ${error.message ?? error}. Updates require manual intervention.`);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"addTask": "Add Task",
|
|
3
|
+
"addTaskButton": "Add Task",
|
|
4
|
+
"assignedTo": "Assigned to",
|
|
5
|
+
"assignProviderLabel": "Assign to provider",
|
|
6
|
+
"assignProviderPlaceholder": "Search providers",
|
|
7
|
+
"assignProviderRoleLabel": "Assign to provider role",
|
|
8
|
+
"assignProviderRolePlaceholder": "Search provider roles",
|
|
9
|
+
"backToTaskDetails": "Back to task details",
|
|
10
|
+
"backToTaskList": "Back to task list",
|
|
11
|
+
"createdBy": "Created by",
|
|
12
|
+
"customTaskName": "Custom task",
|
|
13
|
+
"date": "Date",
|
|
14
|
+
"deleteTask": "Delete task",
|
|
15
|
+
"deleteTaskConfirmationText": "Are you sure you want to delete this task?",
|
|
16
|
+
"deleting": "Deleting",
|
|
17
|
+
"discard": "Discard",
|
|
18
|
+
"dueDate": "Due date",
|
|
19
|
+
"dueDateLabel": "Due date",
|
|
20
|
+
"dueDateRequired": "Due date is required when Date is selected",
|
|
21
|
+
"dueLabel": "Due",
|
|
22
|
+
"errorDeletingTask": "Error deleting task",
|
|
23
|
+
"markComplete": "Mark complete",
|
|
24
|
+
"markIncomplete": "Mark incomplete",
|
|
25
|
+
"name": "Name",
|
|
26
|
+
"nextVisit": "Next visit",
|
|
27
|
+
"noAssignment": "No assignment",
|
|
28
|
+
"noTasksMessage": "No tasks yet",
|
|
29
|
+
"overdue": "Overdue",
|
|
30
|
+
"priorityHigh": "High",
|
|
31
|
+
"priorityLabel": "Priority",
|
|
32
|
+
"priorityLow": "Low",
|
|
33
|
+
"priorityMedium": "Medium",
|
|
34
|
+
"priorityPlaceholder": "Select priority (optional)",
|
|
35
|
+
"providerSearchHint": "Start typing to search for providers",
|
|
36
|
+
"rationale": "Rationale",
|
|
37
|
+
"rationaleLabel": "Explain briefly why this task is necessary (optional)",
|
|
38
|
+
"rationalePlaceholder": "Add a note here",
|
|
39
|
+
"saveTask": "Save task",
|
|
40
|
+
"scheduledInfo": "Scheduled",
|
|
41
|
+
"scheduledOnNextVisit": "On {{date}} for the following visit",
|
|
42
|
+
"scheduledOnThisVisit": "On {{date}} for the same visit",
|
|
43
|
+
"scheduledTodayForNextVisit": "Today for next visit",
|
|
44
|
+
"scheduledTodayForThisVisit": "Today for this visit",
|
|
45
|
+
"selectSingleAssignee": "Select either a provider or a provider role, not both",
|
|
46
|
+
"systemTaskEditSubtitle": "Task name cannot be changed.",
|
|
47
|
+
"systemTaskEditTitle": "You're editing a system task",
|
|
48
|
+
"task": "Task",
|
|
49
|
+
"taskAdded": "Task added",
|
|
50
|
+
"taskAddFailed": "Task add failed",
|
|
51
|
+
"taskCompleted": "Task marked as complete",
|
|
52
|
+
"taskDeleted": "Task deleted",
|
|
53
|
+
"taskIncomplete": "Task marked as incomplete",
|
|
54
|
+
"taskList": "Task list",
|
|
55
|
+
"taskLoadError": "There was a problem loading the task list.",
|
|
56
|
+
"taskNameLabel": "Task name",
|
|
57
|
+
"taskNamePlaceholder": "Enter task name",
|
|
58
|
+
"taskNameRequired": "Task name is required",
|
|
59
|
+
"tasks": "Tasks",
|
|
60
|
+
"taskUpdated": "Task updated",
|
|
61
|
+
"taskUpdateFailed": "Unable to update task",
|
|
62
|
+
"thisVisit": "This visit"
|
|
63
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"esModuleInterop": true,
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"allowSyntheticDefaultImports": true,
|
|
6
|
+
"jsx": "react",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"moduleResolution": "node",
|
|
9
|
+
"lib": [
|
|
10
|
+
"dom",
|
|
11
|
+
"es5",
|
|
12
|
+
"scripthost",
|
|
13
|
+
"es2015",
|
|
14
|
+
"es2015.promise",
|
|
15
|
+
"es2016.array.include",
|
|
16
|
+
"es2018",
|
|
17
|
+
"es2020",
|
|
18
|
+
"es2022",
|
|
19
|
+
],
|
|
20
|
+
"resolveJsonModule": true,
|
|
21
|
+
"noEmit": true,
|
|
22
|
+
"target": "esnext"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('openmrs/default-webpack-config');
|