This repository has been archived by the owner. It is now read-only.
**DEPRECATED & UNMAINTAINED** The payments frontend interface
Switch branches/tags
docker-hub-build gh-pages greenkeeper-babel-core-6.1.2 greenkeeper-babel-core-6.1.4 greenkeeper-babel-core-6.1.18 greenkeeper-babel-core-6.1.19 greenkeeper-babel-core-6.1.20 greenkeeper-babel-core-6.1.21 greenkeeper-babel-core-6.2.0 greenkeeper-babel-core-6.2.1 greenkeeper-babel-core-6.3.2 greenkeeper-babel-core-6.3.13 greenkeeper-babel-core-6.3.17 greenkeeper-babel-core-6.3.21 greenkeeper-babel-core-6.3.26 greenkeeper-babel-core-6.4.0 greenkeeper-babel-core-6.4.5 greenkeeper-babel-core-6.5.0 greenkeeper-babel-core-6.5.1 greenkeeper-babel-core-6.5.2 greenkeeper-babel-core-6.6.0 greenkeeper-babel-core-6.6.4 greenkeeper-babel-core-6.6.5 greenkeeper-babel-core-6.7.0 greenkeeper-babel-core-6.7.2 greenkeeper-babel-core-6.7.4 greenkeeper-babel-core-6.7.5 greenkeeper-babel-core-6.7.6 greenkeeper-babel-core-6.7.7 greenkeeper-babel-core-6.8.0 greenkeeper-babel-core-6.9.0 greenkeeper-babel-core-6.9.1 greenkeeper-babel-core-6.10.4 greenkeeper-babel-core-6.11.4 greenkeeper-babel-core-6.13.0 greenkeeper-babel-core-6.13.1 greenkeeper-babel-core-6.13.2 greenkeeper-babel-core-6.14.0 greenkeeper-babel-core-6.16.0 greenkeeper-babel-core-6.17.0 greenkeeper-babel-core-6.18.0 greenkeeper-babel-core-6.18.1 greenkeeper-babel-core-6.18.2 greenkeeper-babel-eslint-5.0.1 greenkeeper-babel-eslint-6.0.0 greenkeeper-babel-eslint-6.0.1 greenkeeper-babel-eslint-6.0.2 greenkeeper-babel-eslint-6.0.3 greenkeeper-babel-eslint-6.0.4 greenkeeper-babel-eslint-6.0.5 greenkeeper-babel-eslint-6.1.0 greenkeeper-babel-eslint-6.1.1 greenkeeper-babel-eslint-6.1.2 greenkeeper-babel-eslint-7.0.0 greenkeeper-babel-eslint-7.1.0 greenkeeper-babel-loader-5.4.0 greenkeeper-babel-loader-6.1.0 greenkeeper-babel-loader-6.2.0 greenkeeper-babel-loader-6.2.1 greenkeeper-babel-loader-6.2.2 greenkeeper-babel-loader-6.2.3 greenkeeper-babel-loader-6.2.4 greenkeeper-babel-loader-6.2.5 greenkeeper-babel-loader-6.2.6 greenkeeper-babel-loader-6.2.7 greenkeeper-braintree-web-2.22.0 greenkeeper-braintree-web-2.22.1 greenkeeper-braintree-web-2.22.2 greenkeeper-braintree-web-2.23.0 greenkeeper-braintree-web-2.24.0 greenkeeper-braintree-web-2.24.1 greenkeeper-braintree-web-2.25.0 greenkeeper-braintree-web-2.26.0 greenkeeper-braintree-web-2.27.0 greenkeeper-braintree-web-3.0.0 greenkeeper-braintree-web-3.0.1 greenkeeper-braintree-web-3.0.2 greenkeeper-braintree-web-3.1.0 greenkeeper-braintree-web-3.2.0 greenkeeper-braintree-web-3.3.0 greenkeeper-braintree-web-3.4.0 greenkeeper-braintree-web-3.5.0 greenkeeper-card-validator-2.2.8 greenkeeper-card-validator-2.3.0 greenkeeper-card-validator-3.0.0 greenkeeper-classnames-2.2.3 greenkeeper-classnames-2.2.4 greenkeeper-classnames-2.2.5 greenkeeper-cog-style-guide-0.0.3 greenkeeper-connect-fonts-firasans-0.0.5 greenkeeper-connect-fonts-firasans-0.0.6 greenkeeper-eslint-2.2.0 greenkeeper-eslint-2.3.0 greenkeeper-eslint-2.4.0 greenkeeper-eslint-2.5.0 greenkeeper-eslint-2.5.1 greenkeeper-eslint-2.5.2 greenkeeper-eslint-2.5.3 greenkeeper-eslint-2.6.0 greenkeeper-eslint-2.7.0 greenkeeper-eslint-2.8.0 greenkeeper-eslint-2.9.0 greenkeeper-eslint-2.10.0 greenkeeper-eslint-2.10.1 greenkeeper-eslint-2.10.2 greenkeeper-eslint-2.11.0 greenkeeper-eslint-2.11.1 greenkeeper-eslint-2.12.0 greenkeeper-eslint-2.13.0 greenkeeper-eslint-2.13.1 greenkeeper-eslint-3.0.0 greenkeeper-eslint-3.0.1 greenkeeper-eslint-3.1.0 greenkeeper-eslint-3.1.1 greenkeeper-eslint-3.2.0 greenkeeper-eslint-3.2.2 greenkeeper-eslint-3.3.0 greenkeeper-eslint-3.3.1 greenkeeper-eslint-3.5.0 greenkeeper-eslint-3.6.0 greenkeeper-eslint-3.6.1 greenkeeper-eslint-3.7.0 greenkeeper-eslint-3.7.1 greenkeeper-eslint-3.8.0 greenkeeper-eslint-3.8.1 greenkeeper-eslint-3.9.0 greenkeeper-eslint-3.9.1 greenkeeper-eslint-plugin-react-4.2.0 greenkeeper-eslint-plugin-react-4.2.1 greenkeeper-eslint-plugin-react-4.2.2 greenkeeper-eslint-plugin-react-4.2.3 greenkeeper-eslint-plugin-react-4.3.0 greenkeeper-eslint-plugin-react-5.0.0 greenkeeper-eslint-plugin-react-5.0.1 greenkeeper-eslint-plugin-react-5.1.0 greenkeeper-eslint-plugin-react-5.1.1 greenkeeper-eslint-plugin-react-5.2.1 greenkeeper-eslint-plugin-react-5.2.2 greenkeeper-eslint-plugin-react-6.0.0 greenkeeper-eslint-plugin-react-6.1.0 greenkeeper-eslint-plugin-react-6.1.1 greenkeeper-eslint-plugin-react-6.1.2 greenkeeper-eslint-plugin-react-6.2.0 greenkeeper-eslint-plugin-react-6.2.1 greenkeeper-eslint-plugin-react-6.2.2 greenkeeper-eslint-plugin-react-6.4.0 greenkeeper-eslint-plugin-react-6.4.1 greenkeeper-eslint-plugin-react-6.5.0 greenkeeper-eslint-plugin-react-6.6.0 greenkeeper-events-1.1.1 greenkeeper-fecha-1.2.2 greenkeeper-fecha-2.0.0 greenkeeper-fecha-2.2.0 greenkeeper-fecha-2.3.0 greenkeeper-grunt-1.0.0 greenkeeper-grunt-1.0.1 greenkeeper-grunt-concurrent-2.2.1 greenkeeper-grunt-concurrent-2.3.0 greenkeeper-grunt-concurrent-2.3.1 greenkeeper-grunt-contrib-copy-1.0.0 greenkeeper-grunt-contrib-csslint-1.0.0 greenkeeper-grunt-contrib-csslint-2.0.0 greenkeeper-grunt-eslint-18.1.0 greenkeeper-grunt-eslint-19.0.0 greenkeeper-grunt-gh-pages-1.1.0 greenkeeper-grunt-gh-pages-1.2.0 greenkeeper-grunt-gh-pages-2.0.0 greenkeeper-grunt-i18n-abide-0.0.17 greenkeeper-grunt-i18n-abide-0.0.18 greenkeeper-grunt-i18n-abide-0.0.19 greenkeeper-grunt-karma-1.0.0 greenkeeper-grunt-sass-1.2.0 greenkeeper-grunt-sass-1.2.1 greenkeeper-grunt-svg-sprite-1.2.13 greenkeeper-grunt-svg-sprite-1.2.16 greenkeeper-grunt-svg-sprite-1.2.19 greenkeeper-grunt-svg-sprite-1.3.0 greenkeeper-grunt-svg-sprite-1.3.1 greenkeeper-grunt-svg-sprite-1.3.2 greenkeeper-grunt-svg-sprite-1.3.3 greenkeeper-grunt-svg-sprite-1.3.4 greenkeeper-grunt-svg-sprite-1.3.5 greenkeeper-grunt-svg-sprite-1.3.6 greenkeeper-grunt-webpack-1.0.12 greenkeeper-grunt-webpack-1.0.13 greenkeeper-grunt-webpack-1.0.14 greenkeeper-grunt-webpack-1.0.15 greenkeeper-grunt-webpack-1.0.16 greenkeeper-grunt-webpack-1.0.17 greenkeeper-grunt-webpack-1.0.18 greenkeeper-jquery-2.2.2 greenkeeper-jquery-2.2.3 greenkeeper-jquery-2.2.4 greenkeeper-jquery-3.0.0 greenkeeper-jquery-3.1.0 greenkeeper-jquery-3.1.1 greenkeeper-karma-0.13.22 greenkeeper-karma-1.0.0 greenkeeper-karma-1.1.0 greenkeeper-karma-1.1.1 greenkeeper-karma-1.1.2 greenkeeper-karma-1.2.0 greenkeeper-karma-1.3.0 greenkeeper-karma-firefox-launcher-1.0.0 greenkeeper-karma-mocha-0.2.1 greenkeeper-karma-mocha-0.2.2 greenkeeper-karma-mocha-1.0.1 greenkeeper-karma-mocha-1.1.0 greenkeeper-karma-mocha-1.1.1 greenkeeper-karma-mocha-1.2.0 greenkeeper-karma-mocha-1.3.0 greenkeeper-karma-mocha-reporter-1.2.3 greenkeeper-karma-mocha-reporter-1.3.0 greenkeeper-karma-mocha-reporter-2.0.0 greenkeeper-karma-mocha-reporter-2.0.1 greenkeeper-karma-mocha-reporter-2.0.2 greenkeeper-karma-mocha-reporter-2.0.3 greenkeeper-karma-mocha-reporter-2.0.4 greenkeeper-karma-mocha-reporter-2.0.5 greenkeeper-karma-mocha-reporter-2.1.0 greenkeeper-karma-mocha-reporter-2.2.0 greenkeeper-karma-sauce-launcher-0.3.1 greenkeeper-karma-sauce-launcher-1.0.0 greenkeeper-karma-sauce-launcher-1.1.0 greenkeeper-karma-sinon-1.0.5 greenkeeper-karma-sourcemap-loader-0.3.7 greenkeeper-karma-webpack-1.8.0 greenkeeper-load-grunt-configs-1.0.0 greenkeeper-load-grunt-tasks-3.4.1 greenkeeper-load-grunt-tasks-3.5.0 greenkeeper-load-grunt-tasks-3.5.1 greenkeeper-load-grunt-tasks-3.5.2 greenkeeper-lodash.defaults-4.1.0 greenkeeper-lodash.defaults-4.2.0 greenkeeper-lodash.merge-4.3.1 greenkeeper-lodash.merge-4.3.2 greenkeeper-lodash.merge-4.3.3 greenkeeper-lodash.merge-4.3.4 greenkeeper-lodash.merge-4.3.5 greenkeeper-lodash.merge-4.4.0 greenkeeper-lodash.merge-4.5.0 greenkeeper-lodash.merge-4.5.1 greenkeeper-lodash.merge-4.6.0 greenkeeper-mocha-2.3.3 greenkeeper-mocha-2.3.4 greenkeeper-mocha-2.4.1 greenkeeper-mocha-2.4.2 greenkeeper-mocha-2.5.0 greenkeeper-mocha-2.5.1 greenkeeper-mocha-2.5.2 greenkeeper-mocha-2.5.3 greenkeeper-mocha-3.0.0 greenkeeper-mocha-3.0.1 greenkeeper-mocha-3.0.2 greenkeeper-mocha-3.1.0 greenkeeper-mocha-3.1.1 greenkeeper-mocha-3.1.2 greenkeeper-node-libs-browser-1.0.0 greenkeeper-normalize.css-4.1.0 greenkeeper-normalize.css-4.1.1 greenkeeper-normalize.css-4.2.0 greenkeeper-payment-icons-0.0.8 greenkeeper-payment-icons-0.0.9 greenkeeper-payment-icons-0.0.10 greenkeeper-payment-icons-0.0.11 greenkeeper-payment-icons-0.0.12 greenkeeper-react-0.14.0 greenkeeper-react-0.14.3 greenkeeper-react-0.14.4 greenkeeper-react-0.14.5 greenkeeper-react-0.14.7 greenkeeper-react-0.14.8 greenkeeper-react-15.0.0 greenkeeper-react-15.0.1 greenkeeper-react-15.0.2 greenkeeper-react-15.1.0 greenkeeper-react-15.2.0 greenkeeper-react-15.2.1 greenkeeper-react-15.3.0 greenkeeper-react-15.3.1 greenkeeper-react-15.3.2 greenkeeper-react-json-table-0.0.4 greenkeeper-react-json-table-0.1.0 greenkeeper-react-json-table-0.1.1 greenkeeper-react-maskedinput-3.1.0 greenkeeper-react-maskedinput-3.1.1 greenkeeper-react-maskedinput-3.1.2 greenkeeper-react-maskedinput-3.1.3 greenkeeper-react-maskedinput-3.2.0 greenkeeper-react-maskedinput-3.2.1 greenkeeper-react-maskedinput-3.2.2 greenkeeper-react-maskedinput-3.2.3 greenkeeper-react-maskedinput-3.2.4 greenkeeper-react-maskedinput-3.3.0 greenkeeper-react-redux-3.0.1 greenkeeper-react-redux-3.1.1 greenkeeper-react-redux-4.0.0 greenkeeper-react-redux-4.0.1 greenkeeper-react-redux-4.0.2 greenkeeper-react-redux-4.0.3 greenkeeper-react-redux-4.0.4 greenkeeper-react-redux-4.0.5 greenkeeper-react-redux-4.2.1 greenkeeper-react-redux-4.3.0 greenkeeper-react-redux-4.4.0 greenkeeper-react-redux-4.4.1 greenkeeper-react-redux-4.4.2 greenkeeper-react-redux-4.4.3 greenkeeper-react-redux-4.4.4 greenkeeper-react-redux-4.4.5 greenkeeper-redux-3.4.0 greenkeeper-redux-3.5.0 greenkeeper-redux-3.5.1 greenkeeper-redux-3.5.2 greenkeeper-redux-3.6.0 greenkeeper-redux-thunk-1.0.2 greenkeeper-redux-thunk-2.0.0 greenkeeper-redux-thunk-2.0.1 greenkeeper-redux-thunk-2.1.0 greenkeeper-sinon-1.17.3 greenkeeper-sinon-1.17.4 greenkeeper-sinon-1.17.5 greenkeeper-sinon-1.17.6 greenkeeper-update-all greenkeeper-webpack-1.12.15 greenkeeper-webpack-1.13.0 greenkeeper-webpack-1.13.1 greenkeeper-webpack-1.13.2 greenkeeper-webpack-1.13.3 greenkeeper-webpack-dev-server-1.13.0 greenkeeper-webpack-dev-server-1.14.1 greenkeeper-webpack-dev-server-1.15.0 greenkeeper-webpack-dev-server-1.15.1 greenkeeper-webpack-dev-server-1.16.0 greenkeeper-webpack-dev-server-1.16.1 greenkeeper-webpack-dev-server-1.16.2 greenkeeper master redux
Nothing to show
Clone or download
tofumatt Merge pull request #725 from mozilla/greenkeeper-fecha-2.1.0
Update fecha to version 2.1.0 🚀
Latest commit 5cd67c4 Mar 27, 2016

