Skip to content

Instantly share code, notes, and snippets.

View aaronmcadam's full-sized avatar
🎉
Having fun!

Aaron McAdam aaronmcadam

🎉
Having fun!
View GitHub Profile
/**
* Formats a list of Aggregates
* formatAggregates :: [Aggregate] -> [Aggregate]
* @param {Array<Object>} aggregates
* @returns {Array<Object>}
*/
const formatAggregates = aggregates => (
...
)
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({
/**
* 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,
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));
});
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 });
});
/**
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(),
import React, { Component, PropTypes } from 'react';
class UserNav extends Component {
constructor(props) {
super(props);
this.state = { showMenu: false };
this.toggleMenu = this.toggleMenu.bind(this);
}
toggleMenu() {
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')
);
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}/
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