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
| export default function(ComposedComponent) { | |
| let displayName = ComposedComponent.displayName || ComposedComponent.name; | |
| @nuclearComponent({ | |
| formState: FormGetters.formState, | |
| formValidation: FormGetters.formValidation | |
| }) | |
| @provideContextDec({ | |
| Actions: PropTypes.object.isRequired, | |
| formId: PropTypes.string.isRequired |
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
| var checkComplexPassword = function(password) { | |
| var CHAR_LOWERS = /[a-z]/, | |
| CHAR_UPPERS = /[A-Z]/, | |
| CHAR_NUMBERS = /[0-9]/, | |
| CHAR_SPECIAL = /[?=.*!@#$%^&*]/, | |
| CHAR_TYPES = [CHAR_LOWERS,CHAR_UPPERS,CHAR_NUMBERS,CHAR_SPECIAL], | |
| counter = 4; | |
| for (var i=0; i<CHAR_TYPES.length; i++){ | |
| if(!CHAR_TYPES[i].test(password)){ |
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
| let mockNuclearDec = mockNuclearComponent({formState, formValidation}); | |
| HigherOrderInput.__Rewire__('nuclearComponent', mockNuclearDec); | |
| let HigherOrderComponent = HigherOrderInput(Input); | |
| let hoc = TestUtils.renderIntoDocument( | |
| <HigherOrderComponent {...mockProps} /> | |
| ); | |
| let hocElm = React.findDOMNode(hoc); | |
| let inputObj = TestUtils.findRenderedDOMComponentWithClass(hoc, 'one'); |
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
| //input type => Array | |
| var exInput = [ | |
| { | |
| name: 'first_name', | |
| type: 'text', | |
| value: 'burritos', | |
| validation: { | |
| customType: 'email', | |
| conditions: /stuff/ | |
| } |
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
| ▶ tree -h --dirsfirst ./js | |
| ./js | |
| ├── [ 680] common-modules | |
| │ ├── [ 510] auth | |
| │ │ ├── [ 12K] api.js | |
| │ │ ├── [ 763] constants.js | |
| │ │ ├── [6.3K] donation-history.js | |
| │ │ ├── [2.4K] facebook.js | |
| │ │ ├── [2.3K] google.js | |
| │ │ ├── [ 623] index.js |
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, {Component, PropTypes} from 'react'; | |
| import {provideReactor} from 'nuclear-js-react-addons'; | |
| import cx from 'classnames'; | |
| import Form from './form'; | |
| import Input from './form-input'; | |
| import Label from './form-label'; | |
| @provideReactor({ | |
| Actions: PropTypes.object.isRequired | |
| }) |
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 { Store, toImmutable } from 'nuclear-js'; | |
| import {OPEN, CLOSE} from './modal-constants'; | |
| export const isOpenStore = Store({ | |
| getInitialState() { | |
| return false; | |
| }, | |
| initialize() { | |
| // Sets isOpen to true |
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
| #### spec | |
| function testCanCompleteInformationForm(){ | |
| return client.waitForVisible('#id_phone', 2000).then(() => { | |
| return client.setValue('#id_donate_givenName', 'First') | |
| .setValue('#id_donate_familyName', 'Last') | |
| .setValue('#id_donate_address1', 'Address 1') | |
| .setValue('#id_donate_city', 'City') | |
| .selectByValue('#id_donate_state', 'NY') | |
| .setValue('#id_donate_zip', '11201') | |
| .setValue('#id_donate_email', 'info@hillaryclinton.com') |
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
| ###############Speaking Points##################### | |
| - our current eslint config and relation to Gulp and Webpack | |
| - 'use-strict' and babel | |
| - suggested rules https://docs.google.com/spreadsheets/d/1n_6MLaKUOJ1An-VCLHMuoTP1RZfhRsXQoVQArQRFYTA/edit#gid=0 | |
| - variable decalaration, hoising, block scoping | |
| - comments for specific rules in files, i.e. /*global google*/ => const google = window.google | |
| - a couple cool rules | |
| - http://eslint.org/docs/rules/one-var | |
| - ahhhhh...there's so many https://github.com/airbnb/javascript/blob/master/linters/.eslintrc | |
| - process |
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 {join} from 'path'; | |
| import webpack from 'webpack'; | |
| import {merge} from 'lodash'; | |
| import WebpackDevServer from 'webpack-dev-server'; | |
| import makeConfig from './make-config'; | |
| export default function(gulp, plugins, config) { | |
| var {ENV, site, port} = config; | |
| var {gutil, browserSync} = plugins; | |
| const isDev = ENV === 'DEV'; |