Skip to content
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

[CLEANUP] Remove controller wrapped param deprecation #15897

Merged
merged 3 commits into from
Dec 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions packages/ember-glimmer/lib/components/link-to.ts
Original file line number Diff line number Diff line change
Expand Up @@ -774,17 +774,6 @@ const LinkComponent = EmberComponent.extend({
for (let i = 0; i < modelCount; i++) {
let value = params[i + 1];

while (ControllerMixin.detect(value)) {
deprecate(
'Providing `{{link-to}}` with a param that is wrapped in a controller is deprecated. ' +
(this.parentView ? 'Please update `' + this.parentView +
'` to use `{{link-to "post" someController.model}}` instead.' : ''),
false,
{ id: 'ember-routing-views.controller-wrapped-param', until: '3.0.0' },
);
value = value.get('model');
}

models[i] = value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,6 @@ moduleFor('Link-to component', class extends ApplicationTest {
});
}

['@test unwraps controllers']() {
this.router.map(function() {
this.route('profile', { path: '/profile/:id' });
});
this.addTemplate('application', `{{#link-to 'profile' otherController}}Text{{/link-to}}`);
this.add('controller:application', Controller.extend({
otherController: Controller.create({
model: 'foo'
})
}));

let deprecation = /Providing `{{link-to}}` with a param that is wrapped in a controller is deprecated./;

return this.visitWithDeprecation('/', deprecation).then(() => {
this.assertText('Text');
});
}

['@test able to safely extend the built-in component and use the normal path']() {
this.addComponent('custom-link-to', { ComponentClass: LinkComponent.extend() });
this.addTemplate('application', `{{#custom-link-to 'index'}}{{title}}{{/custom-link-to}}`);
Expand Down