Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 25d1a8c

Browse files
committed
Merge branch 'develop'
2 parents 3f29a65 + 4f7b609 commit 25d1a8c

File tree

8 files changed

+25
-13
lines changed

8 files changed

+25
-13
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ENV SEGMENT_IO_API_KEY=$SEGMENT_IO_API_KEY
1717

1818
RUN npm install
1919
RUN npm test
20-
RUN if [ "$NODE_CONFIG_ENV" = "production" ] ; then npm run build ; else npm run build:dev ; fi
20+
RUN npm run build
2121

2222
EXPOSE 3000
2323
CMD ["npm", "start"]

config/webpack/default.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
* Right place for any custom Webpack config, common for all environments.
33
*/
44

5-
let publicPath = process.env.CDN_URL || '/api/cdn/public';
6-
publicPath += '/static-assets';
5+
// let publicPath = process.env.CDN_URL || '/api/cdn/public';
6+
// publicPath += '/static-assets';
7+
8+
const publicPath = '';
79

810
module.exports = {
911
externals: {

config/webpack/production.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ const webpackMerge = require('webpack-merge');
66

77
const customDefaultConfig = require('./default');
88

9+
/*
910
let publicPath = process.env.CDN_URL;
1011
if (publicPath) publicPath += '/static-assets';
1112
else publicPath = '/api/cdn/public/static-assets';
13+
*/
14+
15+
const publicPath = '';
1216

1317
const standardProductionConfig = standardConfigFactory({
1418
context: path.resolve(__dirname, '../..'),

package-lock.json

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
"build": "npm run clean && ./node_modules/.bin/webpack --env=production --progress --profile --colors --display-optimization-bailout",
88
"build:dev": "npm run clean && ./node_modules/.bin/webpack --env=development --progress --profile --colors --display-optimization-bailout",
99
"clean": "./node_modules/.bin/rimraf build",
10-
"dev": "cross-env BABEL_ENV=development node ./bin/www",
10+
"dev": "cross-env BABEL_ENV=development NODE_ENV=development node ./bin/www",
1111
"fix:js": "./node_modules/.bin/eslint --fix --ext .js,.jsx .",
1212
"fix:styles": "./node_modules/.bin/stylelint **/*.scss --syntax scss --fix",
1313
"jest": "cross-env BABEL_ENV=test ./node_modules/.bin/jest --no-cache --maxWorkers=4 --config config/jest/default.js",
1414
"lint": "npm run lint:js && npm run lint:scss",
1515
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
1616
"lint:scss": "./node_modules/.bin/stylelint **/*.scss --syntax scss",
17-
"start": "cross-env BABEL_ENV=production node ./bin/www",
17+
"start": "cross-env BABEL_ENV=production NODE_ENV=production node ./bin/www",
1818
"test": "npm run lint && npm run jest"
1919
},
2020
"repository": {

src/shared/containers/.tmp

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/shared/containers/sandbox/payments/Editor/index.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ function handleProjectDetailsLoading(props) {
6767
class EditorContainer extends React.Component {
6868
componentDidMount() {
6969
const {
70+
authenticating,
7071
challenge,
7172
getChallenge,
7273
loadingProjectsForUsername,
@@ -79,7 +80,7 @@ class EditorContainer extends React.Component {
7980
tokenV3,
8081
username,
8182
} = this.props;
82-
if (!tokenV3) return goToLogin('payments-tool');
83+
if (!authenticating && !tokenV3) return goToLogin('payments-tool');
8384
if (username && username !== loadingProjectsForUsername) {
8485
loadProjects(tokenV3);
8586
}
@@ -96,6 +97,7 @@ class EditorContainer extends React.Component {
9697

9798
componentWillReceiveProps(nextProps) {
9899
const {
100+
authenticating,
99101
challenge,
100102
loadingProjectsForUsername,
101103
loadProjects,
@@ -114,7 +116,7 @@ class EditorContainer extends React.Component {
114116
tokenV3,
115117
username,
116118
} = nextProps;
117-
if (!tokenV3) return goToLogin('payments-tool');
119+
if (!authenticating && !tokenV3) return goToLogin('payments-tool');
118120
const {
119121
projects: oldProjects,
120122
username: oldUsername,
@@ -308,6 +310,7 @@ EditorContainer.defaultProps = {
308310
};
309311

310312
EditorContainer.propTypes = {
313+
authenticating: PT.bool.isRequired,
311314
challenge: PT.shape(),
312315
getChallenge: PT.func.isRequired,
313316
loadingProjectDetailsForId: PT.number.isRequired,
@@ -362,6 +365,7 @@ function mapStateToProps(state, ownProps) {
362365
}
363366

364367
return {
368+
authenticating: auth.authenticating,
365369
challenge,
366370
loadingProjectDetailsForId: direct.loadingProjectDetailsForId,
367371
loadingProjectsForUsername: direct.loadingProjectsForUsername,

src/shared/containers/sandbox/payments/Listing.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ function selectProjectAndLoadMemberTasks(projectId, props) {
2020
class ListingContainer extends React.Component {
2121
componentDidMount() {
2222
const {
23+
authenticating,
2324
loadingProjectsForUsername,
2425
loadProjects,
2526
tokenV3,
2627
username,
2728
} = this.props;
28-
if (!tokenV3) return goToLogin('payments-tool');
29+
if (!authenticating && !tokenV3) return goToLogin('payments-tool');
2930
if (username && username !== loadingProjectsForUsername) {
3031
loadProjects(tokenV3);
3132
}
@@ -34,14 +35,15 @@ class ListingContainer extends React.Component {
3435

3536
componentWillReceiveProps(nextProps) {
3637
const {
38+
authenticating,
3739
loadingProjectsForUsername,
3840
loadProjects,
3941
projects,
4042
selectedProjectId,
4143
tokenV3,
4244
username,
4345
} = nextProps;
44-
if (!tokenV3) return goToLogin('payments-tool');
46+
if (!authenticating && !tokenV3) return goToLogin('payments-tool');
4547
if (username !== this.props.username && username
4648
&& username !== loadingProjectsForUsername) {
4749
loadProjects(tokenV3);
@@ -80,6 +82,7 @@ class ListingContainer extends React.Component {
8082
}
8183

8284
ListingContainer.propTypes = {
85+
authenticating: PT.bool.isRequired,
8386
loadingMemberTasks: PT.bool.isRequired,
8487
loadProjects: PT.func.isRequired,
8588
loadingProjectsForUsername: PT.string.isRequired,
@@ -100,6 +103,7 @@ function mapStateToProps(state) {
100103
const { auth, direct, memberTasks } = state;
101104
const page = state.page.sandbox.payments.listing;
102105
return {
106+
authenticating: auth.authenticating,
103107
loadingMemberTasks: Boolean(memberTasks.loadingUuid),
104108
loadingProjectsForUsername: direct.loadingProjectsForUsername,
105109
memberTasks: memberTasks.tasks,

0 commit comments

Comments
 (0)