Skip to content

Commit c71b2e5

Browse files
committed
Use crate.id with links to force ember to load all the crate data
Fixes rust-lang#331. Thank you @locks!!!! On crate list pages, we had *some* data about each crate, but not keywords. The way the links were constructed, ember saw the partial data that matched and would use that on the crate page instead of reloading the whole crate from the crate show api JSON, which *does* have keywords available. Using the id with the links instead of the whole model forces the request for all the data to happen.
1 parent 83c7d73 commit c71b2e5

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

app/templates/components/crate-downloads-list.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<ul>
22
{{#each crates as |crate|}}
33
<li>
4-
{{#link-to 'crate' crate class='name'}}
4+
{{#link-to 'crate' crate.id class='name'}}
55
{{ crate.name }} ({{ crate.max_version }})
66
<div class='right'>
77
<img class="download-clear-back" src="/assets/download-clear-back.png"/>

app/templates/components/crate-list.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<ul>
22
{{#each crates as |crate|}}
33
<li>
4-
{{#link-to 'crate' crate class='name'}}
4+
{{#link-to 'crate' crate.id class='name'}}
55
<span>{{ crate.name }} ({{ crate.max_version }})</span>
66
<img class="right-arrow" src="/assets/right-arrow.png"/>
77
{{/link-to}}

app/templates/components/crate-row.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class='desc'>
22
<div class='info'>
3-
{{#link-to 'crate' crate}}{{ crate.name }}{{/link-to}}
3+
{{#link-to 'crate' crate.id}}{{ crate.name }}{{/link-to}}
44
<span class='vers small'>{{ crate.max_version }}</span>
55
</div>
66
<div class='summary'>

app/templates/crate/reverse-dependencies.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class='all-versions-back'>
2-
{{#link-to 'crate' crate}}&#11013; Back to {{ crate.name }}{{/link-to}}
2+
{{#link-to 'crate' crate.id}}&#11013; Back to {{ crate.name }}{{/link-to}}
33
</div>
44

55
<div id='results'>

0 commit comments

Comments
 (0)