Skip to content

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

Merged
merged 8 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions app/components/api-index-filter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable ember/no-computed-properties-in-native-classes, ember/classic-decorator-no-classic-methods */
/* eslint-disable ember/no-computed-properties-in-native-classes */
import { classNames } from '@ember-decorators/component';
import { computed } from '@ember/object';
import Component from '@ember/component';
Expand Down Expand Up @@ -26,19 +26,17 @@ export default class ApiIndexFilter extends Component {

filterItems(itemType) {
let items =
this.get(`model.${itemType}`) === undefined
? []
: this.get(`model.${itemType}`);
if (!this.get('filterData.showInherited')) {
this.model[itemType] === undefined ? [] : this.model[`${itemType}`];
if (!this.filterData.showInherited) {
items = items.filter((item) => item.inherited !== true);
}
if (!this.get('filterData.showProtected')) {
if (!this.filterData.showProtected) {
items = items.filter((item) => item.access !== 'protected');
}
if (!this.get('filterData.showPrivate')) {
if (!this.filterData.showPrivate) {
items = items.filter((item) => item.access !== 'private');
}
if (!this.get('filterData.showDeprecated')) {
if (!this.filterData.showDeprecated) {
items = items.filter((item) => item.deprecated !== true);
}

Expand Down Expand Up @@ -91,8 +89,8 @@ export default class ApiIndexFilter extends Component {
* @method findMostLocal
*/
findMostLocal(currentItem, nextItem) {
let currentScope = this.get('model.file');
let parentClassScope = this.get('model.parentClass.file');
let currentScope = this.model.file;
let parentClassScope = this.model.get('parentClass').get('file');
if (currentScope === currentItem.file) {
// if the item belongs to the class, keep it
return currentItem;
Expand Down
8 changes: 4 additions & 4 deletions app/components/api-index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable ember/no-computed-properties-in-native-classes, ember/classic-decorator-no-classic-methods */
/* eslint-disable ember/no-computed-properties-in-native-classes */
import { computed } from '@ember/object';
import Component from '@ember/component';

Expand All @@ -9,21 +9,21 @@ export default class ApiIndex extends Component {
{
title: 'Methods',
tab: 'methods',
items: this.get('itemData.methods'),
items: this.itemData.methods,
class: 'spec-method-list',
routeSuffix: '.methods.method',
},
{
title: 'Properties',
tab: 'properties',
items: this.get('itemData.properties'),
items: this.itemData.properties,
class: 'spec-property-list',
routeSuffix: '.properties.property',
},
{
title: 'Events',
tab: 'events',
items: this.get('itemData.events'),
items: this.itemData.events,
class: 'spec-event-list',
routeSuffix: '.events.event',
},
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/components/api-index-filter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ module('Integration | Component | api index filter', function (hooks) {
},
name: 'hai',
file: 'my-class',
parentClass: {
parentClass: EmberObject.create({
file: 'my-class',
},
}),
methods: [
{
name: 'doSomething',
Expand Down