Skip to content

Commit 4006bdd

Browse files
authored
Merge pull request #774 from ember-learn/jw-cm-octane-rest-stop
Get Octanify and codemodded app running with tests passing
2 parents 752e500 + 9628ec4 commit 4006bdd

File tree

88 files changed

+1044
-928
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1044
-928
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@ jobs:
8282
env:
8383
PERCY_PARALLEL_NONCE: ${{ env.PERCY_PARALLEL_NONCE }}
8484
PERCY_PARALLEL_TOTAL: ${{ env.PERCY_PARALLEL_TOTAL }}
85-
PERCY_TOKEN: 5ad6687f6b1ad3dec2b964f94d3d59ff3880baccf1492c0663e85c1ce79c1a52
85+
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
8686
run: yarn run percy exec -- yarn test:ember

.github/workflows/gh-pages.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: github pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: '14'
17+
- run: npm install -g npm@7
18+
- run: npm install
19+
- run: npx lint-to-the-future output -o lttfOutput --rootUrl ember-api-docs --previous-results https://ember-learn.github.io/ember-api-docs/data.json
20+
- name: Deploy
21+
uses: peaceiris/actions-gh-pages@v3
22+
with:
23+
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
publish_dir: ./lttfOutput

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ terraform.tfstate.backup
3131

3232
public/json-docs/
3333
public/rev-index/
34-
jsconfig.json
3534

3635
package-lock.json
3736

app/adapters/application.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
import JSONAPIAdapter from '@ember-data/adapter/json-api';
1+
/* eslint-disable ember/classic-decorator-hooks, ember/classic-decorator-no-classic-methods */
22
import { inject as service } from '@ember/service';
3+
import JSONAPIAdapter from '@ember-data/adapter/json-api';
34
import fetch from 'fetch';
45
import ENV from 'ember-api-docs/config/environment';
56
import { pluralize } from 'ember-inflector';
67
import { isBlank } from '@ember/utils';
78

8-
export default JSONAPIAdapter.extend({
9-
host: ENV.API_HOST,
10-
11-
currentProject: '',
9+
export default class Application extends JSONAPIAdapter {
10+
host = ENV.API_HOST;
11+
currentProject = '';
12+
currentProjectVersion = '';
1213

13-
currentProjectVersion: '',
14+
@service
15+
metaStore;
1416

15-
metaStore: service(),
16-
projectService: service('project'),
17+
@service('project')
18+
projectService;
1719

18-
ids: null,
20+
ids = null;
1921

2022
shouldReloadRecord(store, { modelName, id }) {
2123
if (modelName === 'project') {
@@ -24,23 +26,25 @@ export default JSONAPIAdapter.extend({
2426
this.currentProjectVersion = id;
2527
}
2628
return; // return undefined so auto determinated
27-
},
29+
}
30+
2831
shouldBackgroundReloadAll() {
2932
return false;
30-
},
33+
}
34+
3135
shouldBackgroundReloadRecord(store, { modelName, id }) {
3236
let key = `${modelName}-${id}`;
3337
let hasId = this.ids[key];
3438
if (!hasId) {
3539
this.ids[key] = true;
3640
}
3741
return !hasId;
38-
},
42+
}
3943

4044
init() {
41-
this._super(...arguments);
45+
super.init(...arguments);
4246
this.ids = {};
43-
},
47+
}
4448

4549
async findRecord(store, { modelName }, id) {
4650
let url;
@@ -87,5 +91,5 @@ export default JSONAPIAdapter.extend({
8791
let response = await fetch(url);
8892
let json = await response.json();
8993
return json;
90-
},
91-
});
94+
}
95+
}

app/components/api-index-filter.js

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,28 @@
1+
/* eslint-disable ember/no-computed-properties-in-native-classes, ember/classic-decorator-no-classic-methods */
2+
import { classNames } from '@ember-decorators/component';
13
import { computed } from '@ember/object';
24
import Component from '@ember/component';
35
import sortBy from 'lodash.sortby';
46

57
const filterDataComputedParams =
68
'filterData.{showInherited,showProtected,showPrivate,showDeprecated}';
79

