Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MasterManager<SS>

MasterManager is a Redux-connected component responsible for rendering preview screens, which can be used for dropping components on top of and thus assigning them to master layouts. It also provides elements for * creating and updating such master layouts. It receives all its props via the Redux state tree.

Type parameters

  • SS

Hierarchy

Index

Constructors

constructor

  • Parameters

    Returns MasterManager

Properties

context

context: any

props

props: Readonly<object> & Readonly<MasterManagerProps>

refs

refs: object

Type declaration

  • [key: string]: ReactInstance

state

state: Readonly<__type>

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

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

Optional UNSAFE_componentWillUpdate

  • UNSAFE_componentWillUpdate(nextProps: Readonly<MasterManagerProps>, nextState: Readonly<__type>, nextContext: any): void

Private addMaster

  • addMaster(): void
  • Callback to add a new master layout. Shows a dialogue prompting the user to choose a name for the layout. If the name is empty or the user cancels the prompt, no new layout is created.

    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(): void
  • Invoked after the component is first mounted. Sets the currentScreen prop if it is not set already.

    Returns void

Optional componentDidUpdate

  • componentDidUpdate(prevProps: Readonly<MasterManagerProps>, prevState: Readonly<__type>, snapshot?: SS): void
  • 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

  • componentWillReceiveProps(nextProps: Readonly<MasterManagerProps>, nextContext: any): void

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

  • componentWillUpdate(nextProps: Readonly<MasterManagerProps>, nextState: Readonly<__type>, nextContext: any): void

forceUpdate

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

    • Optional callBack: undefined | function

    Returns void

Private getComponentsOnScreen

  • getComponentsOnScreen(screenId: string, layoutId?: undefined | string): List<ComponentPlacement> | undefined
  • This function returns a list of components which have been placed onto the given screen for the given layout. If the given layout does not exist or does not have any components assigned to it, undefined is returned.

    Parameters

    • screenId: string

      ID of screen for which we want to get the components

    • Optional layoutId: undefined | string

      ID of layout for which we want to get the components

    Returns List<ComponentPlacement> | undefined

    A list of components placed onto the given screen for the given layout

Optional getSnapshotBeforeUpdate

  • getSnapshotBeforeUpdate(prevProps: Readonly<MasterManagerProps>, prevState: Readonly<__type>): SS | null
  • 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(): Element
  • Renders the component.

    Returns Element

Private renderScreen

  • renderScreen(): Element
  • Renders the preview screen and sets it up so that the user can place elements on it via drag and drop. Also renders a dropdown where the user can update the current screen.

    Returns Element

    JSX elements which render the preview screen and a dropdown for selecting the screen

setState

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

    • K: keyof __type

    Parameters

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

    Returns void

Optional shouldComponentUpdate

  • shouldComponentUpdate(nextProps: Readonly<MasterManagerProps>, nextState: Readonly<__type>, nextContext: any): boolean
  • 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 updateSelectedScreen

  • updateSelectedScreen(e: FormEvent<HTMLSelectElement>): void
  • Callback which is invoked in response to the user selecting a new preview screen.

    Parameters

    • e: FormEvent<HTMLSelectElement>

      Form event from which the screen ID is retrieved

    Returns void

Generated using TypeDoc