import BikeDetailsPresenter from 'PedalPatrol/src/components/presenters/bikedetails-presenter.js'
BikeDetailsPresenter
Extends:
Class for the BikeDetails presenter and view
Constructor Summary
Public Constructor | ||
public |
constructor(view: Object) Creates an instance of BikeDetailsPresenter |
Member Summary
Public Members | ||
public |
convertCase(str: string): string: * Convert the case of a string to title case (first letter of each word is uppercase). |
|
public |
findElement(data: List, key: string): Object: * Finds if an element exists with a specific title based on a key. |
|
public |
Gets the data from the model and returns it to the caller. |
|
public |
getDetailsOrder: List: * Returns the order of the details as a list. |
|
public |
getIgnoredDetails: List: * Ignore this list of properties when transforming data objects to formed data. |
|
public |
goToDirectionsOnMap(data: Object, onError: Function): * Asks the model to open the prompt to open directions. |
|
public |
onDestroy: * If the view or presenter is destroyed, unsubscribe the presenter from the model. |
|
public |
Called when the model is updated with new data. |
|
public |
reorderData(data: List): List: * Reorders the data to be based on a specific order defined in getDetailsOrder. |
|
public |
translateData(data: Object): List, List: * Translates the data from a list of objects to a title and text with an id. |
|
public |
Updates the bike model with new data. |
|
public |
view: * |
Method Summary
Public Methods | ||
public |
confirmFound(rawData: *, callback: *) |
|
public |
getDataFromID(id: *): string |
|
public |
rejectFound(rawData: *, callback: *) |
Public Constructors
Public Members
public convertCase(str: string): string: * source
Convert the case of a string to title case (first letter of each word is uppercase).
public findElement(data: List, key: string): Object: * source
Finds if an element exists with a specific title based on a key.
public getDetailsOrder: List: * source
Returns the order of the details as a list. List will appear in this order. Keys should be defined as the property name replacing all underscores with spaces then converted to title case (Does not include ': ').
Return:
List | A list of title case key names in the order that is needed |
public getIgnoredDetails: List: * source
Ignore this list of properties when transforming data objects to formed data.
Return:
List | A list of string properties to ignore |
public goToDirectionsOnMap(data: Object, onError: Function): * source
Asks the model to open the prompt to open directions.
public onDestroy: * source
If the view or presenter is destroyed, unsubscribe the presenter from the model.
public onUpdated(newData: Object): * source
Called when the model is updated with new data. Refreshes the state of the view. Method is supplied with the data to add. Better way to refresh the state?
public reorderData(data: List): List: * source
Reorders the data to be based on a specific order defined in getDetailsOrder.
Return:
List | The reordered data |
public translateData(data: Object): List, List: * source
Translates the data from a list of objects to a title and text with an id.
Return:
List, List | An object with two lists. 1. The formed data; 2. The list of thumbnails |