Skip to content

Commit

Permalink
Fixing shadow assignment creation issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Krulis committed Nov 8, 2019
1 parent 4ee37ab commit 49ed2c6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import LocalizedTextsFormField from '../LocalizedTextsFormField';
import SubmitButton from '../SubmitButton';
import { LocalizedExerciseName } from '../../helpers/LocalizedNames';
import { validateLocalizedTextsFormData } from '../../../helpers/localizedData';
import { safeGet } from '../../../helpers/common';

const EditShadowAssignmentForm = ({
initialValues: shadowAssignment,
Expand All @@ -28,13 +29,17 @@ const EditShadowAssignmentForm = ({
<div>
<FormBox
title={
<FormattedMessage
id="app.editShadowAssignment.titleName"
defaultMessage="Edit Shadow Assignment — {name}"
values={{
name: <LocalizedExerciseName entity={shadowAssignment} />,
}}
/>
safeGet(shadowAssignment, ['localizedTexts'], []).filter(lt => lt._enabled && lt.name).length > 0 ? (
<FormattedMessage
id="app.editShadowAssignment.titleName"
defaultMessage="Edit Shadow Assignment — {name}"
values={{
name: <LocalizedExerciseName entity={shadowAssignment} />,
}}
/>
) : (
<FormattedMessage id="app.editShadowAssignment.title" defaultMessage="Edit Shadow Assignment" />
)
}
successful={submitSucceeded}
dirty={dirty}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/GroupDetail/GroupDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ const mapStateToProps = (

const mapDispatchToProps = (dispatch, { match: { params } }) => ({
loadAsync: () => GroupDetail.loadAsync(params, dispatch),
createShadowAssignment: () => dispatch(createShadowAssignment({ groupId: params.groupId })),
createShadowAssignment: () => dispatch(createShadowAssignment(params.groupId)),
createGroupExercise: () => dispatch(createExercise({ groupId: params.groupId })),
});

Expand Down

0 comments on commit 49ed2c6

Please sign in to comment.