Permalink
Browse files

Updates import syntax for v 2.16

Previous versions of ember imported it via just importing the Ember
object:
`import Ember from 'ember'`

The favored syntax is now:
`import { PieceOfEmber }` from '@ember/PieceOfEmberThing'

This was done using `ember-modules-codemod` command
  • Loading branch information...
Chris
Chris committed Jan 18, 2018
1 parent 858dea8 commit df3a69eab3a2134bda7e1b6d7a399116b1a5df2b
Showing with 156 additions and 133 deletions.
  1. +4 −4 app/adapters/application.js
  2. +2 −1 app/app.js
  3. +2 −2 app/components/change-password-form.js
  4. +2 −2 app/components/cohort-edit.js
  5. +2 −2 app/components/cohort-table/row.js
  6. +4 −3 app/components/delivery-row.js
  7. +2 −2 app/components/delivery-table-headers.js
  8. +2 −2 app/components/delivery-table.js
  9. +2 −2 app/components/delivery-table/assignment-dropdown.js
  10. +2 −2 app/components/editable-text.js
  11. +2 −2 app/components/email-input.js
  12. +2 −2 app/components/gh-username-input.js
  13. +2 −2 app/components/hamburger-menu.js
  14. +2 −2 app/components/material-row.js
  15. +2 −2 app/components/material-table.js
  16. +8 −6 app/components/my-application.js
  17. +2 −2 app/components/navbar-header.js
  18. +2 −2 app/components/password-confirmation-input.js
  19. +2 −2 app/components/password-input.js
  20. +2 −2 app/components/profile-edit-form.js
  21. +2 −2 app/components/radio-button.js
  22. +2 −2 app/components/sign-in-form.js
  23. +2 −2 app/components/sign-up-form.js
  24. +2 −2 app/initializers/text-field.js
  25. +2 −2 app/router.js
  26. +5 −4 app/routes/application.js
  27. +5 −4 app/routes/change-password.js
  28. +2 −2 app/routes/cohorts/index.js
  29. +2 −2 app/routes/cohorts/new.js
  30. +9 −6 app/routes/dashboard.js
  31. +2 −2 app/routes/dashboard/edit.js
  32. +2 −2 app/routes/dashboard/index.js
  33. +5 −4 app/routes/deliveries.js
  34. +6 −4 app/routes/index.js
  35. +5 −4 app/routes/material.js
  36. +2 −2 app/routes/materials.js
  37. +4 −3 app/routes/oauth.js
  38. +4 −3 app/routes/oauth2callback.js
  39. +5 −4 app/routes/profile.js
  40. +2 −2 app/routes/profile/index.js
  41. +2 −2 app/routes/profiles.js
  42. +5 −4 app/routes/sign-in.js
  43. +7 −5 app/routes/sign-up.js
  44. +2 −2 app/routes/users.js
  45. +4 −3 app/services/ajax.js
  46. +5 −4 app/services/auth.js
  47. +2 −2 tests/helpers/destroy-app.js
  48. +5 −4 tests/helpers/start-app.js
  49. +4 −3 tests/unit/initializers/text-field-test.js
@@ -1,14 +1,14 @@
import { computed } from '@ember/object';
import { inject as service } from '@ember/service';
import ENV from 'planning-genie-client/config/environment'
import ActiveModelAdapter from 'active-model-adapter'

import Ember from 'ember'

