1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 15:19:06 +00:00

multi select and fix image src

This commit is contained in:
Michael An
2019-06-29 11:24:18 +08:00
parent 6c0c0f8ef2
commit 859908df06
4 changed files with 12 additions and 8 deletions

View File

@@ -87,11 +87,13 @@ class FileParticipantDialog extends Component {
if (!selectedOption || selectedOption.length === 0) {
return;
}
seafileAPI.addFileParticipant(repoID, filePath, selectedOption.email).then((res) => {
for (let i = 0; i < selectedOption.length; i++) {
seafileAPI.addFileParticipant(repoID, filePath, selectedOption[i].email).then((res) => {
this.props.onParticipantsChange(repoID, filePath);
}).catch((error) => {
this.handleError(error);
});
}
this.setState({ selectedOption: null });
this.refs.userSelect.clearSelect();
};
@@ -122,7 +124,7 @@ class FileParticipantDialog extends Component {
<div className="participant-add">
<UserSelect
ref="userSelect"
isMulti={false}
isMulti={true}
className="participant-select"
placeholder={gettext('Select users...')}
onSelectChange={this.handleSelectChange}

View File

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { Tooltip } from 'reactstrap';
import ModalPortal from '../modal-portal';
import FileParticipantDialog from '../dialog/file-participant-dialog';
import { serviceURL, gettext } from '../../utils/constants';
import { gettext } from '../../utils/constants';
import '../../css/participants-list.css';
const propTypes = {
@@ -37,7 +37,7 @@ class ParticipantsList extends React.Component {
return (
<div className="participants mb-2 position-relative">
{participants.map((item, index) => {
return <img src={serviceURL + item.avatar_url} className="avatar" alt="avatar" key={index} style={{left: index * -7 + 'px'}}/>;
return <img src={item.avatar_url} className="avatar" alt="avatar" key={index} style={{left: index * -7 + 'px'}}/>;
})}
<span className="add-participants" style={{left: participants.length * 21, top: 8 }} onClick={this.toggleDialog} id="add-participant-icon">
<i className="fas fa-plus-circle"></i>

View File

@@ -616,6 +616,7 @@ class MarkdownEditor extends React.Component {
this.listFileTags();
this.listFileParticipants();
window.showParticipants = true;
setTimeout(() => {
let url = new URL(window.location.href);
if (url.hash) {

View File

@@ -54,6 +54,7 @@ class FileParticipantsView(APIView):
for participant in participant_queryset:
participant_info = get_user_common_info(participant.username)
participant_info['avatar_url'] = request.build_absolute_uri(participant_info['avatar_url'])
participant_list.append(participant_info)
except Exception as e:
logger.error(e)