Skip to content

Commit dafb14f

Browse files
committed
Merge branch 'release/0.5.0'
2 parents 732db79 + 0c1fd07 commit dafb14f

114 files changed

Lines changed: 10732 additions & 70 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@ charset = utf-8
1111
trim_trailing_whitespace = true
1212
insert_final_newline = true
1313
indent_style = space
14-
indent_size = 2
14+
indent_size = 4
1515

1616
[*.js]
1717
indent_style = space
18-
indent_size = 2
18+
indent_size = 4
1919

2020
[*.hbs]
2121
insert_final_newline = false
2222
indent_style = space
23-
indent_size = 2
23+
indent_size = 4
2424

2525
[*.css]
2626
indent_style = space
27-
indent_size = 2
27+
indent_size = 4
2828

2929
[*.html]
3030
indent_style = space
31-
indent_size = 2
31+
indent_size = 4
3232

3333
[*.{diff,md}]
3434
trim_trailing_whitespace = false

.env-travis

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
OSF_CLIENT_ID=CLIENT_ID>
2+
OSF_SCOPE=osf.users.all_read
3+
OSF_URL=https://staging.osf.io
4+
OSF_AUTH_URL=https://staging-accounts.osf.io
5+
6+
JAMDB_URL=https://staging-metadata.osf.io
7+
EXPERIMENT_ID=<STUDY_ID>

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Refs: https://openscience.atlassian.net/browse/LEI-
2+
3+
## Purpose
4+
5+
6+
## Summary of changes
7+
8+
9+
## Testing notes
10+

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,17 @@
1515
/libpeerconnection.log
1616
npm-debug.log
1717
testem.log
18+
/scripts/credentials/*
19+
20+
# local configuration
21+
.env
22+
.env-local
23+
env
24+
25+
# Misc
26+
/scripts/*.json
27+
/scripts/*.csv
28+
29+
/scripts/consent_forms/*csv
30+
/scripts/consent_forms/**
31+
!/scripts/consent_forms/test.csv

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "lib"]
2+
path = lib
3+
url = https://github.com/CenterForOpenScience/exp-addons.git

.jshintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
"strict": false,
2828
"white": false,
2929
"eqnull": true,
30-
"esnext": true,
30+
"esversion": 6,
3131
"unused": true
3232
}

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
language: node_js
33
node_js:
4-
- "4"
4+
- "4.6.0"
55

66
sudo: false
77

@@ -10,9 +10,11 @@ cache:
1010
- node_modules
1111

1212
before_install:
13+
- cp .env-travis .env
14+
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
1315
- npm config set spin false
16+
- npm install -g npm@^2
1417
- npm install -g bower
15-
- npm install phantomjs-prebuilt
1618

1719
install:
1820
- npm install

NOTICE

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ISP uses some third-party code.
2+
3+
4+
locale-utils adapted from ember-i18n internals code
5+
====================================================
6+
## Copyright and license
7+
8+
Copyright 2011 James A. Rosen
9+
10+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
11+
You may obtain a copy of the License at
12+
13+
http://www.apache.org/licenses/LICENSE-2.0
14+
15+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations under the License.

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,47 @@ You will need the following things properly installed on your computer.
2020
* `npm install`
2121
* `bower install`
2222

23+
### Install submodule dependencies
24+
25+
```bash
26+
cd lib
27+
git submodule init
28+
git submodule update
29+
```
30+
31+
You may need to run the npm and bower install commands in `lib/exp-player` and `lib/exp-models` as well.
32+
2333
## Running / Development
2434

35+
Setup instructions are broadly derived from those of the [experimenter addon](https://github.com/CenterForOpenScience/experimenter/).
36+
For most use cases, it should be possible to run against a remote installation of JamDB. The instructions below assume a staging server,
37+
`https://staging-metadata.osf.io`.
38+
39+
To login via OSF:
40+
* create .env file in top directory
41+
* in .env file include:
42+
* OSF_CLIENT_ID=\<client ID for staging account\>
43+
* OSF_SCOPE="osf.users.all_read"
44+
* OSF_URL="https://staging.osf.io"
45+
* OSF_AUTH_URL=https://staging-accounts.osf.io
46+
* JAMDB_URL=https://staging-metadata.osf.io
47+
* EXPERIMENT_ID=\<jam db document ID referencing the desired ISP study\>
48+
49+
* Find jam db document id at: https://staging-experimenter.osf.io/experiments/ (this is the EXPERIMENT_ID)
50+
* Create a new participant at https://staging-experimenter.osf.io/participants
51+
* Study ID: test
52+
* Participant ID: <look in the downloaded csv file>
53+
54+
Then run the ember application:
55+
2556
* `ember server`
2657
* Visit your app at [http://localhost:4200](http://localhost:4200).
2758

59+
### Trying an experiment
60+
Once the app is started, you will need to log in. Provide a study ID and participant ID.
61+
These are human readable strings as defined by the researchers, and are available on request (not committed to Github).
62+
There may be different study IDs to test conditions at different times of day.
63+
2864
### Code Generators
2965

3066
Make use of the many generators for code, try `ember help generate` for more details

app/authenticators/jam-jwt.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import Ember from 'ember';
2+
import ExpJamJwtAuthenticator from 'exp-models/authenticators/jam-jwt';
3+
4+
export default ExpJamJwtAuthenticator.extend({
5+
raven: Ember.inject.service(),
6+
7+
_captureUser(username) {
8+
this.get('raven').callRaven('setUserContext', { id: username });
9+
},
10+
11+
restore(data) {
12+
return this._super(data).then((res) => {
13+
this._captureUser(res.id);
14+
return res;
15+
});
16+
},
17+
18+
authenticate(attrs, token) {
19+
return this._super(attrs, token).then((res) => {
20+
this._captureUser(res.id);
21+
return res;
22+
});
23+
}
24+
25+
});

0 commit comments

Comments
 (0)