export default ActiveModelAdapter.extend({
host: ENV.apiHost,

auth: Ember.inject.service(),
auth: service(),

headers: Ember.computed('auth.credentials.token', {
headers: computed('auth.credentials.token', {
get () {
const headers = {}
const token = this.get('auth.credentials.token')
@@ -1,11 +1,12 @@
import Application from '@ember/application';
import Ember from 'ember'
import Resolver from './resolver'
import loadInitializers from 'ember-load-initializers'
import config from './config/environment'

Ember.MODEL_FACTORY_INJECTIONS = true

const App = Ember.Application.extend({
const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
tagName: 'form',
classNames: ['form-horizontal'],

@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
tagName: 'form',
classNames: ['form-horizontal'],

@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
tagName: 'tr',
actions: {
delete () {
@@ -1,10 +1,11 @@
import Ember from 'ember'
import { inject as service } from '@ember/service';
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
assignedInstructor: null,
filteredProfiles: [],
showInput: false,
flashMessages: Ember.inject.service(),
flashMessages: service(),

// editDuration: true,

@@ -1,4 +1,4 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
})
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
preferences: {
viewAll: true
},
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
actions: {
select (profile) {
this.sendAction('select', profile)
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
editable: false,

actions: {
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
tagName: 'div',
classNames: ['form-group']
})
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
tagName: 'div',
classNames: ['form-group']
})
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
tagName: 'button',
classNames: ['navbar-toggle', 'collapsed'],
attributeBindings: [
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
actions: {
editMaterial () {
return this.get('material')
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
actions: {
editMaterial (material) {
this.sendAction('editMaterial', material)
@@ -1,11 +1,13 @@
import Ember from 'ember'
import { alias } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import Component from '@ember/component';

export default Ember.Component.extend({
auth: Ember.inject.service(),
export default Component.extend({
auth: service(),

user: Ember.computed.alias('auth.credentials.email'),
isAuthenticated: Ember.computed.alias('auth.isAuthenticated'),
profileId: Ember.computed.alias('auth.credentials.profile'),
user: alias('auth.credentials.email'),
isAuthenticated: alias('auth.isAuthenticated'),
profileId: alias('auth.credentials.profile'),

actions: {
signOut () {
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
tagName: 'div',
classNames: ['navbar-header']
})
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
tagName: 'div',
classNames: ['form-group']
})
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
tagName: 'div',
classNames: ['form-group']
})
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
tagName: 'form',
classNames: ['form-horizontal'],

@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
tagName: 'span',

actions: {
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
tagName: 'form',
classNames: ['form-horizontal', 'col-md-6', 'col-md-offset-3', 'col-sm-8', 'col-sm-offset-2'],

@@ -1,6 +1,6 @@
import Ember from 'ember'
import Component from '@ember/component';

export default Ember.Component.extend({
export default Component.extend({
tagName: 'form',
classNames: ['form-horizontal', 'col-md-6', 'col-md-offset-3', 'col-sm-8', 'col-sm-offset-2'],

@@ -1,7 +1,7 @@
import Ember from 'ember'
import TextField from '@ember/component/text-field';

export function initialize () {
Ember.TextField.reopen({
TextField.reopen({
classNames: ['form-control']
})
}
@@ -1,7 +1,7 @@
import Ember from 'ember'
import EmberRouter from '@ember/routing/router';
import config from './config/environment'

const Router = Ember.Router.extend({
const Router = EmberRouter.extend({
location: config.locationType
})

@@ -1,8 +1,9 @@
import Ember from 'ember'
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';

export default Ember.Route.extend({
auth: Ember.inject.service(),
flashMessages: Ember.inject.service(),
export default Route.extend({
auth: service(),
flashMessages: service(),

actions: {
signOut () {
@@ -1,9 +1,10 @@
import Ember from 'ember'
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';
import RSVP from 'rsvp'

export default Ember.Route.extend({
auth: Ember.inject.service(),
flashMessages: Ember.inject.service(),
export default Route.extend({
auth: service(),
flashMessages: service(),

model () {
return RSVP.Promise.resolve({})
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Route from '@ember/routing/route';

export default Ember.Route.extend({
export default Route.extend({
model () {
return this.get('store').findAll('cohort')
},
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Route from '@ember/routing/route';

export default Ember.Route.extend({
export default Route.extend({
model () {
return this.get('store').createRecord('cohort', {})
},
@@ -1,8 +1,11 @@
import Ember from 'ember'
import { hash } from 'rsvp';
import { alias } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';

export default Ember.Route.extend({
auth: Ember.inject.service(),
profile: Ember.computed.alias('auth.credentials.profile'),
export default Route.extend({
auth: service(),
profile: alias('auth.credentials.profile'),

beforeModel () {
if (!this.get('profile')) {
@@ -19,9 +22,9 @@ export default Ember.Route.extend({
// first is the data (undefined) and then data gets back and that I may
// be looking at a race condition rather than broken code. Added in an
// error handler to helper to guard against it.
return Ember.RSVP.hash({
return hash({
profile: this.get('store').findRecord('profile', this.get('profile')),
profiles: this.get('store').findAll('profile')
})
});
}
})
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Route from '@ember/routing/route';

export default Ember.Route.extend({
export default Route.extend({
actions: {
saveProfile (profile) {
profile.save()
@@ -1,6 +1,6 @@
import Ember from 'ember'
import Route from '@ember/routing/route';

export default Ember.Route.extend({
export default Route.extend({
actions: {
dashboard () {
this.transitionTo('profile.edit', this.get('model'))
@@ -1,12 +1,13 @@
import Ember from 'ember'
import { hash } from 'rsvp';
import Route from '@ember/routing/route';

export default Ember.Route.extend({
export default Route.extend({
model () {
return Ember.RSVP.hash({
return hash({
profiles: this.get('store').findAll('profile'),
deliveries: this.get('store').findAll('delivery'),
materials: this.get('store').findAll('material')
})
});
},

actions: {}
@@ -1,8 +1,10 @@
import Ember from 'ember'
import { alias } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';

export default Ember.Route.extend({
auth: Ember.inject.service(),
profile: Ember.computed.alias('auth.credentials.profile'),
export default Route.extend({
auth: service(),
profile: alias('auth.credentials.profile'),

beforeModel () {
if (!this.get('profile')) {
@@ -1,10 +1,11 @@
import Ember from 'ember'
import { hash } from 'rsvp';
import Route from '@ember/routing/route';

export default Ember.Route.extend({
export default Route.extend({
model (params) {
return Ember.RSVP.hash({
return hash({
profiles: this.get('store').findAll('profile'),
material: this.get('store').find('material', params.material_id)
})
});
}
})
Oops, something went wrong.

0 comments on commit df3a69e

Please sign in to comment.