API Docs for: v3.16.0-alpha.2
Show:

InspectorDataAdapter Class

Extends DataAdapter
Module: @ember-data/debug

Implements @ember/debug/data-adapter with for EmberData integration with the ember-inspector.

Methods

columnNameToDesc

(
  • name
)
String private

Creates a human readable string used for column headers

Parameters:

  • name String

    The attribute name

Returns:

String:

Human readable string based on the attribute name

columnsForType

(
  • typeClass
)
Array private

Get the columns for a given model type

Parameters:

Returns:

Array:

An array of columns of the following format: name: {String} The name of the column desc: {String} Humanized description (what would show in a table column name)

getFilters

() Array private

Specifies how records can be filtered based on the state of the record Records returned will need to have a filterValues property with a key for every name in the returned array

Returns:

Array:

List of objects defining filters The object should have a name and desc property

getRecordColor

(
  • record
)
String private

Returns a color that represents the record's state Possible colors: black, blue, green

Parameters:

Returns:

String:

The record color

getRecordColumnValues

(
  • record
)
Object private

Gets the values for each column This is the attribute values for a given record

Parameters:

  • record Model

    to get values from

Returns:

Object:

Keys should match column names defined by the model type

getRecordFilterValues

(
  • record
)
Object private

Returns the values of filters defined by getFilters These reflect the state of the record

Parameters:

Returns:

Object:

The record state filter values

getRecordKeywords

(
  • record
)
Array private

Returns keywords to match when searching records

Parameters:

Returns:

Array:

Relevant keywords for search based on the record's attribute values

getRecords

(
  • modelClass
  • modelName
)
Array

Fetches all loaded records for a given type

Parameters:

  • modelClass Model

    of the record

  • modelName String

    of the record

Returns:

Array:

An array of Model records This array will be observed for changes, so it should update when new records are added/removed

observeRecord

(
  • record
  • recordUpdated
)
Function

Observes all relevant properties and re-sends the wrapped record when a change occurs

Parameters:

  • record Model
  • recordUpdated Function

    Callback used to notify changes

Returns:

Function:

The function to call to remove all observers

watchModelTypes

(
  • typesAdded
  • typesUpdated
)
Function public

Fetch the model types and observe them for changes. Maintains the list of model types without needing the Model package for detection.

Parameters:

  • typesAdded Function

    Callback to call to add types. Takes an array of objects containing wrapped types (returned from wrapModelType).

  • typesUpdated Function

    Callback to call when a type has changed. Takes an array of objects containing wrapped types.

Returns:

Function:

Method to call to remove all observers