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

Commit

Permalink
Updated post list preview to use excerpt instead of plaintext
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinansfield committed Feb 26, 2019
1 parent 5feb903 commit f90811e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/components/gh-posts-list-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export default Component.extend({
return authors.map(author => author.get('name') || author.get('email')).join(', ');
}),

subText: computed('post.{plaintext,customExcerpt,metaDescription}', function () {
let text = this.get('post.plaintext') || '';
subText: computed('post.{excerpt,customExcerpt,metaDescription}', function () {
let text = this.get('post.excerpt') || '';
let customExcerpt = this.get('post.customExcerpt');
let metaDescription = this.get('post.metaDescription');

Expand Down
1 change: 1 addition & 0 deletions app/models/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default Model.extend(Comparable, ValidationEngine, {
validationType: 'post',

createdAtUTC: attr('moment-utc'),
excerpt: attr('string'),
customExcerpt: attr('string'),
featured: attr('boolean', {defaultValue: false}),
featureImage: attr('string'),
Expand Down
4 changes: 0 additions & 4 deletions app/serializers/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ export default ApplicationSerializer.extend(EmbeddedRecordsMixin, {

// Properties that exist on the model but we don't want sent in the payload
delete json.uuid;
// Server-side-generated fields
// TODO: remove once the API has protection against overriding auto generation
delete json.html;
delete json.plaintext;
// Inserted locally as a convenience.
delete json.author_id;
// Read-only virtual property.
Expand Down
1 change: 1 addition & 0 deletions mirage/factories/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default Factory.extend({
ogDescription: null,
ogImage: null,
ogTitle: null,
excerpt(i) { return `Excerpt for post ${i}.`; },
plaintext(i) { return `Plaintext for post ${i}.`; },
publishedAt: '2015-12-19T16:25:07.000Z',
publishedBy: 1,
Expand Down

0 comments on commit f90811e

Please sign in to comment.