fix(ui): fix jira issues
This commit is contained in:
parent
4bda9c6e5b
commit
7c9b56798b
2 changed files with 24 additions and 15 deletions
|
|
@ -14,7 +14,7 @@ const SelectedValue = ({ icon, text }) => {
|
|||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
class IssueForm extends React.PureComponent {
|
||||
componentDidMount() {
|
||||
const { projects, issueTypes } = this.props;
|
||||
|
|
@ -37,7 +37,7 @@ class IssueForm extends React.PureComponent {
|
|||
const { sessionId, addActivity } = this.props;
|
||||
const { instance } = this.props;
|
||||
|
||||
addActivity(sessionId, instance).then(() => {
|
||||
addActivity(sessionId, instance.toJS()).then(() => {
|
||||
const { errors } = this.props;
|
||||
if (!errors || errors.length === 0) {
|
||||
this.props.init({projectId: instance.projectId});
|
||||
|
|
@ -47,20 +47,23 @@ class IssueForm extends React.PureComponent {
|
|||
});
|
||||
}
|
||||
|
||||
write = ({ target: { name, value } }) => this.props.edit({ [ name ]: value });
|
||||
writeOption = (e, { name, value }) => this.props.edit({ [ name ]: value });
|
||||
write = (e) => {
|
||||
const { target: { name, value } } = e;
|
||||
this.props.edit({ [ name ]: value })
|
||||
};
|
||||
writeOption = ({ name, value }) => this.props.edit({ [ name ]: value });
|
||||
|
||||
render() {
|
||||
const { creating, projects, users, issueTypes, instance, closeHandler, metaLoading } = this.props;
|
||||
const projectOptions = projects.map(({name, id}) => ({text: name, value: id })).toArray();
|
||||
const userOptions = users.map(({name, id}) => ({text: name, value: id })).toArray();
|
||||
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 {text: name, value: id, iconUrl, color }
|
||||
}).toArray();
|
||||
|
||||
const selectedIssueType = issueTypes.filter(issue => issue.id == instance.issueType).first();
|
||||
return { label: name, value: id, iconUrl, color }
|
||||
});
|
||||
|
||||
const selectedIssueType = issueTypes.filter(issue => issue.id == instance.issueType)[0];
|
||||
|
||||
return (
|
||||
<Form onSubmit={ this.onSubmit }>
|
||||
<Form.Field className="mb-15-imp">
|
||||
|
|
@ -134,11 +137,16 @@ class IssueForm extends React.PureComponent {
|
|||
variant="primary"
|
||||
disabled={ !instance.validate() }
|
||||
className="float-left mr-2"
|
||||
>{'Create'}</Button>
|
||||
type="submit"
|
||||
>
|
||||
{'Create'}
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
onClick={ closeHandler }
|
||||
>{'Cancel'}</Button>
|
||||
>
|
||||
{'Cancel'}
|
||||
</Button>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ const reducer = (state = initialState, action = {}) => {
|
|||
case FETCH_ASSIGNMENT.SUCCESS:
|
||||
return state.set('activeIssue', Assignment({ ...action.data, users}));
|
||||
case FETCH_META.SUCCESS:
|
||||
issueTypes = List(action.data.issueTypes).map(IssuesType);
|
||||
issueTypes = action.data.issueTypes
|
||||
var issueTypeIcons = {}
|
||||
issueTypes.forEach(iss => {
|
||||
issueTypeIcons[iss.id] = iss.iconUrl
|
||||
|
|
@ -109,9 +109,10 @@ export function fetchAssigment(sessionId, id) {
|
|||
}
|
||||
|
||||
export function addActivity(sessionId, params) {
|
||||
const data = { ...params, assignee: params.assignee.value, issueType: params.issueType.value }
|
||||
return {
|
||||
types: ADD_ACTIVITY.toArray(),
|
||||
call: client => client.post(`/sessions2/${ sessionId }/assign/projects/${params.projectId}`, params.toCreate()),
|
||||
call: client => client.post(`/sessions2/${ sessionId }/assign/projects/${params.projectId.value}`, data),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -120,4 +121,4 @@ export function addMessage(sessionId, assignmentId, params) {
|
|||
types: ADD_MESSAGE.toArray(),
|
||||
call: client => client.post(`/sessions2/${ sessionId }/assign/${ assignmentId }/comment`, params),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue