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

(fix) Fix error that appears when changing locale #560

Merged
merged 1 commit into from
Oct 31, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ export function getSessionLocation() {
return new Promise<SessionLocation | undefined>((res, rej) => {
const sub = getCurrentUser().subscribe((session) => {
res(session.sessionLocation);
sub.unsubscribe();
}, rej);
sub.unsubscribe();
});
}

Expand Down
80 changes: 42 additions & 38 deletions packages/framework/esm-framework/docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,11 @@

- [isDesktop](API.md#isdesktop)
- [setLeftNav](API.md#setleftnav)
- [showActionableNotification](API.md#showactionablenotification)
- [showModal](API.md#showmodal)
- [showNotification](API.md#shownotification)
- [showActionableNotification](API.md#showactionablenotification)
- [showToast](API.md#showtoast)
- [subscribeActionableNotificationShown](API.md#subscribeactionablenotificationshown)
- [subscribeNotificationShown](API.md#subscribenotificationshown)
- [subscribeToastShown](API.md#subscribetoastshown)
- [unsetLeftNav](API.md#unsetleftnav)
Expand Down Expand Up @@ -525,23 +526,23 @@ ___

## UI Type Aliases

### InlineNotificationType
### ActionableNotificationType

Ƭ **InlineNotificationType**: ``"error"`` \| ``"info"`` \| ``"info-square"`` \| ``"success"`` \| ``"warning"`` \| ``"warning-alt"``
Ƭ **ActionableNotificationType**: ``"error"`` \| ``"info"`` \| ``"info-square"`` \| ``"success"`` \| ``"warning"`` \| ``"warning-alt"``

#### Defined in

[packages/framework/esm-styleguide/src/notifications/notification.component.tsx:22](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/notification.component.tsx#L22)
[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:25](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L25)

___

### ActionableNotificationType
### InlineNotificationType

Ƭ **ActionableNotificationType**: ``"error"`` \| ``"info"`` \| ``"info-square"`` \| ``"success"`` \| ``"warning"`` \| ``"warning-alt"``
Ƭ **InlineNotificationType**: ``"error"`` \| ``"info"`` \| ``"info-square"`` \| ``"success"`` \| ``"warning"`` \| ``"warning-alt"``

#### Defined in

[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:25](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L25)
[packages/framework/esm-styleguide/src/notifications/notification.component.tsx:22](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/notification.component.tsx#L22)

___

Expand Down Expand Up @@ -1180,7 +1181,7 @@ ___

#### Defined in

[packages/framework/esm-api/src/shared-api-objects/current-user.ts:239](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L239)
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:241](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L241)

___

Expand Down Expand Up @@ -3858,6 +3859,28 @@ ___

___

### showActionableNotification

▸ **showActionableNotification**(`notification`): `void`

Displays an actionable notification in the UI.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `notification` | [`ActionableNotificationDescriptor`](interfaces/ActionableNotificationDescriptor.md) | The description of the notification to display. |

#### Returns

`void`

#### Defined in

[packages/framework/esm-styleguide/src/notifications/index.tsx:88](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/index.tsx#L88)

___

### showModal

▸ **showModal**(`extensionId`, `props?`, `onClose?`): () => `void`
Expand Down Expand Up @@ -3908,31 +3931,10 @@ Displays an inline notification in the UI.

#### Defined in

[packages/framework/esm-styleguide/src/notifications/index.tsx:40](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/index.tsx#L48)
[packages/framework/esm-styleguide/src/notifications/index.tsx:48](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/index.tsx#L48)

___

### showActionableNotification

▸ **showActionableNotification**(`notification`): `void`

Displays an actionable notification in the UI which takes in an action.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `notification` | [`ActionableNotificationDescriptor`](interfaces/ActionableNotificationDescriptor.md) | The description of the actionable notification to display. |

#### Returns

`void`

#### Defined in

[packages/framework/esm-styleguide/src/notifications/index.tsx:40](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/index.tsx#L88)

___
### showToast

▸ **showToast**(`toast`): `void`
Expand All @@ -3955,15 +3957,15 @@ Displays a toast notification in the UI.

___

### subscribeNotificationShown
### subscribeActionableNotificationShown

▸ **subscribeNotificationShown**(`cb`): () => `void`
▸ **subscribeActionableNotificationShown**(`cb`): () => `void`

#### Parameters

| Name | Type |
| :------ | :------ |
| `cb` | (`data`: [`ShowNotificationEvent`](interfaces/ShowNotificationEvent.md)) => `void` |
| `cb` | (`data`: [`ShowActionableNotificationEvent`](interfaces/ShowActionableNotificationEvent.md)) => `void` |

#### Returns

Expand All @@ -3977,17 +3979,19 @@ ___

#### Defined in

[packages/framework/esm-globals/src/events.ts:93](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L117)
[packages/framework/esm-globals/src/events.ts:126](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L126)

___

▸ **subscribeActionableNotificationShown**(`cb`): () => `void`
### subscribeNotificationShown

▸ **subscribeNotificationShown**(`cb`): () => `void`

#### Parameters

| Name | Type |
| :------ | :------ |
| `cb` | (`data`: [`ShowActionableNotificationEvent`](interfaces/ShowActionableNotificationEvent.md)) => `void` |
| `cb` | (`data`: [`ShowNotificationEvent`](interfaces/ShowNotificationEvent.md)) => `void` |

#### Returns

Expand All @@ -4001,7 +4005,7 @@ ___

#### Defined in

[packages/framework/esm-globals/src/events.ts:93](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L126)
[packages/framework/esm-globals/src/events.ts:117](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L117)

___

Expand All @@ -4027,7 +4031,7 @@ ___

#### Defined in

[packages/framework/esm-globals/src/events.ts:102](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L136)
[packages/framework/esm-globals/src/events.ts:136](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-globals/src/events.ts#L136)

___

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Error.prepareStackTrace

#### Defined in

packages/framework/esm-framework/node_modules/@types/node/globals.d.ts:11
packages/framework/esm-framework/node_modules/@types/node/ts4.8/globals.d.ts:11

___

Expand All @@ -178,7 +178,7 @@ Error.stackTraceLimit

#### Defined in

packages/framework/esm-framework/node_modules/@types/node/globals.d.ts:13
packages/framework/esm-framework/node_modules/@types/node/ts4.8/globals.d.ts:13

## Methods

Expand All @@ -205,4 +205,4 @@ Error.captureStackTrace

#### Defined in

packages/framework/esm-framework/node_modules/@types/node/globals.d.ts:4
packages/framework/esm-framework/node_modules/@types/node/ts4.8/globals.d.ts:4
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@

### UI Properties

- [actionButtonLable](ActionableNotificationDescriptor.md#actionButtonLable)
- [actionButtonLabel](ActionableNotificationDescriptor.md#actionbuttonlabel)
- [critical](ActionableNotificationDescriptor.md#critical)
- [subtitle](ActionableNotificationDescriptor.md#subtitle)
- [kind](ActionableNotificationDescriptor.md#kind)
- [onActionButtonClick](ActionableNotificationDescriptor.md#onActionButtonClick)
- [progressActionLabel](ActionableNotificationDescriptor.md#progressactionlabel)
- [subtitle](ActionableNotificationDescriptor.md#subtitle)
- [title](ActionableNotificationDescriptor.md#title)

### UI Methods

- [onActionButtonClick](ActionableNotificationDescriptor.md#onactionbuttonclick)
- [onClose](ActionableNotificationDescriptor.md#onclose)

## UI Properties

### actionButtonLabel
Expand All @@ -25,21 +30,33 @@

___

• **onActionButtonClick**: `void`
### critical

• `Optional` **critical**: `boolean`

#### Defined in

[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:11](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L11)
[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:16](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L16)

___

### critical
### kind

• `Optional` **critical**: `boolean`
• `Optional` **kind**: `string`

#### Defined in

[packages/framework/esm-styleguide/src/notifications/notification.component.tsx:16](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/notification.component.tsx#L16)
[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:15](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L15)

___

### progressActionLabel

• `Optional` **progressActionLabel**: `string`

#### Defined in

[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:17](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L17)

___

Expand All @@ -49,34 +66,42 @@ ___

#### Defined in

[packages/framework/esm-styleguide/src/notifications/notification.component.tsx:13](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/notification.component.tsx#L13)
[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:13](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L13)

___

### kind
### title

• `Optional` **kind**: [`ActionableNotificationType`](../API.md#actionablenotificationtype)
• `Optional` **title**: `string`

#### Defined in

[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:15](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L15)
[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:14](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L14)

___
## UI Methods

### progressActionLabel
### onActionButtonClick

• `Optional` **progressActionLabel**: `string`
▸ **onActionButtonClick**(): `void`

#### Returns

`void`

#### Defined in

[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:17](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L17)
[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:11](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L11)

___

### title
### onClose

• `Optional` **title**: `string`
▸ `Optional` **onClose**(): `void`

#### Returns

`void`

#### Defined in

[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:14](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L14)
[packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx:12](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/notifications/actionable-notification.component.tsx#L12)
Loading