@openmrs/esm-framework 5.8.2-pre.2534 → 6.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/.turbo/turbo-build.log +6 -6
- package/dist/openmrs-esm-framework.js +1 -1
- package/dist/openmrs-esm-framework.js.map +1 -1
- package/docs/API.md +47 -15
- package/docs/classes/OpenmrsFetchError.md +15 -3
- package/docs/interfaces/CloseWorkspaceOptions.md +17 -0
- package/docs/interfaces/DefaultWorkspaceProps.md +4 -4
- package/docs/interfaces/FeatureFlagDefinition.md +3 -3
- package/docs/interfaces/FetchConfig.md +2 -2
- package/docs/interfaces/FetchError.md +34 -0
- package/docs/interfaces/OpenWorkspace.md +24 -28
- package/docs/interfaces/OpenmrsAppRoutes.md +8 -8
- package/docs/interfaces/PageHeaderContentProps.md +3 -3
- package/docs/interfaces/PageHeaderWrapperProps.md +2 -2
- package/docs/interfaces/Prompt.md +5 -5
- package/docs/interfaces/ResourceLoader.md +1 -1
- package/docs/interfaces/WorkspaceRegistration.md +7 -18
- package/docs/interfaces/WorkspacesInfo.md +22 -4
- package/jest.config.js +1 -0
- package/package.json +19 -20
- package/src/integration-tests/extension-config.test.tsx +21 -4
@@ -23,7 +23,7 @@
|
|
23
23
|
|
24
24
|
#### Defined in
|
25
25
|
|
26
|
-
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:
|
26
|
+
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:89](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L89)
|
27
27
|
|
28
28
|
___
|
29
29
|
|
@@ -35,7 +35,7 @@ Defaults to "Cancel"
|
|
35
35
|
|
36
36
|
#### Defined in
|
37
37
|
|
38
|
-
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:
|
38
|
+
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:94](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L94)
|
39
39
|
|
40
40
|
___
|
41
41
|
|
@@ -47,7 +47,7 @@ Defaults to "Confirm"
|
|
47
47
|
|
48
48
|
#### Defined in
|
49
49
|
|
50
|
-
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:
|
50
|
+
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:91](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L91)
|
51
51
|
|
52
52
|
___
|
53
53
|
|
@@ -57,7 +57,7 @@ ___
|
|
57
57
|
|
58
58
|
#### Defined in
|
59
59
|
|
60
|
-
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:
|
60
|
+
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:88](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L88)
|
61
61
|
|
62
62
|
## Methods
|
63
63
|
|
@@ -71,4 +71,4 @@ ___
|
|
71
71
|
|
72
72
|
#### Defined in
|
73
73
|
|
74
|
-
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:
|
74
|
+
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:92](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L92)
|
@@ -20,4 +20,4 @@
|
|
20
20
|
|
21
21
|
#### Defined in
|
22
22
|
|
23
|
-
[packages/framework/esm-globals/src/types.ts:
|
23
|
+
[packages/framework/esm-globals/src/types.ts:403](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/types.ts#L403)
|
@@ -16,11 +16,10 @@ See [WorkspaceDefinition](../API.md#workspacedefinition) for more information ab
|
|
16
16
|
|
17
17
|
- [canHide](WorkspaceRegistration.md#canhide)
|
18
18
|
- [canMaximize](WorkspaceRegistration.md#canmaximize)
|
19
|
-
- [
|
19
|
+
- [groups](WorkspaceRegistration.md#groups)
|
20
20
|
- [moduleName](WorkspaceRegistration.md#modulename)
|
21
21
|
- [name](WorkspaceRegistration.md#name)
|
22
22
|
- [preferredWindowSize](WorkspaceRegistration.md#preferredwindowsize)
|
23
|
-
- [sidebarFamily](WorkspaceRegistration.md#sidebarfamily)
|
24
23
|
- [title](WorkspaceRegistration.md#title)
|
25
24
|
- [titleNode](WorkspaceRegistration.md#titlenode)
|
26
25
|
- [type](WorkspaceRegistration.md#type)
|
@@ -52,13 +51,13 @@ ___
|
|
52
51
|
|
53
52
|
___
|
54
53
|
|
55
|
-
###
|
54
|
+
### groups
|
56
55
|
|
57
|
-
• **
|
56
|
+
• `Optional` **groups**: `string`[]
|
58
57
|
|
59
58
|
#### Defined in
|
60
59
|
|
61
|
-
[packages/framework/esm-extensions/src/workspaces.ts:
|
60
|
+
[packages/framework/esm-extensions/src/workspaces.ts:20](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/workspaces.ts#L20)
|
62
61
|
|
63
62
|
___
|
64
63
|
|
@@ -68,7 +67,7 @@ ___
|
|
68
67
|
|
69
68
|
#### Defined in
|
70
69
|
|
71
|
-
[packages/framework/esm-extensions/src/workspaces.ts:
|
70
|
+
[packages/framework/esm-extensions/src/workspaces.ts:19](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/workspaces.ts#L19)
|
72
71
|
|
73
72
|
___
|
74
73
|
|
@@ -88,17 +87,7 @@ ___
|
|
88
87
|
|
89
88
|
#### Defined in
|
90
89
|
|
91
|
-
[packages/framework/esm-extensions/src/workspaces.ts:
|
92
|
-
|
93
|
-
___
|
94
|
-
|
95
|
-
### sidebarFamily
|
96
|
-
|
97
|
-
• **sidebarFamily**: `string`
|
98
|
-
|
99
|
-
#### Defined in
|
100
|
-
|
101
|
-
[packages/framework/esm-extensions/src/workspaces.ts:18](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/workspaces.ts#L18)
|
90
|
+
[packages/framework/esm-extensions/src/workspaces.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/workspaces.ts#L17)
|
102
91
|
|
103
92
|
___
|
104
93
|
|
@@ -152,4 +141,4 @@ ___
|
|
152
141
|
|
153
142
|
#### Defined in
|
154
143
|
|
155
|
-
[packages/framework/esm-extensions/src/workspaces.ts:
|
144
|
+
[packages/framework/esm-extensions/src/workspaces.ts:18](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/workspaces.ts#L18)
|
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
- [active](WorkspacesInfo.md#active)
|
10
10
|
- [prompt](WorkspacesInfo.md#prompt)
|
11
|
+
- [workspaceGroup](WorkspacesInfo.md#workspacegroup)
|
11
12
|
- [workspaceWindowState](WorkspacesInfo.md#workspacewindowstate)
|
12
13
|
- [workspaces](WorkspacesInfo.md#workspaces)
|
13
14
|
|
@@ -19,7 +20,7 @@
|
|
19
20
|
|
20
21
|
#### Defined in
|
21
22
|
|
22
|
-
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:
|
23
|
+
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:529](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L529)
|
23
24
|
|
24
25
|
___
|
25
26
|
|
@@ -29,7 +30,24 @@ ___
|
|
29
30
|
|
30
31
|
#### Defined in
|
31
32
|
|
32
|
-
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:
|
33
|
+
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:530](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L530)
|
34
|
+
|
35
|
+
___
|
36
|
+
|
37
|
+
### workspaceGroup
|
38
|
+
|
39
|
+
• `Optional` **workspaceGroup**: `Object`
|
40
|
+
|
41
|
+
#### Type declaration
|
42
|
+
|
43
|
+
| Name | Type |
|
44
|
+
| :------ | :------ |
|
45
|
+
| `cleanup?` | `Function` |
|
46
|
+
| `name` | `string` |
|
47
|
+
|
48
|
+
#### Defined in
|
49
|
+
|
50
|
+
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:533](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L533)
|
33
51
|
|
34
52
|
___
|
35
53
|
|
@@ -39,7 +57,7 @@ ___
|
|
39
57
|
|
40
58
|
#### Defined in
|
41
59
|
|
42
|
-
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:
|
60
|
+
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:531](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L531)
|
43
61
|
|
44
62
|
___
|
45
63
|
|
@@ -49,4 +67,4 @@ ___
|
|
49
67
|
|
50
68
|
#### Defined in
|
51
69
|
|
52
|
-
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:
|
70
|
+
[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:532](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L532)
|
package/jest.config.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@openmrs/esm-framework",
|
3
|
-
"version": "
|
3
|
+
"version": "6.0.0",
|
4
4
|
"license": "MPL-2.0",
|
5
5
|
"browser": "dist/openmrs-esm-framework.js",
|
6
6
|
"main": "src/index.ts",
|
@@ -37,23 +37,23 @@
|
|
37
37
|
"access": "public"
|
38
38
|
},
|
39
39
|
"dependencies": {
|
40
|
-
"@openmrs/esm-api": "
|
41
|
-
"@openmrs/esm-config": "
|
42
|
-
"@openmrs/esm-context": "
|
43
|
-
"@openmrs/esm-dynamic-loading": "
|
44
|
-
"@openmrs/esm-error-handling": "
|
45
|
-
"@openmrs/esm-expression-evaluator": "
|
46
|
-
"@openmrs/esm-extensions": "
|
47
|
-
"@openmrs/esm-feature-flags": "
|
48
|
-
"@openmrs/esm-globals": "
|
49
|
-
"@openmrs/esm-navigation": "
|
50
|
-
"@openmrs/esm-offline": "
|
51
|
-
"@openmrs/esm-react-utils": "
|
52
|
-
"@openmrs/esm-routes": "
|
53
|
-
"@openmrs/esm-state": "
|
54
|
-
"@openmrs/esm-styleguide": "
|
55
|
-
"@openmrs/esm-translations": "
|
56
|
-
"@openmrs/esm-utils": "
|
40
|
+
"@openmrs/esm-api": "6.0.0",
|
41
|
+
"@openmrs/esm-config": "6.0.0",
|
42
|
+
"@openmrs/esm-context": "6.0.0",
|
43
|
+
"@openmrs/esm-dynamic-loading": "6.0.0",
|
44
|
+
"@openmrs/esm-error-handling": "6.0.0",
|
45
|
+
"@openmrs/esm-expression-evaluator": "6.0.0",
|
46
|
+
"@openmrs/esm-extensions": "6.0.0",
|
47
|
+
"@openmrs/esm-feature-flags": "6.0.0",
|
48
|
+
"@openmrs/esm-globals": "6.0.0",
|
49
|
+
"@openmrs/esm-navigation": "6.0.0",
|
50
|
+
"@openmrs/esm-offline": "6.0.0",
|
51
|
+
"@openmrs/esm-react-utils": "6.0.0",
|
52
|
+
"@openmrs/esm-routes": "6.0.0",
|
53
|
+
"@openmrs/esm-state": "6.0.0",
|
54
|
+
"@openmrs/esm-styleguide": "6.0.0",
|
55
|
+
"@openmrs/esm-translations": "6.0.0",
|
56
|
+
"@openmrs/esm-utils": "6.0.0",
|
57
57
|
"dayjs": "^1.10.7"
|
58
58
|
},
|
59
59
|
"peerDependencies": {
|
@@ -72,6 +72,5 @@
|
|
72
72
|
"jest-environment-jsdom": "^29.7.0",
|
73
73
|
"svgo-loader": "^4.0.0",
|
74
74
|
"webpack": "^5.88.0"
|
75
|
-
}
|
76
|
-
"stableVersion": "5.8.1"
|
75
|
+
}
|
77
76
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint-disable */
|
1
2
|
import React from 'react';
|
2
3
|
import { act, render, screen, waitFor } from '@testing-library/react';
|
3
4
|
import { type Person } from '@openmrs/esm-api';
|
@@ -14,6 +15,7 @@ import {
|
|
14
15
|
defineConfigSchema,
|
15
16
|
provide,
|
16
17
|
Type,
|
18
|
+
registerModuleLoad,
|
17
19
|
temporaryConfigStore,
|
18
20
|
configInternalStore,
|
19
21
|
getExtensionSlotsConfigStore,
|
@@ -46,6 +48,7 @@ describe('Interaction between configuration and extension systems', () => {
|
|
46
48
|
attach('A slot', 'Fred');
|
47
49
|
attach('A slot', 'Wilma');
|
48
50
|
defineConfigSchema('esm-flintstone', {});
|
51
|
+
registerModuleLoad('esm-flintstone');
|
49
52
|
|
50
53
|
provide({
|
51
54
|
'esm-flintstone': {
|
@@ -69,7 +72,7 @@ describe('Interaction between configuration and extension systems', () => {
|
|
69
72
|
|
70
73
|
render(<App />);
|
71
74
|
|
72
|
-
screen.findByText('Betty');
|
75
|
+
await screen.findByText('Betty');
|
73
76
|
const slot = screen.getByTestId('slot');
|
74
77
|
const extensions = slot.childNodes;
|
75
78
|
|
@@ -87,6 +90,8 @@ describe('Interaction between configuration and extension systems', () => {
|
|
87
90
|
defineConfigSchema('esm-flintstone', {
|
88
91
|
town: { _type: Type.String, _default: 'Bedrock' },
|
89
92
|
});
|
93
|
+
registerModuleLoad('esm-flintstone');
|
94
|
+
|
90
95
|
attach('Flintstone slot', 'Pebbles');
|
91
96
|
attach('Future slot', 'Pebbles');
|
92
97
|
provide({
|
@@ -136,6 +141,8 @@ describe('Interaction between configuration and extension systems', () => {
|
|
136
141
|
defineConfigSchema('esm-characters', {
|
137
142
|
name: { _type: Type.String, _default: '(no-name)' },
|
138
143
|
});
|
144
|
+
registerModuleLoad('esm-characters');
|
145
|
+
|
139
146
|
attach('Flintstone slot', 'pet#Dino');
|
140
147
|
attach('Flintstone slot', 'pet#BabyPuss');
|
141
148
|
provide({
|
@@ -183,6 +190,7 @@ describe('Interaction between configuration and extension systems', () => {
|
|
183
190
|
registerSimpleExtension('Pearl', 'esm-slaghoople');
|
184
191
|
attach('A slot', 'Pearl');
|
185
192
|
defineConfigSchema('esm-slaghoople', {});
|
193
|
+
registerModuleLoad('esm-flintstone');
|
186
194
|
|
187
195
|
const App = openmrsComponentDecorator({
|
188
196
|
moduleName: 'esm-slaghoople',
|
@@ -194,7 +202,7 @@ describe('Interaction between configuration and extension systems', () => {
|
|
194
202
|
|
195
203
|
render(<App />);
|
196
204
|
|
197
|
-
await
|
205
|
+
await screen.findByText('Pearl');
|
198
206
|
|
199
207
|
act(() => {
|
200
208
|
temporaryConfigStore.setState({
|
@@ -218,6 +226,7 @@ describe('Interaction between configuration and extension systems', () => {
|
|
218
226
|
registerSimpleExtension('Mr. Slate', 'esm-flintstone', true);
|
219
227
|
attach('A slot', 'Mr. Slate');
|
220
228
|
defineConfigSchema('esm-flintstone', { tie: { _default: 'green' } });
|
229
|
+
registerModuleLoad('esm-flintstone');
|
221
230
|
|
222
231
|
const App = openmrsComponentDecorator({
|
223
232
|
moduleName: 'esm-quarry',
|
@@ -228,7 +237,7 @@ describe('Interaction between configuration and extension systems', () => {
|
|
228
237
|
await act(async () => await promise);
|
229
238
|
|
230
239
|
render(<App />);
|
231
|
-
await
|
240
|
+
await screen.findByText(/Mr. Slate/);
|
232
241
|
expect(screen.getByTestId('slot')).toHaveTextContent(/green/);
|
233
242
|
|
234
243
|
act(() => {
|
@@ -256,6 +265,8 @@ describe('Interaction between configuration and extension systems', () => {
|
|
256
265
|
registerSimpleExtension('Bamm-Bamm', 'esm-flintstone', false);
|
257
266
|
attach('A slot', 'Bamm-Bamm');
|
258
267
|
defineConfigSchema('esm-flintstone', { clothes: { _default: 'leopard' } });
|
268
|
+
registerModuleLoad('esm-flintstone');
|
269
|
+
|
259
270
|
function RootComponent() {
|
260
271
|
const store = useExtensionStore();
|
261
272
|
return (
|
@@ -329,6 +340,8 @@ describe('Interaction between configuration and extension systems', () => {
|
|
329
340
|
attach('A slot', 'Wilma');
|
330
341
|
defineConfigSchema('esm-bedrock', {});
|
331
342
|
defineConfigSchema('esm-flintstones', {});
|
343
|
+
registerModuleLoad('esm-bedrock');
|
344
|
+
registerModuleLoad('esm-flintstones');
|
332
345
|
provide({
|
333
346
|
'esm-bedrock': {
|
334
347
|
'Display conditions': {
|
@@ -389,6 +402,7 @@ describe('Interaction between configuration and extension systems', () => {
|
|
389
402
|
registerSimpleExtension('Schmoo', 'esm-bedrock', true);
|
390
403
|
attach('A slot', 'Schmoo');
|
391
404
|
defineConfigSchema('esm-bedrock', {});
|
405
|
+
registerModuleLoad('esm-bedrock');
|
392
406
|
provide({
|
393
407
|
'esm-bedrock': {
|
394
408
|
'Display conditions': {
|
@@ -415,7 +429,7 @@ describe('Interaction between configuration and extension systems', () => {
|
|
415
429
|
|
416
430
|
render(<App />);
|
417
431
|
|
418
|
-
await
|
432
|
+
await screen.findByTestId(/slot/);
|
419
433
|
expect(screen.getByTestId('slot').firstChild).toHaveAttribute('data-extension-id', 'Schmoo');
|
420
434
|
});
|
421
435
|
|
@@ -448,6 +462,8 @@ describe('Interaction between configuration and extension systems', () => {
|
|
448
462
|
attach('A slot', 'Wilma');
|
449
463
|
defineConfigSchema('esm-bedrock', {});
|
450
464
|
defineConfigSchema('esm-flintstones', {});
|
465
|
+
registerModuleLoad('esm-bedrock');
|
466
|
+
registerModuleLoad('esm-flintstones');
|
451
467
|
provide({ 'esm-bedrock': {} });
|
452
468
|
provide({ 'esm-flintstones': {} });
|
453
469
|
|
@@ -490,6 +506,7 @@ async function registerSimpleExtension(
|
|
490
506
|
</div>
|
491
507
|
);
|
492
508
|
};
|
509
|
+
|
493
510
|
registerExtension({
|
494
511
|
name,
|
495
512
|
moduleName,
|