-
-
Notifications
You must be signed in to change notification settings - Fork 113
Fix linting error (#775) #777
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
Conversation
app/components/api-index-filter.js
Outdated
@@ -26,19 +25,19 @@ export default class ApiIndexFilter extends Component { | |||
|
|||
filterItems(itemType) { | |||
let items = | |||
this.get(`model.${itemType}`) === undefined | |||
this.model[`${itemType}`] === undefined |
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 think we can simplify this now:
this.model[`${itemType}`] === undefined | |
this.model[itemType] === undefined |
I think maybe the linter is complaining about formatting here too. Maybe this should be on the same line as let items =
now that it is shorter.
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.
Updated.
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.
Hi! I think this is almost ready to go. See my comments about what to fix to make the linter happy.
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.
Updated code as per @jenweber comments.
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.
Ember Data relationships need to be accessed using get
because models are proxy objects.
app/components/api-index-filter.js
Outdated
let currentScope = this.model.file; | ||
let parentClassScope = this.model.parentClass.file; |
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.
Tests are failing because model
is an Ember Data model and file
seems to be a relationship? Since Ember Data models are proxy objects, you still need to use get
to get relationship values:
let currentScope = this.model.file; | |
let parentClassScope = this.model.parentClass.file; | |
let currentScope = this.model.file; | |
let parentClassScope = this.model.get('parentClass').file; |
6ba5d2f
to
f67b5e0
Compare
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.
Woohoo! Thanks for your effort 😁
c682222
to
885f302
Compare
Closes item-1 at #775