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

Fix this-property-fallback deprecations #462

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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{#each animals as |animal|}}
<div class="{{species}}">
{{#each @animals as |animal|}}
<div class="{{@species}}">
<span data-field="name">{{animal.name}}</span>
</div>
{{/each}}
Expand Down
6 changes: 6 additions & 0 deletions tests/dummy/app/components/dude-translator.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="translator">
<div>
<label>Original</label><span class="original">{{@original}}</span>
<label>Translation:</label><span class="translation">{{concat @original " dude"}}</span>
</div>
</div>
13 changes: 0 additions & 13 deletions tests/dummy/app/components/dude-translator.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{#each profiles as |profile|}}
{{#each @profiles as |profile|}}
<div class="profile">
<span data-field="description">{{profile.description}}</span>
<span data-field="camelCaseDescription">{{profile.camelCaseDescription}}</span>
Expand Down
2 changes: 0 additions & 2 deletions tests/dummy/app/components/profile-list.js

This file was deleted.

36 changes: 36 additions & 0 deletions tests/dummy/app/components/single-employee.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<div class="employee">
<h3>Employee</h3>
<p class="name">Name: {{@employee.name.firstName}} {{@employee.name.lastName}}</p>

<p class="titles">Titles:
{{#each @employee.titles as |title|}}
{{title}}<br>
{{/each}}
</p>

<p class="gender">Gender: {{@employee.gender}}</p>

<p class="birthdate">DOB: {{@employee.birthDate}}</p>

<div class="department-employments">
{{#each @employee.departmentEmployments as |employment|}}
<div class="department-employment">
<p class="department">department: {{employment.department.name}}</p>
<p class="start-date">startDate: {{employment.startDate}}</p>
<p class="end-date">endDate: {{employment.endDate}}</p>

<div class="addresses">
{{#each employment.department.addresses as |address|}}
<p class="address">
<span class="street">{{address.street}}</span>
<span class="city">{{address.city}}</span>
<span class="region">{{address.region}}</span>
<span class="country">{{address.country}}</span>
</p>
<hr>
{{/each}}
</div>
</div>
{{/each}}
</div>
</div>
5 changes: 0 additions & 5 deletions tests/dummy/app/components/single-employee.js

This file was deleted.

18 changes: 18 additions & 0 deletions tests/dummy/app/components/single-user.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<div class="user">
<h3>User</h3>

<div class="name">Name: {{@user.name}}</div>
<div class="funny-name">Funny Name: {{@user.funnyName}}</div>

Projects:
<ul>
{{#each @user.projects as |project|}}
<li class="project">{{project.title}}</li>
{{/each}}
</ul>

<label>Project title<Input class="project-title" @type="textbox" @value={{@projectTitle}} /></label>
{{#if @createProject}}
<button class="add-project" type="button" {{on "click" (fn @createProject @user @projectTitle)}}>Add Project</button>
{{/if}}
</div>
11 changes: 0 additions & 11 deletions tests/dummy/app/components/single-user.js

This file was deleted.

12 changes: 12 additions & 0 deletions tests/dummy/app/components/user-list.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Users:
<ul>
{{#each @users as |user|}}
<li class="user">
<label>Name:</label>
<span class="name">{{user.name}}</span>
<label>Style:</label>
<span class="style">{{user.style}}</span>
<span><button type="button" {{on "click" (fn @deleteUser user)}}>X</button></span>
</li>
{{/each}}
</ul>
2 changes: 0 additions & 2 deletions tests/dummy/app/components/user-list.js

This file was deleted.

3 changes: 3 additions & 0 deletions tests/dummy/app/components/user-search.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div>Search For User:</div>
<label>Username: <Input class="user-name" @type="textbox" @value={{@userName}} /></label>
<button class="find-user" type="button" {{on "click" (fn @userSearch @userName)}}>Go</button>
9 changes: 0 additions & 9 deletions tests/dummy/app/components/user-search.js

This file was deleted.

16 changes: 8 additions & 8 deletions tests/dummy/app/controllers/search.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
import { action } from '@ember/object';

export default Controller.extend({
router: service(),
actions: {
userSearch(name) {
this.router.transitionTo('search.results', name);
},
},
});
export default class SearchController extends Controller {
@service router;
@action
userSearch(name) {
this.router.transitionTo('search.results', name);
}
}
20 changes: 10 additions & 10 deletions tests/dummy/app/controllers/user.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
export default Controller.extend({
store: service(),
actions: {
createProject(user, title) {
return this.store
.createRecord('project', { title: title, user: user })
.save();
},
},
});
import { action } from '@ember/object';
export default class UserController extends Controller {
@service store;
@action
createProject(user, title) {
return this.store
.createRecord('project', { title: title, user: user })
.save();
}
}
2 changes: 1 addition & 1 deletion tests/dummy/app/templates/cats.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{animal-list animals=model species='cat'}}
{{animal-list animals=this.model species='cat'}}
4 changes: 0 additions & 4 deletions tests/dummy/app/templates/components/dude-translator.hbs

This file was deleted.

34 changes: 0 additions & 34 deletions tests/dummy/app/templates/components/single-employee.hbs

This file was deleted.

14 changes: 0 additions & 14 deletions tests/dummy/app/templates/components/single-user.hbs

This file was deleted.

12 changes: 0 additions & 12 deletions tests/dummy/app/templates/components/user-list.hbs

This file was deleted.

3 changes: 0 additions & 3 deletions tests/dummy/app/templates/components/user-search.hbs

This file was deleted.

2 changes: 1 addition & 1 deletion tests/dummy/app/templates/employee.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{single-employee employee=model}}
{{single-employee employee=this.model}}
2 changes: 1 addition & 1 deletion tests/dummy/app/templates/profiles.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{profile-list profiles=model}}
{{profile-list profiles=this.model}}
2 changes: 1 addition & 1 deletion tests/dummy/app/templates/search.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{user-search userSearch=(action "userSearch")}}
{{user-search userSearch=this.userSearch userName=this.userName}}
<div class="results">
{{outlet}}
</div>
10 changes: 5 additions & 5 deletions tests/dummy/app/templates/search/results.hbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{{#each model as |user|}}
{{#each this.model as |user|}}
{{single-user user=user}}
{{/each}}
{{#if model.errors}}
<div>Errors {{model.message}}</div>
{{#if this.model.errors}}
<div>Errors {{this.model.message}}</div>
{{/if}}
{{#if nextPage}}
{{#if this.nextPage}}
<span class="meta">Next Page</span>
{{/if}}
{{#if previousPage}}
{{#if this.previousPage}}
<span class="meta">Previous Page</span>
{{/if}}
4 changes: 2 additions & 2 deletions tests/dummy/app/templates/user.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{#if model}}
{{single-user user=model createProject=(action "createProject")}}
{{#if this.model}}
{{single-user user=this.model createProject=(action "createProject") projectTitle=this.projectTitle}}
{{else}}
<div class="error">User not found</div>
{{/if}}
2 changes: 1 addition & 1 deletion tests/dummy/app/templates/users.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{user-list users=model deleteUser=(action "deleteUser")}}
{{user-list users=this.model deleteUser=(action "deleteUser")}}
1 change: 0 additions & 1 deletion tests/dummy/config/deprecation-workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ self.deprecationWorkflow.config = {
},
{ handler: 'silence', matchId: 'ember-source.deprecation-without-for' },
{ handler: 'silence', matchId: 'ember-source.deprecation-without-since' },
{ handler: 'silence', matchId: 'this-property-fallback' },
],
};