Skip to content

Fix all remaining LinkTo positional arg issues #823

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

Merged
merged 2 commits into from
Nov 18, 2022
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
16 changes: 8 additions & 8 deletions app/components/ember-data-landing-page.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
</h2>
<ul class="spec-method-list">
<li>
{{#link-to "project-version.classes.class" "Model"}}
<LinkTo @route="project-version.classes.class" @model="Model">
Model
{{/link-to}}
</LinkTo>
- an object that represents the underlying data that your application presents to the user.
</li>
<li>
{{#link-to "project-version.classes.class" "Store"}}
<LinkTo @route="project-version.classes.class" @model="Store">
Store
{{/link-to}}
</LinkTo>
- a service that contains all of the data for records loaded from the server.
</li>
<li>
{{#link-to "project-version.classes.class" "Adapter"}}
<LinkTo @route="project-version.classes.class" @model="Adapter">
Adapter
{{/link-to}}
</LinkTo>
- determines how data is persisted to a backend data store.
</li>
<li>
{{#link-to "project-version.classes.class" "Serializer"}}
<LinkTo @route="project-version.classes.class" @model="Serializer">
Serializer
{{/link-to}}
</LinkTo>
- format the data sent to and received from the backend store.
</li>
</ul>
Expand Down
22 changes: 12 additions & 10 deletions app/components/ember-landing-page.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@
</p>
<h2>Commonly searched-for documentation</h2>
<ul class="spec-method-list">
<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>
<li>{{#link-to 'project-version.functions.function' '@glimmer/tracking' 'tracked'}}Tracked{{/link-to}} - make your templates responsive to property updates</li>
<li>{{#link-to 'project-version.classes.class' 'ComputedProperty'}}Computed Properties{{/link-to}} - declare functions as properties</li>
<li>{{#link-to 'project-version.classes.class' '@ember/object/computed'}}Computed Macros{{/link-to}} - shorter ways of expressing certain types of computed properties</li>
<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>
<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>
<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>
<li>{{#link-to 'project-version.classes.class' 'Helper'}}Helpers{{/link-to}} - a way to define custom display functions that are used in templates</li>
<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>
<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>
{{! template-lint-disable no-potential-path-strings }}
<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>
<li><LinkTo @route='project-version.functions.function' @models={{array '@glimmer/tracking' 'tracked'}}>Tracked</LinkTo> - make your templates responsive to property updates</li>
<li><LinkTo @route='project-version.classes.class' @model='ComputedProperty'>Computed Properties</LinkTo> - declare functions as properties</li>
{{! template-lint-disable no-potential-path-strings }}
<li><LinkTo @route='project-version.classes.class' @model='@ember/object/computed'>Computed Macros</LinkTo> - shorter ways of expressing certain types of computed properties</li>
<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>
<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>
<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>
<li><LinkTo @route='project-version.classes.class' @model='Helper'>Helpers</LinkTo> - a way to define custom display functions that are used in templates</li>
<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>
<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>
</ul>
<h2>Useful links</h2>
<ul>
Expand Down
72 changes: 44 additions & 28 deletions tests/integration/components/api-index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,18 @@ module('Integration | Component | api index', function (hooks) {
<ul class=\"{{section.class}}\">
{{#each section.items as |item|}}
<li>
{{#link-to \"item.route\"
sectionData.projectId
sectionData.projectVersion
sectionData.name
item.name
(query-params anchor=item.name)}}
<LinkTo
@route=\"item.route\"
@models={{array
sectionData.projectId
sectionData.projectVersion
sectionData.name
item.name
}}
@query={{hash anchor=item.name}}
>
{{item.name}}
{{/link-to}}
</LinkTo>
</li>
{{/each}}
</ul>
Expand Down Expand Up @@ -126,14 +130,18 @@ module('Integration | Component | api index', function (hooks) {
<ul class=\"{{section.class}}\">
{{#each section.items as |item|}}
<li>
{{#link-to \"item.route\"
sectionData.projectId
sectionData.projectVersion
sectionData.name
item.name
(query-params anchor=item.name)}}
<LinkTo
@route=\"item.route\"
@models={{array
sectionData.projectId
sectionData.projectVersion
sectionData.name
item.name
}}
@query={{hash anchor=item.name}}
>
{{item.name}}
{{/link-to}}
</LinkTo>
</li>
{{/each}}
</ul>
Expand Down Expand Up @@ -268,14 +276,18 @@ module('Integration | Component | api index', function (hooks) {
<ul class=\"{{section.class}}\">
{{#each section.items as |item|}}
<li>
{{#link-to \"item.route\"
sectionData.projectId
sectionData.projectVersion
sectionData.name
item.name
(query-params anchor=item.name)}}
<LinkTo
@route=\"item.route\"
@models={{array
sectionData.projectId
sectionData.projectVersion
sectionData.name
item.name
}}
@query={{hash anchor=item.name}}
>
{{item.name}}
{{/link-to}}
</LinkTo>
</li>
{{/each}}
</ul>
Expand Down Expand Up @@ -410,14 +422,18 @@ module('Integration | Component | api index', function (hooks) {
<ul class=\"{{section.class}}\">
{{#each section.items as |item|}}
<li>
{{#link-to "item.route"
sectionData.projectId
sectionData.projectVersion
sectionData.name
item.name
(query-params anchor=item.name)}}
<LinkTo
@route=\"item.route\"
@models={{array
sectionData.projectId
sectionData.projectVersion
sectionData.name
item.name
}}
query={{hash anchor=item.name}}
>
{{item.name}}
{{/link-to}}
</LinkTo>
</li>
{{/each}}
</ul>
Expand Down