File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
components/forms/EditShadowAssignmentForm Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import LocalizedTextsFormField from '../LocalizedTextsFormField';
1010import SubmitButton from '../SubmitButton' ;
1111import { LocalizedExerciseName } from '../../helpers/LocalizedNames' ;
1212import { validateLocalizedTextsFormData } from '../../../helpers/localizedData' ;
13+ import { safeGet } from '../../../helpers/common' ;
1314
1415const EditShadowAssignmentForm = ( {
1516 initialValues : shadowAssignment ,
@@ -28,13 +29,17 @@ const EditShadowAssignmentForm = ({
2829 < div >
2930 < FormBox
3031 title = {
31- < FormattedMessage
32- id = "app.editShadowAssignment.titleName"
33- defaultMessage = "Edit Shadow Assignment — {name}"
34- values = { {
35- name : < LocalizedExerciseName entity = { shadowAssignment } /> ,
36- } }
37- />
32+ safeGet ( shadowAssignment , [ 'localizedTexts' ] , [ ] ) . filter ( lt => lt . _enabled && lt . name ) . length > 0 ? (
33+ < FormattedMessage
34+ id = "app.editShadowAssignment.titleName"
35+ defaultMessage = "Edit Shadow Assignment — {name}"
36+ values = { {
37+ name : < LocalizedExerciseName entity = { shadowAssignment } /> ,
38+ } }
39+ />
40+ ) : (
41+ < FormattedMessage id = "app.editShadowAssignment.title" defaultMessage = "Edit Shadow Assignment" />
42+ )
3843 }
3944 successful = { submitSucceeded }
4045 dirty = { dirty }
Original file line number Diff line number Diff line change @@ -436,7 +436,7 @@ const mapStateToProps = (
436436
437437const mapDispatchToProps = ( dispatch , { match : { params } } ) => ( {
438438 loadAsync : ( ) => GroupDetail . loadAsync ( params , dispatch ) ,
439- createShadowAssignment : ( ) => dispatch ( createShadowAssignment ( { groupId : params . groupId } ) ) ,
439+ createShadowAssignment : ( ) => dispatch ( createShadowAssignment ( params . groupId ) ) ,
440440 createGroupExercise : ( ) => dispatch ( createExercise ( { groupId : params . groupId } ) ) ,
441441} ) ;
442442
You can’t perform that action at this time.
0 commit comments