-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENG-4008] Unsilence deprecation 'ember-metal.get-with-default' #1660
Changes from all commits
45984ba
a481946
9ea26c7
3a9136a
8ff29d1
5bc7869
216654c
f9e0ab1
4819b8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
import SessionService from 'ember-simple-auth/services/session'; | ||
|
||
export default class OsfSession extends SessionService { | ||
handleAuthentication() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect we can get away with rewriting this line to use |
||
return; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'ember-osf-web/services/-private/session'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ self.deprecationWorkflow = self.deprecationWorkflow || {}; | |
self.deprecationWorkflow.config = { | ||
workflow: [ | ||
{ handler: 'silence', matchId: 'ember-inflector.globals' }, | ||
{ handler: 'silence', matchId: 'ember-metal.get-with-default' }, | ||
{ handler: 'silence', matchId: 'computed-property.volatile' }, | ||
{ handler: 'silence', matchId: 'implicit-injections' }, | ||
{ handler: 'silence', matchId: 'manager-capabilities.modifiers-3-13' }, | ||
|
@@ -18,5 +17,9 @@ self.deprecationWorkflow.config = { | |
{ handler: 'silence', matchId: 'ember-engines.deprecation-camelized-engine-names' }, | ||
{ handler: 'silence', matchId: 'ember-data:legacy-test-helper-support' }, | ||
{ handler: 'silence', matchId: 'has-block-and-has-block-params' }, | ||
{ handler: 'silence', matchId: 'ember-simple-auth.initializer.setup-session-restoration' }, | ||
{ handler: 'silence', matchId: 'ember-simple-auth.events.session-service' }, | ||
{ handler: 'silence', matchId: 'ember-cli-mirage.miragejs.import' }, | ||
{ handler: 'silence', matchId: 'ember-cli-mirage-config-routes-only-export' }, | ||
Comment on lines
+20
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So we un-silence one deprecation warning and add 4 more rules to silence deprecation warnings? Is it because removing the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, and mirage had to be upgraded as well. |
||
], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import Service from '@ember/service'; | ||
import { render } from '@ember/test-helpers'; | ||
import { hbs } from 'ember-cli-htmlbars'; | ||
import { setupMirage } from 'ember-cli-mirage/test-support'; | ||
|
@@ -13,6 +14,12 @@ interface ThisTestContext extends TestContext { | |
currentUser: CurrentUser; | ||
} | ||
|
||
const sessionStub = Service.extend({ | ||
isAuthenticated: false, | ||
data: {}, | ||
on: () => { /* stub */ }, | ||
}); | ||
|
||
module('Integration | Component | tos-consent-banner', hooks => { | ||
setupRenderingTest(hooks); | ||
setupMirage(hooks); | ||
|
@@ -21,14 +28,17 @@ module('Integration | Component | tos-consent-banner', hooks => { | |
hooks.beforeEach(function(this: ThisTestContext) { | ||
this.store = this.owner.lookup('service:store'); | ||
this.currentUser = this.owner.lookup('service:current-user'); | ||
this.owner.unregister('service:session'); | ||
this.owner.register('service:session', sessionStub); | ||
Comment on lines
+31
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this is a similar issue I ran into in my router-deprecation PR. Since the |
||
|
||
}); | ||
|
||
hooks.afterEach(() => { | ||
sandbox.restore(); | ||
}); | ||
|
||
test('hidden when no user is logged in', async function(assert) { | ||
await render(hbs`{{tos-consent-banner}}`); | ||
await render(hbs`<TosConsentBanner />`); | ||
assert.dom(this.element).hasText(''); | ||
}); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this an async method? There is no
await
here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly because the ember-simple-auth upgrade guide said to do so. https://github.com/mainmatter/ember-simple-auth/blob/master/guides/upgrade-to-v3.md#make-your-custom-session-store-asynchronous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In which case, should we
return await this.authenticate()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I can see why it didn't complain, because it is returning a promise, but this is the more correct way to go.