diff --git a/frontend/app/components/Session_/Issues/IssueForm.js b/frontend/app/components/Session_/Issues/IssueForm.js index bedbb2860..b263739f3 100644 --- a/frontend/app/components/Session_/Issues/IssueForm.js +++ b/frontend/app/components/Session_/Issues/IssueForm.js @@ -3,17 +3,17 @@ import { connect } from 'react-redux'; import { Form, Input, Button, CircularLoader } from 'UI'; //import { } from 'Duck/issues'; import { addActivity, init, edit, fetchAssignments, fetchMeta } from 'Duck/assignments'; -import Select from 'Shared/Select' +import Select from 'Shared/Select'; const SelectedValue = ({ icon, text }) => { - return( + return (
{/* */} - { icon } - { text } + {icon} + {text}
- ) -} + ); +}; class IssueForm extends React.PureComponent { componentDidMount() { @@ -21,7 +21,7 @@ class IssueForm extends React.PureComponent { this.props.init({ projectId: projects[0] ? projects[0].id : '', - issueType: issueTypes[0] ? issueTypes[0].id : '' + issueType: issueTypes[0] ? issueTypes[0].id : '', }); } @@ -41,43 +41,46 @@ class IssueForm extends React.PureComponent { addActivity(sessionId, instance.toJS()).then(() => { const { errors } = this.props; if (!errors || errors.length === 0) { - this.props.init({projectId: instance.projectId}); + this.props.init({ projectId: instance.projectId }); this.props.fetchAssignments(sessionId); this.props.closeHandler(); } }); - } + }; write = (e) => { - const { target: { name, value } } = e; - this.props.edit({ [ name ]: value }) + const { + target: { name, value }, + } = e; + this.props.edit({ [name]: value }); }; - writeOption = ({ name, value }) => this.props.edit({ [ name ]: value }); + writeOption = ({ name, value }) => this.props.edit({ [name]: value.value }); render() { - const { creating, projects, users, issueTypes, instance, closeHandler, metaLoading } = this.props; - const projectOptions = projects.map(({name, id}) => ({label: name, value: id })).toArray(); - const userOptions = users.map(({name, id}) => ({label: name, value: id })).toArray(); + const { creating, projects, users, issueTypes, instance, closeHandler, metaLoading } = + this.props; + const projectOptions = projects.map(({ name, id }) => ({ label: name, value: id })).toArray(); + const userOptions = users.map(({ name, id }) => ({ label: name, value: id })).toArray(); - const issueTypeOptions = issueTypes.map(({name, id, iconUrl, color }) => { - return { label: name, value: id, iconUrl, color } + const issueTypeOptions = issueTypes.map(({ name, id, iconUrl, color }) => { + return { label: name, value: id, iconUrl, color }; }); - const selectedIssueType = issueTypes.filter(issue => issue.id == instance.issueType)[0]; + const selectedIssueType = issueTypes.filter((issue) => issue.id == instance.issueType)[0]; return ( -
+ @@ -113,9 +122,9 @@ class IssueForm extends React.PureComponent { @@ -127,25 +136,22 @@ class IssueForm extends React.PureComponent {