Skip to content
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

Tumblr photo feature #175

Merged
merged 5 commits into from
Feb 15, 2018
Merged

Conversation

MrChriZ
Copy link
Contributor

@MrChriZ MrChriZ commented Feb 14, 2018

Add's Tumblr-Photo to project
#3

May require some fine tuning but hopefully this is a good start.
Apologies if I've missed anything I'm fairly new to this pull request lark :)

import Post from './tumblr-post';
import { alias } from '@ember/object/computed'

const attr = DS.attr;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can import this directly (I haven't posted the entire project over, but no reason not to use it now):

import attr from 'ember-data/attr';

@@ -17,5 +18,6 @@ export default DS.Model.extend({
source_title: attr('string'),
liked: attr('boolean'),
state: attr('string'),
total_posts: attr('number')
total_posts: attr('number'),
isPhotoEntry: equal('type', 'photo')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we already have type on the model, we shouldn't add a photo-specific computed like this. It won't scale to adding more and more types. I'll add a suggestion down where you use this for a better alternative.

{{#if post.isPhotoEntry}}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use ember-truth-helpers here:

{{#if (eq post.type 'photo')}}

You can install this addon to the repo:

ember install ember-truth-helpers

Please make sure to move it to dependencies in package.json; by default, it will be added to devDependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was aware of ember-truth-helpers but didn't want to add new dependencies to the project. Will add it thanks.

import Route from '@ember/routing/route';

export default Route.extend({
model() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the indent spacing in this file to be consistent with the rest of the project.

@@ -0,0 +1,5 @@
<h1>Welcome to my blog!</h1>

<h3>This blog uses the default blog settings</h3>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add something to this to make it clear this page only displays photos

Copy link
Owner

@elwayman02 elwayman02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great start, thank you for contributing! I've asked for a few small changes, but this is looking great.

@elwayman02
Copy link
Owner

Additionally, please make sure to run tests locally, since the CI build is broken atm

@MrChriZ
Copy link
Contributor Author

MrChriZ commented Feb 15, 2018

Thanks will review changes and then repost. I'm running Ember tests and all tests are passing locally. I saw something is up with the Travis setup.

@MrChriZ
Copy link
Contributor Author

MrChriZ commented Feb 15, 2018

Ah broke a test... 👎

@MrChriZ
Copy link
Contributor Author

MrChriZ commented Feb 15, 2018

All tests running again.

@elwayman02 elwayman02 merged commit a226072 into elwayman02:master Feb 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants