Skip to content

Commit b2a0b05

Browse files
author
Jeff Mataya
committed
Merge branch 'master' into customer/top-drawer
2 parents 33ef008 + d080443 commit b2a0b05

387 files changed

Lines changed: 4042 additions & 5245 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# Keys
1414
ashes/public_key.pem
1515
.env.local
16+
/foxcomm-staging.json
1617

1718
# target folder
1819
middlewarehouse/consumers/shipstation/shipstation-consumer

README.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ will have been created. You can exit the VM.
5252
The appliance VM (a single VM containing all services) can be run either on your
5353
local environment through VirtualBox or VMWare Fusion, or in the cloud through
5454
Google Compute Engine. If you have sufficient hardware resources, a local VM
55-
will give you the most flexibility and performance.
55+
will give you the most flexibility and performance. Currently, the VM is
56+
configured to use 8 GB of memory and 4 vCPUs, so it’s not worth trying unless
57+
you have 12+ GB of RAM.
5658

5759
**Local VM**
5860

@@ -115,17 +117,5 @@ Edit your hosts file so that `local.foxcommerce.com` points to the new box using
115117
| [ashes](ashes) | The Admin UI, written in React.js. |
116118
| [api-js](api-js) | A JavaScript library for interacting with the FoxCommerce API. |
117119
| [firebrand](firebrand) | A demo storefront used to show off the capabilities of FoxCommerce APIs. |
118-
| [integration-tests](integration-tests) | Our tests for hitting the system as a black box at the API level. |
119120
| [prov-shit](prov-shit) | All of our DevOps tools for deploying the application to both development and production. |
120121
| [api-docs](api-docs) | Our API documentation in API Blueprint format and Postman query collections. |
121-
122-
## Usage
123-
124-
### Updating from Upstream
125-
126-
Updating from upstream will pull in all commits on each project's `master`
127-
branch. All commit history in each repository will be cloned into this repo.
128-
129-
```
130-
$ make update
131-
```

ashes/.flowconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
[libs]
3030
src/interfaces/
31+
src/interfaces/paragons/
3132

3233
[options]
3334
unsafe.enable_getters_and_setters=true

ashes/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ logs
66
pids
77
*.pid
88
*.seed
9+
.git-rev
910

1011
# Directory for precompiled es7 sources
1112
lib

ashes/Makefile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,24 @@ run-staging: setup stop
3838
run-production: setup stop
3939
export NODE_ENV=production; nohup ./node_modules/.bin/gulp server 2>&1 &
4040

41+
hooks:
42+
./node_modules/.bin/gulp hooks
43+
44+
rev:
45+
git describe --always | cat > .git-rev
46+
47+
dev d: rev
48+
test -f .env && export eval `cat .env` || true && ./node_modules/.bin/gulp dev
49+
50+
prod p:
51+
test -f .env && export eval `cat .env` || true && NODE_ENV=production ./node_modules/.bin/gulp build
52+
test -f .env && export eval `cat .env` || true && NODE_ENV=production node boot.js
53+
4154
build-dev: setup
4255
./node_modules/.bin/flow check
4356
test -f .env && export eval `cat .env` || true && ON_SERVER=true ./node_modules/.bin/gulp build
4457

45-
build:
58+
build: rev
4659
$(call header, Building)
4760
make setup
4861
./node_modules/.bin/flow check
@@ -57,4 +70,4 @@ docker-push:
5770
docker tag $(DOCKER_TAG) $(DOCKER_REPO)/$(DOCKER_TAG):$(DOCKER_BRANCH)
5871
docker push $(DOCKER_REPO)/$(DOCKER_TAG):$(DOCKER_BRANCH)
5972

60-
.PHONY: build test test-cov tag docker docker-push
73+
.PHONY: hooks rev dev d prod p build test test-cov tag docker docker-push

ashes/README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* node
66

