Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions src/components/FileList/AddFilePermissions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const AddFilePermission = ({ onCancel, onSubmit, onChange, selectedUsers, projec
const projectMembersByHandle = mapKeys(projectMembers, value => value.handle)
return handles.filter(handle => handle).map(h => get(projectMembersByHandle[h], 'userId'))
}

return (
<Modal
isOpen
Expand Down Expand Up @@ -43,15 +43,20 @@ const AddFilePermission = ({ onCancel, onSubmit, onChange, selectedUsers, projec
>All project members</button>
</div>
</div>

{/* Share with specific people */}
<div className="input-container">
<div className="hint">OR ONLY SPECIFIC PEOPLE</div>

<UserAutoComplete projectMembers={projectMembers} selectedUsers={selectedUsers} onUpdate={onChange} loggedInUser={loggedInUser} />
<UserAutoComplete
projectMembers={projectMembers}
selectedUsers={selectedUsers ? selectedUsers.split(',').map((handle) => ({ value: handle, label: handle })) : []}
onUpdate={onChange}
loggedInUser={loggedInUser}
/>

<div styleName="btn-selected-members">
<button className="tc-btn tc-btn-primary tc-btn-md"
<button className="tc-btn tc-btn-primary tc-btn-md"
onClick={() => onSubmit(mapHandlesToUserIds(selectedUsers.split(',')))}
disabled={!selectedUsers || selectedUsers.length === 0 || isSharingAttachment }
>Share with selected members</button>
Expand All @@ -63,11 +68,11 @@ const AddFilePermission = ({ onCancel, onSubmit, onChange, selectedUsers, projec
}

AddFilePermission.propTypes = {
onCancel: PropTypes.func.isRequired,
onSubmit: PropTypes.func.isRequired,
onChange: PropTypes.func.isRequired,
selectedUsers: PropTypes.string,
projectMembers: PropTypes.object,
onCancel: PropTypes.func.isRequired,
onSubmit: PropTypes.func.isRequired,
onChange: PropTypes.func.isRequired,
selectedUsers: PropTypes.string,
projectMembers: PropTypes.object,
loggedInUser: PropTypes.object.isRequired,
isSharingAttachment: PropTypes.bool.isRequired,
}
Expand Down
5 changes: 3 additions & 2 deletions src/components/FileList/FileListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,11 @@ export default class FileListItem extends React.Component {
{ (errors && errors.title) && <div className="error-message">{ errors.title }</div> }
<textarea defaultValue={description} ref="desc" maxLength={250} className="tc-textarea" />
{ (errors && errors.desc) && <div className="error-message">{ errors.desc }</div> }
<UserAutoComplete onUpdate={this.onUserIdChange}
<UserAutoComplete
onUpdate={this.onUserIdChange}
projectMembers={projectMembers}
loggedInUser={loggedInUser}
selectedUsers={this.userIdsToHandles(allowedUsers).join(',')}
selectedUsers={this.userIdsToHandles(allowedUsers).map((handle) => ({ value: handle, label: handle }))}
/>
</div>
)
Expand Down
4 changes: 2 additions & 2 deletions src/components/LinksMenu/EditFileAttachment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ export class EditFileAttachment extends React.Component {
You're about to edit an attachment
</div>
<div className="modal-body">
<label for="title">Title:</label>
<label htmlFor="title">Title:</label>
<input className="edit-input" type="text" value={title} onChange={this.handleTitleChange.bind(this)} name="title"/>
<br />
<label for="title">File Viewers:</label>
<label>File Viewers:</label>
<UserAutoComplete onUpdate={this.onUserIdChange}
projectMembers={projectMembers}
loggedInUser={loggedInUser}
Expand Down
5 changes: 4 additions & 1 deletion src/components/UserAutoComplete/UserAutoComplete.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ const UserAutoComplete = ({

UserAutoComplete.propTypes = {
projectMembers: PropTypes.object,
selectedUsers: PropTypes.string,
selectedUsers: PropTypes.arrayOf(PropTypes.shape({
value: PropTypes.string,
label: PropTypes.string,
})),
onUpdate: PropTypes.func,
loggedInUser: PropTypes.object
}
Expand Down
2 changes: 1 addition & 1 deletion src/projects/create/components/FillProjectDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class FillProjectDetails extends Component {
submitBtnText={ submitBtnText }
productTemplates={productTemplates}
/>
<ProjectEstimationSection project={dirtyProject} templates={templates} />
{/* <ProjectEstimationSection project={dirtyProject} templates={templates} /> */}
</div>
{formDisclaimer && (
<div className="left-area-footer">
Expand Down