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 Component from '@ember/component'; | |
import layout from '../templates/components/new-build-notifier'; | |
import { MDCSnackbar } from '@material/snackbar'; | |
import { inject as service } from '@ember/service'; | |
import { set } from '@ember/object'; | |
import { task, timeout } from 'ember-concurrency'; | |
import config from 'ember-get-config'; | |
import { isEmpty } from '@ember/utils'; | |
export default Component.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 { addSuccessHandler } from 'ember-service-worker/service-worker-registration'; | |
window.isUpdateAvailable = | |
'Promise' in window | |
? new Promise(function(resolve) { | |
addSuccessHandler(function(reg) { | |
reg.onupdatefound = function() { | |
const { installing } = reg; | |
installing.onstatechange = function() { | |
if (installing.state === 'activated') { |
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
// app/initializers/asset-map.js | |
import Ember from 'ember'; | |
export function initialize(application) { | |
let assetMap = Ember.Object.extend(); | |
application.register('impact:assets', assetMap); | |
application.inject('component:i18n-image', 'assets', 'impact:assets'); | |
} |
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
// app/locales/en/translations.json | |
{ | |
"app": { | |
"hello": "Hello" | |
} | |
} | |
// app/locales/es/translations.json | |
{ | |
"app": { |
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
// app/locales/en/translations.js | |
export default { | |
app: { | |
hello: 'Hello' | |
} | |
} | |
// app/locales/es/translations.js | |
export default { | |
app: { |
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
<?php | |
/** | |
* Translation definitions of what data is pushed to Crowdin. | |
* The languages table drives what languages are supported. | |
* | |
* Expected format: | |
* 'base table name' => [ | |
* 'tl' => 'the translation content table', | |
* 'path' => 'where the content should live in Crowdin' |
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
// page.js | |
import PageObject, { | |
text, | |
isVisible | |
} from 'frontend/tests/page-object'; | |
export default PageObject.create({ | |
// some button | |
button: { | |
scope: '#some-button-id', |
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
// without page object - bad | |
test('here is a test that does not use a page object', function(assert) { | |
this.render(hbs`{{my-component}}`); | |
const $button = this.$('#some-button-id'); | |
const $description = this.$('p'); | |
assert.ok($button.is(':visible'), 'I see the button'); | |
assert.equal($description.text().trim(), 'Some text', 'The text is shown correctly'); | |
}); |
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('this is a dummy test', function(assert) { | |
const a = true; | |
const b = true; | |
// a developer can quickly scan these messages to understand what | |
// needs to happen and why. | |
assert.ok(a, 'A is true when X'); | |
assert.equal(a, b, 'A and B are equal when X'); | |
}); |
NewerOlder