This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Formats a list of Aggregates | |
* formatAggregates :: [Aggregate] -> [Aggregate] | |
* @param {Array<Object>} aggregates | |
* @returns {Array<Object>} | |
*/ | |
const formatAggregates = aggregates => ( | |
... | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetchResponse = (responseId, projectId) => ( | |
callBizApi(getEndpoints(responseId)) | |
.then(initialData => { | |
const response = initialData.response; | |
const taskId = response.taskId; | |
const participantId = response.participant.id; | |
return callBizApi(getRelationEndpoints(projectId, taskId, participantId)) | |
.then(relationData => ( | |
mapResponse({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns a Comparison of 2 Tasks | |
* @param {string} projectId the Project ID | |
* @param {Array<string>} taskIds a list of Task IDs | |
* @returns {Promise<Object>} | |
*/ | |
const fetchComparison = (projectId, leftTaskId, rightTaskId) => ( | |
new Promise(resolve => ( | |
R.composeP( | |
resolve, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express'; | |
import fetchAttributes from '../services/attributes'; | |
/* eslint new-cap: "off" */ | |
const router = express.Router(); | |
router.route('/tasks/:taskId/attributes') | |
.get((req, res) => { | |
fetchAttributes(req.params.taskId).then(responses => res.json(responses)); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { curry } from 'ramda'; | |
const makeRequest = curry((endpoint, tokenResponse) => { | |
const token = bizApi.accessToken.create(tokenResponse); | |
const accessToken = token.token.access_token; | |
return bizApi.api('GET', endpoint, { access_token: accessToken }); | |
}); | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MultiCode = ({ interview, options, dispatchChange }) => { | |
const currentOptions = () => ( | |
getCurrentOptions(interview.selections.value, options) | |
); | |
const addValues = (selectedOptions) => { | |
dispatchChange(selectedOptions.map(option => ({ optionId: option.id }))); | |
}; | |
const updateForm = (optionIsSelected, option) => { | |
const selectedOptions = mapOptions( | |
currentOptions(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Router, browserHistory } from 'react-router'; | |
import routes from './routes'; | |
ReactDOM.render( | |
<Router history={browserHistory} routes={routes} />, | |
document.querySelector('.container') | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
page.response_headers['Content-Type'].should == "application/gpx+xml" | |
page.response_headers['Content-Disposition'].should =~ /attachment/ | |
page.response_headers['Content-Disposition'].should =~ /#{@route.gpx_file_name}/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "feature_spec_helper" | |
RSpec.feature "Participant completes an Interview" do | |
PROJECT_ID = 94 # Interview Project | |
INTERVIEW_ID = 341 # Interview Task | |
INTERVIEW_TASK_LIST_ID = 109 # Blanks | |
scenario "viewing the Interview" do | |
sign_in_and_visit_interview |