Skip to content

Get Octanify and codemodded app running with tests passing #774

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 14 commits into from
Oct 1, 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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ jobs:
env:
PERCY_PARALLEL_NONCE: ${{ env.PERCY_PARALLEL_NONCE }}
PERCY_PARALLEL_TOTAL: ${{ env.PERCY_PARALLEL_TOTAL }}
PERCY_TOKEN: 5ad6687f6b1ad3dec2b964f94d3d59ff3880baccf1492c0663e85c1ce79c1a52
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
run: yarn run percy exec -- yarn test:ember
24 changes: 24 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: github pages

on:
push:
branches:
- master
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install -g npm@7
- run: npm install
- 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
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./lttfOutput
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ terraform.tfstate.backup

public/json-docs/
public/rev-index/
jsconfig.json

package-lock.json

Expand Down
36 changes: 20 additions & 16 deletions app/adapters/application.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import JSONAPIAdapter from '@ember-data/adapter/json-api';
/* eslint-disable ember/classic-decorator-hooks, ember/classic-decorator-no-classic-methods */
import { inject as service } from '@ember/service';
import JSONAPIAdapter from '@ember-data/adapter/json-api';
import fetch from 'fetch';
import ENV from 'ember-api-docs/config/environment';
import { pluralize } from 'ember-inflector';
import { isBlank } from '@ember/utils';

export default JSONAPIAdapter.extend({
host: ENV.API_HOST,

currentProject: '',
export default class Application extends JSONAPIAdapter {
host = ENV.API_HOST;
currentProject = '';
currentProjectVersion = '';

currentProjectVersion: '',
@service
metaStore;

metaStore: service(),
projectService: service('project'),
@service('project')
projectService;

ids: null,
ids = null;

shouldReloadRecord(store, { modelName, id }) {
if (modelName === 'project') {
Expand All @@ -24,23 +26,25 @@ export default JSONAPIAdapter.extend({
this.currentProjectVersion = id;
}
return; // return undefined so auto determinated
},
}

shouldBackgroundReloadAll() {
return false;
},
}

shouldBackgroundReloadRecord(store, { modelName, id }) {
let key = `${modelName}-${id}`;
let hasId = this.ids[key];
if (!hasId) {
this.ids[key] = true;
}
return !hasId;
},
}

init() {
this._super(...arguments);
super.init(...arguments);
this.ids = {};
},
}

async findRecord(store, { modelName }, id) {
let url;
Expand Down Expand Up @@ -87,5 +91,5 @@ export default JSONAPIAdapter.extend({
let response = await fetch(url);
let json = await response.json();
return json;
},
});
}
}
69 changes: 29 additions & 40 deletions app/components/api-index-filter.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
/* eslint-disable ember/no-computed-properties-in-native-classes, ember/classic-decorator-no-classic-methods */
import { classNames } from '@ember-decorators/component';
import { computed } from '@ember/object';
import Component from '@ember/component';
import sortBy from 'lodash.sortby';

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

