Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EventContainer<SS>

This component renders a given event as a box on screen. It displays title, description, number of parameters and, depending on trigger mode and number of parameters a button to either launch the event directly or to open a modal dialogue which allows the user to configure event parameters and then either launch or enqueue it.

param

The document ID for the current session

param

The event to be rendered

param

A callback invoked when the event has been triggered

Type parameters

  • SS

Hierarchy

Index

Constructors

constructor

Properties

context

context: any

props

props: Readonly<object> & Readonly<EventContainerProps>

refs

refs: object

Type declaration

  • [key: string]: ReactInstance

state

state: Readonly<EventContainerState>

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<EventContainerProps>, nextContext: any): void

Optional UNSAFE_componentWillUpdate

Optional componentDidCatch

  • componentDidCatch(error: Error, errorInfo: ErrorInfo): void
  • Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.

    Parameters

    • error: Error
    • errorInfo: ErrorInfo

    Returns void

Optional componentDidMount

  • componentDidMount(): void
  • Called immediately after a compoment is mounted. Setting state here will trigger re-rendering.

    Returns void

Optional componentDidUpdate

  • Called immediately after updating occurs. Not called for the initial render.

    The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.

    Parameters

    Returns void

Optional componentWillMount

  • componentWillMount(): void

Optional componentWillReceiveProps

Optional componentWillUnmount

  • componentWillUnmount(): void
  • Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as cancelled network requests, or cleaning up any DOM elements created in componentDidMount.

    Returns void

Optional componentWillUpdate

forceUpdate

  • forceUpdate(callBack?: undefined | function): void
  • Parameters

    • Optional callBack: undefined | function

    Returns void

Private getButtonLabel

  • getButtonLabel(triggerMode?: string): string
  • Returns the label to be put on the launch button of the event. The label depends on whether the event has any parameters, on the triggerMode, flags in the event itself or the verb field of the event if it is set.

    Parameters

    • Default value triggerMode: string = "trigger"

      The current trigger mode. Defaults to trigger

    Returns string

    The label for the submit button

Optional getSnapshotBeforeUpdate

  • Runs before React applies the result of render to the document, and returns an object to be given to componentDidUpdate. Useful for saving things such as scroll position before render causes changes to it.

    Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.

    Parameters

    Returns SS | null

Private launchEvent

  • launchEvent(triggerMode?: string): Promise<void>
  • Callback invoked in response to the user clicking the submit button. Based on the given triggerMode, a different URL is composed which is then used to trigger the event with the given params. Invokes the onTriggered callback with either the argument success or error after the request has completed and updates the state accordingly.

    Parameters

    • Default value triggerMode: string = "trigger"

      The current trigger mode. Defaults to trigger

    Returns Promise<void>

render

  • render(): Element
  • Renders the component

    Returns Element

Private renderEventModal

  • renderEventModal(): null | ReactPortal
  • Renders a modal dialogue for the current event and attaches it to the DOM element modal-root through a portal. Whether the modal is rendereed or not, depends on the value of the showEventModal state variable.

    Returns null | ReactPortal

    A portal to the event modal or null

Private renderParamCount

  • renderParamCount(count: number): null | Element
  • Renders the parameter count for an event and returns it as a formatted JSX string. If zero is passed, the function returns null.

    Parameters

    • count: number

      Number of parameters

    Returns null | Element

    A JSX string displaying the count or null

setState

  • setState<K>(state: function | null | S | object, callback?: undefined | function): void
  • Type parameters

    • K: keyof EventContainerState

    Parameters

    • state: function | null | S | object
    • Optional callback: undefined | function

    Returns void

Optional shouldComponentUpdate

  • Called to determine whether the change in props and state should trigger a re-render.

    Component always returns true. PureComponent implements a shallow comparison on props and state and returns true if any props or states have changed.

    If false is returned, Component#render, componentWillUpdate and componentDidUpdate will not be called.

    Parameters

    Returns boolean

Generated using TypeDoc