@openmrs/esm-framework 4.0.3-pre.367 → 4.0.3-pre.371
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 +6 -6
- package/docs/classes/OpenmrsFetchError.md +35 -31
- package/package.json +18 -13
- package/src/integration-tests/extension-config.test.tsx +92 -65
package/docs/API.md
CHANGED
|
@@ -397,7 +397,7 @@ ___
|
|
|
397
397
|
|
|
398
398
|
#### Defined in
|
|
399
399
|
|
|
400
|
-
[packages/framework/esm-react-utils/src/Extension.tsx:
|
|
400
|
+
[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
401
|
|
|
402
402
|
___
|
|
403
403
|
|
|
@@ -719,7 +719,7 @@ and *must* only be used once within that `<ExtensionSlot>`.
|
|
|
719
719
|
|
|
720
720
|
#### Defined in
|
|
721
721
|
|
|
722
|
-
[packages/framework/esm-react-utils/src/Extension.tsx:
|
|
722
|
+
[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
723
|
|
|
724
724
|
___
|
|
725
725
|
|
|
@@ -2227,7 +2227,7 @@ An array of extensions assigned to the named slot
|
|
|
2227
2227
|
|
|
2228
2228
|
#### Defined in
|
|
2229
2229
|
|
|
2230
|
-
[packages/framework/esm-extensions/src/extensions.ts:
|
|
2230
|
+
[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
2231
|
|
|
2232
2232
|
___
|
|
2233
2233
|
|
|
@@ -2309,7 +2309,7 @@ ___
|
|
|
2309
2309
|
|
|
2310
2310
|
### renderExtension
|
|
2311
2311
|
|
|
2312
|
-
▸ **renderExtension**(`domElement`, `extensionSlotName`, `extensionSlotModuleName`, `extensionId`, `renderFunction?`, `additionalProps?`): `Parcel` \| ``null
|
|
2312
|
+
▸ **renderExtension**(`domElement`, `extensionSlotName`, `extensionSlotModuleName`, `extensionId`, `renderFunction?`, `additionalProps?`): `Promise`<`Parcel` \| ``null``\>
|
|
2313
2313
|
|
|
2314
2314
|
Mounts into a DOM node (representing an extension slot)
|
|
2315
2315
|
a lazy-loaded component from *any* frontend module
|
|
@@ -2328,7 +2328,7 @@ that registered an extension component for this slot.
|
|
|
2328
2328
|
|
|
2329
2329
|
#### Returns
|
|
2330
2330
|
|
|
2331
|
-
`Parcel` \| ``null
|
|
2331
|
+
`Promise`<`Parcel` \| ``null``\>
|
|
2332
2332
|
|
|
2333
2333
|
#### Defined in
|
|
2334
2334
|
|
|
@@ -3875,7 +3875,7 @@ The dispose function to force closing the modal dialog.
|
|
|
3875
3875
|
|
|
3876
3876
|
#### Defined in
|
|
3877
3877
|
|
|
3878
|
-
[packages/framework/esm-styleguide/src/modals/index.tsx:
|
|
3878
|
+
[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
3879
|
|
|
3880
3880
|
___
|
|
3881
3881
|
|
|
@@ -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
|
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.371",
|
|
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.371",
|
|
39
|
+
"@openmrs/esm-breadcrumbs": "^4.0.3-pre.371",
|
|
40
|
+
"@openmrs/esm-config": "^4.0.3-pre.371",
|
|
41
|
+
"@openmrs/esm-error-handling": "^4.0.3-pre.371",
|
|
42
|
+
"@openmrs/esm-extensions": "^4.0.3-pre.371",
|
|
43
|
+
"@openmrs/esm-globals": "^4.0.3-pre.371",
|
|
44
|
+
"@openmrs/esm-offline": "^4.0.3-pre.371",
|
|
45
|
+
"@openmrs/esm-react-utils": "^4.0.3-pre.371",
|
|
46
|
+
"@openmrs/esm-state": "^4.0.3-pre.371",
|
|
47
|
+
"@openmrs/esm-styleguide": "^4.0.3-pre.371",
|
|
48
|
+
"@openmrs/esm-utils": "^4.0.3-pre.371",
|
|
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": "ad139e1b9853124a8328b443b309ad3a869fe9f3"
|
|
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();
|