README.md

No Maintenance Intended Build Status Dependency Status devDependency Status

Note This project is no longer maintained.

Sauce Test Status

Note Sauce Labs tests are only run on PRs from the main repo or commits to master.

Payments UI

This project comprises all styles, behaviour and interfaces for mozilla/payments.

Grunt tasks

Run tasks with grunt e.g. grunt watch-static or grunt serve.

Task name Description
build build all CSS/JS files for deployment
serve watch CSS/JS for changes; serves static files via webpack dev server to enable hot module reloading
test run tests locally
test-sauce run full Sauce Labs test suite
watch-email watch email-specific static files for changes; updates CSS/JS on change
watch-static watch files for changes; updates CSS/JS on change

Developers

Email Styles

To get the right paths for the email CSS and rebuild files as they change run:

DEV=1 grunt watch-email

Dependency installation and updates

Install grunt-cli globally with npm install -g grunt-cli. Then run npm install to install the local deps needed for development.

Dependencies are automatically kept up-to-date using greenkeeper.

npm deps only

We're aiming to only use npm packaged deps rather than bower. This is to be able to track dep versions in one place.

Libraries + external deps

Normally built artifacts aren't committed. However, to manage dep changes more tightly, production libs (JS, CSS + fonts) are committed to the tree.

JS libs are committed from node_modules as webpack knows how to find deps in node_modules.

