Skip to content

Commit e3c69d6

Browse files
authored
Merge pull request #777 from rajakvk/rk-775-fix-linting-error-2
Fix linting error (#775)
2 parents c5e0aa6 + 885f302 commit e3c69d6

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

app/components/api-index-filter.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable ember/no-computed-properties-in-native-classes, ember/classic-decorator-no-classic-methods */
1+
/* eslint-disable ember/no-computed-properties-in-native-classes */
22
import { classNames } from '@ember-decorators/component';
33
import { computed } from '@ember/object';
44
import Component from '@ember/component';
@@ -26,19 +26,17 @@ export default class ApiIndexFilter extends Component {
2626

2727
filterItems(itemType) {
2828
let items =
29-
this.get(`model.${itemType}`) === undefined
30-
? []
31-
: this.get(`model.${itemType}`);
32-
if (!this.get('filterData.showInherited')) {
29+
this.model[itemType] === undefined ? [] : this.model[`${itemType}`];
30+
if (!this.filterData.showInherited) {
3331
items = items.filter((item) => item.inherited !== true);
3432
}
35-
if (!this.get('filterData.showProtected')) {
33+
if (!this.filterData.showProtected) {
3634
items = items.filter((item) => item.access !== 'protected');
3735
}
38-
if (!this.get('filterData.showPrivate')) {
36+
if (!this.filterData.showPrivate) {
3937
items = items.filter((item) => item.access !== 'private');
4038
}
41-
if (!this.get('filterData.showDeprecated')) {
39+
if (!this.filterData.showDeprecated) {
4240
items = items.filter((item) => item.deprecated !== true);
4341
}
4442

@@ -91,8 +89,8 @@ export default class ApiIndexFilter extends Component {
9189
* @method findMostLocal
9290
*/
9391
findMostLocal(currentItem, nextItem) {
94-
let currentScope = this.get('model.file');
95-
let parentClassScope = this.get('model.parentClass.file');
92+
let currentScope = this.model.file;
93+
let parentClassScope = this.model.get('parentClass').get('file');
9694
if (currentScope === currentItem.file) {
9795
// if the item belongs to the class, keep it
9896
return currentItem;

app/components/api-index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable ember/no-computed-properties-in-native-classes, ember/classic-decorator-no-classic-methods */
1+
/* eslint-disable ember/no-computed-properties-in-native-classes */
22
import { computed } from '@ember/object';
33
import Component from '@ember/component';
44

@@ -9,21 +9,21 @@ export default class ApiIndex extends Component {
99
{
1010
title: 'Methods',
1111
tab: 'methods',
12-
items: this.get('itemData.methods'),
12+
items: this.itemData.methods,
1313
class: 'spec-method-list',
1414
routeSuffix: '.methods.method',
1515
},
1616
{
1717
title: 'Properties',
1818
tab: 'properties',
19-
items: this.get('itemData.properties'),
19+
items: this.itemData.properties,
2020
class: 'spec-property-list',
2121
routeSuffix: '.properties.property',
2222
},
2323
{
2424
title: 'Events',
2525
tab: 'events',
26-
items: this.get('itemData.events'),
26+
items: this.itemData.events,
2727
class: 'spec-event-list',
2828
routeSuffix: '.events.event',
2929
},

tests/integration/components/api-index-filter-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ module('Integration | Component | api index filter', function (hooks) {
2222
},
2323
name: 'hai',
2424
file: 'my-class',
25-
parentClass: {
25+
parentClass: EmberObject.create({
2626
file: 'my-class',
27-
},
27+
}),
2828
methods: [
2929
{
3030
name: 'doSomething',

0 commit comments

Comments
 (0)