diff --git a/packages/component-sortable-list/src/components/SortableList.js b/packages/component-sortable-list/src/components/SortableList.js index e454020635d88c8712efb97209a30001803a3227..0858630f0aa568f250de046bc4270b0a6e0666f6 100644 --- a/packages/component-sortable-list/src/components/SortableList.js +++ b/packages/component-sortable-list/src/components/SortableList.js @@ -89,7 +89,7 @@ const DecoratedItem = compose( )(Item) const SortableList = ({ - items, + items = [], itemKey = 'id', moveItem, listItem, diff --git a/packages/components-faraday/src/components/AuthorList/AuthorAdder.js b/packages/components-faraday/src/components/AuthorList/AuthorAdder.js index 19a4bda77c1d338841d03d25b35d84f653accf27..f6e389871336a681f58d0a36bdbe3ed30c80728c 100644 --- a/packages/components-faraday/src/components/AuthorList/AuthorAdder.js +++ b/packages/components-faraday/src/components/AuthorList/AuthorAdder.js @@ -13,13 +13,15 @@ import classes from './AuthorList.local.scss' import { getAuthorFetching } from '../../redux/authors' import { MenuItem, ValidatedTextField } from './FormItems' -const emailRegex = new RegExp(/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/) +const emailRegex = new RegExp( + /^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i, //eslint-disable-lint +) const emailValidator = value => emailRegex.test(value) ? undefined : 'Invalid email' const AuthorAdder = ({ - authors, + authors = [], editMode, setEditMode, handleSubmit, @@ -90,7 +92,7 @@ export default compose( onSubmit: ( values, dispatch, - { authors, addAuthor, setEditMode, setFormAuthors, reset, match }, + { authors = [], addAuthor, setEditMode, setFormAuthors, reset, match }, ) => { const collectionId = get(match, 'params.project') const fragmentId = get(match, 'params.version') diff --git a/packages/components-faraday/src/components/Dashboard/AbstractModal.js b/packages/components-faraday/src/components/Dashboard/AbstractModal.js index 07e8e491a47270bb0802c8537e172b015b819fd2..5222f2b116e9afe1dba1efc91bdbaa86f2a5521f 100644 --- a/packages/components-faraday/src/components/Dashboard/AbstractModal.js +++ b/packages/components-faraday/src/components/Dashboard/AbstractModal.js @@ -39,14 +39,14 @@ const Root = styled.div` position: relative; ` -const Title = styled.span` +const Title = styled.div` font-family: Helvetica; font-size: 18px; text-align: left; color: #667080; ` -const Subtitle = styled.span` +const Subtitle = styled.div` color: #667080; font-family: Helvetica; font-size: 14px; diff --git a/packages/components-faraday/src/components/SortableList/SortableList.js b/packages/components-faraday/src/components/SortableList/SortableList.js index e454020635d88c8712efb97209a30001803a3227..0858630f0aa568f250de046bc4270b0a6e0666f6 100644 --- a/packages/components-faraday/src/components/SortableList/SortableList.js +++ b/packages/components-faraday/src/components/SortableList/SortableList.js @@ -89,7 +89,7 @@ const DecoratedItem = compose( )(Item) const SortableList = ({ - items, + items = [], itemKey = 'id', moveItem, listItem, diff --git a/packages/components-faraday/src/redux/files.js b/packages/components-faraday/src/redux/files.js index e2679c4df83195999a3d98cc7b773f25d91c092c..e1ba5b9d3766f3dc1992671a15fa460c9e2d1bba 100644 --- a/packages/components-faraday/src/redux/files.js +++ b/packages/components-faraday/src/redux/files.js @@ -68,7 +68,7 @@ export const getFileError = state => state.files.error // thunked actions export const uploadFile = (file, type, fragmentId) => dispatch => { dispatch(uploadRequest(type)) - return request('/aws', createFileData(file, type, fragmentId)).then( + return request('/file', createFileData(file, type, fragmentId)).then( r => { dispatch(uploadSuccess()) return r @@ -82,7 +82,7 @@ export const uploadFile = (file, type, fragmentId) => dispatch => { export const deleteFile = fileId => dispatch => { dispatch(removeRequest()) - return remove(`/aws/${fileId}`) + return remove(`/file/${fileId}`) .then(r => { dispatch(removeSuccess()) return r @@ -90,7 +90,7 @@ export const deleteFile = fileId => dispatch => { .catch(err => dispatch(removeFailure(err.message))) } -export const getSignedUrl = fileId => dispatch => get(`/aws/${fileId}`) +export const getSignedUrl = fileId => dispatch => get(`/file/${fileId}`) // reducer export default (state = initialState, action) => {