From 3660a516102c1d60eb635b10a2c9b03555abd715 Mon Sep 17 00:00:00 2001 From: Vineet Sharma Date: Wed, 9 Aug 2023 12:01:13 +0530 Subject: [PATCH 1/3] Updated the LoggedInUser type for better understanding --- .../esm-api/src/types/user-resource.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/framework/esm-api/src/types/user-resource.ts b/packages/framework/esm-api/src/types/user-resource.ts index d1710caa2..ceb90e16c 100644 --- a/packages/framework/esm-api/src/types/user-resource.ts +++ b/packages/framework/esm-api/src/types/user-resource.ts @@ -13,7 +13,23 @@ export interface LoggedInUser { display: string; username: string; systemId: string; - userProperties: { [key: string]: any } | null; + userProperties: { + /** + * The UUIDs of patients the user has visited + * Seprataed by commas + * To get the array, do `user.userProperties.patientsVisited.split(',')` + * To store the array, do `patientsVisited: patientsVisited.join(',')` + */ + patientsVisited?: string; + /** + * The UUIDs of patient lists the user has starred + * Seprataed by commas + * To get the array, do `user.userProperties.starredPatientLists.split(',')` + * To store the array, perform `starredPatientLists: starredPatientLists.join(',')` + */ + starredPatientLists?: string; + [key: string]: string | undefined; + } | null; person: Person; privileges: Array; roles: Array; From b4fba6790406a1ef53168a4dc946335e44d93fd8 Mon Sep 17 00:00:00 2001 From: Vineet Sharma Date: Wed, 9 Aug 2023 12:11:25 +0530 Subject: [PATCH 2/3] Updated documentation --- .../esm-framework/docs/interfaces/LoggedInUser.md | 14 +++++++------- .../esm-framework/docs/interfaces/Person.md | 6 +++--- .../esm-framework/docs/interfaces/Privilege.md | 6 +++--- .../esm-framework/docs/interfaces/Role.md | 6 +++--- .../docs/interfaces/SessionLocation.md | 6 +++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/framework/esm-framework/docs/interfaces/LoggedInUser.md b/packages/framework/esm-framework/docs/interfaces/LoggedInUser.md index bb0b6022c..2bcfe2823 100644 --- a/packages/framework/esm-framework/docs/interfaces/LoggedInUser.md +++ b/packages/framework/esm-framework/docs/interfaces/LoggedInUser.md @@ -30,7 +30,7 @@ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:22](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L22) +[packages/framework/esm-api/src/types/user-resource.ts:38](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L38) ___ @@ -50,7 +50,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:21](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L21) +[packages/framework/esm-api/src/types/user-resource.ts:37](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L37) ___ @@ -60,7 +60,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L17) +[packages/framework/esm-api/src/types/user-resource.ts:33](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L33) ___ @@ -70,7 +70,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:18](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L18) +[packages/framework/esm-api/src/types/user-resource.ts:34](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L34) ___ @@ -80,7 +80,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:20](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L20) +[packages/framework/esm-api/src/types/user-resource.ts:36](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L36) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:19](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L19) +[packages/framework/esm-api/src/types/user-resource.ts:35](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L35) ___ @@ -106,7 +106,7 @@ ___ ### userProperties -• **userProperties**: ``null`` \| { `[key: string]`: `any`; } +• **userProperties**: ``null`` \| { `[key: string]`: `string` \| `undefined`; `patientsVisited?`: `string` ; `starredPatientLists?`: `string` } #### Defined in diff --git a/packages/framework/esm-framework/docs/interfaces/Person.md b/packages/framework/esm-framework/docs/interfaces/Person.md index fc9eecf51..400b703d1 100644 --- a/packages/framework/esm-framework/docs/interfaces/Person.md +++ b/packages/framework/esm-framework/docs/interfaces/Person.md @@ -18,7 +18,7 @@ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:34](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L34) +[packages/framework/esm-api/src/types/user-resource.ts:50](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L50) ___ @@ -28,7 +28,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:35](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L35) +[packages/framework/esm-api/src/types/user-resource.ts:51](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L51) ___ @@ -38,4 +38,4 @@ ___ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:33](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L33) +[packages/framework/esm-api/src/types/user-resource.ts:49](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L49) diff --git a/packages/framework/esm-framework/docs/interfaces/Privilege.md b/packages/framework/esm-framework/docs/interfaces/Privilege.md index 4cf536f66..bdb99087a 100644 --- a/packages/framework/esm-framework/docs/interfaces/Privilege.md +++ b/packages/framework/esm-framework/docs/interfaces/Privilege.md @@ -18,7 +18,7 @@ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:40](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L40) +[packages/framework/esm-api/src/types/user-resource.ts:56](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L56) ___ @@ -28,7 +28,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:41](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L41) +[packages/framework/esm-api/src/types/user-resource.ts:57](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L57) ___ @@ -38,4 +38,4 @@ ___ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:39](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L39) +[packages/framework/esm-api/src/types/user-resource.ts:55](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L55) diff --git a/packages/framework/esm-framework/docs/interfaces/Role.md b/packages/framework/esm-framework/docs/interfaces/Role.md index cf65af2e3..8eb0e8318 100644 --- a/packages/framework/esm-framework/docs/interfaces/Role.md +++ b/packages/framework/esm-framework/docs/interfaces/Role.md @@ -18,7 +18,7 @@ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:46](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L46) +[packages/framework/esm-api/src/types/user-resource.ts:62](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L62) ___ @@ -28,7 +28,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:47](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L47) +[packages/framework/esm-api/src/types/user-resource.ts:63](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L63) ___ @@ -38,4 +38,4 @@ ___ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:45](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L45) +[packages/framework/esm-api/src/types/user-resource.ts:61](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L61) diff --git a/packages/framework/esm-framework/docs/interfaces/SessionLocation.md b/packages/framework/esm-framework/docs/interfaces/SessionLocation.md index ecf88c107..a5a686119 100644 --- a/packages/framework/esm-framework/docs/interfaces/SessionLocation.md +++ b/packages/framework/esm-framework/docs/interfaces/SessionLocation.md @@ -18,7 +18,7 @@ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:28](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L28) +[packages/framework/esm-api/src/types/user-resource.ts:44](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L44) ___ @@ -28,7 +28,7 @@ ___ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:29](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L29) +[packages/framework/esm-api/src/types/user-resource.ts:45](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L45) ___ @@ -38,4 +38,4 @@ ___ #### Defined in -[packages/framework/esm-api/src/types/user-resource.ts:27](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L27) +[packages/framework/esm-api/src/types/user-resource.ts:43](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/types/user-resource.ts#L43) From 92b53d3b7a7051321b2ebc6ba9e7156b2af086e1 Mon Sep 17 00:00:00 2001 From: Dennis Kigen Date: Thu, 10 Aug 2023 23:03:41 +0300 Subject: [PATCH 3/3] Fix typo --- packages/framework/esm-api/src/types/user-resource.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/framework/esm-api/src/types/user-resource.ts b/packages/framework/esm-api/src/types/user-resource.ts index ceb90e16c..e792ba7a6 100644 --- a/packages/framework/esm-api/src/types/user-resource.ts +++ b/packages/framework/esm-api/src/types/user-resource.ts @@ -16,14 +16,14 @@ export interface LoggedInUser { userProperties: { /** * The UUIDs of patients the user has visited - * Seprataed by commas + * Separated by commas * To get the array, do `user.userProperties.patientsVisited.split(',')` * To store the array, do `patientsVisited: patientsVisited.join(',')` */ patientsVisited?: string; /** * The UUIDs of patient lists the user has starred - * Seprataed by commas + * Separated by commas * To get the array, do `user.userProperties.starredPatientLists.split(',')` * To store the array, perform `starredPatientLists: starredPatientLists.join(',')` */