@openmrs/esm-framework 3.3.2-pre.1187 → 3.3.2-pre.1208

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.
@@ -18,7 +18,7 @@
18
18
 
19
19
  #### Defined in
20
20
 
21
- [packages/framework/esm-api/src/types/user-resource.ts:46](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L46)
21
+ [packages/framework/esm-api/src/types/user-resource.ts:34](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L34)
22
22
 
23
23
  ___
24
24
 
@@ -28,7 +28,7 @@ ___
28
28
 
29
29
  #### Defined in
30
30
 
31
- [packages/framework/esm-api/src/types/user-resource.ts:47](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L47)
31
+ [packages/framework/esm-api/src/types/user-resource.ts:35](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L35)
32
32
 
33
33
  ___
34
34
 
@@ -38,4 +38,4 @@ ___
38
38
 
39
39
  #### Defined in
40
40
 
41
- [packages/framework/esm-api/src/types/user-resource.ts:45](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L45)
41
+ [packages/framework/esm-api/src/types/user-resource.ts:33](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L33)
@@ -18,7 +18,7 @@
18
18
 
19
19
  #### Defined in
20
20
 
21
- [packages/framework/esm-api/src/types/user-resource.ts:52](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L52)
21
+ [packages/framework/esm-api/src/types/user-resource.ts:40](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L40)
22
22
 
23
23
  ___
24
24
 
@@ -28,7 +28,7 @@ ___
28
28
 
29
29
  #### Defined in
30
30
 
31
- [packages/framework/esm-api/src/types/user-resource.ts:53](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L53)
31
+ [packages/framework/esm-api/src/types/user-resource.ts:41](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L41)
32
32
 
33
33
  ___
34
34
 
@@ -38,4 +38,4 @@ ___
38
38
 
39
39
  #### Defined in
40
40
 
41
- [packages/framework/esm-api/src/types/user-resource.ts:51](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L51)
41
+ [packages/framework/esm-api/src/types/user-resource.ts:39](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L39)
@@ -18,7 +18,7 @@
18
18
 
19
19
  #### Defined in
20
20
 
21
- [packages/framework/esm-api/src/types/user-resource.ts:58](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L58)
21
+ [packages/framework/esm-api/src/types/user-resource.ts:46](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L46)
22
22
 
23
23
  ___
24
24
 
@@ -28,7 +28,7 @@ ___
28
28
 
29
29
  #### Defined in
30
30
 
31
- [packages/framework/esm-api/src/types/user-resource.ts:59](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L59)
31
+ [packages/framework/esm-api/src/types/user-resource.ts:47](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L47)
32
32
 
33
33
  ___
34
34
 
@@ -38,4 +38,4 @@ ___
38
38
 
39
39
  #### Defined in
40
40
 
41
- [packages/framework/esm-api/src/types/user-resource.ts:57](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L57)
41
+ [packages/framework/esm-api/src/types/user-resource.ts:45](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L45)
@@ -22,7 +22,7 @@
22
22
 
23
23
  #### Defined in
24
24
 
25
- [packages/framework/esm-api/src/types/user-resource.ts:14](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L14)
25
+ [packages/framework/esm-api/src/types/user-resource.ts:2](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L2)
26
26
 
27
27
  ___
28
28
 
@@ -32,7 +32,7 @@ ___
32
32
 
33
33
  #### Defined in
34
34
 
35
- [packages/framework/esm-api/src/types/user-resource.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L15)
35
+ [packages/framework/esm-api/src/types/user-resource.ts:3](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L3)
36
36
 
37
37
  ___
38
38
 
@@ -49,7 +49,7 @@ ___
49
49
 
50
50
  #### Defined in
51
51
 
52
- [packages/framework/esm-api/src/types/user-resource.ts:19](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L19)
52
+ [packages/framework/esm-api/src/types/user-resource.ts:7](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L7)
53
53
 
54
54
  ___
55
55
 
@@ -59,7 +59,7 @@ ___
59
59
 
60
60
  #### Defined in
61
61
 
62
- [packages/framework/esm-api/src/types/user-resource.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L16)
62
+ [packages/framework/esm-api/src/types/user-resource.ts:4](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L4)
63
63
 
64
64
  ___
65
65
 
@@ -69,7 +69,7 @@ ___
69
69
 
70
70
  #### Defined in
71
71
 
