@openmrs/esm-framework 3.2.0 → 3.2.1-pre.1010
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/dist/openmrs-esm-framework.js +1 -1
- package/dist/openmrs-esm-framework.js.LICENSE.txt +2 -0
- package/dist/openmrs-esm-framework.js.map +1 -1
- package/docs/API.md +1460 -1737
- package/docs/classes/OpenmrsFetchError.md +32 -27
- package/docs/enums/Type.md +11 -0
- package/docs/enums/VisitMode.md +5 -5
- package/docs/enums/VisitStatus.md +4 -4
- package/docs/interfaces/AssignedExtension.md +74 -0
- package/docs/interfaces/Config.md +1 -1
- package/docs/interfaces/ConfigSchema.md +3 -3
- package/docs/interfaces/ConnectedExtension.md +3 -106
- package/docs/interfaces/CurrentPatientOptions.md +3 -3
- package/docs/interfaces/ExtensionInfo.md +8 -8
- package/docs/interfaces/ExtensionInstance.md +1 -1
- package/docs/interfaces/ExtensionInternalStore.md +34 -0
- package/docs/interfaces/ExtensionProps.md +2 -2
- package/docs/interfaces/ExtensionRegistration.md +7 -9
- package/docs/interfaces/ExtensionSlotConfig.md +4 -4
- package/docs/interfaces/ExtensionSlotConfigObject.md +9 -3
- package/docs/interfaces/ExtensionSlotInfo.md +23 -9
- package/docs/interfaces/ExtensionSlotState.md +30 -0
- package/docs/interfaces/ExtensionStore.md +2 -17
- package/docs/interfaces/FHIRRequestObj.md +5 -5
- package/docs/interfaces/FHIRResource.md +5 -5
- package/docs/interfaces/OfflineModeResult.md +41 -0
- package/docs/interfaces/OfflineSynchronizationStore.md +4 -1
- package/docs/interfaces/OnlyThePatient.md +3 -3
- package/docs/interfaces/PatientWithFullResponse.md +3 -3
- package/docs/interfaces/QueueItemDescriptor.md +9 -4
- package/docs/interfaces/SyncItem.md +19 -9
- package/docs/interfaces/SyncProcessOptions.md +7 -5
- package/docs/interfaces/VisitItem.md +6 -6
- package/mock.tsx +25 -6
- package/package.json +13 -13
- package/src/integration-tests/extension-config.test.tsx +4 -10
- package/docs/interfaces/ConfigStore.md +0 -34
- package/docs/interfaces/ExtensionDetails.md +0 -81
- package/docs/interfaces/ExtensionSlotConfigsStore.md +0 -32
- package/docs/interfaces/ExtensionSlotInstance.md +0 -51
- package/docs/interfaces/ImplementerToolsConfigStore.md +0 -19
- package/docs/interfaces/WorkspaceItem.md +0 -74
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-framework",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1-pre.1010",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"browser": "dist/openmrs-esm-framework.js",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@openmrs/esm-api": "^3.2.
|
|
39
|
-
"@openmrs/esm-breadcrumbs": "^3.2.
|
|
40
|
-
"@openmrs/esm-config": "^3.2.
|
|
41
|
-
"@openmrs/esm-error-handling": "^3.2.
|
|
42
|
-
"@openmrs/esm-extensions": "^3.2.
|
|
43
|
-
"@openmrs/esm-globals": "^3.2.
|
|
44
|
-
"@openmrs/esm-offline": "^3.2.
|
|
45
|
-
"@openmrs/esm-react-utils": "^3.2.
|
|
46
|
-
"@openmrs/esm-state": "^3.2.
|
|
47
|
-
"@openmrs/esm-styleguide": "^3.2.
|
|
48
|
-
"@openmrs/esm-utils": "^3.2.
|
|
38
|
+
"@openmrs/esm-api": "^3.2.1-pre.1010",
|
|
39
|
+
"@openmrs/esm-breadcrumbs": "^3.2.1-pre.1010",
|
|
40
|
+
"@openmrs/esm-config": "^3.2.1-pre.1010",
|
|
41
|
+
"@openmrs/esm-error-handling": "^3.2.1-pre.1010",
|
|
42
|
+
"@openmrs/esm-extensions": "^3.2.1-pre.1010",
|
|
43
|
+
"@openmrs/esm-globals": "^3.2.1-pre.1010",
|
|
44
|
+
"@openmrs/esm-offline": "^3.2.1-pre.1010",
|
|
45
|
+
"@openmrs/esm-react-utils": "^3.2.1-pre.1010",
|
|
46
|
+
"@openmrs/esm-state": "^3.2.1-pre.1010",
|
|
47
|
+
"@openmrs/esm-styleguide": "^3.2.1-pre.1010",
|
|
48
|
+
"@openmrs/esm-utils": "^3.2.1-pre.1010",
|
|
49
49
|
"dayjs": "^1.10.7"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "2d2457c75087b97cd8959d6a4dc854e3f6b8f6f5"
|
|
52
52
|
}
|
|
@@ -2,12 +2,9 @@ import React from "react";
|
|
|
2
2
|
import {
|
|
3
3
|
attach,
|
|
4
4
|
registerExtension,
|
|
5
|
-
|
|
6
|
-
updateExtensionStore,
|
|
7
|
-
ExtensionStore,
|
|
5
|
+
updateInternalExtensionStore,
|
|
8
6
|
} from "../../../esm-extensions";
|
|
9
7
|
import {
|
|
10
|
-
Extension,
|
|
11
8
|
ExtensionSlot,
|
|
12
9
|
getSyncLifecycle,
|
|
13
10
|
openmrsComponentDecorator,
|
|
@@ -18,7 +15,7 @@ import { render, screen, waitFor } from "@testing-library/react";
|
|
|
18
15
|
|
|
19
16
|
describe("Interaction between configuration and extension systems", () => {
|
|
20
17
|
beforeEach(() => {
|
|
21
|
-
|
|
18
|
+
updateInternalExtensionStore(() => ({ slots: {}, extensions: {} }));
|
|
22
19
|
});
|
|
23
20
|
|
|
24
21
|
test("Config should add, order, and remove extensions within slots", async () => {
|
|
@@ -26,7 +23,6 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
26
23
|
registerSimpleExtension("Wilma", "esm-flintstone");
|
|
27
24
|
registerSimpleExtension("Barney", "esm-rubble");
|
|
28
25
|
registerSimpleExtension("Betty", "esm-rubble");
|
|
29
|
-
registerExtensionSlot("esm-flintstone", "A slot");
|
|
30
26
|
attach("A slot", "Fred");
|
|
31
27
|
attach("A slot", "Wilma");
|
|
32
28
|
defineConfigSchema("esm-flintstone", {});
|
|
@@ -58,8 +54,6 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
58
54
|
|
|
59
55
|
test("Extensions should recieve config from module and from 'configure' key", async () => {
|
|
60
56
|
registerSimpleExtension("Wilma", "esm-flintstone", true);
|
|
61
|
-
registerExtensionSlot("esm-flintstone", "Flintstone slot");
|
|
62
|
-
registerExtensionSlot("esm-flintstone", "Future slot");
|
|
63
57
|
defineConfigSchema("esm-flintstone", {
|
|
64
58
|
town: { _type: Type.String, _default: "Bedrock" },
|
|
65
59
|
});
|
|
@@ -105,7 +99,6 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
105
99
|
|
|
106
100
|
test("Should be possible to attach the same extension twice with different configurations", async () => {
|
|
107
101
|
registerSimpleExtension("pet", "esm-characters", true);
|
|
108
|
-
registerExtensionSlot("esm-flintstone", "Flintstone slot");
|
|
109
102
|
defineConfigSchema("esm-characters", {
|
|
110
103
|
name: { _type: Type.String, _default: "(no-name)" },
|
|
111
104
|
});
|
|
@@ -161,7 +154,8 @@ function registerSimpleExtension(
|
|
|
161
154
|
</div>
|
|
162
155
|
);
|
|
163
156
|
};
|
|
164
|
-
registerExtension(
|
|
157
|
+
registerExtension({
|
|
158
|
+
name,
|
|
165
159
|
moduleName,
|
|
166
160
|
load: getSyncLifecycle(
|
|
167
161
|
takesConfig ? ConfigurableComponent : SimpleComponent,
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
[@openmrs/esm-framework](../API.md) / ConfigStore
|
|
2
|
-
|
|
3
|
-
# Interface: ConfigStore
|
|
4
|
-
|
|
5
|
-
Output configs
|
|
6
|
-
|
|
7
|
-
Each module has its own stores for its config and its extension slots' configs.
|
|
8
|
-
|
|
9
|
-
## Table of contents
|
|
10
|
-
|
|
11
|
-
### Properties
|
|
12
|
-
|
|
13
|
-
- [config](ConfigStore.md#config)
|
|
14
|
-
- [loaded](ConfigStore.md#loaded)
|
|
15
|
-
|
|
16
|
-
## Properties
|
|
17
|
-
|
|
18
|
-
### config
|
|
19
|
-
|
|
20
|
-
• **config**: ``null`` \| [`ConfigObject`](ConfigObject.md)
|
|
21
|
-
|
|
22
|
-
#### Defined in
|
|
23
|
-
|
|
24
|
-
[packages/framework/esm-config/src/module-config/state.ts:125](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/state.ts#L125)
|
|
25
|
-
|
|
26
|
-
___
|
|
27
|
-
|
|
28
|
-
### loaded
|
|
29
|
-
|
|
30
|
-
• **loaded**: `boolean`
|
|
31
|
-
|
|
32
|
-
#### Defined in
|
|
33
|
-
|
|
34
|
-
[packages/framework/esm-config/src/module-config/state.ts:126](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/state.ts#L126)
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
[@openmrs/esm-framework](../API.md) / ExtensionDetails
|
|
2
|
-
|
|
3
|
-
# Interface: ExtensionDetails
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### Properties
|
|
8
|
-
|
|
9
|
-
- [meta](ExtensionDetails.md#meta)
|
|
10
|
-
- [moduleName](ExtensionDetails.md#modulename)
|
|
11
|
-
- [offline](ExtensionDetails.md#offline)
|
|
12
|
-
- [online](ExtensionDetails.md#online)
|
|
13
|
-
- [order](ExtensionDetails.md#order)
|
|
14
|
-
|
|
15
|
-
### Methods
|
|
16
|
-
|
|
17
|
-
- [load](ExtensionDetails.md#load)
|
|
18
|
-
|
|
19
|
-
## Properties
|
|
20
|
-
|
|
21
|
-
### meta
|
|
22
|
-
|
|
23
|
-
• **meta**: `Record`<`string`, `any`\>
|
|
24
|
-
|
|
25
|
-
#### Defined in
|
|
26
|
-
|
|
27
|
-
[packages/framework/esm-extensions/src/extensions.ts:56](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L56)
|
|
28
|
-
|
|
29
|
-
___
|
|
30
|
-
|
|
31
|
-
### moduleName
|
|
32
|
-
|
|
33
|
-
• **moduleName**: `string`
|
|
34
|
-
|
|
35
|
-
#### Defined in
|
|
36
|
-
|
|
37
|
-
[packages/framework/esm-extensions/src/extensions.ts:54](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L54)
|
|
38
|
-
|
|
39
|
-
___
|
|
40
|
-
|
|
41
|
-
### offline
|
|
42
|
-
|
|
43
|
-
• `Optional` **offline**: `boolean` \| `object`
|
|
44
|
-
|
|
45
|
-
#### Defined in
|
|
46
|
-
|
|
47
|
-
[packages/framework/esm-extensions/src/extensions.ts:58](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L58)
|
|
48
|
-
|
|
49
|
-
___
|
|
50
|
-
|
|
51
|
-
### online
|
|
52
|
-
|
|
53
|
-
• `Optional` **online**: `boolean` \| `object`
|
|
54
|
-
|
|
55
|
-
#### Defined in
|
|
56
|
-
|
|
57
|
-
[packages/framework/esm-extensions/src/extensions.ts:57](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L57)
|
|
58
|
-
|
|
59
|
-
___
|
|
60
|
-
|
|
61
|
-
### order
|
|
62
|
-
|
|
63
|
-
• `Optional` **order**: `number`
|
|
64
|
-
|
|
65
|
-
#### Defined in
|
|
66
|
-
|
|
67
|
-
[packages/framework/esm-extensions/src/extensions.ts:59](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L59)
|
|
68
|
-
|
|
69
|
-
## Methods
|
|
70
|
-
|
|
71
|
-
### load
|
|
72
|
-
|
|
73
|
-
▸ **load**(): `Promise`<`any`\>
|
|
74
|
-
|
|
75
|
-
#### Returns
|
|
76
|
-
|
|
77
|
-
`Promise`<`any`\>
|
|
78
|
-
|
|
79
|
-
#### Defined in
|
|
80
|
-
|
|
81
|
-
[packages/framework/esm-extensions/src/extensions.ts:55](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L55)
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
[@openmrs/esm-framework](../API.md) / ExtensionSlotConfigsStore
|
|
2
|
-
|
|
3
|
-
# Interface: ExtensionSlotConfigsStore
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### Properties
|
|
8
|
-
|
|
9
|
-
- [extensionSlotConfigs](ExtensionSlotConfigsStore.md#extensionslotconfigs)
|
|
10
|
-
- [loaded](ExtensionSlotConfigsStore.md#loaded)
|
|
11
|
-
|
|
12
|
-
## Properties
|
|
13
|
-
|
|
14
|
-
### extensionSlotConfigs
|
|
15
|
-
|
|
16
|
-
• **extensionSlotConfigs**: `Record`<`string`, [`ExtensionSlotConfigObject`](ExtensionSlotConfigObject.md)\>
|
|
17
|
-
|
|
18
|
-
Configs for each extension slot in the module, indexed by slot name
|
|
19
|
-
|
|
20
|
-
#### Defined in
|
|
21
|
-
|
|
22
|
-
[packages/framework/esm-config/src/module-config/state.ts:146](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/state.ts#L146)
|
|
23
|
-
|
|
24
|
-
___
|
|
25
|
-
|
|
26
|
-
### loaded
|
|
27
|
-
|
|
28
|
-
• **loaded**: `boolean`
|
|
29
|
-
|
|
30
|
-
#### Defined in
|
|
31
|
-
|
|
32
|
-
[packages/framework/esm-config/src/module-config/state.ts:147](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/state.ts#L147)
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
[@openmrs/esm-framework](../API.md) / ExtensionSlotInstance
|
|
2
|
-
|
|
3
|
-
# Interface: ExtensionSlotInstance
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### Properties
|
|
8
|
-
|
|
9
|
-
- [addedIds](ExtensionSlotInstance.md#addedids)
|
|
10
|
-
- [idOrder](ExtensionSlotInstance.md#idorder)
|
|
11
|
-
- [removedIds](ExtensionSlotInstance.md#removedids)
|
|
12
|
-
|
|
13
|
-
## Properties
|
|
14
|
-
|
|
15
|
-
### addedIds
|
|
16
|
-
|
|
17
|
-
• **addedIds**: `string`[]
|
|
18
|
-
|
|
19
|
-
A set of additional extension IDs which have been added to to this slot despite not being
|
|
20
|
-
explicitly `attach`ed to it.
|
|
21
|
-
An example may be an extension which is added to the slot via the configuration.
|
|
22
|
-
|
|
23
|
-
#### Defined in
|
|
24
|
-
|
|
25
|
-
[packages/framework/esm-extensions/src/store.ts:47](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L47)
|
|
26
|
-
|
|
27
|
-
___
|
|
28
|
-
|
|
29
|
-
### idOrder
|
|
30
|
-
|
|
31
|
-
• **idOrder**: `string`[]
|
|
32
|
-
|
|
33
|
-
A set allowing explicit ordering of the `assignedIds`.
|
|
34
|
-
|
|
35
|
-
#### Defined in
|
|
36
|
-
|
|
37
|
-
[packages/framework/esm-extensions/src/store.ts:57](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L57)
|
|
38
|
-
|
|
39
|
-
___
|
|
40
|
-
|
|
41
|
-
### removedIds
|
|
42
|
-
|
|
43
|
-
• **removedIds**: `string`[]
|
|
44
|
-
|
|
45
|
-
A set of extension IDs which have been removed/hidden from this slot, even though they have
|
|
46
|
-
previously been `attach`ed/added to it.
|
|
47
|
-
An example may be an extension which is removed from the slot via the configuration.
|
|
48
|
-
|
|
49
|
-
#### Defined in
|
|
50
|
-
|
|
51
|
-
[packages/framework/esm-extensions/src/store.ts:53](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L53)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
[@openmrs/esm-framework](../API.md) / ImplementerToolsConfigStore
|
|
2
|
-
|
|
3
|
-
# Interface: ImplementerToolsConfigStore
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### Properties
|
|
8
|
-
|
|
9
|
-
- [config](ImplementerToolsConfigStore.md#config)
|
|
10
|
-
|
|
11
|
-
## Properties
|
|
12
|
-
|
|
13
|
-
### config
|
|
14
|
-
|
|
15
|
-
• **config**: [`Config`](Config.md)
|
|
16
|
-
|
|
17
|
-
#### Defined in
|
|
18
|
-
|
|
19
|
-
[packages/framework/esm-config/src/module-config/state.ts:179](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/state.ts#L179)
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
[@openmrs/esm-framework](../API.md) / WorkspaceItem
|
|
2
|
-
|
|
3
|
-
# Interface: WorkspaceItem
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### Properties
|
|
8
|
-
|
|
9
|
-
- [component](WorkspaceItem.md#component)
|
|
10
|
-
- [componentClosed](WorkspaceItem.md#componentclosed)
|
|
11
|
-
- [inProgress](WorkspaceItem.md#inprogress)
|
|
12
|
-
- [name](WorkspaceItem.md#name)
|
|
13
|
-
- [props](WorkspaceItem.md#props)
|
|
14
|
-
- [validations](WorkspaceItem.md#validations)
|
|
15
|
-
|
|
16
|
-
## Properties
|
|
17
|
-
|
|
18
|
-
### component
|
|
19
|
-
|
|
20
|
-
• **component**: `any`
|
|
21
|
-
|
|
22
|
-
#### Defined in
|
|
23
|
-
|
|
24
|
-
[packages/framework/esm-api/src/workspace/workspace.resource.tsx:24](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/workspace/workspace.resource.tsx#L24)
|
|
25
|
-
|
|
26
|
-
___
|
|
27
|
-
|
|
28
|
-
### componentClosed
|
|
29
|
-
|
|
30
|
-
• `Optional` **componentClosed**: `Function`
|
|
31
|
-
|
|
32
|
-
#### Defined in
|
|
33
|
-
|
|
34
|
-
[packages/framework/esm-api/src/workspace/workspace.resource.tsx:29](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/workspace/workspace.resource.tsx#L29)
|
|
35
|
-
|
|
36
|
-
___
|
|
37
|
-
|
|
38
|
-
### inProgress
|
|
39
|
-
|
|
40
|
-
• **inProgress**: `boolean`
|
|
41
|
-
|
|
42
|
-
#### Defined in
|
|
43
|
-
|
|
44
|
-
[packages/framework/esm-api/src/workspace/workspace.resource.tsx:28](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/workspace/workspace.resource.tsx#L28)
|
|
45
|
-
|
|
46
|
-
___
|
|
47
|
-
|
|
48
|
-
### name
|
|
49
|
-
|
|
50
|
-
• **name**: `string`
|
|
51
|
-
|
|
52
|
-
#### Defined in
|
|
53
|
-
|
|
54
|
-
[packages/framework/esm-api/src/workspace/workspace.resource.tsx:25](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/workspace/workspace.resource.tsx#L25)
|
|
55
|
-
|
|
56
|
-
___
|
|
57
|
-
|
|
58
|
-
### props
|
|
59
|
-
|
|
60
|
-
• **props**: `any`
|
|
61
|
-
|
|
62
|
-
#### Defined in
|
|
63
|
-
|
|
64
|
-
[packages/framework/esm-api/src/workspace/workspace.resource.tsx:26](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/workspace/workspace.resource.tsx#L26)
|
|
65
|
-
|
|
66
|
-
___
|
|
67
|
-
|
|
68
|
-
### validations
|
|
69
|
-
|
|
70
|
-
• `Optional` **validations**: `Function`
|
|
71
|
-
|
|
72
|
-
#### Defined in
|
|
73
|
-
|
|
74
|
-
[packages/framework/esm-api/src/workspace/workspace.resource.tsx:27](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/workspace/workspace.resource.tsx#L27)
|