Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) Update type LoggedInUser to list userProperties in use #744

Merged
merged 3 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion packages/framework/esm-api/src/types/user-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,23 @@ export interface LoggedInUser {
display: string;
username: string;
systemId: string;
userProperties: { [key: string]: any } | null;
userProperties: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, the one thing I'm noticing is that these comments for named properties don't appear in the autogenerated docs, which is a bit unfortunate, but this is overall a big improvement.

/**
* The UUIDs of patients the user has visited
* 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
* Separated 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<Privilege>;
roles: Array<Role>;
Expand Down
14 changes: 7 additions & 7 deletions packages/framework/esm-framework/docs/interfaces/LoggedInUser.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

___

Expand All @@ -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)

___

Expand All @@ -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)

___

Expand All @@ -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)

___

Expand All @@ -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)

___

Expand All @@ -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)

___

Expand All @@ -106,7 +106,7 @@ ___

### userProperties

• **userProperties**: ``null`` \| { `[key: string]`: `any`; }
• **userProperties**: ``null`` \| { `[key: string]`: `string` \| `undefined`; `patientsVisited?`: `string` ; `starredPatientLists?`: `string` }

#### Defined in

Expand Down
6 changes: 3 additions & 3 deletions packages/framework/esm-framework/docs/interfaces/Person.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

___

Expand All @@ -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)

___

Expand All @@ -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)
6 changes: 3 additions & 3 deletions packages/framework/esm-framework/docs/interfaces/Privilege.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

___

Expand All @@ -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)

___

Expand All @@ -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)
6 changes: 3 additions & 3 deletions packages/framework/esm-framework/docs/interfaces/Role.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

___

Expand All @@ -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)

___

Expand All @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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)

___

Expand All @@ -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)

___

Expand All @@ -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)
Loading