Commit a4c097ba authored by Sam Galson's avatar Sam Galson
Browse files

Merge branch 'pipelines' into 'master'

Pipelines

See merge request !2
parents 8a5c5110 41dea0f9
Pipeline #3614 passed with stages
in 9 minutes and 22 seconds
......@@ -7,3 +7,5 @@ coverage/
api/db/*
logs/*
infra/development.env
log.txt
config.json
......@@ -33,6 +33,7 @@ review:xpub-collabra:
stage: review
variables:
PACKAGE_NAME: xpub-collabra
FORCE_FRESH_DB: "yes"
environment:
name: $PACKAGE_NAME/review/$CI_COMMIT_REF_NAME
# !! kube-lego will fail if domain > 64 chars
......@@ -102,78 +103,78 @@ demo:xpub-collabra:
- create_deployment
# -----------------------------------------------
# xpub-ui ---------------------------------
# xpub-ui ---------------------------------------
# -----------------------------------------------
review:xpub-ui:
image: xpub/deployer:latest
stage: review
variables:
PACKAGE_NAME: xpub-ui
environment:
name: $PACKAGE_NAME/review/$CI_COMMIT_REF_NAME
# !! kube-lego will fail if domain > 64 chars
url: "https://${CI_ENVIRONMENT_SLUG}.${BASE_DOMAIN}"
on_stop: stop_review:xpub-ui
only:
- branches
script:
- source deploy.sh
- create_deployment
stop_review:xpub-ui:
image: xpub/deployer:latest
stage: review
variables:
PACKAGE_NAME: xpub-ui
GIT_STRATEGY: none
when: manual
environment:
name: $PACKAGE_NAME/review/$CI_COMMIT_REF_NAME
action: stop
script:
- source deploy.sh
- delete_deployment
staging:xpub-ui:
image: xpub/deployer:latest
stage: staging
variables:
PACKAGE_NAME: xpub-ui
environment:
name: $PACKAGE_NAME/staging
url: "https://${CI_ENVIRONMENT_SLUG}.${BASE_DOMAIN}"
only:
- master
script:
- source deploy.sh
- create_deployment
production:xpub-ui:
image: xpub/deployer:latest
stage: production
variables:
PACKAGE_NAME: xpub-ui
environment:
name: $PACKAGE_NAME/production
url: "https://${CI_ENVIRONMENT_SLUG}.${BASE_DOMAIN}"
when: manual
only:
- master
script:
- source deploy.sh
- create_deployment
demo:xpub-ui:
image: xpub/deployer:latest
stage: demo
variables:
PACKAGE_NAME: xpub-ui
environment:
name: $PACKAGE_NAME/demo
url: "https://${CI_ENVIRONMENT_SLUG}.${BASE_DOMAIN}"
when: manual
script:
- source deploy.sh
- create_deployment
#review:xpub-ui:
# image: xpub/deployer:latest
# stage: review
# variables:
# PACKAGE_NAME: xpub-ui
# environment:
# name: $PACKAGE_NAME/review/$CI_COMMIT_REF_NAME
# # !! kube-lego will fail if domain > 64 chars
# url: "https://${CI_ENVIRONMENT_SLUG}.${BASE_DOMAIN}"
# on_stop: stop_review:xpub-ui
# only:
# - branches
# script:
# - source deploy.sh
# - create_deployment
#
#stop_review:xpub-ui:
# image: xpub/deployer:latest
# stage: review
# variables:
# PACKAGE_NAME: xpub-ui
# GIT_STRATEGY: none
# when: manual
# environment:
# name: $PACKAGE_NAME/review/$CI_COMMIT_REF_NAME
# action: stop
# script:
# - source deploy.sh
# - delete_deployment
#
#staging:xpub-ui:
# image: xpub/deployer:latest
# stage: staging
# variables:
# PACKAGE_NAME: xpub-ui
# environment:
# name: $PACKAGE_NAME/staging
# url: "https://${CI_ENVIRONMENT_SLUG}.${BASE_DOMAIN}"
# only:
# - master
# script:
# - source deploy.sh
# - create_deployment
#
#production:xpub-ui:
# image: xpub/deployer:latest
# stage: production
# variables:
# PACKAGE_NAME: xpub-ui
# environment:
# name: $PACKAGE_NAME/production
# url: "https://${CI_ENVIRONMENT_SLUG}.${BASE_DOMAIN}"
# when: manual
# only:
# - master
# script:
# - source deploy.sh
# - create_deployment
#
#demo:xpub-ui:
# image: xpub/deployer:latest
# stage: demo
# variables:
# PACKAGE_NAME: xpub-ui
# environment:
# name: $PACKAGE_NAME/demo
# url: "https://${CI_ENVIRONMENT_SLUG}.${BASE_DOMAIN}"
# when: manual
# script:
# - source deploy.sh
# - create_deployment
#
......@@ -9,6 +9,7 @@ RUN mkdir -p ${HOME}
# the rest is for compiling leveldown
RUN apk add --no-cache --virtual .gyp \
python \
curl \
make \
g++ \
git
......@@ -35,10 +36,11 @@ WORKDIR ${HOME}/packages/xpub-collabra
# TODO pass in username and password as build arguments
RUN [ "npx", "pubsweet", "build"]
WORKDIR ${HOME}/packages/xpub-ui
RUN [ "npm", "run", "styleguide:build" ]
# Create file for kubernetes health checks
RUN touch ./styleguide/health
## No xpub-ui to deploy yet
# WORKDIR ${HOME}/packages/xpub-ui
# RUN [ "npm", "run", "styleguide:build" ]
## Create file for kubernetes health checks
# RUN touch ./styleguide/health
EXPOSE 3000
......
......@@ -24,7 +24,6 @@ Note: xpub is still _very_ new. This repository contains an initial set of compo
* `xpub-selectors`: some useful redux selectors
* `xpub-styleguide`: components for use in react-styleguidist
* `xpub-theme`: fonts and styles for use in xpub applications
* `xpub-ui`: a library of user interface elements for use in PubSweet components
* `xpub-upload`: a helper function for file uploading
* `xpub-validators`: validator functions for use with redux-form
......
{
"couchdb": {
"uuid": "fc06236e-0908-4a5c-b08e-560ff042e338"
}
}
[Mon, 11 Dec 2017 11:27:28 GMT] [info] [<0.000.0>] pouchdb-server has started on http://127.0.0.1:5984/
[Mon, 11 Dec 2017 11:27:28 GMT] [info] [<0.000.0>] database files will be saved to api/db/
[Mon, 11 Dec 2017 11:27:28 GMT] [info] [<0.000.0>] navigate to http://127.0.0.1:5984/_utils for the Fauxton UI.
[Mon, 11 Dec 2017 11:27:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils 301
[Mon, 11 Dec 2017 11:27:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/ 200
[Mon, 11 Dec 2017 11:27:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/dashboard.assets/css/styles-a9623008fc27e79da2388441deeacfab.css 200
[Mon, 11 Dec 2017 11:27:41 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/dashboard.assets/js/bundle-34997e32896293a1fa5d71f79eb1b4f7.js 200
[Mon, 11 Dec 2017 11:27:41 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_session 200
[Mon, 11 Dec 2017 11:27:41 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_session 304
[Mon, 11 Dec 2017 11:27:41 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET / 200
[Mon, 11 Dec 2017 11:27:41 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/dashboard.assets/img/pouchdb-site.png 200
[Mon, 11 Dec 2017 11:27:41 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/dashboard.assets/fonts/fauxtonicon5.woff 200
[Mon, 11 Dec 2017 11:27:41 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_all_dbs?_=1512991661242 200
[Mon, 11 Dec 2017 11:27:41 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_all_dbs?startkey=%22%22&endkey=%22%E9%A6%99%22&limit=30&_=1512991661243 200
[Mon, 11 Dec 2017 11:27:41 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_replicator?_=1512991661244 200
[Mon, 11 Dec 2017 11:27:41 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_users?_=1512991661245 200
[Mon, 11 Dec 2017 11:27:41 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/dashboard.assets/fonts/fontawesome-webfont.woff 200
[Mon, 11 Dec 2017 11:27:42 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/dashboard.assets/img/pouchdb-favicon.png 200
[Mon, 11 Dec 2017 11:28:15 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_all_dbs?_=1512991661246 200
[Mon, 11 Dec 2017 11:28:15 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_replicator?_=1512991661247 200
[Mon, 11 Dec 2017 11:28:15 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_users?_=1512991661248 200
[Mon, 11 Dec 2017 11:28:21 GMT] [info] [<0.000.0>] 127.0.0.1 - - PUT /production 201
[Mon, 11 Dec 2017 11:28:21 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?startkey=%22_design%2F%22&endkey=%22_design0%22&include_docs=true&limit=501 200
[Mon, 11 Dec 2017 11:28:21 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?limit=21 200
[Mon, 11 Dec 2017 11:28:21 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?startkey=%22%22&endkey=%22%E9%A6%99%22&limit=30&_=1512991661249 200
[Mon, 11 Dec 2017 11:28:32 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_all_dbs?_=1512991661250 200
[Mon, 11 Dec 2017 11:28:32 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_replicator?_=1512991661251 200
[Mon, 11 Dec 2017 11:28:32 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_users?_=1512991661252 200
[Mon, 11 Dec 2017 11:28:32 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production?_=1512991661253 200
[Mon, 11 Dec 2017 11:28:36 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_active_tasks 200
[Mon, 11 Dec 2017 11:28:39 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_all_dbs?_=1512991661254 200
[Mon, 11 Dec 2017 11:28:39 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_replicator?_=1512991661255 200
[Mon, 11 Dec 2017 11:28:39 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_users?_=1512991661256 200
[Mon, 11 Dec 2017 11:28:39 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production?_=1512991661257 200
[Mon, 11 Dec 2017 11:28:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?startkey=%22_design%2F%22&endkey=%22_design0%22&include_docs=true&limit=501 304
[Mon, 11 Dec 2017 11:28:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?limit=21 304
[Mon, 11 Dec 2017 11:28:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?startkey=%22%22&endkey=%22%E9%A6%99%22&limit=30&_=1512991661258 200
[Mon, 11 Dec 2017 11:28:43 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_index? 200
[Mon, 11 Dec 2017 11:28:43 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/dashboard.assets/img/couch-watermark.png 200
[Mon, 11 Dec 2017 11:28:50 GMT] [info] [<0.000.0>] 127.0.0.1 - - POST /production/_find 200
[Mon, 11 Dec 2017 11:30:01 GMT] [info] [<0.000.0>] 127.0.0.1 - - POST /production/_find 200
[Mon, 11 Dec 2017 11:31:05 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/docs/intro/api.html 404
[Mon, 11 Dec 2017 11:31:21 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_index? 304
[Mon, 11 Dec 2017 11:31:31 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?startkey=%22_design%2F%22&endkey=%22_design0%22&include_docs=true&limit=501 304
[Mon, 11 Dec 2017 11:31:31 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?limit=21 304
[Mon, 11 Dec 2017 11:31:32 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?startkey=%22%22&endkey=%22%E9%A6%99%22&limit=30&_=1512991661259 200
[Mon, 11 Dec 2017 11:31:34 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_changes?limit=100 200
[Mon, 11 Dec 2017 11:31:34 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?startkey=%22%22&endkey=%22%E9%A6%99%22&limit=30&_=1512991661260 200
[Mon, 11 Dec 2017 11:31:38 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_index? 304
[Mon, 11 Dec 2017 11:31:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?startkey=%22_design%2F%22&endkey=%22_design0%22&include_docs=true&limit=501 304
[Mon, 11 Dec 2017 11:31:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?limit=21 304
[Mon, 11 Dec 2017 11:31:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?startkey=%22%22&endkey=%22%E9%A6%99%22&limit=30&_=1512991661261 200
[Mon, 11 Dec 2017 11:31:41 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?limit=21 304
[Mon, 11 Dec 2017 11:31:46 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?limit=21 304
[Mon, 11 Dec 2017 11:31:50 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?include_docs=true&conflicts=true&limit=21 200
[Mon, 11 Dec 2017 11:31:53 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_all_dbs?_=1512991661262 200
[Mon, 11 Dec 2017 11:31:54 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_replicator?_=1512991661263 200
[Mon, 11 Dec 2017 11:31:54 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_users?_=1512991661264 200
[Mon, 11 Dec 2017 11:31:54 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production?_=1512991661265 200
[Mon, 11 Dec 2017 11:33:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_membership 200
[Mon, 11 Dec 2017 11:33:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_node/node1@127.0.0.1/_config 200
[Mon, 11 Dec 2017 11:33:43 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_all_dbs?_=1512991661266 200
[Mon, 11 Dec 2017 11:33:43 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_replicator?_=1512991661267 200
[Mon, 11 Dec 2017 11:33:43 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_users?_=1512991661268 200
[Mon, 11 Dec 2017 11:33:43 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production?_=1512991661269 200
[Mon, 11 Dec 2017 11:34:57 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?startkey=%22_design%2F%22&endkey=%22_design0%22&include_docs=true&limit=501 304
[Mon, 11 Dec 2017 11:34:57 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?limit=21 304
[Mon, 11 Dec 2017 11:34:57 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?startkey=%22%22&endkey=%22%E9%A6%99%22&limit=30&_=1512991661270 200
[Mon, 11 Dec 2017 11:35:01 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_index? 304
[Mon, 11 Dec 2017 11:35:04 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?startkey=%22_design%2F%22&endkey=%22_design0%22&include_docs=true&limit=501 304
[Mon, 11 Dec 2017 11:35:04 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?limit=21 304
[Mon, 11 Dec 2017 11:35:04 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?startkey=%22%22&endkey=%22%E9%A6%99%22&limit=30&_=1512991661271 200
[Mon, 11 Dec 2017 11:35:06 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?limit=21 304
[Mon, 11 Dec 2017 11:37:25 GMT] [info] [<0.000.0>] pouchdb-server has started on http://127.0.0.1:5984/
[Mon, 11 Dec 2017 11:37:25 GMT] [info] [<0.000.0>] database files will be saved to api/db/
[Mon, 11 Dec 2017 11:37:25 GMT] [info] [<0.000.0>] navigate to http://127.0.0.1:5984/_utils for the Fauxton UI.
[Mon, 11 Dec 2017 11:37:36 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/ 304
[Mon, 11 Dec 2017 11:37:36 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/dashboard.assets/css/styles-a9623008fc27e79da2388441deeacfab.css 304
[Mon, 11 Dec 2017 11:37:36 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/dashboard.assets/js/bundle-34997e32896293a1fa5d71f79eb1b4f7.js 304
[Mon, 11 Dec 2017 11:37:36 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_session 304
[Mon, 11 Dec 2017 11:37:37 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_session 304
[Mon, 11 Dec 2017 11:37:37 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET / 304
[Mon, 11 Dec 2017 11:37:37 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/dashboard.assets/img/pouchdb-site.png 304
[Mon, 11 Dec 2017 11:37:37 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/dashboard.assets/fonts/fauxtonicon5.woff 304
[Mon, 11 Dec 2017 11:37:37 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?limit=21 304
[Mon, 11 Dec 2017 11:37:37 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?startkey=%22_design%2F%22&endkey=%22_design0%22&include_docs=true&limit=501 304
[Mon, 11 Dec 2017 11:37:37 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/dashboard.assets/fonts/fontawesome-webfont.woff 304
[Mon, 11 Dec 2017 11:37:37 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production/_all_docs?startkey=%22%22&endkey=%22%E9%A6%99%22&limit=30&_=1512992256896 200
[Mon, 11 Dec 2017 11:37:37 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_utils/dashboard.assets/img/pouchdb-favicon.png 200
[Mon, 11 Dec 2017 11:37:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_all_dbs?_=1512992256897 200
[Mon, 11 Dec 2017 11:37:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_all_dbs?startkey=%22%22&endkey=%22%E9%A6%99%22&limit=30&_=1512992256898 200
[Mon, 11 Dec 2017 11:37:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_replicator?_=1512992256899 200
[Mon, 11 Dec 2017 11:37:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /production?_=1512992256901 200
[Mon, 11 Dec 2017 11:37:40 GMT] [info] [<0.000.0>] 127.0.0.1 - - GET /_users?_=1512992256900 200
[Mon, 11 Dec 2017 11:37:55 GMT] [info] [<0.000.0>] 127.0.0.1 - - DELETE /production 500
......@@ -19,7 +19,7 @@
"redux": "^3.6.0",
"xpub-bootstrap": "^0.0.2",
"xpub-journal": "^0.0.2",
"xpub-ui": "^0.0.2"
"@pubsweet/ui": "^0.1.1"
},
"peerDependencies": {
"prop-types": "^15.5.10",
......
......@@ -3,7 +3,7 @@ import { compose } from 'recompose'
import { connect } from 'react-redux'
// import PropTypes from 'prop-types'
import { AppBar } from 'xpub-ui'
import { AppBar } from '@pubsweet/ui'
import { withJournal } from 'xpub-journal'
import 'xpub-bootstrap'
......
......@@ -20,7 +20,7 @@
"recompose": "^0.26.0",
"redux": "^3.6.0",
"redux-form": "^7.0.3",
"xpub-ui": "^0.0.2"
"@pubsweet/ui": "^0.1.1"
},
"devDependencies": {
"babel-core": "^6.26.0",
......
import React from 'react'
import { Field } from 'redux-form'
import { Link } from 'react-router-dom'
import { Button, TextField } from 'xpub-ui'
import { Button, TextField } from '@pubsweet/ui'
import classes from './Form.local.scss'
const UsernameInput = props => <TextField label="Username" {...props.input} />
......
import { get } from 'lodash'
import config from 'config'
import { reduxForm, SubmissionError } from 'redux-form'
import { compose } from 'recompose'
import { connect } from 'react-redux'
import { login } from '../redux/login'
import Login from './Login'
const redirectPath = ({ location: { state } }) => {
const redirect = get(config, ['pubsweet-client', 'login-redirect'], '/')
return state && state.from && state.from.pathname !== '/logout'
? state.from.pathname
: redirect
}
import redirectPath from '../redirect'
const onSubmit = (values, dispatch, { history, location }) => {
dispatch(login(values))
......
import React from 'react'
import { Field } from 'redux-form'
import { Link } from 'react-router-dom'
import { Button, TextField } from 'xpub-ui'
import { Button, TextField } from '@pubsweet/ui'
import classes from './Form.local.scss'
const UsernameInput = props => <TextField label="Username" {...props.input} />
......
......@@ -3,16 +3,21 @@ import { compose } from 'recompose'
import { reduxForm, SubmissionError } from 'redux-form'
import { signup } from '../redux/signup'
import Signup from './Signup'
import redirectPath from '../redirect'
const onSubmit = (values, dispatch) => {
dispatch(signup(values)).catch(error => {
if (error.validationErrors) {
throw new SubmissionError(error.validationErrors)
} else {
console.error(error)
// TODO: display error
}
})
const onSubmit = (values, dispatch, { history, location }) => {
dispatch(signup(values))
.then(() => {
history.push(redirectPath({ location }))
})
.catch(error => {
if (error.validationErrors) {
throw new SubmissionError(error.validationErrors)
} else {
console.error(error)
// TODO: display error
}
})
}
export default compose(
......
import { get } from 'lodash'
import config from 'config'
const allowedRedirect = pathname =>
['/logout', '/login', '/signup'].indexOf(pathname) === -1
export default ({ location: { state } }) =>
state && state.from && allowedRedirect(state.from.pathname)
? state.from.pathname
: get(config, ['pubsweet-client', 'login-redirect'], '/')
......@@ -25,7 +25,7 @@
"xpub-connect": "^0.0.2",
"xpub-journal": "^0.0.2",
"xpub-selectors": "^0.0.2",
"xpub-ui": "^0.0.2",
"@pubsweet/ui": "^0.1.1",
"xpub-upload": "^0.0.2"
},
"devDependencies": {
......
import React from 'react'
import { compose, withProps } from 'recompose'
import { Menu } from 'xpub-ui'
import { Menu } from '@pubsweet/ui'
import { withJournal } from 'xpub-journal'
// TODO: select multiple editors
const AssignEditor = ({
journal,
project,
team,
teamName,
......
import React from 'react'
import { compose, withProps } from 'recompose'
import { groupBy } from 'lodash'
import { Badge } from 'xpub-ui'
import { Badge } from '@pubsweet/ui'
import classes from './Reviews.local.scss'
const Reviews = ({ reviews }) => (
......
import React from 'react'
import Dropzone from 'react-dropzone'
import classnames from 'classnames'
import { Icon } from 'xpub-ui'
import { Icon } from '@pubsweet/ui'
import classes from './UploadManuscript.local.scss'
const isIdle = conversion =>
......
import React from 'react'
import { Button } from 'xpub-ui'
import { Button } from '@pubsweet/ui'
import { getReviewerFromUser } from 'xpub-selectors'
import classes from './Item.local.scss'
import ProjectLink from '../ProjectLink'
......
......@@ -30,7 +30,7 @@
"xpub-edit": "^0.0.2",
"xpub-journal": "^0.0.2",
"xpub-selectors": "^0.0.2",
"xpub-ui": "^0.0.2",
"@pubsweet/ui": "^0.1.1",
"xpub-upload": "^0.0.2",
"xpub-validators": "^0.0.2"
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment