Skip to content
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
3 changes: 1 addition & 2 deletions .ember-cli
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false,
"pod": true
"disableAnalytics": false
}
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ _(In Progress)_ We plan to use the [ember-i18n](https://github.com/jamesarosen/e

### Components

We will use "pod" style structure for all of the components in this addon. As long as you use the ember-cli to generate the component scaffolds (`ember g component my-component`) , this should happend by default. Basically components should be structured like:
We will use "pod" style structure for all of the components in this addon. This means when generating component scaffolds with ember-cli you must pass the --pod flag: `ember g component my-component --pod`. Basically components should be structured like:

- addon/components/<name>/
- component.js
Expand Down
10 changes: 8 additions & 2 deletions addon/adapters/node.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import ApplicationAdapter from './application';

export default ApplicationAdapter.extend({
buildURL() {
buildURL(_, __, ___, requestType) {
// Embed contributors
return `${this._super(...arguments)}?embed=contributors`;
var base = this._super(...arguments);
if (requestType === 'GET') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was recently looking along parallel lines... does this work? It seems like requestType is the Ember query type, not an HTTP method. See:
https://github.com/emberjs/data/blob/v2.5.1/addon/-private/adapters/build-url-mixin.js#L54

return `${base}?embed=contributors`;
}
else {
return base;
}
}
});
2 changes: 1 addition & 1 deletion addon/mixins/osf-login-route.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default Ember.Mixin.create(UnauthenticatedRouteMixin, {
session: Ember.inject.service(),
beforeModel() {
var accessToken;
if (config.OSF.local) {
if (config.OSF.isLocal) {
accessToken = config.OSF.accessToken;
} else {
// Acquire an OSF access token, then exchange it for a Jam token
Expand Down
16 changes: 16 additions & 0 deletions app/locales/en-us/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Ember-I18n includes configuration for common locales. Most users
// can safely delete this file. Use it if you need to override behavior
// for a locale or define behavior for a locale that Ember-I18n
// doesn't know about.
export default {
// rtl: [true|FALSE],
//
// pluralForm: function(count) {
// if (count === 0) { return 'zero'; }
// if (count === 1) { return 'one'; }
// if (count === 2) { return 'two'; }
// if (count < 5) { return 'few'; }
// if (count >= 5) { return 'many'; }
// return 'other';
// }
};
11 changes: 11 additions & 0 deletions app/locales/en-us/translations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default {
// "some.translation.key": "Text for some.translation.key",
//
// "a": {
// "nested": {
// "key": "Text for a.nested.key"
// }
// },
//
// "key.with.interpolation": "Text with {{anInterpolation}}"
};
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {
ENV.OSF.authUrl = 'http://localhost:8080/oauth2/profile';

ENV.OSF.accessToken = SETTINGS.PERSONAL_ACCESS_TOKEN;
ENV.OSF.local = true;
ENV.OSF.isLocal = true;
}
if (BACKEND === 'stage') {
ENV.OSF.url = 'https://staging.osf.io/';
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/adapters/node-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ moduleFor('adapter:node', 'Unit | Adapter | node', {
test('it embeds contributors', function(assert) {
let adapter = this.subject();

//let url = adapter.buildURL('nodes', null, null, 'GET', null);
assert.ok(adapter);
let url = adapter.buildURL('nodes', null, null, 'GET', null);
assert.ok(url.indexOf('embed=contributors'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A unit test! 👍

});