This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {request, raw} from 'ic-ajax'; | |
var ApplicationRoute = Ember.Route.extend({ | |
beforeModel: function() { | |
}, | |
model: function () { | |
return new Ember.RSVP.Promise(function (resolve, reject) { | |
var promise = new Ember.RSVP.Promise(function (p1Resolve, reject) { | |
request({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ActivityRow = React.createClass({ | |
render: function() { | |
return ( | |
<div className="activity-row"> | |
<span className="activity-time-stamp">{this.props.activity.timestamp}</span> | |
<p>{this.props.activity.title}</p> | |
<p className="activity-detail">{this.props.activity.detail}</p> | |
</div> | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Helper.helper(function(params) { | |
var reviews = params[0] || []; | |
var total = reviews.map((review) => { | |
return review.rating; | |
}).reduce((prev, next) => { | |
return prev + next; | |
}); | |
var fullStars = Math.floor(total / reviews.length); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from "ember-data"; | |
export default DS.JSONAPIAdapter.extend(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import { task, timeout } from 'ember-concurrency'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
myTask: task(function * () { | |
let didConfirm = yield this.get('getConfirmation').perform("Are you sure?"); | |
if (didConfirm) { | |
alert("woot"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test('Check if totals device view is ok', async t => { | |
const devices = await monitoredDevicesSection.find('.card'); | |
//await t.expect(devices.count).ok(); | |
const numberOfIndividualDevices = await devices.count; | |
console.log(numberOfIndividualDevices); | |
}); |