export default Component.extend({
classNames: ['api-index-filter'],
@classNames('api-index-filter')
export default class ApiIndexFilter extends Component {
@computed('model.methods.[]', filterDataComputedParams)
get filteredMethods() {
return this.filterItems('methods');
}

filteredMethods: computed(
'model.methods.[]',
filterDataComputedParams,
function () {
return this.filterItems('methods');
}
),

filteredEvents: computed(
'model.events.[]',
filterDataComputedParams,
function () {
return this.filterItems('events');
}
),
@computed('model.events.[]', filterDataComputedParams)
get filteredEvents() {
return this.filterItems('events');
}

filteredProperties: computed(
'model.properties.[]',
filterDataComputedParams,
function () {
return this.filterItems('properties');
}
),
@computed('model.properties.[]', filterDataComputedParams)
get filteredProperties() {
return this.filterItems('properties');
}

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

let sortedItems = sortBy(items, (item) => item.name);
return this.filterMultipleInheritance(sortedItems);
},
}

filteredData: computed(
'filteredMethods',
'filteredProperties',
'filteredEvents',
function () {
return {
methods: this.filteredMethods,
properties: this.filteredProperties,
events: this.filteredEvents,
};
}
),
@computed('filteredMethods', 'filteredProperties', 'filteredEvents')
get filteredData() {
return {
methods: this.filteredMethods,
properties: this.filteredProperties,
events: this.filteredEvents,
};
}

/**
* Returns an array where duplicate methods (by name) are removed.
Expand Down Expand Up @@ -94,7 +82,8 @@ export default Component.extend({
}
}
return dedupedArray;
},
}

/**
* Returns whichever item is most local.
* What is "most local" is determined by looking at the file path for the
Expand All @@ -114,5 +103,5 @@ export default Component.extend({
// otherwise, the next item must be "more local"
return nextItem;
}
},
});
}
}
10 changes: 6 additions & 4 deletions app/components/api-index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/* eslint-disable ember/no-computed-properties-in-native-classes, ember/classic-decorator-no-classic-methods */
import { computed } from '@ember/object';
import Component from '@ember/component';

export default Component.extend({
sections: computed('itemData.{methods,properties,events}', function () {
export default class ApiIndex extends Component {
@computed('itemData.{methods,properties,events}')
get sections() {
return [
{
title: 'Methods',
Expand All @@ -26,5 +28,5 @@ export default Component.extend({
routeSuffix: '.events.event',
},
];
}),
});
}
}
19 changes: 11 additions & 8 deletions app/components/class-field-description.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
import Component from '@ember/component';
import { inject as service } from '@ember/service';
/* eslint-disable ember/no-computed-properties-in-native-classes, ember/classic-decorator-no-classic-methods */
import { computed } from '@ember/object';
import { inject as service } from '@ember/service';
import Component from '@ember/component';

export default Component.extend({
legacyModuleMappings: service(),
export default class ClassFieldDescription extends Component {
@service
legacyModuleMappings;

hasImportExample: computed('field.{name,class}', function () {
@computed('field.{name,class}')
get hasImportExample() {
return this.legacyModuleMappings.hasFunctionMapping(
this.get('field.name'),
this.get('field.class')
);
}),
}

/**
* Callback for updating the anchor with the field name that was clicked by a user.
*
* @method updateAnchor
* @method fieldName String The name representing the field that was clicked.
*/
updateAnchor() {},
});
updateAnchor() {}
}
7 changes: 4 additions & 3 deletions app/components/ember-anchor.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-disable ember/classic-decorator-no-classic-methods */
import { get } from '@ember/object';
import AnchorComponent from 'ember-anchor/components/ember-anchor';
import config from 'ember-api-docs/config/environment';
import getOffset from 'ember-api-docs/utils/get-offset';

export default AnchorComponent.extend({
export default class EmberAnchor extends AnchorComponent {
// This overrides Ember Anchor to support scrolling within a fixed position element
_scrollToElemPosition() {
let qp = this.anchorQueryParam;
Expand All @@ -25,5 +26,5 @@ export default AnchorComponent.extend({
scrollContainer.scrollTop = offsetToScroll;
}
}
},
});
}
}
17 changes: 9 additions & 8 deletions app/components/import-example.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/* eslint-disable ember/classic-decorator-no-classic-methods */
import { action } from '@ember/object';
import Component from '@ember/component';
import { later } from '@ember/runloop';

export default Component.extend({
actions: {
showSuccess() {
this.toggleProperty('showClipboardSuccessIcon');
later(this, () => this.toggleProperty('showClipboardSuccessIcon'), 950);
},
},
});
export default class ImportExample extends Component {
@action
showSuccess() {
this.toggleProperty('showClipboardSuccessIcon');
later(this, () => this.toggleProperty('showClipboardSuccessIcon'), 950);
}
}
6 changes: 3 additions & 3 deletions app/components/loading-spinner.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { classNames } from '@ember-decorators/component';
import Component from '@ember/component';

export default Component.extend({
classNames: ['loading-spinner'],
});
@classNames('loading-spinner')
export default class LoadingSpinner extends Component {}
6 changes: 3 additions & 3 deletions app/components/search-input/dropdown-header.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { classNames } from '@ember-decorators/component';
import Component from '@ember/component';

export default Component.extend({
classNames: ['ds-suggestion'],
});
@classNames('ds-suggestion')
export default class DropdownHeader extends Component {}
33 changes: 19 additions & 14 deletions app/components/search-input/dropdown.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
import { set } from '@ember/object';
/* eslint-disable ember/no-computed-properties-in-native-classes, ember/classic-decorator-hooks */
import {
classNames,
attributeBindings,
tagName,
} from '@ember-decorators/component';
import { set, get, computed } from '@ember/object';
import Component from '@ember/component';
import { get, computed } from '@ember/object';
import { A } from '@ember/array';

export default Component.extend({
@tagName('span')
@classNames('ds-dropdown-menu', 'ds-with-1')
@attributeBindings('role')
export default class Dropdown extends Component {
// Public API
role: 'listbox',
isVisible: false,
role = 'listbox';

// Private API
tagName: 'span',
classNames: ['ds-dropdown-menu', 'ds-with-1'],
attributeBindings: ['role'],
isVisible = false;

init() {
this._super(...arguments);
super.init(...arguments);
set(this, 'results', A());
},
}

// show
// Massage data to make it easier for displaying on the template
Expand All @@ -28,7 +32,8 @@ export default Component.extend({
* }
* }
*/
_groupedResults: computed('results.[]', function () {
@computed('results.[]')
get _groupedResults() {
if (!get(this, 'results.length')) {
return {};
}
Expand Down Expand Up @@ -72,5 +77,5 @@ export default Component.extend({

return lvl0Result;
}, {});
}),
});
}
}
Loading