InspectorDataAdapter Class
Implements @ember/debug/data-adapter
with for EmberData
integration with the ember-inspector.
Item Index
Methods
columnNameToDesc
-
name
Creates a human readable string used for column headers
Parameters:
-
name
StringThe attribute name
Returns:
Human readable string based on the attribute name
columnsForType
-
typeClass
Get the columns for a given model type
Parameters:
-
typeClass
Model
Returns:
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:
List of objects defining filters
The object should have a name
and desc
property
getRecordColor
-
record
Returns a color that represents the record's state Possible colors: black, blue, green
Parameters:
-
record
Model
Returns:
The record color
getRecordColumnValues
-
record
Gets the values for each column This is the attribute values for a given record
Parameters:
-
record
Modelto get values from
Returns:
Keys should match column names defined by the model type
getRecordFilterValues
-
record
Returns the values of filters defined by getFilters
These reflect the state of the record
Parameters:
-
record
Model
Returns:
The record state filter values
getRecordKeywords
-
record
Returns keywords to match when searching records
Parameters:
-
record
Model
Returns:
Relevant keywords for search based on the record's attribute values
getRecords
-
modelClass
-
modelName
Fetches all loaded records for a given type
Parameters:
-
modelClass
Modelof the record
-
modelName
Stringof the record
Returns:
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
Observes all relevant properties and re-sends the wrapped record when a change occurs
Parameters:
-
record
Model -
recordUpdated
FunctionCallback used to notify changes
Returns:
The function to call to remove all observers
watchModelTypes
-
typesAdded
-
typesUpdated
Fetch the model types and observe them for changes. Maintains the list of model types without needing the Model package for detection.
Parameters:
-
typesAdded
FunctionCallback to call to add types. Takes an array of objects containing wrapped types (returned from
wrapModelType
). -
typesUpdated
FunctionCallback to call when a type has changed. Takes an array of objects containing wrapped types.
Returns:
Method to call to remove all observers
watchTypeIfUnseen
-
store
-
discoveredTypes
-
type
-
typesAdded
-
typesUpdated
-
releaseMethods
Loop over the discovered types and use the callbacks from watchModelTypes to notify the consumer of this adapter about the mdoels.
Parameters:
-
store
Store -
discoveredTypes
Map -
type
String -
typesAdded
Function -
typesUpdated
Function -
releaseMethods
Array