Skip to content

Commit 65b1a43

Browse files
authored
Merge pull request #823 from ember-learn/deprecations
Fix all remaining `LinkTo` positional arg issues
2 parents 0160189 + 83a5443 commit 65b1a43

File tree

3 files changed

+64
-46
lines changed

3 files changed

+64
-46
lines changed

app/components/ember-data-landing-page.hbs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@
1010
</h2>
1111
<ul class="spec-method-list">
1212
<li>
13-
{{#link-to "project-version.classes.class" "Model"}}
13+
<LinkTo @route="project-version.classes.class" @model="Model">
1414
Model
15-
{{/link-to}}
15+
</LinkTo>
1616
- an object that represents the underlying data that your application presents to the user.
1717
</li>
1818
<li>
19-
{{#link-to "project-version.classes.class" "Store"}}
19+
<LinkTo @route="project-version.classes.class" @model="Store">
2020
Store
21-
{{/link-to}}
21+
</LinkTo>
2222
- a service that contains all of the data for records loaded from the server.
2323
</li>
2424
<li>
25-
{{#link-to "project-version.classes.class" "Adapter"}}
25+
<LinkTo @route="project-version.classes.class" @model="Adapter">
2626
Adapter
27-
{{/link-to}}
27+
</LinkTo>
2828
- determines how data is persisted to a backend data store.
2929
</li>
3030
<li>
31-
{{#link-to "project-version.classes.class" "Serializer"}}
31+
<LinkTo @route="project-version.classes.class" @model="Serializer">
3232
Serializer
33-
{{/link-to}}
33+
</LinkTo>
3434
- format the data sent to and received from the backend store.
3535
</li>
3636
</ul>

app/components/ember-landing-page.hbs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@
1111
</p>
1212
<h2>Commonly searched-for documentation</h2>
1313
<ul class="spec-method-list">
14-
<li>Components - {{#link-to 'project-version.classes.class' 'Component'}}Classic{{/link-to}} or {{#link-to 'project-version.modules.module' '@glimmer/component'}}Glimmer{{/link-to}}; a view that is completely isolated</li>
15-
<li>{{#link-to 'project-version.functions.function' '@glimmer/tracking' 'tracked'}}Tracked{{/link-to}} - make your templates responsive to property updates</li>
16-
<li>{{#link-to 'project-version.classes.class' 'ComputedProperty'}}Computed Properties{{/link-to}} - declare functions as properties</li>
17-
<li>{{#link-to 'project-version.classes.class' '@ember/object/computed'}}Computed Macros{{/link-to}} - shorter ways of expressing certain types of computed properties</li>
18-
<li>{{#link-to 'project-version.classes.class' 'EmberArray'}}EmberArray{{/link-to}} - contains methods like {{#link-to 'project-version.classes.class.methods.method' 'EmberArray' 'forEach' (query-params anchor='forEach')}}forEach{{/link-to}} and {{#link-to 'project-version.classes.class.methods.method' 'EmberArray' 'mapBy' (query-params anchor='mapBy')}}mapBy{{/link-to}} that help you iterate over Ember Objects</li>
19-
<li>{{#link-to 'project-version.classes.class' 'EmberObject'}}EmberObject{{/link-to}} - the main base class for all Ember objects, including the {{#link-to 'project-version.classes.class.methods.method' 'EmberObject' 'get' (query-params anchor='get')}}get{{/link-to}} and {{#link-to 'project-version.classes.class.methods.method' 'EmberObject' 'set' (query-params anchor='set')}}set{{/link-to}} methods</li>
20-
<li>{{#link-to 'project-version.classes.class' 'Ember.Templates.helpers'}}Ember.Templates.helpers{{/link-to}} - built-in functions that can be used in templates, such as the {{#link-to 'project-version.classes.class.methods.method' 'Ember.Templates.helpers' 'each' (query-params anchor='each')}}each{{/link-to}}, {{#link-to 'project-version.classes.class.methods.method' 'Ember.Templates.helpers' 'on' (query-params anchor='on')}}on{{/link-to}} and {{#link-to 'project-version.classes.class.methods.method' 'Ember.Templates.helpers' 'fn' (query-params anchor='fn')}}fn{{/link-to}} helpers</li>
21-
<li>{{#link-to 'project-version.classes.class' 'Helper'}}Helpers{{/link-to}} - a way to define custom display functions that are used in templates</li>
22-
<li>{{#link-to 'project-version.classes.class' 'Route'}}Route{{/link-to}} - used to define individual routes, including the {{#link-to 'project-version.classes.class.methods.method' 'Route' 'model' (query-params anchor='model')}}model{{/link-to}} hook for loading data</li>
23-
<li>{{#link-to 'project-version.classes.class' 'Service'}}Service{{/link-to}} - an Ember object that lives for the duration of the application, and can be made available in different parts of your application</li>
14+
{{! template-lint-disable no-potential-path-strings }}
15+
<li>Components - <LinkTo @route='project-version.classes.class' @model='Component'>Classic</LinkTo> or <LinkTo @route='project-version.modules.module' @model='@glimmer/component'>Glimmer</LinkTo>; a view that is completely isolated</li>
16+
<li><LinkTo @route='project-version.functions.function' @models={{array '@glimmer/tracking' 'tracked'}}>Tracked</LinkTo> - make your templates responsive to property updates</li>
17+
<li><LinkTo @route='project-version.classes.class' @model='ComputedProperty'>Computed Properties</LinkTo> - declare functions as properties</li>
18+
{{! template-lint-disable no-potential-path-strings }}
19+
<li><LinkTo @route='project-version.classes.class' @model='@ember/object/computed'>Computed Macros</LinkTo> - shorter ways of expressing certain types of computed properties</li>
20+
<li><LinkTo @route='project-version.classes.class' @model='EmberArray'>EmberArray</LinkTo> - contains methods like <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'EmberArray' 'forEach'}} @query={{hash anchor='forEach'}}>forEach</LinkTo> and <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'EmberArray' 'mapBy'}} @query={{hash anchor='mapBy'}}>mapBy</LinkTo> that help you iterate over Ember Objects</li>
21+
<li><LinkTo @route='project-version.classes.class' @model='EmberObject'>EmberObject</LinkTo> - the main base class for all Ember objects, including the <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'EmberObject' 'get'}} @query={{hash anchor='get'}}>get</LinkTo> and <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'EmberObject' 'set'}} @query={{hash anchor='set'}}>set</LinkTo> methods</li>
22+
<li><LinkTo @route='project-version.classes.class' @model='Ember.Templates.helpers'>Ember.Templates.helpers</LinkTo> - built-in functions that can be used in templates, such as the <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'Ember.Templates.helpers' 'each'}} @query={{hash anchor='each'}}>each</LinkTo>, <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'Ember.Templates.helpers' 'on'}} @query={{hash anchor='on'}}>on</LinkTo> and <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'Ember.Templates.helpers' 'fn'}} @query={{hash anchor='fn'}}>fn</LinkTo> helpers</li>
23+
<li><LinkTo @route='project-version.classes.class' @model='Helper'>Helpers</LinkTo> - a way to define custom display functions that are used in templates</li>
24+
<li><LinkTo @route='project-version.classes.class' @model='Route'>Route</LinkTo> - used to define individual routes, including the <LinkTo @route='project-version.classes.class.methods.method' @models={{array 'Route' 'model'}} @query={{hash anchor='model'}}>model</LinkTo> hook for loading data</li>
25+
<li><LinkTo @route='project-version.classes.class' @model='Service'>Service</LinkTo> - an Ember object that lives for the duration of the application, and can be made available in different parts of your application</li>
2426
</ul>
2527
<h2>Useful links</h2>
2628
<ul>

tests/integration/components/api-index-test.js

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,18 @@ module('Integration | Component | api index', function (hooks) {
5252
<ul class=\"{{section.class}}\">
5353
{{#each section.items as |item|}}
5454
<li>
55-
{{#link-to \"item.route\"
56-
sectionData.projectId
57-
sectionData.projectVersion
58-
sectionData.name
59-
item.name
60-
(query-params anchor=item.name)}}
55+
<LinkTo
56+
@route=\"item.route\"
57+
@models={{array
58+
sectionData.projectId
59+
sectionData.projectVersion
60+
sectionData.name
61+
item.name
62+
}}
63+
@query={{hash anchor=item.name}}
64+
>
6165
{{item.name}}
62-
{{/link-to}}
66+
</LinkTo>
6367
</li>
6468
{{/each}}
6569
</ul>
@@ -126,14 +130,18 @@ module('Integration | Component | api index', function (hooks) {
126130
<ul class=\"{{section.class}}\">
127131
{{#each section.items as |item|}}
128132
<li>
129-
{{#link-to \"item.route\"
130-
sectionData.projectId
131-
sectionData.projectVersion
132-
sectionData.name
133-
item.name
134-
(query-params anchor=item.name)}}
133+
<LinkTo
134+
@route=\"item.route\"
135+
@models={{array
136+
sectionData.projectId
137+
sectionData.projectVersion
138+
sectionData.name
139+
item.name
140+
}}
141+
@query={{hash anchor=item.name}}
142+
>
135143
{{item.name}}
136-
{{/link-to}}
144+
</LinkTo>
137145
</li>
138146
{{/each}}
139147
</ul>
@@ -268,14 +276,18 @@ module('Integration | Component | api index', function (hooks) {
268276
<ul class=\"{{section.class}}\">
269277
{{#each section.items as |item|}}
270278
<li>
271-
{{#link-to \"item.route\"
272-
sectionData.projectId
273-
sectionData.projectVersion
274-
sectionData.name
275-
item.name
276-
(query-params anchor=item.name)}}
279+
<LinkTo
280+
@route=\"item.route\"
281+
@models={{array
282+
sectionData.projectId
283+
sectionData.projectVersion
284+
sectionData.name
285+
item.name
286+
}}
287+
@query={{hash anchor=item.name}}
288+
>
277289
{{item.name}}
278-
{{/link-to}}
290+
</LinkTo>
279291
</li>
280292
{{/each}}
281293
</ul>
@@ -410,14 +422,18 @@ module('Integration | Component | api index', function (hooks) {
410422
<ul class=\"{{section.class}}\">
411423
{{#each section.items as |item|}}
412424
<li>
413-
{{#link-to "item.route"
414-
sectionData.projectId
415-
sectionData.projectVersion
416-
sectionData.name
417-
item.name
418-
(query-params anchor=item.name)}}
425+
<LinkTo
426+
@route=\"item.route\"
427+
@models={{array
428+
sectionData.projectId
429+
sectionData.projectVersion
430+
sectionData.name
431+
item.name
432+
}}
433+
query={{hash anchor=item.name}}
434+
>
419435
{{item.name}}
420-
{{/link-to}}
436+
</LinkTo>
421437
</li>
422438
{{/each}}
423439
</ul>

0 commit comments

Comments
 (0)