Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ManualInputForm<SS>

This component renders a form for updating configuration manually through form input fields. It supplies a prop onSubmit, which is a callback that is invoked when the form was successfully submitted and a prop formData which allows for passing in initial values that the form should be populated with.

param

Callback invoked when the form is submitted

param

Inital values for input fields

Type parameters

  • SS

Hierarchy

Index

Constructors

constructor

Properties

context

context: any

Private formKeys

formKeys: Array<keyof FormValues> = ["layoutService", "clientApiUrl", "logLevel","timelineService", "mode", "noKibana", "websocketService"]

Private modeValues

modeValues: Array<string> = ["standalone"]

props

props: Readonly<object> & Readonly<ManualInputFormProps>

refs

refs: object

Type declaration

  • [key: string]: ReactInstance

state

state: Readonly<ManualInputFormState>

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<ManualInputFormProps>, 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

componentWillReceiveProps

  • Invoked when the component is about to receive new props. Updates the state with the new form data.

    Parameters

    Returns 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

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(): Element
  • Renders the component

    Returns Element

Private renderNotification

  • renderNotification(): undefined | Element
  • Renders a notification badge if the submitSuccess state variable is set.

    Returns undefined | Element

setState

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

    • K: keyof ManualInputFormState

    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 submitManualForm

  • submitManualForm(): Promise<void>
  • Invoked in response to the user submitting the form. Gathers all form values and sends them to the server. Updates the state accordingly.

    Returns Promise<void>

Private updateFormData

  • updateFormData(key: keyof FormValues, value: string | boolean): void
  • Updates a configuration key with the given value by updating the state. Also sets the formTainted property to true, which enables the submit button.

    Parameters

    • key: keyof FormValues

      Key to be updated

    • value: string | boolean

      Updated value

    Returns void

Generated using TypeDoc