Commit c4234cfd authored by Jure's avatar Jure

Merge branch 'master' into '9-collection-teams'

# Conflicts:
#   src/reducers/teams.js
parents 71804212 2b932bed
Pipeline #2624 passed with stage
in 1 minute and 37 seconds
......@@ -86,3 +86,13 @@ export const FILE_UPLOAD_FAILURE = 'FILE_UPLOAD_FAILURE'
export const RESET_ERROR_MESSAGE = 'RESET_ERROR_MESSAGE'
export const HYDRATE = 'HYDRATE'
// The following actions are implemented elsewhere in pubsweet components
export const LOGIN_REQUEST = 'LOGIN_REQUEST'
export const LOGIN_SUCCESS = 'LOGIN_SUCCESS'
export const LOGIN_FAILURE = 'LOGIN_FAILURE'
export const LOGOUT_REQUEST = 'LOGOUT_REQUEST'
export const LOGOUT_SUCCESS = 'LOGOUT_SUCCESS'
export const LOGOUT_FAILURE = 'LOGOUT_FAILURE'
......@@ -3,11 +3,9 @@ import { ConnectedRouter } from 'react-router-redux'
import { Provider } from 'react-redux'
import PropTypes from 'prop-types'
import routes from 'app/routes'
export default class Root extends React.Component {
render () {
const { store, history } = this.props
const { store, history, routes } = this.props
return (
<Provider store={store}>
<div>
......@@ -21,6 +19,7 @@ export default class Root extends React.Component {
}
Root.propTypes = {
routes: PropTypes.node.isRequired,
history: PropTypes.object.isRequired,
store: PropTypes.object.isRequired
}
......@@ -9,11 +9,10 @@ import {
DELETE_COLLECTION_SUCCESS,
GET_FRAGMENTS_SUCCESS,
CREATE_FRAGMENT_SUCCESS,
DELETE_FRAGMENT_SUCCESS
DELETE_FRAGMENT_SUCCESS,
LOGOUT_SUCCESS
} from '../actions/types'
import { LOGOUT_SUCCESS } from 'pubsweet-component-login/types'
import find from 'lodash/find'
import union from 'lodash/union'
import difference from 'lodash/difference'
......
import {
GET_CURRENT_USER_REQUEST, GET_CURRENT_USER_SUCCESS, GET_CURRENT_USER_FAILURE
GET_CURRENT_USER_REQUEST,
GET_CURRENT_USER_SUCCESS,
GET_CURRENT_USER_FAILURE,
LOGOUT_SUCCESS
} from '../actions/types'
import { LOGOUT_SUCCESS } from 'pubsweet-component-login/types'
export default function (state = {
isFetching: false,
isAuthenticated: false
......
......@@ -10,11 +10,10 @@ import {
// UPDATE_FRAGMENT_FAILURE,
DELETE_FRAGMENT_REQUEST,
DELETE_FRAGMENT_FAILURE,
DELETE_FRAGMENT_SUCCESS
DELETE_FRAGMENT_SUCCESS,
LOGOUT_SUCCESS
} from '../actions/types'
import { LOGOUT_SUCCESS } from 'pubsweet-component-login/types'
import clone from 'lodash/clone'
import unset from 'lodash/unset'
......
......@@ -3,11 +3,10 @@ import {
CREATE_TEAM_SUCCESS,
UPDATE_TEAM_SUCCESS,
DELETE_TEAM_SUCCESS,
GET_COLLECTION_TEAMS_SUCCESS
GET_COLLECTION_TEAMS_SUCCESS,
LOGOUT_SUCCESS
} from '../actions/types'
import { LOGOUT_SUCCESS } from 'pubsweet-component-login/types'
import clone from 'lodash/clone'
import findIndex from 'lodash/findIndex'
import difference from 'lodash/difference'
......
......@@ -6,11 +6,10 @@ import {
GET_USER_SUCCESS,
UPDATE_USER_REQUEST,
UPDATE_USER_SUCCESS,
GET_CURRENT_USER_SUCCESS
GET_CURRENT_USER_SUCCESS,
LOGOUT_SUCCESS
} from '../actions/types'
import { LOGOUT_SUCCESS } from 'pubsweet-component-login/types'
// TODO: store users as an object/map instead of an array
// The users reducer.
......
......@@ -2,7 +2,6 @@ const allReducers = require('../../src/reducers').default
const reducer = require('../../src/reducers/collections').default
const T = require('../../src/actions/types')
const { LOGOUT_SUCCESS } = require('pubsweet-component-login/types')
describe('collections reducers', () => {
it('is exported in the all reducers object', () => {
......@@ -99,7 +98,7 @@ describe('collections reducers', () => {
it('logout success', () => {
const actual = reducer([mockCollectionWithFragment], {
type: LOGOUT_SUCCESS
type: T.LOGOUT_SUCCESS
})
expect(actual).toEqual([])
})
......
......@@ -2,7 +2,6 @@ const allReducers = require('../../src/reducers').default
const reducer = require('../../src/reducers/currentUser').default
const T = require('../../src/actions/types')
const {LOGOUT_SUCCESS} = require('pubsweet-component-login/types')
describe('currentUser reducers', () => {
it('is exported in the all reducers object', () => {
......@@ -43,7 +42,7 @@ describe('currentUser reducers', () => {
const actual = reducer({
user: mockuser
}, {
type: LOGOUT_SUCCESS
type: T.LOGOUT_SUCCESS
})
expect(actual).toEqual({
isFetching: false,
......
......@@ -2,7 +2,6 @@ const allReducers = require('../../src/reducers').default
const reducer = require('../../src/reducers/fragments').default
const T = require('../../src/actions/types')
const {LOGOUT_SUCCESS} = require('pubsweet-component-login/types')
const clone = require('lodash/clone')
......@@ -80,7 +79,7 @@ describe('fragments reducers', () => {
it('logout success', () => {
const actual = reducer(mockstate, {
type: LOGOUT_SUCCESS
type: T.LOGOUT_SUCCESS
})
expect(actual).toEqual({})
})
......
......@@ -2,7 +2,6 @@ const allReducers = require('../../src/reducers').default
const reducer = require('../../src/reducers/teams').default
const T = require('../../src/actions/types')
const {LOGOUT_SUCCESS} = require('pubsweet-component-login/types')
describe('teams reducers', () => {
it('is exported in the all reducers object', () => {
......@@ -47,7 +46,7 @@ describe('teams reducers', () => {
it('logout success', () => {
const actual = reducer(mockstate, {
type: LOGOUT_SUCCESS
type: T.LOGOUT_SUCCESS
})
expect(actual).toEqual([])
})
......
......@@ -4,7 +4,6 @@ const allReducers = require('../../src/reducers').default
const reducer = require('../../src/reducers/users').default
const T = require('../../src/actions/types')
const {LOGOUT_SUCCESS} = require('pubsweet-component-login/types')
describe('users reducers', () => {
it('is exported in the all reducers object', () => {
......@@ -78,7 +77,7 @@ describe('users reducers', () => {
it('logout success', () => {
const actual = reducer(mockstate, {
type: LOGOUT_SUCCESS,
type: T.LOGOUT_SUCCESS,
user: usermod
})
expect(actual).toEqual({
......
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