diff --git a/packages/component-faraday-ui/src/UserProfile.js b/packages/component-faraday-ui/src/UserProfile.js index 292c04822b7ee0bdbcfb2662a12a91bb961cc8ca..a5f0555c1cc902a233e97989fb0c4a290bfae559 100644 --- a/packages/component-faraday-ui/src/UserProfile.js +++ b/packages/component-faraday-ui/src/UserProfile.js @@ -1,13 +1,14 @@ /* eslint-disable handle-callback-err */ -import React, { Fragment } from 'react' import { get } from 'lodash' +import PropTypes from 'prop-types' import styled from 'styled-components' import { reduxForm } from 'redux-form' +import React, { Fragment } from 'react' import { th } from '@pubsweet/ui-toolkit' +import { withCountries } from 'pubsweet-component-faraday-ui' import { required as requiredValidator } from 'xpub-validators' import { compose, withStateHandlers, withProps } from 'recompose' import { H3, Spinner, ValidatedField, TextField, Menu } from '@pubsweet/ui' -import { withCountries } from 'pubsweet-component-faraday-ui' import { Row, @@ -236,6 +237,72 @@ const UserProfile = ({ /> ) +UserProfile.propTypes = { + /** Passes journals label and value which will appear in the signature. */ + journal: PropTypes.shape({ + title: PropTypes.arrayOf( + PropTypes.shape({ + label: PropTypes.string, + value: PropTypes.string, + }), + ), + }), + /** Passes properties for the users profile */ + user: PropTypes.shape({ + /** Users unique id. */ + id: PropTypes.string, + /** Type of created account. */ + type: PropTypes.string, + /** Determine if account is admin ot not. */ + admin: PropTypes.bool, + /** Email used for user authentification. */ + email: PropTypes.string, + /** */ + teams: PropTypes.array, + /** Title of account userd. */ + title: PropTypes.string, + /** */ + agreeTC: PropTypes.bool, + /** Country of account user. */ + contry: PropTypes.string, + /** Status of account. */ + isActive: PropTypes.bool, + /** Last Name of accounts user. */ + lastName: PropTypes.string, + /** First name of accounts user. */ + username: PropTypes.string, + /** Account user first name. */ + firstName: PropTypes.string, + /** */ + fragments: PropTypes.array, + /** Accounts user affiliation. */ + affiliation: PropTypes.string, + /** */ + collection: PropTypes.array, + /** Determine if account is confirmed or not. */ + isConfirmed: PropTypes.bool, + /** Determine if account is editor in chief or not. */ + editorInChief: PropTypes.bool, + /** */ + notifications: PropTypes.shape({ + email: PropTypes.shape({ + user: PropTypes.bool, + system: PropTypes.bool, + }), + }), + + /** Determine if account is hendling editor or not. */ + handlingEditor: PropTypes.bool, + /** Users unique token */ + token: PropTypes.array, + }), +} + +UserProfile.defaultProps = { + journal: {}, + user: {}, +} + export default compose( withCountries, withStateHandlers(