Updated post list preview to use excerpt instead of plaintext

This commit is contained in:
Kevin Ansfield 2019-02-26 13:37:23 +07:00
parent fb7db69ffe
commit 81eddbbf72
4 changed files with 4 additions and 6 deletions

View File

@ -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');

View File

@ -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'),

View File

@ -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.

View File

@ -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,