Skip to content

Commit

Permalink
Merge pull request #15884 from emberjs/remove-link-to-current-when
Browse files Browse the repository at this point in the history
Remove currentWhen property from link-to component
  • Loading branch information
rwjblue authored Nov 30, 2017
2 parents 23c3bac + f156c0d commit f1850bc
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 47 deletions.
7 changes: 0 additions & 7 deletions packages/ember-glimmer/lib/components/link-to.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,6 @@ const LinkComponent = EmberComponent.extend({

tagName: 'a',

/**
@deprecated Use current-when instead.
@property currentWhen
@private
*/
currentWhen: deprecatingAlias('current-when', { id: 'ember-routing-view.deprecated-current-when', until: '3.0.0' }),

/**
Used to determine when this `LinkComponent` is active.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,6 @@ moduleFor('Link-to component', class extends ApplicationTest {
return p;
}

['@test accessing `currentWhen` triggers a deprecation'](assert) {
let component;
this.addComponent('link-to', {
ComponentClass: LinkComponent.extend({
init() {
this._super(...arguments);
component = this;
}
})
});

this.addTemplate('application', `{{link-to 'Index' 'index'}}`);

return this.visit('/').then(() => {
expectDeprecation(() => {
component.get('currentWhen');
}, /Usage of `currentWhen` is deprecated, use `current-when` instead/);
});
}

['@test should be able to be inserted in DOM when the router is not present']() {
this.addTemplate('application', `{{#link-to 'index'}}Go to Index{{/link-to}}`);

Expand Down
20 changes: 0 additions & 20 deletions packages/ember/tests/helpers/link_to_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,26 +417,6 @@ moduleFor('The {{link-to}} helper - nested routes and link-to arguments', class
assert.equal(normalizeUrl(this.$('#item a').attr('href')), '/about');
}

['@test The {{link-to}} helper supports currentWhen (DEPRECATED)'](assert) {
expectDeprecation('Usage of `currentWhen` is deprecated, use `current-when` instead.');

this.router.map(function() {
this.route('index', { path: '/' }, function() {
this.route('about');
});
this.route('item');
});

this.addTemplate('index', `<h3>Home</h3>{{outlet}}`);
this.addTemplate('index.about', `
{{#link-to 'item' id='other-link' currentWhen='index'}}ITEM{{/link-to}}
`);

this.visit('/about');

assert.equal(this.$('#other-link.active').length, 1, 'The link is active since current-when is a parent route');
}

[`@test The {{link-to}} helper supports custom, nested, current-when`](assert) {
this.router.map(function() {
this.route('index', { path: '/' }, function() {
Expand Down

0 comments on commit f1850bc

Please sign in to comment.