openmrs-esm-core

O3 Framework / OpenWorkspace

Interface: OpenWorkspace

Defined in: packages/framework/esm-styleguide/src/workspaces/workspaces.ts:113

See [[WorkspaceDefinition]] for more information about these properties

Extends

Properties

additionalProps

additionalProps: object

Defined in: packages/framework/esm-styleguide/src/workspaces/workspaces.ts:114


canHide

canHide: boolean

Defined in: packages/framework/esm-extensions/src/workspaces.ts:14

Inherited from

WorkspaceRegistration.canHide


canMaximize

canMaximize: boolean

Defined in: packages/framework/esm-extensions/src/workspaces.ts:15

Inherited from

WorkspaceRegistration.canMaximize


currentWorkspaceGroup?

optional currentWorkspaceGroup: string

Defined in: packages/framework/esm-styleguide/src/workspaces/workspaces.ts:115


groups

groups: string[]

Defined in: packages/framework/esm-extensions/src/workspaces.ts:20

Inherited from

WorkspaceRegistration.groups


moduleName

moduleName: string

Defined in: packages/framework/esm-extensions/src/workspaces.ts:19

Inherited from

WorkspaceRegistration.moduleName


name

name: string

Defined in: packages/framework/esm-extensions/src/workspaces.ts:10

Inherited from

WorkspaceRegistration.name


preferredWindowSize

preferredWindowSize: WorkspaceWindowState

Defined in: packages/framework/esm-extensions/src/workspaces.ts:17

Inherited from

WorkspaceRegistration.preferredWindowSize


title

title: string

Defined in: packages/framework/esm-extensions/src/workspaces.ts:11

Inherited from

WorkspaceRegistration.title


titleNode?

optional titleNode: ReactNode

Defined in: packages/framework/esm-extensions/src/workspaces.ts:12

Inherited from

WorkspaceRegistration.titleNode


type

type: string

Defined in: packages/framework/esm-extensions/src/workspaces.ts:13

Inherited from

WorkspaceRegistration.type


width

width: "narrow" | "wider" | "extra-wide"

Defined in: packages/framework/esm-extensions/src/workspaces.ts:16

Inherited from

WorkspaceRegistration.width

Methods

closeWorkspace()

closeWorkspace(closeWorkspaceOptions?): void

Defined in: packages/framework/esm-styleguide/src/workspaces/workspaces.ts:49

Call this function to close the workspace. This function will prompt the user if there are any unsaved changes to workspace.

You can pass onWorkspaceClose function to be called when the workspace is finally closed, given the user forcefully closes the workspace.

Parameters

closeWorkspaceOptions?

CloseWorkspaceOptions

Returns

void

Inherited from

DefaultWorkspaceProps.closeWorkspace


closeWorkspaceWithSavedChanges()

closeWorkspaceWithSavedChanges(closeWorkspaceOptions?): void

Defined in: packages/framework/esm-styleguide/src/workspaces/workspaces.ts:59

Call this function to close the workspace after the form is saved. This function will directly close the workspace without any prompt

Parameters

closeWorkspaceOptions?

CloseWorkspaceOptions

Returns

void

Inherited from

DefaultWorkspaceProps.closeWorkspaceWithSavedChanges


load()

load(): Promise<LifeCycles>

Defined in: packages/framework/esm-extensions/src/workspaces.ts:18

Returns

Promise<LifeCycles>

Inherited from

WorkspaceRegistration.load


promptBeforeClosing()

promptBeforeClosing(testFcn): void

Defined in: packages/framework/esm-styleguide/src/workspaces/workspaces.ts:54

Call this with a no-args function that returns true if the user should be prompted before this workspace is closed; e.g. if there is unsaved data.

Parameters

testFcn

() => boolean

Returns

void

Inherited from

DefaultWorkspaceProps.promptBeforeClosing


setTitle()

setTitle(title, titleNode?): void

Defined in: packages/framework/esm-styleguide/src/workspaces/workspaces.ts:74

Use this to set the workspace title if it needs to be set dynamically.

Workspace titles generally are set in the workspace declaration in the routes.json file. They can also be set by the workspace launcher by passing workspaceTitle in the additionalProps parameter of the launchWorkspace function. This function is useful when the workspace title needs to be set dynamically.

Parameters

title

string

The title to set. If using titleNode, set this to a human-readable string which will identify the workspace in notifications and other places.

titleNode?

ReactNode

A React object to put in the workspace header in place of the title. This is useful for displaying custom elements in the header. Note that custom header elements can also be attached to the workspace header extension slots.

Returns

void

Inherited from

DefaultWorkspaceProps.setTitle