72
- [packages/framework/esm-api/src/types/user-resource.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L17)
72
+ [packages/framework/esm-api/src/types/user-resource.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L5)
73
73
 
74
74
  ___
75
75
 
@@ -79,7 +79,7 @@ ___
79
79
 
80
80
  #### Defined in
81
81
 
82
- [packages/framework/esm-api/src/types/user-resource.ts:20](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L20)
82
+ [packages/framework/esm-api/src/types/user-resource.ts:8](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L8)
83
83
 
84
84
  ___
85
85
 
@@ -89,4 +89,4 @@ ___
89
89
 
90
90
  #### Defined in
91
91
 
92
- [packages/framework/esm-api/src/types/user-resource.ts:18](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L18)
92
+ [packages/framework/esm-api/src/types/user-resource.ts:6](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L6)
@@ -18,7 +18,7 @@
18
18
 
19
19
  #### Defined in
20
20
 
21
- [packages/framework/esm-api/src/types/user-resource.ts:40](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L40)
21
+ [packages/framework/esm-api/src/types/user-resource.ts:28](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L28)
22
22
 
23
23
  ___
24
24
 
@@ -28,7 +28,7 @@ ___
28
28
 
29
29
  #### Defined in
30
30
 
31
- [packages/framework/esm-api/src/types/user-resource.ts:41](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L41)
31
+ [packages/framework/esm-api/src/types/user-resource.ts:29](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L29)
32
32
 
33
33
  ___
34
34
 
@@ -38,4 +38,4 @@ ___
38
38
 
39
39
  #### Defined in
40
40
 
41
- [packages/framework/esm-api/src/types/user-resource.ts:39](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L39)
41
+ [packages/framework/esm-api/src/types/user-resource.ts:27](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L27)
package/mock.tsx CHANGED
@@ -14,6 +14,10 @@ export { interpolateString, interpolateUrl } from "@openmrs/esm-config";
14
14
 
15
15
  window.i18next = { ...window.i18next, language: "en" };
16
16
 
17
+ // Needed for all mocks using stores
18
+ const availableStores: Record<string, StoreEntity> = {};
19
+ const initialStates: Record<string, any> = {};
20
+
17
21
  /* esm-globals */
18
22
 