Whilst this creates noise it does help ensure deps in the browser are identical and can't get mangled by a broken deps installation.

dealing with bower

Unfortunately some deps only work with bower. For these cases, make sure bower.json has the package name and version, run bower install, and commit the distributed files to public/bower_components. Hopefully these cases will be rare.

Watching for file changes in development.

If you're using payments-env to run the complete payments system then you'll want to use grunt watch-static on your host to watch for file changes. In other words, start docker to run all the things but keep a shell open on the host machine just to compile static assets for the docker VM to serve.

Hot module reloading

If you run the webpack-dev-server you can get hot module reloading. This turns on a feature where the code automatically updates in the browser as you change the code in your editor.

For example run grunt serve to run the webpack-dev-server.

And then visit:

http://localhost:8080/webpack-dev-server/management.html

You should find that changes to the react modules are reflected immediately without refresh. Read on if you want to also interact with the API server.

Developing with webpack-dev-server + docker for hot reloading.

If you are running the full stack with payments-env then you'll also be able to interact with the API when using hot reloading.

First, create an /etc/hosts entry like 127.0.0.1 pay.webpack so that you can access your webpack server on a predictable host.

To see the purchase interface with hot module loading enabled visit the example site at:

http://pay.dev?webpack

To see the management interface:

http://pay.webpack:8080/webpack-dev-server/management.html