77
5.1.0 or above is required version for Ashes.
8-
To install this or anothers versions of node you can use [nvm](https://github.com/creationix/nvm) or [n](https://github.com/tj/n) node version manager.
8+
To install this or anothers versions of node you can use [brew](http://brew.sh), [nvm](https://github.com/creationix/nvm) or [n](https://github.com/tj/n) node version manager.
99

1010
If using nvm, run the following to install the version listed in `.nvmrc`. For example, if using node `v5.1.0`, follow these commands:
1111

@@ -40,16 +40,25 @@ npm install
4040

4141
### Get certificate to communicate with Phoenix
4242

43-
You can clone `prov-shit` repository and use `${PROV_SHIT_HOME}/ansible/roles/secret_keys/files/public_key.pem`. It is encrypted by ansible and you'll have to decrypt it.
43+
You can clone `prov-shit` repository and use `${PROV_SHIT_HOME}/ansible/roles/secret_keys/files/public_key.pem`. It is encrypted by ansible and you'll have to decrypt it. Add it to `.env` file: `export PHOENIX_PUBLIC_KEY=${PATH_TO_KEY}`.
44+
45+
or just add `export DEV_SKIP_JWT_VERIFY=1` to `.env` file for non-production usage.
4446

4547
### Run the dev server
4648

4749
```
48-
PHOENIX_PUBLIC_KEY=${PATH_TO_KEY} npm run dev
50+
make d
4951
```
5052

51-
By default, gulp run tests before starting node-server, but you can define env variable ASHES_NO_TEST_FOR_DEV
52-
for disable this behaviour.
53+
By default, gulp run tests before starting node-server, but you can define env variable `ASHES_NO_TEST_FOR_DEV`
54+
for disable this behaviour. Also, see `ASHES_NO_WATCH_FOR_TEST`:
55+
56+
```
57+
# disable watching of test files
58+
export ASHES_NO_WATCH_FOR_TEST=1
59+
# disable all tests while developing
60+
export ASHES_NO_TEST_FOR_DEV=1
61+
```
5362

5463
Also gulp can notify you about tasks completion if env variable ASHES_NOTIFY_ABOUT_TASKS is defined.
5564

@@ -59,33 +68,36 @@ or completely override watchify options via `.watchifyrc` file in project root.
5968
### Pointing to Phoenix
6069

6170
By default, Ashes looks locally for phoenix and ElasticSearch `http://localhost`. If you want to change
62-
which phoenix and ES Ashes uses, you can set the `API_URL` environment variable.
71+
which phoenix and ES Ashes uses, you can set the `API_URL` environment variable `export API_URL=...` to `.env` file.
6372

6473
```
6574
export API_URL=http://10.240.0.3
6675
npm run dev
6776
```
6877

78+
### Run the production server
79+
80+
```
81+
make p
82+
```
83+
6984
### Stripe.js
7085

7186
In order to Stripe.js to work (used for creating credit cards in Stripe) you need to provide publishable key for stripe (https://stripe.com/docs/stripe.js#setting-publishable-key)
72-
You can set Stripe key by exporting `STRIPE_PUBLISHABLE_KEY` variable, or setting it in your `.env` file if you're using foreman, or run dev command with it:
87+
You can set Stripe key by exporting `STRIPE_PUBLISHABLE_KEY` variable, or setting it in your `.env`:
7388

7489
`export STRIPE_PUBLISHABLE_KEY=pk_test_r6t0niqmG9OOZhhaSkacUUU1`
7590

76-
`STRIPE_PUBLISHABLE_KEY=pk_test_r6t0niqmG9OOZhhaSkacUUU1 npm run dev`
77-
78-
7991
### Git Hooks
8092

8193
If you want to setup some Git hooks, run the following:
8294

8395
```
84-
./node_modules/.bin/gulp hooks
96+
make hooks
8597
```
8698

8799
Now, installed hook runs tests and prevents push if they haven't passed.
88-
If you prefer skip test run on each file change you can define env variable ASHES_NO_WATCH_FOR_TEST.
100+
If you prefer skip test run on each file change you can define env variable `ASHES_NO_WATCH_FOR_TEST`.
89101

90102
### Vagrant setup
91103

ashes/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"contributors": "https://github.com/FoxComm/highlander/graphs/contributors",
3939
"homepage": "https://github.com/FoxComm/highlander#readme",
4040
"dependencies": {
41-
"@foxcomm/wings": "^1.7.1",
41+
"@foxcomm/wings": "^1.9.0",
4242
"babel-polyfill": "^6.13.0",
4343
"browserHistory": "file:src/opt/browserHistory",
4444
"chance": "^0.7.6",
@@ -122,13 +122,13 @@
122122
"canvas": "^1.4.0",
123123
"chai": "^3.0.0",
124124
"co-mocha": "^1.1.2",
125-
"css-modulesify": "0.25.1",
125+
"css-modulesify": "^0.26.0",
126126
"cssnano": "^3.7.3",
127127
"envify": "^3.4.0",
128128
"eslint": "^3.4.0",
129129
"eslint-plugin-lodash-fp": "^2.0.1",
130130
"eslint-plugin-react": "^6.2.0",
131-
"flow-bin": "0.25.0",
131+
"flow-bin": "^0.25.0",
132132
"gulp": "^3.9.0",
133133
"gulp-concat": "^2.6.0",
134134
"gulp-cssnano": "^2.1.2",

ashes/server/middleware.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ module.exports = function(app) {
3232
}
3333
});
3434

35-
const publicKey = loadPublicKey(config);
36-
3735
function getToken(ctx) {
3836
const jwtToken = ctx.cookies.get(config.api.auth.cookieName);
3937
if (!jwtToken) {
@@ -46,7 +44,7 @@ module.exports = function(app) {
4644
console.info('DEV_SKIP_JWT_VERIFY is enabled, JWT is not verified');
4745
token = jwt.decode(jwtToken);
4846
} else {
49-
token = jwt.verify(jwtToken, publicKey, {
47+
token = jwt.verify(jwtToken, loadPublicKey(config), {
5048
issuer: 'FC',
5149
audience: 'user',
5250
algorithms: ['RS256', 'RS384', 'RS512']

ashes/src/components/activity-trail/activities/assignments/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import React from 'react';
33
import types from '../base/types';
44
import { joinEntities } from '../base/utils';
5-
import { assignmentTypes } from '../../../../paragons/watcher';
5+
import { assignmentTypes } from 'paragons/participants';
66

77
// components
88
import CordTarget from '../base/cord-target';

ashes/src/components/activity-trail/activities/base/types.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
// list of all available types
2+
// list of all available types
33
// https://github.com/FoxComm/phoenix-scala/tree/master/app/services/activity
44

55
const types = {
@@ -105,6 +105,16 @@ const types = {
105105
/* SKUs */
106106
FULL_SKU_CREATED: 'full_sku_created',
107107
FULL_SKU_UPDATED: 'full_sku_updated',
108+
109+
/* Coupons */
110+
111+
COUPON_CREATED: 'coupon_created',
112+
COUPON_UPDATED: 'coupon_updated',
113+
114+
/* Promotions */
115+
116+
PROMOTION_CREATED: 'promotion_created',
117+
PROMOTION_UPDATED: 'promotion_updated',
108118
};
109119

110120
export const derivedTypes = {

0 commit comments

Comments
 (0)