diff --git a/src/components/forms/EditGroupForm/EditGroupForm.js b/src/components/forms/EditGroupForm/EditGroupForm.js
index 29abfbf04..2495d6248 100644
--- a/src/components/forms/EditGroupForm/EditGroupForm.js
+++ b/src/components/forms/EditGroupForm/EditGroupForm.js
@@ -21,7 +21,8 @@ const EditGroupForm = ({
hasThreshold,
collapsable = false,
isOpen = true,
- reset
+ reset,
+ isSuperAdmin
}) =>
-
- }
- />
+ {isSuperAdmin &&
+
+ }
+ />}
{
diff --git a/src/components/forms/ForkExerciseForm/ForkExerciseForm.css b/src/components/forms/ForkExerciseForm/ForkExerciseForm.css
index ca4e570d0..824f8b236 100644
--- a/src/components/forms/ForkExerciseForm/ForkExerciseForm.css
+++ b/src/components/forms/ForkExerciseForm/ForkExerciseForm.css
@@ -1,4 +1,4 @@
-.formSpace {
- padding-left: 10px;
+.forkForm {
+ padding-left: 0px;
display: flex;
}
diff --git a/src/components/forms/ForkExerciseForm/ForkExerciseForm.js b/src/components/forms/ForkExerciseForm/ForkExerciseForm.js
index 7c7dcef5c..fb627bccd 100644
--- a/src/components/forms/ForkExerciseForm/ForkExerciseForm.js
+++ b/src/components/forms/ForkExerciseForm/ForkExerciseForm.js
@@ -13,7 +13,7 @@ import { SuccessIcon } from '../../../components/icons';
import { forkStatuses } from '../../../redux/modules/exercises';
import { getFork } from '../../../redux/selectors/exercises';
import ResourceRenderer from '../../helpers/ResourceRenderer';
-import { getLocalizedName } from '../../../helpers/getLocalizedData';
+import { getGroupCanonicalLocalizedName } from '../../../helpers/getLocalizedData';
import withLinks from '../../../helpers/withLinks';
@@ -41,6 +41,7 @@ class ForkExerciseForm extends Component {
submitSucceeded,
invalid,
groups,
+ groupsAccessor,
intl: { locale }
} = this.props;
@@ -70,7 +71,7 @@ class ForkExerciseForm extends Component {
defaultMessage="Saving failed. Please try again later."
/>
}
-
}
-
- {canEditExercise &&
- }
-
+ {canEditExercise &&
+
+
+
+ {isSuperAdmin &&
+ forkExercise(forkId, formData)}
+ groupsAccessor={groupsAccessor}
+ />}
+
+ }
@@ -218,32 +274,28 @@ class Exercise extends Component {
}
{!exercise.isBroken &&
+ !exercise.isLocked &&
}
- noPadding
+ unlimitedHeight
>
-
- {() =>
-
-
- this.assignExercise(groupId)}
- />}
+
+ {visibleGroups =>
+ }
}
@@ -438,6 +490,7 @@ Exercise.propTypes = {
}).isRequired,
loadAsync: PropTypes.func.isRequired,
assignExercise: PropTypes.func.isRequired,
+ editAssignment: PropTypes.func.isRequired,
push: PropTypes.func.isRequired,
exercise: ImmutablePropTypes.map,
supervisedGroups: PropTypes.object,
@@ -451,9 +504,15 @@ Exercise.propTypes = {
links: PropTypes.object,
deleteReferenceSolution: PropTypes.func.isRequired,
forkExercise: PropTypes.func.isRequired,
- groups: ImmutablePropTypes.map
+ groups: ImmutablePropTypes.map,
+ isSuperAdmin: PropTypes.bool,
+ groupsAccessor: PropTypes.func.isRequired,
+ firstDeadline: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
+ allowSecondDeadline: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])
};
+const editMultiAssignFormSelector = formValueSelector('multiAssign');
+
export default withLinks(
connect(
(state, { params: { exerciseId } }) => {
@@ -467,12 +526,20 @@ export default withLinks(
canEditExercise: canLoggedUserEditExercise(exerciseId)(state),
referenceSolutions: referenceSolutionsSelector(exerciseId)(state),
exercisePipelines: exercisePipelinesSelector(exerciseId)(state),
- groups: groupsSelector(state)
+ groups: groupsSelector(state),
+ groupsAccessor: groupDataAccessorSelector(state),
+ isSuperAdmin: isLoggedAsSuperAdmin(state),
+ firstDeadline: editMultiAssignFormSelector(state, 'firstDeadline'),
+ allowSecondDeadline: editMultiAssignFormSelector(
+ state,
+ 'allowSecondDeadline'
+ )
};
},
(dispatch, { params: { exerciseId } }) => ({
loadAsync: userId => Exercise.loadAsync({ exerciseId }, dispatch, userId),
assignExercise: groupId => dispatch(assignExercise(groupId, exerciseId)),
+ editAssignment: (id, body) => dispatch(editAssignment(id, body)),
push: url => dispatch(push(url)),
initCreateReferenceSolution: userId => dispatch(init(userId, exerciseId)),
createExercisePipeline: () =>
diff --git a/src/redux/modules/users.js b/src/redux/modules/users.js
index ca60a576d..19618a918 100644
--- a/src/redux/modules/users.js
+++ b/src/redux/modules/users.js
@@ -45,6 +45,7 @@ export const fetchAllUsers = actions.fetchMany({
endpoint: fetchManyEndpoint
});
export const loadUserData = actions.pushResource;
+export const fetchUser = actions.fetchResource;
export const fetchUserIfNeeded = actions.fetchIfNeeded;
export const validateRegistrationData = (email, password) =>
createApiAction({