8-
export default Component.extend({
9-
classNames: ['api-index-filter'],
10+
@classNames('api-index-filter')
11+
export default class ApiIndexFilter extends Component {
12+
@computed('model.methods.[]', filterDataComputedParams)
13+
get filteredMethods() {
14+
return this.filterItems('methods');
15+
}
1016

11-
filteredMethods: computed(
12-
'model.methods.[]',
13-
filterDataComputedParams,
14-
function () {
15-
return this.filterItems('methods');
16-
}
17-
),
18-
19-
filteredEvents: computed(
20-
'model.events.[]',
21-
filterDataComputedParams,
22-
function () {
23-
return this.filterItems('events');
24-
}
25-
),
17+
@computed('model.events.[]', filterDataComputedParams)
18+
get filteredEvents() {
19+
return this.filterItems('events');
20+
}
2621

27-
filteredProperties: computed(
28-
'model.properties.[]',
29-
filterDataComputedParams,
30-
function () {
31-
return this.filterItems('properties');
32-
}
33-
),
22+
@computed('model.properties.[]', filterDataComputedParams)
23+
get filteredProperties() {
24+
return this.filterItems('properties');
25+
}
3426

3527
filterItems(itemType) {
3628
let items =
@@ -52,20 +44,16 @@ export default Component.extend({
5244

5345
let sortedItems = sortBy(items, (item) => item.name);
5446
return this.filterMultipleInheritance(sortedItems);
55-
},
47+
}
5648

57-
filteredData: computed(
58-
'filteredMethods',
59-
'filteredProperties',
60-
'filteredEvents',
61-
function () {
62-
return {
63-
methods: this.filteredMethods,
64-
properties: this.filteredProperties,
65-
events: this.filteredEvents,
66-
};
67-
}
68-
),
49+
@computed('filteredMethods', 'filteredProperties', 'filteredEvents')
50+
get filteredData() {
51+
return {
52+
methods: this.filteredMethods,
53+
properties: this.filteredProperties,
54+
events: this.filteredEvents,
55+
};
56+
}
6957

7058
/**
7159
* Returns an array where duplicate methods (by name) are removed.
@@ -94,7 +82,8 @@ export default Component.extend({
9482
}
9583
}
9684
return dedupedArray;
97-
},
85+
}
86+
9887
/**
9988
* Returns whichever item is most local.
10089
* What is "most local" is determined by looking at the file path for the
@@ -114,5 +103,5 @@ export default Component.extend({
114103
// otherwise, the next item must be "more local"
115104
return nextItem;
116105
}
117-
},
118-
});
106+
}
107+
}

app/components/api-index.js

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

4-
export default Component.extend({
5-
sections: computed('itemData.{methods,properties,events}', function () {
5+
export default class ApiIndex extends Component {
6+
@computed('itemData.{methods,properties,events}')
7+
get sections() {
68
return [
79
{
810
title: 'Methods',
@@ -26,5 +28,5 @@ export default Component.extend({
2628
routeSuffix: '.events.event',
2729
},
2830
];
29-
}),
30-
});
31+
}
32+
}
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
import Component from '@ember/component';
2-
import { inject as service } from '@ember/service';
1+
/* eslint-disable ember/no-computed-properties-in-native-classes, ember/classic-decorator-no-classic-methods */
32
import { computed } from '@ember/object';
3+
import { inject as service } from '@ember/service';
4+
import Component from '@ember/component';
45

5-
export default Component.extend({
6-
legacyModuleMappings: service(),
6+
export default class ClassFieldDescription extends Component {
7+
@service
8+
legacyModuleMappings;
79

8-
hasImportExample: computed('field.{name,class}', function () {
10+
@computed('field.{name,class}')
11+
get hasImportExample() {
912
return this.legacyModuleMappings.hasFunctionMapping(
1013
this.get('field.name'),
1114
this.get('field.class')
1215
);
13-
}),
16+
}
1417

1518
/**
1619
* Callback for updating the anchor with the field name that was clicked by a user.
1720
*
1821
* @method updateAnchor
1922
* @method fieldName String The name representing the field that was clicked.
2023
*/
21-
updateAnchor() {},
22-
});
24+
updateAnchor() {}
25+
}

app/components/ember-anchor.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
/* eslint-disable ember/classic-decorator-no-classic-methods */
12
import { get } from '@ember/object';
23
import AnchorComponent from 'ember-anchor/components/ember-anchor';
34
import config from 'ember-api-docs/config/environment';
45
import getOffset from 'ember-api-docs/utils/get-offset';
56

6-
export default AnchorComponent.extend({
7+
export default class EmberAnchor extends AnchorComponent {
78
// This overrides Ember Anchor to support scrolling within a fixed position element
89
_scrollToElemPosition() {
910
let qp = this.anchorQueryParam;
@@ -25,5 +26,5 @@ export default AnchorComponent.extend({
2526
scrollContainer.scrollTop = offsetToScroll;
2627
}
2728
}
28-
},
29-
});
29+
}
30+
}

app/components/import-example.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
/* eslint-disable ember/classic-decorator-no-classic-methods */
2+
import { action } from '@ember/object';
13
import Component from '@ember/component';
24
import { later } from '@ember/runloop';
35

4-
export default Component.extend({
5-
actions: {
6-
showSuccess() {
7-
this.toggleProperty('showClipboardSuccessIcon');
8-
later(this, () => this.toggleProperty('showClipboardSuccessIcon'), 950);
9-
},
10-
},
11-
});
6+
export default class ImportExample extends Component {
7+
@action
8+
showSuccess() {
9+
this.toggleProperty('showClipboardSuccessIcon');
10+
later(this, () => this.toggleProperty('showClipboardSuccessIcon'), 950);
11+
}
12+
}

app/components/loading-spinner.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { classNames } from '@ember-decorators/component';
12
import Component from '@ember/component';
23

3-
export default Component.extend({
4-
classNames: ['loading-spinner'],
5-
});
4+
@classNames('loading-spinner')
5+
export default class LoadingSpinner extends Component {}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { classNames } from '@ember-decorators/component';
12
import Component from '@ember/component';
23

3-
export default Component.extend({
4-
classNames: ['ds-suggestion'],
5-
});
4+
@classNames('ds-suggestion')
5+
export default class DropdownHeader extends Component {}

app/components/search-input/dropdown.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1-
import { set } from '@ember/object';
1+
/* eslint-disable ember/no-computed-properties-in-native-classes, ember/classic-decorator-hooks */
2+
import {
3+
classNames,
4+
attributeBindings,
5+
tagName,
6+
} from '@ember-decorators/component';
7+
import { set, get, computed } from '@ember/object';
28
import Component from '@ember/component';
3-
import { get, computed } from '@ember/object';
49
import { A } from '@ember/array';
510

6-
export default Component.extend({
11+
@tagName('span')
12+
@classNames('ds-dropdown-menu', 'ds-with-1')
13+
@attributeBindings('role')
14+
export default class Dropdown extends Component {
715
// Public API
8-
role: 'listbox',
9-
isVisible: false,
16+
role = 'listbox';
1017

11-
// Private API
12-
tagName: 'span',
13-
classNames: ['ds-dropdown-menu', 'ds-with-1'],
14-
attributeBindings: ['role'],
18+
isVisible = false;
1519

1620
init() {
17-
this._super(...arguments);
21+
super.init(...arguments);
1822
set(this, 'results', A());
19-
},
23+
}
2024

2125
// show
2226
// Massage data to make it easier for displaying on the template
@@ -28,7 +32,8 @@ export default Component.extend({
2832
* }
2933
* }
3034
*/
31-
_groupedResults: computed('results.[]', function () {
35+
@computed('results.[]')
36+
get _groupedResults() {
3237
if (!get(this, 'results.length')) {
3338
return {};
3439
}
@@ -72,5 +77,5 @@ export default Component.extend({
7277

7378
return lvl0Result;
7479
}, {});
75-
}),
76-
});
80+
}
81+
}

0 commit comments

Comments
 (0)