Options
All
  • Public
  • Public/Protected
  • All
Menu

Component for requesting and listing all schemas

Hierarchy

  • Component<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }, SchemaListState>
    • default

Index

Constructors

constructor

  • new default(props: SchemaListProps): default
  • Parameters

    • props: SchemaListProps

    Returns default

Properties

context

context: any

If using the new style context, re-declare this in your class to be the React.ContextType of your static contextType. Should be used with type annotation or static contextType.

static contextType = MyContext
// For TS pre-3.7:
context!: React.ContextType<typeof MyContext>
// For TS 3.7 and above:
declare context: React.ContextType<typeof MyContext>
see

https://reactjs.org/docs/context.html

Readonly props

props: Readonly<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }> & Readonly<{ children?: ReactNode }>

refs

refs: {}

Type declaration

  • [key: string]: ReactInstance

state

state: Readonly<SchemaListState>

Optional Static contextType

contextType: Context<any>

If set, this.context will be set at runtime to the current value of the given Context.

Usage:

type MyContext = number
const Ctx = React.createContext<MyContext>(0)

class Foo extends React.Component {
  static contextType = Ctx
  context!: React.ContextType<typeof Ctx>
  render () {
    return <>My context's value: {this.context}</>;
  }
}
see

https://reactjs.org/docs/context.html#classcontexttype

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }>, nextContext: any): void
  • Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.

    Calling Component#setState generally does not trigger this method.

    This method will not stop working in React 17.

    Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.

    deprecated

    16.3, use static getDerivedStateFromProps instead

    see

    https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props

    see

    https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path

    Parameters

    • nextProps: Readonly<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }>
    • nextContext: any

    Returns void

Optional UNSAFE_componentWillUpdate

  • UNSAFE_componentWillUpdate(nextProps: Readonly<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }>, nextState: Readonly<SchemaListState>, nextContext: any): 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
  • Upon being mounted query the backend for list of schemas that is avaliable on the database

    Returns void

Optional componentDidUpdate

  • componentDidUpdate(prevProps: Readonly<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }>, prevState: Readonly<SchemaListState>, snapshot?: any): 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

    • prevProps: Readonly<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }>
    • prevState: Readonly<SchemaListState>
    • Optional snapshot: any

    Returns void

Optional componentWillMount

  • componentWillMount(): void

Optional componentWillReceiveProps

  • componentWillReceiveProps(nextProps: Readonly<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }>, nextContext: any): void
  • Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.

    Calling Component#setState generally does not trigger this method.

    Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.

    deprecated

    16.3, use static getDerivedStateFromProps instead; will stop working in React 17

    see

    https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props

    see

    https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path

    Parameters

    • nextProps: Readonly<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }>
    • nextContext: any

    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

  • componentWillUpdate(nextProps: Readonly<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }>, nextState: Readonly<SchemaListState>, nextContext: any): void

flipSchemaOrder

  • flipSchemaOrder(): void
  • Due to the assumtion that schemaList is initally in alphabetical ascending order and that there is only two option to sort the list that is ascending and decensding with ascending by default, we can take advantage by this by just simply fliping the list when the user change between the two sort mode. We also need to change the selected schema index accordingly which is simply just lengtOfArray - currentIndex - 1

    Returns void

forceUpdate

  • forceUpdate(callback?: () => void): void
  • Parameters

    • Optional callback: () => void
        • (): void
        • Returns void

    Returns void

Optional getSnapshotBeforeUpdate

  • getSnapshotBeforeUpdate(prevProps: Readonly<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }>, prevState: Readonly<SchemaListState>): any
  • 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

    • prevProps: Readonly<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }>
    • prevState: Readonly<SchemaListState>

    Returns any

handleSchemaSelection

  • handleSchemaSelection(schemaIndex: number): void
  • Function to handle schema selection from the user

    Parameters

    • schemaIndex: number

      Index of the selected schema

    Returns void

onSearchStringChange

  • onSearchStringChange(event: ChangeEvent<HTMLInputElement>): void
  • Call back for schema search input box OnChange

    Parameters

    • event: ChangeEvent<HTMLInputElement>

    Returns void

render

  • render(): Element
  • Returns Element

setState

  • setState<K>(state: null | SchemaListState | ((prevState: Readonly<SchemaListState>, props: Readonly<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }>) => null | SchemaListState | Pick<SchemaListState, K>) | Pick<SchemaListState, K>, callback?: () => void): void
  • Type parameters

    • K: "schemaList" | "restrictiedSchemaList" | "searchString" | "selectedSchemaIndex"

    Parameters

    • state: null | SchemaListState | ((prevState: Readonly<SchemaListState>, props: Readonly<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }>) => null | SchemaListState | Pick<SchemaListState, K>) | Pick<SchemaListState, K>
    • Optional callback: () => void
        • (): void
        • Returns void

    Returns void

Optional shouldComponentUpdate

  • shouldComponentUpdate(nextProps: Readonly<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }>, nextState: Readonly<SchemaListState>, 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

    • nextProps: Readonly<{ currentlySelectedSchema: string; handleSchemaSelection: (schemaName: string) => void; token: string }>
    • nextState: Readonly<SchemaListState>
    • nextContext: any

    Returns boolean

Generated using TypeDoc