This file contains 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('dotenv').config(); | |
const { startWithCleanDb } = require('../../../utils/test.helpers'); | |
const { add } = require('../invitation.service'); | |
const { ADMIN_LEVELS, TABLES } = require('../../../constants'); | |
const { AuthorizationError } = require('../../../errors'); | |
const knex = require('../../../../db/connection'); | |
jest.mock('../../../mailer'); | |
const { sendUserInvitationMail } = require('../../../mailer'); |
This file contains 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
componentWillReceiveProps(nextProps) { | |
if (nextProps.isOpen && !this.props.isOpen) { | |
this.props.getSuperTestruns(this.props.superDispatchName); | |
} | |
} |
This file contains 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, { Component } from 'react' | |
import PropTypes from 'prop-types' | |
import { | |
ListGroup, | |
ListGroupItem, | |
Input, | |
Label, | |
FormGroup | |
} from 'reactstrap' | |
import { Link } from 'react-router-dom' |
This file contains 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('babel-register')(); | |
const jsdom = require('jsdom'); | |
const { JSDOM } = jsdom; | |
const exposedProperties = ['window', 'navigator', 'document']; | |
const { document } = (new JSDOM('')).window; | |
global.document = document; | |
global.window = document.defaultView; |
This file contains 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 _ = require('lodash'); | |
const debug = require('debug')('fixapi:utils:http'); | |
const errors = require('../../utils/error'); | |
/** | |
* # http | |
* | |
* Wrapper for all API functions. Wraps the API method so that it receives the data from the request. | |
* And formats a JSON response depending on the result or error. | |
* |
This file contains 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 PropTypes from 'prop-types' | |
import { Card, CardTitle } from 'material-ui/Card' | |
export const FeatureCard = ({ color, title, subtitle, icon }) => { | |
const styles = { | |
card: { borderLeft: `solid 4px ${color}`, flex: '1', marginRight: '1em' }, | |
icon: { float: 'right', width: 64, height: 64, padding: 16, color }, | |
}; | |
return (<Card style={styles.card} > |
This file contains 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, { PropTypes } from 'react' | |
import { Route, Redirect } from 'react-router-dom' | |
import { connect } from 'react-redux' | |
import { createStructuredSelector } from 'reselect' | |
import { selectLoggedIn } from '../User/selectors' | |
export const PrivateRoute = ({ component, ...rest, loggedIn }) => ( | |
<Route {...rest} render={props => ( | |
loggedIn ? ( | |
React.createElement(component, props) |
This file contains 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
function* bar() { | |
yield delay(10000); | |
console.log('ok'); | |
} | |
function* foo() { | |
while(true) { | |
yield take(SOME_ACTION); | |
yield bar; | |
} |
This file contains 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 'whatwg-fetch'; | |
import { validTokenPresent } from './checkAuth' | |
import { take, fork, cancel, call, put, cancelled, select } from 'redux-saga/effects' | |
function parseJSON(response) { | |
return response.json(); | |
} | |
function checkStatus(response) { |
This file contains 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
export function putToS3(file, signedRequest) { | |
return new Promise((resolve, reject) => { | |
const xhr = new XMLHttpRequest(); | |
xhr.open('PUT', signedRequest); | |
xhr.setRequestHeader('x-amz-acl', 'public-read'); | |
xhr.onload = () => { | |
if (xhr.status === 200) { | |
resolve('ok'); | |
} | |
}; |
NewerOlder