19
23
  export function setupPaths(config: any) {
@@ -42,6 +46,13 @@ export function getCurrentUser() {
42
46
  return of({ authenticated: false });
43
47
  }
44
48
 
49
+ export const mockSessionStore = createGlobalStore("mock-session-store", {
50
+ loaded: false,
51
+ session: null,
52
+ });
53
+
54
+ export const getSessionStore = jest.fn(() => mockSessionStore);
55
+
45
56
  export const newWorkspaceItem = jest.fn();
46
57
 
47
58
  export const fhirBaseUrl = "/ws/fhir2/R4";
@@ -54,10 +65,6 @@ interface StoreEntity {
54
65
 
55
66
  export type MockedStore<T> = Store<T> & { resetMock: () => void };
56
67
 
57
- const initialStates: Record<string, any> = {};
58
-
59
- const availableStores: Record<string, StoreEntity> = {};
60
-
61
68
  export const mockStores = availableStores;
62
69
 
63
70
  export function createGlobalStore<TState>(
@@ -236,7 +243,10 @@ export const usePatient = jest.fn(() => ({
236
243
  error: null,
237
244
  }));
238
245
 
239
- export const useSession = jest.fn(() => null);
246
+ export const useSession = jest.fn(() => ({
247
+ authenticated: false,
248
+ sessionId: "",
249
+ }));
240
250
 
241
251
  export const useLayoutType = jest.fn(() => "desktop");
242
252
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-framework",
3
- "version": "3.3.2-pre.1187",
3
+ "version": "3.3.2-pre.1208",
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.3.2-pre.1187",
39
- "@openmrs/esm-breadcrumbs": "^3.3.2-pre.1187",
40
- "@openmrs/esm-config": "^3.3.2-pre.1187",
41
- "@openmrs/esm-error-handling": "^3.3.2-pre.1187",
42
- "@openmrs/esm-extensions": "^3.3.2-pre.1187",
43
- "@openmrs/esm-globals": "^3.3.2-pre.1187",
44
- "@openmrs/esm-offline": "^3.3.2-pre.1187",
45
- "@openmrs/esm-react-utils": "^3.3.2-pre.1187",
46
- "@openmrs/esm-state": "^3.3.2-pre.1187",
47
- "@openmrs/esm-styleguide": "^3.3.2-pre.1187",
48
- "@openmrs/esm-utils": "^3.3.2-pre.1187",
38
+ "@openmrs/esm-api": "^3.3.2-pre.1208",
39
+ "@openmrs/esm-breadcrumbs": "^3.3.2-pre.1208",
40
+ "@openmrs/esm-config": "^3.3.2-pre.1208",
41
+ "@openmrs/esm-error-handling": "^3.3.2-pre.1208",
42
+ "@openmrs/esm-extensions": "^3.3.2-pre.1208",
43
+ "@openmrs/esm-globals": "^3.3.2-pre.1208",
44
+ "@openmrs/esm-offline": "^3.3.2-pre.1208",
45
+ "@openmrs/esm-react-utils": "^3.3.2-pre.1208",
46
+ "@openmrs/esm-state": "^3.3.2-pre.1208",
47
+ "@openmrs/esm-styleguide": "^3.3.2-pre.1208",
48
+ "@openmrs/esm-utils": "^3.3.2-pre.1208",
49
49
  "dayjs": "^1.10.7"
50
50
  },
51
- "gitHead": "6739e87e1c98a4b3b1d7471b44c06a016d2cfff6"
51
+ "gitHead": "535fc8b5e11e011d0c14df5458c62c2b6c4630c6"
52
52
  }
@@ -1,27 +0,0 @@
1
- [@openmrs/esm-framework](../API.md) / CurrentUserOptions
2
-
3
- # Interface: CurrentUserOptions
4
-
5
- ## Hierarchy
6
-
7
- - **`CurrentUserOptions`**
8
-
9
- ↳ [`CurrentUserWithResponseOption`](CurrentUserWithResponseOption.md)
10
-
11
- ↳ [`CurrentUserWithoutResponseOption`](CurrentUserWithoutResponseOption.md)
12
-
13
- ## Table of contents
14
-
15
- ### Properties
16
-
17
- - [includeAuthStatus](CurrentUserOptions.md#includeauthstatus)
18
-
19
- ## Properties
20
-
21
- ### includeAuthStatus
22
-
23
- • `Optional` **includeAuthStatus**: `boolean`
24
-
25
- #### Defined in
26
-
27
- [packages/framework/esm-api/src/types/user-resource.ts:2](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L2)
@@ -1,29 +0,0 @@
1
- [@openmrs/esm-framework](../API.md) / CurrentUserWithResponseOption
2
-
3
- # Interface: CurrentUserWithResponseOption
4
-
5
- ## Hierarchy
6
-
7
- - [`CurrentUserOptions`](CurrentUserOptions.md)
8
-
9
- ↳ **`CurrentUserWithResponseOption`**
10
-
11
- ## Table of contents
12
-
13
- ### Properties
14
-
15
- - [includeAuthStatus](CurrentUserWithResponseOption.md#includeauthstatus)
16
-
17
- ## Properties
18
-
19
- ### includeAuthStatus
20
-
21
- • **includeAuthStatus**: ``true``
22
-
23
- #### Overrides
24
-
25
- [CurrentUserOptions](CurrentUserOptions.md).[includeAuthStatus](CurrentUserOptions.md#includeauthstatus)
26
-
27
- #### Defined in
28
-
29
- [packages/framework/esm-api/src/types/user-resource.ts:6](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L6)
@@ -1,29 +0,0 @@
1
- [@openmrs/esm-framework](../API.md) / CurrentUserWithoutResponseOption
2
-
3
- # Interface: CurrentUserWithoutResponseOption
4
-
5
- ## Hierarchy
6
-
7
- - [`CurrentUserOptions`](CurrentUserOptions.md)
8
-
9
- ↳ **`CurrentUserWithoutResponseOption`**
10
-
11
- ## Table of contents
12
-
13
- ### Properties
14
-
15
- - [includeAuthStatus](CurrentUserWithoutResponseOption.md#includeauthstatus)
16
-
17
- ## Properties
18
-
19
- ### includeAuthStatus
20
-
21
- • **includeAuthStatus**: ``false``
22
-
23
- #### Overrides
24
-
25
- [CurrentUserOptions](CurrentUserOptions.md).[includeAuthStatus](CurrentUserOptions.md#includeauthstatus)
26
-
27
- #### Defined in
28
-
29
- [packages/framework/esm-api/src/types/user-resource.ts:10](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/user-resource.ts#L10)