Skip to content

Commit

Permalink
(fix) O3-2724: Follow-up PR to add mocks and additional public type e…
Browse files Browse the repository at this point in the history
…xports (#984)
  • Loading branch information
brandones authored Apr 29, 2024
1 parent 16ba2c5 commit 7635f34
Show file tree
Hide file tree
Showing 9 changed files with 542 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/framework/esm-framework/docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -5619,7 +5619,7 @@ Function to close an opened workspace
| Name | Type | Description |
| :------ | :------ | :------ |
| `name` | `string` | Workspace registration name |
| `options` | `CloseWorkspaceOptions` | Options to close workspace |
| `options` | [`CloseWorkspaceOptions`](interfaces/CloseWorkspaceOptions.md) | Options to close workspace |

#### Returns

Expand Down Expand Up @@ -5701,11 +5701,11 @@ ___

### useWorkspaces

**useWorkspaces**(): `WorkspacesInfo`
**useWorkspaces**(): [`WorkspacesInfo`](interfaces/WorkspacesInfo.md)

#### Returns

`WorkspacesInfo`
[`WorkspacesInfo`](interfaces/WorkspacesInfo.md)

#### Defined in

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[@openmrs/esm-framework](../API.md) / CloseWorkspaceOptions

# Interface: CloseWorkspaceOptions

## Table of contents

### Properties

- [ignoreChanges](CloseWorkspaceOptions.md#ignorechanges)

### Methods

- [onWorkspaceClose](CloseWorkspaceOptions.md#onworkspaceclose)

## Properties

### ignoreChanges

`Optional` **ignoreChanges**: `boolean`

Whether to close the workspace ignoring all the changes present in the workspace.

If ignoreChanges is true, the user will not be prompted to save changes before closing
even if the `testFcn` passed to `promptBeforeClosing` returns `true`.

#### Defined in

[packages/framework/esm-styleguide/src/workspaces/types.ts:10](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/types.ts#L10)

## Methods

### onWorkspaceClose

`Optional` **onWorkspaceClose**(): `void`

If you want to take an action after the workspace is closed, you can pass your function as
`onWorkspaceClose`. This function will be called only after the workspace is closed, given
that the user might be shown a prompt.

#### Returns

`void`

void

#### Defined in

[packages/framework/esm-styleguide/src/workspaces/types.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/types.ts#L17)
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ closed, given the user forcefully closes the workspace.

| Name | Type |
| :------ | :------ |
| `closeWorkspaceOptions?` | `CloseWorkspaceOptions` |
| `closeWorkspaceOptions?` | [`CloseWorkspaceOptions`](CloseWorkspaceOptions.md) |

#### Returns

Expand All @@ -52,7 +52,7 @@ will directly close the workspace without any prompt

| Name | Type |
| :------ | :------ |
| `closeWorkspaceOptions?` | `CloseWorkspaceOptions` |
| `closeWorkspaceOptions?` | [`CloseWorkspaceOptions`](CloseWorkspaceOptions.md) |

#### Returns

Expand Down
235 changes: 235 additions & 0 deletions packages/framework/esm-framework/docs/interfaces/OpenWorkspace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
[@openmrs/esm-framework](../API.md) / OpenWorkspace

# Interface: OpenWorkspace

## Hierarchy

- [`WorkspaceRegistration`](WorkspaceRegistration.md)

**`OpenWorkspace`**

## Table of contents

### Workspace Properties

- [additionalProps](OpenWorkspace.md#additionalprops)
- [canHide](OpenWorkspace.md#canhide)
- [canMaximize](OpenWorkspace.md#canmaximize)
- [moduleName](OpenWorkspace.md#modulename)
- [name](OpenWorkspace.md#name)
- [preferredWindowSize](OpenWorkspace.md#preferredwindowsize)
- [title](OpenWorkspace.md#title)
- [type](OpenWorkspace.md#type)
- [width](OpenWorkspace.md#width)

### Other Methods

- [closeWorkspace](OpenWorkspace.md#closeworkspace)
- [closeWorkspaceWithSavedChanges](OpenWorkspace.md#closeworkspacewithsavedchanges)
- [promptBeforeClosing](OpenWorkspace.md#promptbeforeclosing)

### Workspace Methods

- [load](OpenWorkspace.md#load)

## Workspace Properties

### additionalProps

**additionalProps**: `object`

#### Defined in

[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:49](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L49)

___

### canHide

**canHide**: `boolean`

#### Inherited from

[WorkspaceRegistration](WorkspaceRegistration.md).[canHide](WorkspaceRegistration.md#canhide)

#### Defined in

[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:40](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L40)

___

### canMaximize

**canMaximize**: `boolean`

#### Inherited from

[WorkspaceRegistration](WorkspaceRegistration.md).[canMaximize](WorkspaceRegistration.md#canmaximize)

#### Defined in

[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:41](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L41)

___

### moduleName

**moduleName**: `string`

#### Inherited from

[WorkspaceRegistration](WorkspaceRegistration.md).[moduleName](WorkspaceRegistration.md#modulename)

#### Defined in

[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:45](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L45)

___

### name

**name**: `string`

#### Inherited from

[WorkspaceRegistration](WorkspaceRegistration.md).[name](WorkspaceRegistration.md#name)

#### Defined in

[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:37](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L37)

___

### preferredWindowSize

**preferredWindowSize**: [`WorkspaceWindowState`](../API.md#workspacewindowstate)

#### Inherited from

[WorkspaceRegistration](WorkspaceRegistration.md).[preferredWindowSize](WorkspaceRegistration.md#preferredwindowsize)

#### Defined in

[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:43](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L43)

___

### title

**title**: `string`

#### Inherited from

[WorkspaceRegistration](WorkspaceRegistration.md).[title](WorkspaceRegistration.md#title)

#### Defined in

[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:38](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L38)

___

### type

**type**: `string`

#### Inherited from

[WorkspaceRegistration](WorkspaceRegistration.md).[type](WorkspaceRegistration.md#type)

#### Defined in

[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:39](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L39)

___

### width

**width**: ``"narrow"`` \| ``"wider"``

#### Inherited from

[WorkspaceRegistration](WorkspaceRegistration.md).[width](WorkspaceRegistration.md#width)

#### Defined in

[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:42](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L42)

## Other Methods

### closeWorkspace

**closeWorkspace**(`closeWorkspaceOptions?`): `boolean`

#### Parameters

| Name | Type |
| :------ | :------ |
| `closeWorkspaceOptions?` | [`CloseWorkspaceOptions`](CloseWorkspaceOptions.md) |

#### Returns

`boolean`

#### Defined in

[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:50](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L50)

___

### closeWorkspaceWithSavedChanges

**closeWorkspaceWithSavedChanges**(`closeWorkspaceOptions?`): `boolean`

#### Parameters

| Name | Type |
| :------ | :------ |
| `closeWorkspaceOptions?` | [`CloseWorkspaceOptions`](CloseWorkspaceOptions.md) |

#### Returns

`boolean`

#### Defined in

[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:51](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L51)

___

### promptBeforeClosing

**promptBeforeClosing**(`testFcn`): `void`

#### Parameters

| Name | Type |
| :------ | :------ |
| `testFcn` | () => `boolean` |

#### Returns

`void`

#### Defined in

[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:52](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L52)

___

## Workspace Methods

### load

**load**(): `Promise`<{ `default?`: `LifeCycles`<{}\> } & `LifeCycles`<{}\>\>

#### Returns

`Promise`<{ `default?`: `LifeCycles`<{}\> } & `LifeCycles`<{}\>\>

#### Inherited from

[WorkspaceRegistration](WorkspaceRegistration.md).[load](WorkspaceRegistration.md#load)

#### Defined in

[packages/framework/esm-styleguide/src/workspaces/workspaces.ts:44](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/workspaces/workspaces.ts#L44)
Loading

0 comments on commit 7635f34

Please sign in to comment.