Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Fixed ember resolver warning for ambiguous authorNames access
Browse files Browse the repository at this point in the history
no issue
- we've added an `{{author-names}}` helper, this generated a warning from `{{gh-posts-list-item}}` which contained `{{authorNames}}` referencing a CP on the component context
- changing the CP access to be explicit using `{{this.authorNames}}` resolves the warning
- updated other references in the template to be explicit in order to differentiate between local context and helpers (this will be enforced in later Ember versions)
  • Loading branch information
kevinansfield committed Mar 13, 2019
1 parent c35d443 commit 53c4c13
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions app/templates/components/gh-posts-list-item.hbs
@@ -1,34 +1,38 @@
<h3 class="gh-content-entry-title">{{#link-to "editor.edit" post.displayName post.id class="permalink" title="Edit this post"}}{{post.title}}{{/link-to}}</h3>
<p>{{subText}}</p>
<h3 class="gh-content-entry-title">
{{#link-to "editor.edit" this.post.displayName this.post.id class="permalink" title="Edit this post"}}
{{this.post.title}}
{{/link-to}}
</h3>
<p>{{this.subText}}</p>

<section class="gh-content-entry-meta">
{{#if isPage}}
{{#if this.isPage}}
<span class="gh-content-status-draft gh-badge gh-badge-black">Page</span>
{{/if}}

{{#if isScheduled}}
{{#if this.isScheduled}}
<span class="gh-content-status-draft gh-badge">Scheduled</span>
{{/if}}

{{#if isDraft}}
{{#if this.isDraft}}
<span class="gh-content-status-draft gh-badge gh-badge-red">Draft</span>
{{/if}}

{{#if isFeatured}}
{{#if this.isFeatured}}
<span class="gh-content-status-featured gh-badge gh-badge-blue">Featured</span>
{{/if}}

{{#if (and isPublished (not post.page))}}
{{#if (and this.isPublished (not this.post.page))}}
<span class="gh-content-status-published">Published</span>
{{/if}}

by <span class="gh-content-entry-author">{{authorNames}}</span> &mdash;
by <span class="gh-content-entry-author">{{this.authorNames}}</span> &mdash;

{{#if isPublished}}
{{gh-format-post-time post.publishedAtUTC published=true}}
{{#if this.isPublished}}
{{gh-format-post-time this.post.publishedAtUTC published=true}}
{{else if isScheduled}}
<span class="green">Will go live {{gh-format-post-time post.publishedAtUTC scheduled=true}}</span>
<span class="green">Will go live {{gh-format-post-time this.post.publishedAtUTC scheduled=true}}</span>
{{else}}
Last edited {{gh-format-post-time post.updatedAtUTC draft=true}}
Last edited {{gh-format-post-time this.post.updatedAtUTC draft=true}}
{{/if}}
</section>

0 comments on commit 53c4c13

Please sign in to comment.