@openmrs/esm-framework 4.0.3-pre.367 → 4.0.3-pre.379
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 +12 -12
- package/dist/openmrs-esm-framework.js +1 -1
- package/dist/openmrs-esm-framework.js.LICENSE.txt +5 -3
- package/dist/openmrs-esm-framework.js.map +1 -1
- package/docs/API.md +65 -9
- package/docs/classes/OpenmrsFetchError.md +35 -31
- package/docs/interfaces/ActionableNotificationDescriptor.md +82 -0
- package/mock.tsx +1 -0
- package/package.json +18 -13
- package/src/integration-tests/extension-config.test.tsx +92 -65
package/docs/API.md
CHANGED
|
@@ -160,6 +160,7 @@
|
|
|
160
160
|
- [setLeftNav](API.md#setleftnav)
|
|
161
161
|
- [showModal](API.md#showmodal)
|
|
162
162
|
- [showNotification](API.md#shownotification)
|
|
163
|
+
- [showActionableNotification](API.md#showactionablenotification)
|
|
163
164
|
- [showToast](API.md#showtoast)
|
|
164
165
|
- [subscribeNotificationShown](API.md#subscribenotificationshown)
|
|
165
166
|
- [subscribeToastShown](API.md#subscribetoastshown)
|
|
@@ -397,7 +398,7 @@ ___
|
|
|
397
398
|
|
|
398
399
|
#### Defined in
|
|
399
400
|
|
|
400
|
-
[packages/framework/esm-react-utils/src/Extension.tsx:
|
|
401
|
+
[packages/framework/esm-react-utils/src/Extension.tsx:13](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/Extension.tsx#L13)
|
|
401
402
|
|
|
402
403
|
___
|
|
403
404
|
|
|
@@ -534,6 +535,16 @@ ___
|
|
|
534
535
|
|
|
535
536
|
___
|
|
536
537
|
|
|
538
|
+
### ActionableNotificationType
|
|
539
|
+
|
|
540
|
+
Ƭ **ActionableNotificationType**: ``"error"`` \| ``"info"`` \| ``"info-square"`` \| ``"success"`` \| ``"warning"`` \| ``"warning-alt"``
|
|
541
|
+
|
|
542
|
+
#### Defined in
|
|
543
|
+
|
|
544
|
+
[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:25](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L25)
|
|
545
|
+
|
|
546
|
+
___
|
|
547
|
+
|
|
537
548
|
### LayoutType
|
|
538
549
|
|
|
539
550
|
Ƭ **LayoutType**: ``"phone"`` \| ``"tablet"`` \| ``"small-desktop"`` \| ``"large-desktop"``
|
|
@@ -719,7 +730,7 @@ and *must* only be used once within that `<ExtensionSlot>`.
|
|
|
719
730
|
|
|
720
731
|
#### Defined in
|
|
721
732
|
|
|
722
|
-
[packages/framework/esm-react-utils/src/Extension.tsx:
|
|
733
|
+
[packages/framework/esm-react-utils/src/Extension.tsx:35](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/Extension.tsx#L35)
|
|
723
734
|
|
|
724
735
|
___
|
|
725
736
|
|
|
@@ -2227,7 +2238,7 @@ An array of extensions assigned to the named slot
|
|
|
2227
2238
|
|
|
2228
2239
|
#### Defined in
|
|
2229
2240
|
|
|
2230
|
-
[packages/framework/esm-extensions/src/extensions.ts:
|
|
2241
|
+
[packages/framework/esm-extensions/src/extensions.ts:360](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/extensions.ts#L360)
|
|
2231
2242
|
|
|
2232
2243
|
___
|
|
2233
2244
|
|
|
@@ -2309,7 +2320,7 @@ ___
|
|
|
2309
2320
|
|
|
2310
2321
|
### renderExtension
|
|
2311
2322
|
|
|
2312
|
-
▸ **renderExtension**(`domElement`, `extensionSlotName`, `extensionSlotModuleName`, `extensionId`, `renderFunction?`, `additionalProps?`): `Parcel` \| ``null
|
|
2323
|
+
▸ **renderExtension**(`domElement`, `extensionSlotName`, `extensionSlotModuleName`, `extensionId`, `renderFunction?`, `additionalProps?`): `Promise`<`Parcel` \| ``null``\>
|
|
2313
2324
|
|
|
2314
2325
|
Mounts into a DOM node (representing an extension slot)
|
|
2315
2326
|
a lazy-loaded component from *any* frontend module
|
|
@@ -2328,7 +2339,7 @@ that registered an extension component for this slot.
|
|
|
2328
2339
|
|
|
2329
2340
|
#### Returns
|
|
2330
2341
|
|
|
2331
|
-
`Parcel` \| ``null
|
|
2342
|
+
`Promise`<`Parcel` \| ``null``\>
|
|
2332
2343
|
|
|
2333
2344
|
#### Defined in
|
|
2334
2345
|
|
|
@@ -3875,7 +3886,7 @@ The dispose function to force closing the modal dialog.
|
|
|
3875
3886
|
|
|
3876
3887
|
#### Defined in
|
|
3877
3888
|
|
|
3878
|
-
[packages/framework/esm-styleguide/src/modals/index.tsx:
|
|
3889
|
+
[packages/framework/esm-styleguide/src/modals/index.tsx:167](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/modals/index.tsx#L167)
|
|
3879
3890
|
|
|
3880
3891
|
___
|
|
3881
3892
|
|
|
@@ -3897,10 +3908,31 @@ Displays an inline notification in the UI.
|
|
|
3897
3908
|
|
|
3898
3909
|
#### Defined in
|
|
3899
3910
|
|
|
3900
|
-
[packages/framework/esm-styleguide/src/notifications/index.tsx:40](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/index.tsx#
|
|
3911
|
+
[packages/framework/esm-styleguide/src/notifications/index.tsx:40](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/index.tsx#L48)
|
|
3901
3912
|
|
|
3902
3913
|
___
|
|
3903
3914
|
|
|
3915
|
+
### showActionableNotification
|
|
3916
|
+
|
|
3917
|
+
▸ **showActionableNotification**(`notification`): `void`
|
|
3918
|
+
|
|
3919
|
+
Displays an actionable notification in the UI which takes in an action.
|
|
3920
|
+
|
|
3921
|
+
#### Parameters
|
|
3922
|
+
|
|
3923
|
+
| Name | Type | Description |
|
|
3924
|
+
| :------ | :------ | :------ |
|
|
3925
|
+
| `notification` | [`ActionableNotificationDescriptor`](interfaces/ActionableNotificationDescriptor.md) | The description of the actionable notification to display. |
|
|
3926
|
+
|
|
3927
|
+
#### Returns
|
|
3928
|
+
|
|
3929
|
+
`void`
|
|
3930
|
+
|
|
3931
|
+
#### Defined in
|
|
3932
|
+
|
|
3933
|
+
[packages/framework/esm-styleguide/src/notifications/index.tsx:40](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/index.tsx#L88)
|
|
3934
|
+
|
|
3935
|
+
___
|
|
3904
3936
|
### showToast
|
|
3905
3937
|
|
|
3906
3938
|
▸ **showToast**(`toast`): `void`
|
|
@@ -3945,7 +3977,31 @@ ___
|
|
|
3945
3977
|
|
|
3946
3978
|
#### Defined in
|
|
3947
3979
|
|
|
3948
|
-
[packages/framework/esm-globals/src/events.ts:93](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#
|
|
3980
|
+
[packages/framework/esm-globals/src/events.ts:93](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L117)
|
|
3981
|
+
|
|
3982
|
+
___
|
|
3983
|
+
|
|
3984
|
+
▸ **subscribeActionableNotificationShown**(`cb`): () => `void`
|
|
3985
|
+
|
|
3986
|
+
#### Parameters
|
|
3987
|
+
|
|
3988
|
+
| Name | Type |
|
|
3989
|
+
| :------ | :------ |
|
|
3990
|
+
| `cb` | (`data`: [`ShowActionableNotificationEvent`](interfaces/ShowActionableNotificationEvent.md)) => `void` |
|
|
3991
|
+
|
|
3992
|
+
#### Returns
|
|
3993
|
+
|
|
3994
|
+
`fn`
|
|
3995
|
+
|
|
3996
|
+
▸ (): `void`
|
|
3997
|
+
|
|
3998
|
+
##### Returns
|
|
3999
|
+
|
|
4000
|
+
`void`
|
|
4001
|
+
|
|
4002
|
+
#### Defined in
|
|
4003
|
+
|
|
4004
|
+
[packages/framework/esm-globals/src/events.ts:93](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L126)
|
|
3949
4005
|
|
|
3950
4006
|
___
|
|
3951
4007
|
|
|
@@ -3971,7 +4027,7 @@ ___
|
|
|
3971
4027
|
|
|
3972
4028
|
#### Defined in
|
|
3973
4029
|
|
|
3974
|
-
[packages/framework/esm-globals/src/events.ts:102](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#
|
|
4030
|
+
[packages/framework/esm-globals/src/events.ts:102](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L136)
|
|
3975
4031
|
|
|
3976
4032
|
___
|
|
3977
4033
|
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
- [message](OpenmrsFetchError.md#message)
|
|
26
26
|
- [name](OpenmrsFetchError.md#name)
|
|
27
27
|
- [stack](OpenmrsFetchError.md#stack)
|
|
28
|
+
- [prepareStackTrace](OpenmrsFetchError.md#preparestacktrace)
|
|
28
29
|
- [stackTraceLimit](OpenmrsFetchError.md#stacktracelimit)
|
|
29
30
|
|
|
30
31
|
### Methods
|
|
31
32
|
|
|
32
33
|
- [captureStackTrace](OpenmrsFetchError.md#capturestacktrace)
|
|
33
|
-
- [prepareStackTrace](OpenmrsFetchError.md#preparestacktrace)
|
|
34
34
|
|
|
35
35
|
## API Constructors
|
|
36
36
|
|
|
@@ -135,70 +135,74 @@ node_modules/typescript/lib/lib.es5.d.ts:1024
|
|
|
135
135
|
|
|
136
136
|
___
|
|
137
137
|
|
|
138
|
-
###
|
|
139
|
-
|
|
140
|
-
▪ `Static` **stackTraceLimit**: `number`
|
|
141
|
-
|
|
142
|
-
#### Inherited from
|
|
143
|
-
|
|
144
|
-
Error.stackTraceLimit
|
|
138
|
+
### prepareStackTrace
|
|
145
139
|
|
|
146
|
-
|
|
140
|
+
▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any`
|
|
147
141
|
|
|
148
|
-
|
|
142
|
+
#### Type declaration
|
|
149
143
|
|
|
150
|
-
|
|
144
|
+
▸ (`err`, `stackTraces`): `any`
|
|
151
145
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
▸ `Static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
|
146
|
+
Optional override for formatting stack traces
|
|
155
147
|
|
|
156
|
-
|
|
148
|
+
**`see`** https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
157
149
|
|
|
158
|
-
|
|
150
|
+
##### Parameters
|
|
159
151
|
|
|
160
152
|
| Name | Type |
|
|
161
153
|
| :------ | :------ |
|
|
162
|
-
| `
|
|
163
|
-
| `
|
|
154
|
+
| `err` | `Error` |
|
|
155
|
+
| `stackTraces` | `CallSite`[] |
|
|
164
156
|
|
|
165
|
-
|
|
157
|
+
##### Returns
|
|
166
158
|
|
|
167
|
-
`
|
|
159
|
+
`any`
|
|
168
160
|
|
|
169
161
|
#### Inherited from
|
|
170
162
|
|
|
171
|
-
Error.
|
|
163
|
+
Error.prepareStackTrace
|
|
172
164
|
|
|
173
165
|
#### Defined in
|
|
174
166
|
|
|
175
|
-
node_modules/@types/node/globals.d.ts:
|
|
167
|
+
packages/framework/esm-framework/node_modules/@types/node/globals.d.ts:11
|
|
176
168
|
|
|
177
169
|
___
|
|
178
170
|
|
|
179
|
-
###
|
|
171
|
+
### stackTraceLimit
|
|
180
172
|
|
|
181
|
-
|
|
173
|
+
▪ `Static` **stackTraceLimit**: `number`
|
|
182
174
|
|
|
183
|
-
|
|
175
|
+
#### Inherited from
|
|
184
176
|
|
|
185
|
-
|
|
177
|
+
Error.stackTraceLimit
|
|
178
|
+
|
|
179
|
+
#### Defined in
|
|
180
|
+
|
|
181
|
+
packages/framework/esm-framework/node_modules/@types/node/globals.d.ts:13
|
|
182
|
+
|
|
183
|
+
## Methods
|
|
184
|
+
|
|
185
|
+
### captureStackTrace
|
|
186
|
+
|
|
187
|
+
▸ `Static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
|
|
188
|
+
|
|
189
|
+
Create .stack property on a target object
|
|
186
190
|
|
|
187
191
|
#### Parameters
|
|
188
192
|
|
|
189
193
|
| Name | Type |
|
|
190
194
|
| :------ | :------ |
|
|
191
|
-
| `
|
|
192
|
-
| `
|
|
195
|
+
| `targetObject` | `object` |
|
|
196
|
+
| `constructorOpt?` | `Function` |
|
|
193
197
|
|
|
194
198
|
#### Returns
|
|
195
199
|
|
|
196
|
-
`
|
|
200
|
+
`void`
|
|
197
201
|
|
|
198
202
|
#### Inherited from
|
|
199
203
|
|
|
200
|
-
Error.
|
|
204
|
+
Error.captureStackTrace
|
|
201
205
|
|
|
202
206
|
#### Defined in
|
|
203
207
|
|
|
204
|
-
node_modules/@types/node/globals.d.ts:
|
|
208
|
+
packages/framework/esm-framework/node_modules/@types/node/globals.d.ts:4
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
[@openmrs/esm-framework](../API.md) / ActionableNotificationDescriptor
|
|
2
|
+
|
|
3
|
+
# Interface: ActionableNotificationDescriptor
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### UI Properties
|
|
8
|
+
|
|
9
|
+
- [actionButtonLable](ActionableNotificationDescriptor.md#actionButtonLable)
|
|
10
|
+
- [critical](ActionableNotificationDescriptor.md#critical)
|
|
11
|
+
- [subtitle](ActionableNotificationDescriptor.md#subtitle)
|
|
12
|
+
- [kind](ActionableNotificationDescriptor.md#kind)
|
|
13
|
+
- [onActionButtonClick](ActionableNotificationDescriptor.md#onActionButtonClick)
|
|
14
|
+
- [title](ActionableNotificationDescriptor.md#title)
|
|
15
|
+
|
|
16
|
+
## UI Properties
|
|
17
|
+
|
|
18
|
+
### actionButtonLabel
|
|
19
|
+
|
|
20
|
+
• **actionButtonLabel**: `string`
|
|
21
|
+
|
|
22
|
+
#### Defined in
|
|
23
|
+
|
|
24
|
+
[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:10](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L10)
|
|
25
|
+
|
|
26
|
+
___
|
|
27
|
+
|
|
28
|
+
• **onActionButtonClick**: `void`
|
|
29
|
+
|
|
30
|
+
#### Defined in
|
|
31
|
+
|
|
32
|
+
[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:11](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L11)
|
|
33
|
+
|
|
34
|
+
___
|
|
35
|
+
|
|
36
|
+
### critical
|
|
37
|
+
|
|
38
|
+
• `Optional` **critical**: `boolean`
|
|
39
|
+
|
|
40
|
+
#### Defined in
|
|
41
|
+
|
|
42
|
+
[packages/framework/esm-styleguide/src/notifications/notification.component.tsx:16](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/notification.component.tsx#L16)
|
|
43
|
+
|
|
44
|
+
___
|
|
45
|
+
|
|
46
|
+
### subtitle
|
|
47
|
+
|
|
48
|
+
• **subtitle**: `string`
|
|
49
|
+
|
|
50
|
+
#### Defined in
|
|
51
|
+
|
|
52
|
+
[packages/framework/esm-styleguide/src/notifications/notification.component.tsx:13](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/notification.component.tsx#L13)
|
|
53
|
+
|
|
54
|
+
___
|
|
55
|
+
|
|
56
|
+
### kind
|
|
57
|
+
|
|
58
|
+
• `Optional` **kind**: [`ActionableNotificationType`](../API.md#actionablenotificationtype)
|
|
59
|
+
|
|
60
|
+
#### Defined in
|
|
61
|
+
|
|
62
|
+
[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:15](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L15)
|
|
63
|
+
|
|
64
|
+
___
|
|
65
|
+
|
|
66
|
+
### progressActionLabel
|
|
67
|
+
|
|
68
|
+
• `Optional` **progressActionLabel**: `string`
|
|
69
|
+
|
|
70
|
+
#### Defined in
|
|
71
|
+
|
|
72
|
+
[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:17](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L17)
|
|
73
|
+
|
|
74
|
+
___
|
|
75
|
+
|
|
76
|
+
### title
|
|
77
|
+
|
|
78
|
+
• `Optional` **title**: `string`
|
|
79
|
+
|
|
80
|
+
#### Defined in
|
|
81
|
+
|
|
82
|
+
[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:14](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L14)
|
package/mock.tsx
CHANGED
|
@@ -303,6 +303,7 @@ export const useVisitTypes = jest.fn(() => []);
|
|
|
303
303
|
/* esm-styleguide */
|
|
304
304
|
|
|
305
305
|
export const showNotification = jest.fn();
|
|
306
|
+
export const showActionableNotification = jest.fn();
|
|
306
307
|
export const showToast = jest.fn();
|
|
307
308
|
export const showModal = jest.fn();
|
|
308
309
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-framework",
|
|
3
|
-
"version": "4.0.3-pre.
|
|
3
|
+
"version": "4.0.3-pre.379",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"browser": "dist/openmrs-esm-framework.js",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -35,18 +35,23 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@openmrs/esm-api": "^4.0.3-pre.
|
|
39
|
-
"@openmrs/esm-breadcrumbs": "^4.0.3-pre.
|
|
40
|
-
"@openmrs/esm-config": "^4.0.3-pre.
|
|
41
|
-
"@openmrs/esm-error-handling": "^4.0.3-pre.
|
|
42
|
-
"@openmrs/esm-extensions": "^4.0.3-pre.
|
|
43
|
-
"@openmrs/esm-globals": "^4.0.3-pre.
|
|
44
|
-
"@openmrs/esm-offline": "^4.0.3-pre.
|
|
45
|
-
"@openmrs/esm-react-utils": "^4.0.3-pre.
|
|
46
|
-
"@openmrs/esm-state": "^4.0.3-pre.
|
|
47
|
-
"@openmrs/esm-styleguide": "^4.0.3-pre.
|
|
48
|
-
"@openmrs/esm-utils": "^4.0.3-pre.
|
|
38
|
+
"@openmrs/esm-api": "^4.0.3-pre.379",
|
|
39
|
+
"@openmrs/esm-breadcrumbs": "^4.0.3-pre.379",
|
|
40
|
+
"@openmrs/esm-config": "^4.0.3-pre.379",
|
|
41
|
+
"@openmrs/esm-error-handling": "^4.0.3-pre.379",
|
|
42
|
+
"@openmrs/esm-extensions": "^4.0.3-pre.379",
|
|
43
|
+
"@openmrs/esm-globals": "^4.0.3-pre.379",
|
|
44
|
+
"@openmrs/esm-offline": "^4.0.3-pre.379",
|
|
45
|
+
"@openmrs/esm-react-utils": "^4.0.3-pre.379",
|
|
46
|
+
"@openmrs/esm-state": "^4.0.3-pre.379",
|
|
47
|
+
"@openmrs/esm-styleguide": "^4.0.3-pre.379",
|
|
48
|
+
"@openmrs/esm-utils": "^4.0.3-pre.379",
|
|
49
49
|
"dayjs": "^1.10.7"
|
|
50
50
|
},
|
|
51
|
-
"
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"jest": "28.1.0",
|
|
53
|
+
"jest-cli": "28.1.0",
|
|
54
|
+
"jest-environment-jsdom": "28.1.0"
|
|
55
|
+
},
|
|
56
|
+
"gitHead": "1a240c7c9dbef90d166e1fe29390d48d3cc9b305"
|
|
52
57
|
}
|
|
@@ -59,13 +59,16 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
61
|
});
|
|
62
|
-
const App = openmrsComponentDecorator({
|
|
63
|
-
moduleName: "esm-flintstone",
|
|
64
|
-
featureName: "The Flintstones",
|
|
65
|
-
disableTranslations: true,
|
|
66
|
-
})(() => <ExtensionSlot data-testid="slot" name="A slot" />);
|
|
67
62
|
|
|
68
|
-
|
|
63
|
+
act(() => {
|
|
64
|
+
const App = openmrsComponentDecorator({
|
|
65
|
+
moduleName: "esm-flintstone",
|
|
66
|
+
featureName: "The Flintstones",
|
|
67
|
+
disableTranslations: true,
|
|
68
|
+
})(() => <ExtensionSlot data-testid="slot" name="A slot" />);
|
|
69
|
+
|
|
70
|
+
render(<App />);
|
|
71
|
+
});
|
|
69
72
|
|
|
70
73
|
await waitFor(() => expect(screen.getByText("Betty")).toBeInTheDocument());
|
|
71
74
|
|
|
@@ -101,18 +104,21 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
101
104
|
},
|
|
102
105
|
},
|
|
103
106
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
|
|
108
|
+
act(() => {
|
|
109
|
+
const App = openmrsComponentDecorator({
|
|
110
|
+
moduleName: "esm-flintstone",
|
|
111
|
+
featureName: "The Flintstones",
|
|
112
|
+
disableTranslations: true,
|
|
113
|
+
})(() => (
|
|
114
|
+
<>
|
|
115
|
+
<ExtensionSlot data-testid="flintstone-slot" name="Flintstone slot" />
|
|
116
|
+
<ExtensionSlot data-testid="future-slot" name="Future slot" />
|
|
117
|
+
</>
|
|
118
|
+
));
|
|
119
|
+
|
|
120
|
+
render(<App />);
|
|
121
|
+
});
|
|
116
122
|
|
|
117
123
|
await screen.findAllByText(/.*Pebbles.*/);
|
|
118
124
|
|
|
@@ -148,17 +154,20 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
148
154
|
},
|
|
149
155
|
},
|
|
150
156
|
});
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
157
|
+
|
|
158
|
+
act(() => {
|
|
159
|
+
const App = openmrsComponentDecorator({
|
|
160
|
+
moduleName: "esm-flintstone",
|
|
161
|
+
featureName: "The Flintstones",
|
|
162
|
+
disableTranslations: true,
|
|
163
|
+
})(() => (
|
|
164
|
+
<>
|
|
165
|
+
<ExtensionSlot data-testid="flintstone-slot" name="Flintstone slot" />
|
|
166
|
+
</>
|
|
167
|
+
));
|
|
168
|
+
|
|
169
|
+
render(<App />);
|
|
170
|
+
});
|
|
162
171
|
|
|
163
172
|
await screen.findAllByText(/.*Dino.*/);
|
|
164
173
|
|
|
@@ -174,13 +183,16 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
174
183
|
registerSimpleExtension("Pearl", "esm-slaghoople");
|
|
175
184
|
attach("A slot", "Pearl");
|
|
176
185
|
defineConfigSchema("esm-slaghoople", {});
|
|
177
|
-
const App = openmrsComponentDecorator({
|
|
178
|
-
moduleName: "esm-slaghoople",
|
|
179
|
-
featureName: "The Slaghooples",
|
|
180
|
-
disableTranslations: true,
|
|
181
|
-
})(() => <ExtensionSlot data-testid="slot" name="A slot" />);
|
|
182
186
|
|
|
183
|
-
|
|
187
|
+
act(() => {
|
|
188
|
+
const App = openmrsComponentDecorator({
|
|
189
|
+
moduleName: "esm-slaghoople",
|
|
190
|
+
featureName: "The Slaghooples",
|
|
191
|
+
disableTranslations: true,
|
|
192
|
+
})(() => <ExtensionSlot data-testid="slot" name="A slot" />);
|
|
193
|
+
|
|
194
|
+
render(<App />);
|
|
195
|
+
});
|
|
184
196
|
|
|
185
197
|
await waitFor(() => expect(screen.getByText("Pearl")).toBeInTheDocument());
|
|
186
198
|
|
|
@@ -207,13 +219,16 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
207
219
|
registerSimpleExtension("Mr. Slate", "esm-flintstone", true);
|
|
208
220
|
attach("A slot", "Mr. Slate");
|
|
209
221
|
defineConfigSchema("esm-flintstone", { tie: { _default: "green" } });
|
|
210
|
-
const App = openmrsComponentDecorator({
|
|
211
|
-
moduleName: "esm-quarry",
|
|
212
|
-
featureName: "The Flintstones",
|
|
213
|
-
disableTranslations: true,
|
|
214
|
-
})(() => <ExtensionSlot data-testid="slot" name="A slot" />);
|
|
215
222
|
|
|
216
|
-
|
|
223
|
+
act(() => {
|
|
224
|
+
const App = openmrsComponentDecorator({
|
|
225
|
+
moduleName: "esm-quarry",
|
|
226
|
+
featureName: "The Flintstones",
|
|
227
|
+
disableTranslations: true,
|
|
228
|
+
})(() => <ExtensionSlot data-testid="slot" name="A slot" />);
|
|
229
|
+
|
|
230
|
+
render(<App />);
|
|
231
|
+
});
|
|
217
232
|
|
|
218
233
|
await waitFor(() =>
|
|
219
234
|
expect(screen.getByText(/Mr. Slate/)).toBeInTheDocument()
|
|
@@ -258,13 +273,16 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
258
273
|
</div>
|
|
259
274
|
);
|
|
260
275
|
}
|
|
261
|
-
const App = openmrsComponentDecorator({
|
|
262
|
-
moduleName: "esm-flintstone",
|
|
263
|
-
featureName: "The Flintstones",
|
|
264
|
-
disableTranslations: true,
|
|
265
|
-
})(RootComponent);
|
|
266
276
|
|
|
267
|
-
|
|
277
|
+
act(() => {
|
|
278
|
+
const App = openmrsComponentDecorator({
|
|
279
|
+
moduleName: "esm-flintstone",
|
|
280
|
+
featureName: "The Flintstones",
|
|
281
|
+
disableTranslations: true,
|
|
282
|
+
})(RootComponent);
|
|
283
|
+
|
|
284
|
+
render(<App />);
|
|
285
|
+
});
|
|
268
286
|
|
|
269
287
|
await waitFor(() => expect(screen.getByTestId(/slot/)).toBeInTheDocument());
|
|
270
288
|
|
|
@@ -335,13 +353,16 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
335
353
|
</div>
|
|
336
354
|
);
|
|
337
355
|
}
|
|
338
|
-
const App = openmrsComponentDecorator({
|
|
339
|
-
moduleName: "esm-bedrock",
|
|
340
|
-
featureName: "Bedrock",
|
|
341
|
-
disableTranslations: true,
|
|
342
|
-
})(RootComponent);
|
|
343
356
|
|
|
344
|
-
|
|
357
|
+
act(() => {
|
|
358
|
+
const App = openmrsComponentDecorator({
|
|
359
|
+
moduleName: "esm-bedrock",
|
|
360
|
+
featureName: "Bedrock",
|
|
361
|
+
disableTranslations: true,
|
|
362
|
+
})(RootComponent);
|
|
363
|
+
|
|
364
|
+
render(<App />);
|
|
365
|
+
});
|
|
345
366
|
|
|
346
367
|
await waitFor(() => expect(screen.getByTestId(/slot/)).toBeInTheDocument());
|
|
347
368
|
expect(screen.getByTestId("slot").firstChild).toHaveAttribute(
|
|
@@ -391,13 +412,16 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
391
412
|
</div>
|
|
392
413
|
);
|
|
393
414
|
}
|
|
394
|
-
const App = openmrsComponentDecorator({
|
|
395
|
-
moduleName: "esm-bedrock",
|
|
396
|
-
featureName: "Bedrock",
|
|
397
|
-
disableTranslations: true,
|
|
398
|
-
})(RootComponent);
|
|
399
415
|
|
|
400
|
-
|
|
416
|
+
act(() => {
|
|
417
|
+
const App = openmrsComponentDecorator({
|
|
418
|
+
moduleName: "esm-bedrock",
|
|
419
|
+
featureName: "Bedrock",
|
|
420
|
+
disableTranslations: true,
|
|
421
|
+
})(RootComponent);
|
|
422
|
+
|
|
423
|
+
render(<App />);
|
|
424
|
+
});
|
|
401
425
|
|
|
402
426
|
await waitFor(() => expect(screen.getByTestId(/slot/)).toBeInTheDocument());
|
|
403
427
|
expect(screen.getByTestId("slot").firstChild).toHaveAttribute(
|
|
@@ -444,13 +468,16 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
444
468
|
</div>
|
|
445
469
|
);
|
|
446
470
|
}
|
|
447
|
-
const App = openmrsComponentDecorator({
|
|
448
|
-
moduleName: "esm-bedrock",
|
|
449
|
-
featureName: "Bedrock",
|
|
450
|
-
disableTranslations: true,
|
|
451
|
-
})(RootComponent);
|
|
452
471
|
|
|
453
|
-
|
|
472
|
+
act(() => {
|
|
473
|
+
const App = openmrsComponentDecorator({
|
|
474
|
+
moduleName: "esm-bedrock",
|
|
475
|
+
featureName: "Bedrock",
|
|
476
|
+
disableTranslations: true,
|
|
477
|
+
})(RootComponent);
|
|
478
|
+
|
|
479
|
+
render(<App />);
|
|
480
|
+
});
|
|
454
481
|
|
|
455
482
|
await waitFor(() => {
|
|
456
483
|
expect(screen.getByTestId(/slot/)).toBeInTheDocument();
|