Skip to content

Commit

Permalink
fix docs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Nov 13, 2019
1 parent 05f101f commit 85da8e7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
10 changes: 10 additions & 0 deletions packages/-ember-data/node-tests/fixtures/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,5 +252,15 @@ module.exports = {
'pushPayload [OPTIONAL]',
'serializeIntoHash [OPTIONAL]',
'normalize [OPTIONAL]',
'columnNameToDesc',
'columnsForType',
'getFilters',
'getRecordColor',
'getRecordColumnValues',
'getRecordFilterValues',
'getRecordKeywords',
'getRecords',
'watchModelTypes',
'observeRecord',
],
};
35 changes: 23 additions & 12 deletions packages/debug/addon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ export default DataAdapter.extend({
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
@private
@method getFilters
@private
@return {Array} List of objects defining filters
The object should have a `name` and `desc` property
*/
Expand All @@ -68,8 +69,9 @@ export default DataAdapter.extend({
/**
Fetch the model types and observe them for changes.
Maintains the list of model types without needing the Model package for detection.
@public
@method watchModelTypes
@internal
@param {Function} typesAdded Callback to call to add types.
Takes an array of objects containing wrapped types (returned from `wrapModelType`).
@param {Function} typesUpdated Callback to call when a type has changed.
Expand Down Expand Up @@ -113,6 +115,7 @@ export default DataAdapter.extend({
* the consumer of this adapter about the mdoels.
*
* @param {store} store
* @internal
* @param {Map} discoveredTypes
* @param {String} type
* @param {Function} typesAdded
Expand All @@ -131,8 +134,9 @@ export default DataAdapter.extend({

/**
Creates a human readable string used for column headers
@private
@method columnNameToDesc
@private
@param {String} name The attribute name
@return {String} Human readable string based on the attribute name
*/
Expand All @@ -146,8 +150,9 @@ export default DataAdapter.extend({

/**
Get the columns for a given model type
@private
@method columnsForType
@private
@param {Model} typeClass
@return {Array} An array of columns of the following format:
name: {String} The name of the column
Expand All @@ -174,8 +179,9 @@ export default DataAdapter.extend({

/**
Fetches all loaded records for a given type
@private
@method getRecords
@internal
@param {Model} modelClass of the record
@param {String} modelName of the record
@return {Array} An array of Model records
Expand All @@ -200,8 +206,9 @@ export default DataAdapter.extend({
/**
Gets the values for each column
This is the attribute values for a given record
@private
@method getRecordColumnValues
@private
@param {Model} record to get values from
@return {Object} Keys should match column names defined by the model type
*/
Expand All @@ -220,8 +227,9 @@ export default DataAdapter.extend({

/**
Returns keywords to match when searching records
@private
@method getRecordKeywords
@private
@param {Model} record
@return {Array} Relevant keywords for search based on the record's attribute values
*/
Expand All @@ -236,8 +244,9 @@ export default DataAdapter.extend({
/**
Returns the values of filters defined by `getFilters`
These reflect the state of the record
@private
@method getRecordFilterValues
@private
@param {Model} record
@return {Object} The record state filter values
*/
Expand All @@ -251,11 +260,12 @@ export default DataAdapter.extend({

/**
Returns a color that represents the record's state
@private
Possible colors: black, blue, green
@method getRecordColor
@private
@param {Model} record
@return {String} The record color
Possible options: black, blue, green
*/
getRecordColor(record) {
let color = 'black';
Expand All @@ -270,8 +280,9 @@ export default DataAdapter.extend({
/**
Observes all relevant properties and re-sends the wrapped record
when a change occurs
@private
@method observerRecord
@method observeRecord
@internal
@param {Model} record
@param {Function} recordUpdated Callback used to notify changes
@return {Function} The function to call to remove all observers
Expand Down

0 comments on commit 85da8e7

Please sign in to comment.