mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 10:22:46 +00:00
enable show contact email when search user (#4641)
* enable show contact email when search user * [user-select] added new user option with email shown Co-authored-by: lian <lian@seafile.com> Co-authored-by: llj <lingjun.li1@gmail.com>
This commit is contained in:
@@ -2,10 +2,12 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import AsyncSelect from 'react-select/lib/Async';
|
||||
import { seafileAPI } from '../utils/seafile-api.js';
|
||||
import { gettext } from '../utils/constants';
|
||||
import { gettext, enableShowContactEmailWhenSearchUser } from '../utils/constants';
|
||||
import { Utils } from '../utils/utils.js';
|
||||
import toaster from './toast';
|
||||
|
||||
import '../css/user-select.css';
|
||||
|
||||
const propTypes = {
|
||||
placeholder: PropTypes.string.isRequired,
|
||||
onSelectChange: PropTypes.func.isRequired,
|
||||
@@ -42,10 +44,19 @@ class UserSelect extends React.Component {
|
||||
obj.value = item.name;
|
||||
obj.email = item.email;
|
||||
obj.label =
|
||||
<React.Fragment>
|
||||
<img src={item.avatar_url} className="select-module select-module-icon avatar" alt=""/>
|
||||
<span className='select-module select-module-name'>{item.name}</span>
|
||||
</React.Fragment>;
|
||||
enableShowContactEmailWhenSearchUser ? (
|
||||
<div className="d-flex">
|
||||
<img src={item.avatar_url} className="avatar" width="24" alt="" />
|
||||
<div className="ml-2">
|
||||
<span className="user-option-name">{item.name}</span><br />
|
||||
<span className="user-option-email">{item.contact_email}</span>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<React.Fragment>
|
||||
<img src={item.avatar_url} className="select-module select-module-icon avatar" alt=""/>
|
||||
<span className='select-module select-module-name'>{item.name}</span>
|
||||
</React.Fragment>);
|
||||
this.options.push(obj);
|
||||
}
|
||||
callback(this.options);
|
||||
|
7
frontend/src/css/user-select.css
Normal file
7
frontend/src/css/user-select.css
Normal file
@@ -0,0 +1,7 @@
|
||||
.user-option-name {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.user-option-email {
|
||||
font-size: 12px;
|
||||
}
|
@@ -62,6 +62,7 @@ export const canAddPublicRepo = window.app.pageOptions.canAddPublicRepo;
|
||||
export const canInvitePeople = window.app.pageOptions.canInvitePeople;
|
||||
export const canLockUnlockFile = window.app.pageOptions.canLockUnlockFile;
|
||||
export const customNavItems = window.app.pageOptions.customNavItems;
|
||||
export const enableShowContactEmailWhenSearchUser = window.app.pageOptions.enableShowContactEmailWhenSearchUser;
|
||||
export const maxUploadFileSize = window.app.pageOptions.maxUploadFileSize;
|
||||
export const maxNumberOfFilesForFileupload = window.app.pageOptions.maxNumberOfFilesForFileupload;
|
||||
|
||||
|
Reference in New Issue
Block a user