Web: People: Profile: Added displayed information for @self profile view

This commit is contained in:
Ilya Oleshko 2019-07-25 17:13:12 +03:00
parent 96cb6d5841
commit f9e3b2980d

View File

@ -96,7 +96,7 @@ const getFormattedDepartments = (departments) => {
};
const sendMail = (email) => {
window.open('mailto:'+email);
window.open('mailto:' + email);
};
const capitalizeFirstLetter = (string) => {
@ -106,6 +106,7 @@ const capitalizeFirstLetter = (string) => {
const createContacts = (contacts) => {
return contacts.map((contact, index) => {
if (contact.value)
return (
<div key={index} style={{ display: "inline-flex", width: "300px" }}>
<IconButton color="#333333" size={16} iconName={contact.icon} isFill={true} onClick={() => { }} />
@ -116,7 +117,7 @@ const createContacts = (contacts) => {
};
const SectionBodyContent = (props) => {
const { profile, history } = props;
const { profile, history, isSelf, isAdmin } = props;
getFormattedContacts(profile);
@ -144,10 +145,12 @@ const SectionBodyContent = (props) => {
{profile.workFrom && <Text.Body style={restMargins} color='lightGray' title='Employed since'>Employed since:</Text.Body>}
{profile.birthday && <Text.Body style={restMargins} color='lightGray' title='Date of birth'>Date of birth:</Text.Body>}
{profile.location && <Text.Body style={restMargins} color='lightGray' title='Location'>Location:</Text.Body>}
{isSelf && <Text.Body style={restMargins} color='lightGray' title='Language'>Language:</Text.Body>}
{isSelf && <Text.Body style={{marginTop: "24px"}} color='lightGray' title='Affiliate status'>Affiliate status:</Text.Body>}
</div>
<div>
<Text.Body style={restMargins}>{profile.isVisitor ? "Guest" : "Employee"}</Text.Body>
<Text.Body style={restMargins}><Link type="page" fontSize={13} isHovered={true} text={profile.email} onClick={() => sendMail(profile.email)}/>{profile.activationStatus === 2 && ' (Pending)'}</Text.Body>
<Text.Body style={restMargins}><Link type="page" fontSize={13} isHovered={true} text={profile.email} onClick={() => sendMail(profile.email)} />{profile.activationStatus === 2 && ' (Pending)'}</Text.Body>
<Text.Body style={restMargins}>{getFormattedDepartments(profile.department)}</Text.Body>
<Text.Body style={restMargins}>{profile.title}</Text.Body>
<Text.Body style={restMargins}>{profile.mobilePhone}</Text.Body>
@ -155,8 +158,32 @@ const SectionBodyContent = (props) => {
<Text.Body style={restMargins}>{getFormattedDate(profile.workFrom)}</Text.Body>
<Text.Body style={restMargins}>{getFormattedDate(profile.birthday)}</Text.Body>
<Text.Body style={restMargins}>{profile.location}</Text.Body>
{isSelf && <Text.Body style={restMargins}>{profile.cultureName}</Text.Body>}
{isSelf && <Button style={{marginTop: "22px"}} size="base" label="Become our Affiliate" onClick={() => console.log('Become our Affiliate onClick()')}/>}
</div>
</div>
{isSelf &&
<div style={{ width: "100%", marginBottom: "24px" }}>
<ToggleContent label="Login settings" style={notesWrapper} isOpen={true}>
<Text.Body tag="span">
Two-factor authentication via code generating application was enabled for all users by cloud service administrator.
<div style={{marginTop: "10px"}}>
<Link type="action" isBold={true} isHovered={true} fontSize={13} text='Reset application' />
<Link style={{marginLeft: "18px"}} type="action" isBold={true} isHovered={true} fontSize={13} text='Show backup codes' />
</div>
</Text.Body>
</ToggleContent>
</div>
}
{isSelf &&
<div style={{ width: "100%", marginBottom: "24px" }}>
<ToggleContent label="Subscriptions" style={notesWrapper} isOpen={true}>
<Text.Body tag="span">
<Button size="big" label="Edit subscriptions" primary={true} onClick={() => console.log('Edit subscriptions onClick()')}/>
</Text.Body>
</ToggleContent>
</div>
}
{profile.notes &&
<div style={{ width: "100%" }}>
<ToggleContent label="Comment" style={notesWrapper} isOpen={true}>