Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GeneralSettings<SS>

This component allows the user to configure various aspects of the preview player by changing a series of settings. This component also offers access to various debug links.

param

The document ID for the current session

Type parameters

  • SS

Hierarchy

Index

Constructors

constructor

Properties

context

context: any

debugLinks

debugLinks: object

Type declaration

  • [key: string]: string

description

description: string

Private descriptionRef

descriptionRef: Nullable<HTMLInputElement>

enableControls

enableControls: boolean

playerMode

playerMode: string

previewFromWebcam

previewFromWebcam: boolean

props

props: Readonly<object> & Readonly<GeneralSettingsProps>

refs

refs: object

Type declaration

  • [key: string]: ReactInstance

Private settingsUrl

settingsUrl: string

startPaused

startPaused: boolean

state

state: Readonly<GeneralSettingsState>

viewerExtraOffset

viewerExtraOffset: string

Private viewerExtraOffsetRef

viewerExtraOffsetRef: Nullable<HTMLInputElement>

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

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

Optional UNSAFE_componentWillUpdate

Private changeDescription

  • changeDescription(): void
  • Callback invoked when the user wants to update the description of the current session. The updated value is obtained from a ref.

    Returns void

Private changeEnableControls

  • changeEnableControls(e: ChangeEvent<HTMLInputElement>): void
  • Callback invoked when the user wants to update the enableControls setting. The value is converted from string to boolean before is it passed to the server.

    Parameters

    • e: ChangeEvent<HTMLInputElement>

      The original change event

    Returns void

Private changePlayerMode

  • changePlayerMode(e: ChangeEvent<HTMLSelectElement>): void
  • Callback invoked when the user wants to update the playerMode setting.

    Parameters

    • e: ChangeEvent<HTMLSelectElement>

      The original change event

    Returns void

Private changePreviewFromWebcam

  • changePreviewFromWebcam(e: ChangeEvent<HTMLInputElement>): void
  • Callback invoked when the user wants to update the previewFromWebcam setting. The value is converted from string to boolean before is it passed to the server.

    Parameters

    • e: ChangeEvent<HTMLInputElement>

      The original change event

    Returns void

Private changeStartPaused

  • changeStartPaused(e: ChangeEvent<HTMLInputElement>): void
  • Callback invoked when the user wants to update the startPaused setting. The value is converted from string to boolean before is it passed to the server.

    Parameters

    • e: ChangeEvent<HTMLInputElement>

      The original change event

    Returns void

Private changeViewerExtraOffset

  • changeViewerExtraOffset(): void
  • Callback invoked when the user wants to update the viewerExtraOffset setting. The updated value is retrieved from a ref.

    Returns void

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

componentDidMount

  • componentDidMount(): Promise<void>
  • Invoked after the component first mounts. Requests the settings values from the server and stores the values in the component's internal state.

    Returns Promise<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

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

render

  • render(): null | Element
  • Renders the component

    Returns null | Element

Private renderDebugLinks

  • renderDebugLinks(links: object): Element[]
  • Renders a list of links given as key-value pairs as JSX elements. Where the key is the name of the link and the value is the link itself.

    Parameters

    • links: object

      Links to render as a list

      • [key: string]: string

    Returns Element[]

    The links wrapped in JSX elements

Private renderNotification

  • renderNotification(): undefined | Element
  • Renders a notification badge indicating either success or failure of a request to update a settings key. If the saveSuccessful state variable is undefined, nothing is rendered. The notification is cleared and disappears after one second.

    Returns undefined | Element

    The rendered notification

setState

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

    • K: keyof GeneralSettingsState

    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

Private updateSettingsKey

  • Generic function for updating settings values. The function takes the settings key to be updated and the updated value, creates a HTTP request and if successful, updates the state accordingly. In case the request fails, the error condition is set.

    Parameters

    • key: GeneralSettingsKey

      The key to update

    • value: string | boolean

      The new value for the given key

    Returns Promise<void>

Generated using TypeDoc