-
Notifications
You must be signed in to change notification settings - Fork 1
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
Tumblr photo feature #175
Conversation
addon/models/tumblr-post-photo.js
Outdated
import Post from './tumblr-post'; | ||
import { alias } from '@ember/object/computed' | ||
|
||
const attr = DS.attr; |
There was a problem hiding this comment.
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';
addon/models/tumblr-post.js
Outdated
@@ -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') |
There was a problem hiding this comment.
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}} |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
tests/dummy/app/routes/photo-blog.js
Outdated
import Route from '@ember/routing/route'; | ||
|
||
export default Route.extend({ | ||
model() { |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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
There was a problem hiding this 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.
Additionally, please make sure to run tests locally, since the CI build is broken atm |
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. |
Ah broke a test... 👎 |
All tests running again. |
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 :)