diff --git a/products/ASC.People/Client/public/locales/en/Resource.json b/products/ASC.People/Client/public/locales/en/Resource.json index 53230c22ee..79d8a18af4 100644 --- a/products/ASC.People/Client/public/locales/en/Resource.json +++ b/products/ASC.People/Client/public/locales/en/Resource.json @@ -2,6 +2,7 @@ "Profile": "Profile", "AboutCompanyTitle": "About this program", "LogoutButton": "Sign Out", + "AddPhoto": "Add Photo", "EditPhoto": "Edit Photo", "FirstName": "First Name", "LastName": "Last Name", @@ -10,13 +11,20 @@ "ContactInformation": "Contact Information", "UserType": "Type", "Sex": "Sex", + "SexMale": "Male", + "SexFemale": "Female", "Birthdate": "Date of Birth", + "EmployedSinceDate": "Employed since", "Location": "Location", + "Position": "Position", + "Departments": "Departments", "Language": "Language", "Subscriptions": "Subscriptions", "SocialProfiles": "Social Profiles", "PendingTitle": "Pending", "EditUserDialogTitle": "Edit Profile", "LoadingProcessing": "Loading...", - "LoadingDescription": "Please wait..." + "LoadingDescription": "Please wait...", + "ActivationLink": "Activation link", + "TemporaryPassword": "Temporary password" } \ No newline at end of file diff --git a/products/ASC.People/Client/src/components/pages/ProfileAction/Section/Body/Form/userForm.js b/products/ASC.People/Client/src/components/pages/ProfileAction/Section/Body/Form/userForm.js index e972d842f2..114f19633d 100644 --- a/products/ASC.People/Client/src/components/pages/ProfileAction/Section/Body/Form/userForm.js +++ b/products/ASC.People/Client/src/components/pages/ProfileAction/Section/Body/Form/userForm.js @@ -1,13 +1,13 @@ import React, { useCallback } from 'react' import { withRouter } from 'react-router' -import { Field, reduxForm } from 'redux-form' -import { Avatar, Button, TextInput, Textarea, Label } from 'asc-web-components' +import { connect } from 'react-redux' +import { Field, reduxForm, formValueSelector } from 'redux-form' +import { Avatar, Button, TextInput, Textarea, DateInput, Label, RadioButton, Text } from 'asc-web-components' import submit from './submit' import validate from './validate' import styled from 'styled-components'; import { useTranslation } from 'react-i18next'; - const getUserRole = user => { if(user.isOwner) return "owner"; if(user.isAdmin) return "admin"; @@ -52,17 +52,30 @@ const FieldContainer = styled.div` flex-direction: row; margin: 0 0 16px 0; - .label { + .field-label { line-height: 32px; margin: 0; width: 110px; } + .field-input { + width: 320px; + } + + .radio-group { + line-height: 32px; + display: flex; + + label:not(:first-child) { + margin-left: 33px; + } + } + @media ${device.tablet} { flex-direction: column; align-items: start; - .label { + .field-label { line-height: unset; margin: 0 0 4px 0; width: auto; @@ -71,25 +84,43 @@ const FieldContainer = styled.div` } `; - - const FieldBody = styled.div` flex-grow: 1; `; -const renderField = ({ input, label, type, meta: { touched, error } }) => ( +const RadioGroupFieldBody = styled(FieldBody).attrs({ + className: "radio-group" +})``; + +const renderTextField = ({ input, label, isRequired, meta: { touched, error } }) => ( - ) -const UserForm = props => { +const renderPasswordField = ({ input, isDisabled }) => ( + +) + +const renderDateField = ({ input, label, isRequired, meta: { touched, error } }) => ( + + +) + +const renderRadioField = ({ input, label, isChecked }) => ( + +) + +let UserForm = props => { const { t, i18n } = useTranslation(); - const { error, handleSubmit, submitting, initialValues, userType, history } = props; + const { error, handleSubmit, submitting, initialValues, sexIsMale, passwordTypeIsLink, passwordError, userType, history } = props; const onCancel = useCallback(() => { history.goBack(); @@ -100,7 +131,7 @@ const UserForm = props => { { - initialValues + initialValues.id ? { size="max" role={userType} editing={true} - editLabel={"Add photo"} + editLabel={t('Resource:AddPhoto')} editAction={onEditAvatar} /> } @@ -122,27 +153,70 @@ const UserForm = props => { + + + + + + + + + +
-