JavaScript Linting

We're using eslint for JavaScript linting. Most editors will have instructions for enabling eslint (see below for how to configure vim + syntastic). Alternatively just run the grunt eslint command which is self-contained.

Eslint Vim settings (Syntastic)

You'll need the packages listed below installed globally:

npm install -g eslint babel-eslint eslint-plugin-react

Using syntastic, the following snippet turns on eslint selectively for projects with a .eslintrc.

autocmd FileType javascript let b:syntastic_checkers = findfile('.eslintrc', '.;') != '' ? ['eslint'] : ['jshint']

Tests

To run the tests locally run: grunt test. This will run the unit tests against Firefox.

Cross-browser testing

The tests are run only on Firefox when a PR is submitted. When that code is landed on master, Travis will run the tests on Sauce Labs.

Running Sauce Labs on a PR [Team Only]

If you're a member of the payments team and you want to get Sauce Labs coverage for a PR - push the branch to the main mozilla/payments-ui repo and make a PR from that.

Running the tests on SauceLabs locally

First Sign-up for a Sauce Labs 'Open Sauce' account to get your keys.

Then you'll need to export the SauceLabs username and access key as env vars:

export SAUCE_USERNAME=<YOUR_OPEN_SAUCE_USERNAME>
export SAUCE_ACCESS_KEY=<YOUR_ACCESS_KEY>

Then you should find you can run: grunt karma:sauce and run all the tests on SauceLabs.

Styleguide

The styleguide is based on the styles and templates that live in the tree.

It can be build statically with the grunt build-styleguide command.

The styleguide is published here.

Updating the styleguide

Run grunt publish-styleguide

Running the styleguide locally

Run grunt styleguide (defaults to running on localhost:4001).

Localization (l10n)

We're using grunt-i18n-abide to run the extraction commands.

Because we're using React we need to operate on the compiled JS file. This also means we aren't running extraction on un-used code.

To run an extraction, checkout out the payments-l10n repository so that it has the same parent directory as payments-ui (../payments-l10n from the current location). Then do the following:

npm install
grunt webpack abideExtract