Skip to content

Commit 57e0ae8

Browse files
committed
Merge branch 'release/0.4.0'
2 parents 8393568 + 115c244 commit 57e0ae8

Some content is hidden

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

59 files changed

+855
-588
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
**/bower_components
3+
**/dist
4+
**/node_modules
5+
**/tmp

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
coverage
2+
dist
3+
docs
4+
tmp

.eslintrc.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
root: true,
3+
parserOptions: {
4+
ecmaVersion: 6,
5+
sourceType: 'module'
6+
},
7+
extends: 'eslint:recommended',
8+
env: {
9+
browser: true,
10+
es6: true
11+
},
12+
globals: {
13+
MathJax: true
14+
},
15+
rules: {}
16+
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
.npmrc
1717
npm-debug.log
1818
testem.log
19+
.idea
1920

2021
# Never commit configuration or private settings
2122
config/*.yml

.jshintrc

Lines changed: 0 additions & 34 deletions
This file was deleted.

.template-lintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* jshint node:true */
1+
/* eslint-env node */
22
'use strict';
33

44
module.exports = {

Dockerfile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
FROM node:boron
2+
3+
RUN apt-get update \
4+
&& apt-get install -y \
5+
git \
6+
# Next 2 needed for yarn
7+
apt-transport-https \
8+
ca-certificates \
9+
# watchman
10+
build-essential \
11+
automake \
12+
autoconf \
13+
python-dev \
14+
&& apt-get clean \
15+
&& apt-get autoremove -y \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
19+
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
20+
&& apt-get update \
21+
&& apt-get install -y \
22+
yarn \
23+
&& apt-get clean \
24+
&& apt-get autoremove -y \
25+
&& rm -rf /var/lib/apt/lists/*
26+
27+
ENV WATCHMAN_VERSION 4.7.0
28+
RUN cd /tmp \
29+
&& git clone https://github.com/facebook/watchman.git \
30+
&& cd watchman \
31+
&& git checkout v$WATCHMAN_VERSION \
32+
&& ./autogen.sh \
33+
&& ./configure --enable-statedir=/tmp \
34+
&& make \
35+
&& make install \
36+
&& mv watchman /usr/local/bin/watchman \
37+
&& rm -Rf /tmp/watchman
38+
39+
RUN mkdir -p /code
40+
WORKDIR /code
41+
42+
COPY ./package.json ./yarn.lock /code/
43+
RUN yarn --pure-lockfile
44+
45+
COPY ./.bowerrc /code/.bowerrc
46+
COPY ./bower.json /code/bower.json
47+
RUN ./node_modules/bower/bin/bower install --allow-root --config.interactive=false
48+
49+
COPY ./ /code/
50+
51+
ARG GIT_COMMIT=
52+
ENV GIT_COMMIT ${GIT_COMMIT}
53+
54+
ARG APP_ENV=production
55+
ENV APP_ENV ${APP_ENV}
56+
ARG BACKEND=local
57+
ENV BACKEND ${BACKEND}
58+
RUN ./node_modules/ember-cli/bin/ember build --env ${APP_ENV}
59+
60+
CMD ["yarn", "test"]

addon/adapters/osf-adapter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export default DS.JSONAPIAdapter.extend(HasManyQuery.RESTAdapterMixin, GenericDa
9393
* @param {String} url
9494
* @param {Boolean} isBulk
9595
**/
96-
_createRelated(store, snapshot, createdSnapshots, relationship, url, isBulk = false) { // jshint ignore:line
96+
_createRelated(store, snapshot, createdSnapshots, relationship, url) { //, isBulk = false) {
9797
// TODO support bulk create?
9898
// if (isBulk) {
9999
//
@@ -183,7 +183,7 @@ export default DS.JSONAPIAdapter.extend(HasManyQuery.RESTAdapterMixin, GenericDa
183183
* @param {String} url
184184
* @param {Boolean} isBulk
185185
**/
186-
_deleteRelated(store, snapshot, deletedSnapshots, relationship, url, isBulk = false) { // jshint ignore:line
186+
_deleteRelated(store, snapshot, deletedSnapshots) { //, relationship, url, isBulk = false) {
187187
return this._removeRelated(...arguments).then(() => {
188188
deletedSnapshots.forEach(s => s.record.unloadRecord());
189189
});

addon/components/dropzone-widget/component.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* global Dropzone */
2+
13
import Ember from 'ember';
24
import config from 'ember-get-config';
35

@@ -32,10 +34,7 @@ export default Ember.Component.extend({
3234
let preUpload = this.get('preUpload');
3335
let dropzoneOptions = this.get('options') || {};
3436

35-
if (!this.get('buildUrl') && !preUpload && !dropzoneOptions.url) {
36-
console.error('Need to define url somewhere');
37-
}
38-
let drop = new Dropzone(`#${this.elementId}`, { // jshint ignore:line
37+
let drop = new Dropzone(`#${this.elementId}`, {
3938
url: file => typeof this.get('buildUrl') === 'function' ? this.get('buildUrl')(file) : this.get('buildUrl'),
4039
autoProcessQueue: false,
4140
dictDefaultMessage: this.get('defaultMessage') || 'Drop files here to upload'

addon/components/file-widget/component.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ export default Ember.Component.extend({
6262
selectNodeFile(file) {
6363
this.send('selectFile', file.get('links.download'));
6464
},
65-
selectNode(node) {
66-
console.log(node);
67-
},
68-
selectFile(url) {
69-
console.log(url);
70-
},
7165
preUpload() {
7266
return new Ember.RSVP.Promise((resolve) => resolve());
7367
}

addon/components/navbar-auth-dropdown/component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default Ember.Component.extend({
6363
actions: {
6464
logout() {
6565
const redirectUrl = this.get('redirectUrl');
66-
const query = redirectUrl ? '?' + Ember.$.param({ redirect_url: redirectUrl }) : '';
66+
const query = redirectUrl ? '?' + Ember.$.param({ next_url: redirectUrl }) : '';
6767
// TODO: May not work well if logging out from page that requires login- check?
6868
this.get('session').invalidate()
6969
.then(() => window.location.href = `${config.OSF.url}logout/${query}`);

addon/components/osf-footer/template.hbs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
<div class="col-sm-2 col-md-3 col-md-offset-1">
66
<h4>OSF</h4>
77
<ul>
8-
<li><a href="explore/activity/">Explore</a></li>
8+
<li><a href="/explore/activity/">Explore</a></li>
99
<li>
1010
{{{supportEmail}}}
1111
</li>
12-
<li><a href="support">FAQ/Guides</a></li>
12+
<li><a href="/support">FAQ/Guides</a></li>
1313
<li><a href="https://api.osf.io/v2/docs/">API</a></li>
1414
<li><a href="https://github.com/CenterForOpenScience/osf.io">Source Code</a></li>
1515
</ul>
@@ -18,8 +18,8 @@
1818
<h4>Center for Open Science</h4>
1919
<ul>
2020
<li><a href="http://cos.io">Home</a></li>
21-
<li><a href="ezcuj/wiki/home/">Reproducibility Project: Psychology</a></li>
22-
<li><a href="e81xl/wiki/home/">Reproducibility Project: Cancer Biology</a></li>
21+
<li><a href="/ezcuj/wiki/home/">Reproducibility Project: Psychology</a></li>
22+
<li><a href="/e81xl/wiki/home/">Reproducibility Project: Cancer Biology</a></li>
2323
<li><a href="http://cos.io/top/">TOP Guidelines</a></li>
2424
<li><a href="https://www.givinglibrary.org/organizations/center-for-open-science">Donate</a></li>
2525
</ul>

addon/mixins/commentable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export default Ember.Mixin.create({
8484
*/
8585
reportComment() {
8686
// TODO: Implement
87-
console.log('Consider this comment reported');
87+
// console.log('Consider this comment reported');
8888
}
8989
}
9090
});

addon/mixins/host-app-name.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import config from 'ember-get-config';
2+
import Ember from 'ember';
3+
4+
/**
5+
* @module ember-osf
6+
* @submodule mixins
7+
*/
8+
9+
/**
10+
* This mixin provides an attribute that holds the host app name, and is intended to be used with other ember-osf components.
11+
*
12+
* Sample usage:
13+
* ```
14+
* // components/componentA.js
15+
* import hostAppName from ‘ember-osf/mixins/host-app-name’;
16+
*
17+
* export default Component.extend(hostAppName);
18+
* ```
19+
*
20+
* ```
21+
* // components/ComponentB.js
22+
* import hostAppName from ‘ember-osf/mixins/host-app-name’;
23+
*
24+
* export default Component.extend(hostAppName);
25+
*
26+
* ```
27+
* The above example will result in both component A and component B sharing the same attribute hostAppName.
28+
*
29+
*/
30+
31+
export default Ember.Mixin.create({
32+
/**
33+
* The name of the hosting app is stored in the config/environment.js. Use the package ember-get-config to
34+
* gain access to the app's config file.
35+
* @property {String} hostAppName
36+
*/
37+
hostAppName: config.appName
38+
});

addon/mixins/node-actions.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export default Ember.Mixin.create({
105105
* @param {Boolean} sendEmail Whether user will receive an email when added. "default: true"
106106
* @return {Promise} Returns a promise that resolves to the newly created contributor object.
107107
*/
108-
addContributor(userId, permission, isBibliographic, sendEmail) { // jshint ignore:line
108+
addContributor() {
109109
return this.get('_node').addContributor(...arguments);
110110
},
111111
/**
@@ -116,7 +116,7 @@ export default Ember.Mixin.create({
116116
* @param {Boolean} sendEmail Whether user will receive an email when added. "default: true"
117117
* @return {Promise} Returns a promise that resolves to an array of added contributors
118118
*/
119-
addContributors(contributors, sendEmail) { // jshint ignore:line
119+
addContributors() {
120120
return this.get('_node').addContributors(...arguments);
121121
},
122122
/**
@@ -141,7 +141,7 @@ export default Ember.Mixin.create({
141141
* @return {Promise} Returns a promise that resolves to the updated node
142142
* with edited contributor relationships.
143143
*/
144-
updateContributors(contributors, permissionsChanges, bibliographicChanges) { // jshint ignore:line
144+
updateContributors() {
145145
return this.get('_node').updateContributors(...arguments);
146146
},
147147

@@ -155,7 +155,7 @@ export default Ember.Mixin.create({
155155
* @return {Promise} Returns a promise that resolves to the updated node
156156
* with edited contributor relationships.
157157
*/
158-
updateContributor(contributor, permissions, bibliographic) { // jshint ignore:line
158+
updateContributor() {
159159
return this.get('_node').updateContributor(...arguments);
160160
},
161161
/**

addon/mixins/osf-cookie-login-route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ export default Ember.Mixin.create({
2626

2727
// Block transition until auth attempt resolves. If auth fails, let the page load normally.
2828
return this.get('session').authenticate('authenticator:osf-cookie')
29-
.catch(err => console.log('Authentication failed: ', err));
29+
.catch(err => Ember.Logger.log('Authentication failed: ', err));
3030
}
3131
});

addon/mixins/osf-token-login-route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ export default Ember.Mixin.create({
3535
}
3636

3737
return this.get('session').authenticate('authenticator:osf-token', accessToken)
38-
.catch(err => console.log('Authentication failed: ', err));
38+
.catch(err => Ember.Logger.log('Authentication failed: ', err));
3939
}
4040
});

addon/models/file-version.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ import OsfModel from './osf-model';
1717
*/
1818
export default OsfModel.extend({
1919
size: DS.attr('number'),
20+
dateCreated: DS.attr('date'),
2021
contentType: DS.attr('fixstring')
2122
});

addon/models/preprint-provider.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export default OsfModel.extend({
66
logoPath: DS.attr('string'),
77
bannerPath: DS.attr('string'),
88
description: DS.attr('fixstring'),
9+
domain: DS.attr('string'),
910
example: DS.attr('fixstring'),
1011
advisoryBoard: DS.attr('string'),
1112
emailContact: DS.attr('fixstring'),

addon/serializers/comment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Ember from 'ember';
22
import OsfSerializer from './osf-serializer';
33

44
export default OsfSerializer.extend({
5-
serialize(snapshot, options) { // jshint ignore:line
5+
serialize(snapshot) {
66
// Add relationships field to identify comment target
77
let serialized = this._super(...arguments);
88

addon/serializers/osf-serializer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export default DS.JSONAPISerializer.extend({
104104
return serialized;
105105
},
106106

107-
serializeAttribute(snapshot, json, key, attribute) { // jshint ignore:line
107+
serializeAttribute(snapshot, json, key) {
108108
// In certain cases, a field may be omitted from the server payload, but have a value (undefined)
109109
// when serialized from the model. (eg node.template_from)
110110
// Omit fields with a value of undefined before sending to the server. (but still allow null to be sent)
@@ -114,7 +114,7 @@ export default DS.JSONAPISerializer.extend({
114114
}
115115
},
116116

117-
normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) { // jshint ignore:line
117+
normalizeArrayResponse(store, primaryModelClass, payload) {
118118
// Ember data does not yet support pagination. For any request that returns more than one result, add pagination data
119119
// under meta, and then calculate total pages to be loaded.
120120
let documentHash = this._super(...arguments);

app/mixins/host-app-name.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {default} from 'ember-osf/mixins/host-app-name';

app/mixins/keen-tracker.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
/* eslint-disable no-unused-vars */
12
// This helps ember-browserify find npm modules in ember-cli addons
23

3-
import md5 from 'npm:js-md5'; // jshint ignore:line
4-
import config from 'ember-get-config'; // jshint ignore:line
5-
import _get from 'npm:lodash/get'; // jshint ignore:line
6-
import Cookie from 'npm:js-cookie'; // jshint ignore:line
7-
import keenTracking from 'npm:keen-tracking'; // jshint ignore:line
4+
import md5 from 'npm:js-md5';
5+
import config from 'ember-get-config';
6+
import _get from 'npm:lodash/get';
7+
import Cookie from 'npm:js-cookie';
8+
import keenTracking from 'npm:keen-tracking';
89

910
export {default} from 'ember-osf/mixins/keen-tracker';

blueprints/.jshintrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

blueprints/ember-osf/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*jshint node:true*/
1+
/* eslint-env node */
22
var fs = require('fs');
33
var path = require('path');
44

config/coverage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-env node */
12
'use strict';
23

34
//See https://github.com/kategengler/ember-cli-code-coverage/issues/41

0 commit comments

Comments
 (0)