Skip to content

Commit

Permalink
fix deprecated import of getOwner
Browse files Browse the repository at this point in the history
  • Loading branch information
sly7-7 committed Dec 9, 2016
1 parent 97a78c0 commit 8c4b763
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 21 deletions.
4 changes: 2 additions & 2 deletions addon/internal-session.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Ember from 'ember';
import getOwner from 'ember-getowner-polyfill';

const {
RSVP,
Expand All @@ -12,7 +11,8 @@ const {
assert,
deprecate,
set,
debug
debug,
getOwner
} = Ember;
const assign = emberAssign || merge;

Expand Down
3 changes: 1 addition & 2 deletions addon/mixins/application-route-mixin.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import Ember from 'ember';
import getOwner from 'ember-getowner-polyfill';
import Configuration from './../configuration';

const { inject, Mixin, A, run: { bind }, testing, computed } = Ember;
const { inject, Mixin, A, run: { bind }, testing, computed, getOwner } = Ember;

/**
The mixin for the application route; __defines methods that are called when
Expand Down
3 changes: 1 addition & 2 deletions addon/mixins/authenticated-route-mixin.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import Ember from 'ember';
import getOwner from 'ember-getowner-polyfill';
import Configuration from './../configuration';

const { inject: { service }, Mixin, assert, computed } = Ember;
const { inject: { service }, Mixin, assert, computed, getOwner } = Ember;

/**
__This mixin is used to make routes accessible only if the session is
Expand Down
3 changes: 1 addition & 2 deletions addon/mixins/unauthenticated-route-mixin.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import Ember from 'ember';
import getOwner from 'ember-getowner-polyfill';
import Configuration from './../configuration';

const { inject: { service }, Mixin, assert, computed } = Ember;
const { inject: { service }, Mixin, assert, computed, getOwner } = Ember;

/**
__This mixin is used to make routes accessible only if the session is
Expand Down
3 changes: 1 addition & 2 deletions addon/services/session.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Ember from 'ember';
import getOwner from 'ember-getowner-polyfill';

const SESSION_DATA_KEY_PREFIX = /^data\./;

const { computed, A, Service, Evented } = Ember;
const { computed, A, Service, Evented, getOwner } = Ember;

/**
__The session service provides access to the current session as well as
Expand Down
3 changes: 1 addition & 2 deletions addon/session-stores/adaptive.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/* global localStorage */
import Ember from 'ember';
import getOwner from 'ember-getowner-polyfill';
import Base from 'ember-simple-auth/session-stores/base';
import LocalStorage from 'ember-simple-auth/session-stores/local-storage';
import Cookie from 'ember-simple-auth/session-stores/cookie';

const { computed, inject: { service } } = Ember;
const { computed, inject: { service }, getOwner } = Ember;

const LOCAL_STORAGE_TEST_KEY = '_ember_simple_auth_test_key';

Expand Down
3 changes: 1 addition & 2 deletions addon/session-stores/cookie.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Ember from 'ember';
import BaseStore from './base';
import objectsAreEqual from '../utils/objects-are-equal';
import getOwner from 'ember-getowner-polyfill';

const { RSVP, computed, inject: { service }, run: { next, cancel, later, scheduleOnce }, isEmpty, typeOf, testing, isPresent, K, A } = Ember;
const { RSVP, computed, inject: { service }, run: { next, cancel, later, scheduleOnce }, isEmpty, typeOf, testing, isPresent, K, A, getOwner } = Ember;

const persistingProperty = function(beforeSet = K) {
return computed({
Expand Down
3 changes: 1 addition & 2 deletions addon/session-stores/local-storage.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* global localStorage */
import Ember from 'ember';
import getOwner from 'ember-getowner-polyfill';
import BaseStore from './base';
import objectsAreEqual from '../utils/objects-are-equal';

const { RSVP, $: jQuery, computed } = Ember;
const { RSVP, $: jQuery, computed, getOwner } = Ember;

/**
Session store that persists data in the browser's `localStorage`.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"ember-cli-import-polyfill": "^0.2.0",
"ember-cli-is-package-missing": "^1.0.0",
"ember-cookies": "^0.0.10",
"ember-getowner-polyfill": "^1.0.1",
"ember-getowner-polyfill": "^1.1.0",
"ember-network": "^0.3.0",
"silent-error": "^1.0.0"
},
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/internal-session-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import InternalSession from 'ember-simple-auth/internal-session';
import EphemeralStore from 'ember-simple-auth/session-stores/ephemeral';
import Authenticator from 'ember-simple-auth/authenticators/base';

const { RSVP, K, run: { next } } = Ember;
const { RSVP, K, run: { next }, setOwner } = Ember;

describe('InternalSession', () => {
let session;
Expand All @@ -19,7 +19,8 @@ describe('InternalSession', () => {
container = { lookup() {} };
store = EphemeralStore.create();
authenticator = Authenticator.create();
session = InternalSession.create({ store, container });
session = InternalSession.create({ store });
setOwner(session, container);
sinon.stub(container, 'lookup').withArgs('authenticator').returns(authenticator);
});

Expand Down
5 changes: 3 additions & 2 deletions tests/unit/services/session-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { expect } from 'chai';
import sinon from 'sinon';
import Session from 'ember-simple-auth/services/session';

const { ObjectProxy, Evented, run: { next }, set } = Ember;
const { ObjectProxy, Evented, run: { next }, set, setOwner } = Ember;

describe('SessionService', () => {
let sessionService;
Expand All @@ -21,7 +21,8 @@ describe('SessionService', () => {
};
let container = { lookup() {} };
sinon.stub(container, 'lookup').withArgs('authorizer').returns(authorizer);
sessionService = Session.create({ container, session });
sessionService = Session.create({ session });
setOwner(sessionService, container);
});

it('forwards the "authenticationSucceeded" event from the session', (done) => {
Expand Down

0 comments on commit 8c4b763

Please sign in to comment.