Options
All
  • Public
  • Public/Protected
  • All
Menu

Parent component for handling displaying TableContent and TableInfo

Hierarchy

  • Component<TableViewProps, TableViewState>
    • default

Index

Constructors

constructor

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

    • props: TableViewProps

    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<TableViewProps> & Readonly<{ children?: ReactNode }>

refs

refs: {}

Type declaration

  • [key: string]: ReactInstance

state

state: Readonly<TableViewState>

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<TableViewProps>, nextContext: any): void

Optional UNSAFE_componentWillUpdate

  • UNSAFE_componentWillUpdate(nextProps: Readonly<TableViewProps>, nextState: Readonly<TableViewState>, 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

Optional componentDidMount

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

    Returns void

componentDidUpdate

  • componentDidUpdate(prevProps: TableViewProps, prevState: TableViewState): void
  • Handle updating views based on the possiable following changes

    • selectedTableName changes => Fetch current view and set the other to need update
    • currentView changes => Fetch if data refresh is needed, if not just switch
    • currentPageNumber changes => Refetch the tuples with the given page and current set of restrictions
    • restrictions changes => Refetch tuples with updated restrictions

    Parameters

    • prevProps: TableViewProps
    • prevState: TableViewState

    Returns void

Optional componentWillMount

  • componentWillMount(): void

Optional componentWillReceiveProps

  • componentWillReceiveProps(nextProps: Readonly<TableViewProps>, 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<TableViewProps>, nextState: Readonly<TableViewState>, nextContext: any): void

fetchTableAttribute

  • fetchTableAttribute(): void
  • Function to query the back end to get infomation about the table attributes

    Returns void

fetchTableAttributeAndContent

  • fetchTableAttributeAndContent(): Promise<number>
  • Combination method for fetching table attribute and content. Typically use when the selected table changes

    Returns Promise<number>

fetchTableContent

  • fetchTableContent(): void
  • Utility function for refeshing the table view of tuples with the given restriction set via this.state.restrictions

    Returns void

fetchTableDefinition

  • fetchTableDefinition(): void
  • Method to fetch definition from back end and update the tableInfoData state

    Returns void

forceUpdate

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

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

    Returns void

getCurrentView

  • getCurrentView(): Element
  • Helper function for rendering the content. Either return TableContent, TableInfo or a loading logo

    Returns Element

    TableContent || TableInfo || Loading logo

Optional getSnapshotBeforeUpdate

  • getSnapshotBeforeUpdate(prevProps: Readonly<TableViewProps>, prevState: Readonly<TableViewState>): 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<TableViewProps>
    • prevState: Readonly<TableViewState>

    Returns any

parseTableAttributes

  • parseTableAttributes(jsonResult: any): default
  • Function to convert the api return json to produce a TableAttributeInfo

    Parameters

    • jsonResult: any

    Returns default

parseTableTypeString

  • parseTableTypeString(tableTypeString: string): default
  • Function to deal figure out what is the datatype given a string

    Parameters

    • tableTypeString: string

      The table type in string that was return from the api call

    Returns default

render

  • render(): Element
  • Returns Element

setNumberOfTuplesPerPage

  • setNumberOfTuplesPerPage(numberOfTuplesPerPage: number): void
  • Setter method for number of tuples per page

    Parameters

    • numberOfTuplesPerPage: number

      number of tuples per page to view

    Returns void

setPageNumber

  • setPageNumber(pageNumber: number): void
  • Setter method to change which page is being viewed

    Parameters

    • pageNumber: number

      Page number that the user wants to view

    Returns void

setRestrictions

  • setRestrictions(restrictions: Set<default>): void
  • Setter for valid restrictions to apply during table fetching

    Parameters

    • restrictions: Set<default>

      Array of vaild Restrictions

    Returns void

setState

  • setState<K>(state: null | TableViewState | ((prevState: Readonly<TableViewState>, props: Readonly<TableViewProps>) => null | TableViewState | Pick<TableViewState, K>) | Pick<TableViewState, K>, callback?: () => void): void
  • Type parameters

    • K: "tableAttributesInfo" | "errorMessage" | "totalNumOfTuples" | "currentPageNumber" | "maxPageNumber" | "currentView" | "tableContentNeedRefresh" | "tableDefinitionNeedRefresh" | "numberOfTuplesPerPage" | "setNumberOFTuplesPerPageTimeout" | "tableContentData" | "tableInfoData" | "isLoading" | "restrictions"

    Parameters

    • state: null | TableViewState | ((prevState: Readonly<TableViewState>, props: Readonly<TableViewProps>) => null | TableViewState | Pick<TableViewState, K>) | Pick<TableViewState, K>
    • Optional callback: () => void
        • (): void
        • Returns void

    Returns void

Optional shouldComponentUpdate

  • shouldComponentUpdate(nextProps: Readonly<TableViewProps>, nextState: Readonly<TableViewState>, 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<TableViewProps>
    • nextState: Readonly<TableViewState>
    • nextContext: any

    Returns boolean

switchCurrentView

  • switchCurrentView(viewChoice: CurrentView): void
  • Switch current view given to viewChoice

    Parameters

    • viewChoice: CurrentView

    Returns void

Generated using TypeDoc