diff --git a/src/components/forms/EditGroupForm/EditGroupForm.js b/src/components/forms/EditGroupForm/EditGroupForm.js index 82b42f717..0d78e92c2 100644 --- a/src/components/forms/EditGroupForm/EditGroupForm.js +++ b/src/components/forms/EditGroupForm/EditGroupForm.js @@ -24,6 +24,7 @@ export const EDIT_GROUP_FORM_EMPTY_INITIAL_VALUES = { publicStats: false, hasThreshold: false, isOrganizational: false, + isExam: false, detaining: false, makeMeAdmin: true, threshold: 0, @@ -47,6 +48,7 @@ const EditGroupForm = ({ reset, isSuperAdmin, isOrganizational = false, + isExam = false, }) => ( {createNew && ( - - - } - /> - + <> + + + } + disabled={isExam} + /> + + + } + disabled={isOrganizational} + /> + + )} {!isOrganizational && ( } @@ -201,7 +216,7 @@ const EditGroupForm = ({ { diff --git a/src/locales/cs.json b/src/locales/cs.json index 4987e1266..4e8b1862f 100644 --- a/src/locales/cs.json +++ b/src/locales/cs.json @@ -265,6 +265,7 @@ "app.createExerciseForm.title": "Vytvořit novou úlohu", "app.createExerciseForm.validation.noGroupSelected": "Nebyla vybrána domovská skupina.", "app.createGroup.detaining": "Zadržuje studenty (jen vedoucí může studenty odebrat)", + "app.createGroup.isExam": "Zkoušková", "app.createGroup.externalId": "Externí identifikátor skupiny (aby bylo možné snáze vyrábět vazby na externí datové zdroje):", "app.createGroup.hasThreshold": "Studenti potřebují určitý počet bodů pro splnění kurzu", "app.createGroup.isOrganizational": "Organizační (pro vytváření hierarchie)", diff --git a/src/locales/en.json b/src/locales/en.json index 1054ef05e..55388c234 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -265,6 +265,7 @@ "app.createExerciseForm.title": "Create New Exercise", "app.createExerciseForm.validation.noGroupSelected": "No group of residence has been selected.", "app.createGroup.detaining": "Detaining students (only supervisor can remove them)", + "app.createGroup.isExam": "Exam", "app.createGroup.externalId": "External ID of the group (helps create bindings to external data sources):", "app.createGroup.hasThreshold": "Students require cetrain number of points to complete the course", "app.createGroup.isOrganizational": "Organizational (for structural purposes only)", @@ -2137,4 +2138,4 @@ "recodex-judge-shuffle-all": "Unordered-tokens-and-rows judge", "recodex-judge-shuffle-newline": "Unordered-tokens judge (ignoring ends of lines)", "recodex-judge-shuffle-rows": "Unordered-rows judge" -} \ No newline at end of file +} diff --git a/src/locales/whitelist_cs.json b/src/locales/whitelist_cs.json index 2fe335df0..44b8e2c40 100644 --- a/src/locales/whitelist_cs.json +++ b/src/locales/whitelist_cs.json @@ -109,6 +109,7 @@ "app.externalRegistrationForm.instance", "app.failureList.headLink", "app.faq.title", + "app.groupExamsTable.selectButton", "app.homepage.githubLink", "app.homepage.title", "app.instancesTable.admin", @@ -163,6 +164,5 @@ "app.systemMessagesList.text", "generic.detail", "generic.email", - "generic.role", - "app.groupExamsTable.selectButton" -] + "generic.role" +] \ No newline at end of file diff --git a/src/pages/GroupInfo/GroupInfo.js b/src/pages/GroupInfo/GroupInfo.js index ff6b15c1a..c3a94c2bd 100644 --- a/src/pages/GroupInfo/GroupInfo.js +++ b/src/pages/GroupInfo/GroupInfo.js @@ -104,6 +104,8 @@ class GroupInfo extends Component { isStudent, addSubgroup, hasThreshold, + isOrganizational, + isExam, pendingMemberships, addAdmin, addSupervisor, @@ -248,6 +250,8 @@ class GroupInfo extends Component { isOpen={false} hasThreshold={hasThreshold} isSuperAdmin={isSuperAdmin} + isOrganizational={isOrganizational} + isExam={isExam} /> )} @@ -283,6 +287,8 @@ GroupInfo.propTypes = { addObserver: PropTypes.func.isRequired, removeMember: PropTypes.func.isRequired, hasThreshold: PropTypes.bool, + isOrganizational: PropTypes.bool, + isExam: PropTypes.bool, pendingMemberships: ImmutablePropTypes.list, links: PropTypes.object, intl: PropTypes.shape({ locale: PropTypes.string.isRequired }).isRequired, @@ -308,6 +314,8 @@ const mapStateToProps = (state, { params: { groupId } }) => { isSuperAdmin: isLoggedAsSuperAdmin(state), isStudent: loggedUserIsStudentOfSelector(state)(groupId), hasThreshold: addSubgroupFormSelector(state, 'hasThreshold'), + isOrganizational: addSubgroupFormSelector(state, 'isOrganizational'), + isExam: addSubgroupFormSelector(state, 'isExam'), pendingMemberships: pendingMembershipsSelector(state, groupId), }; }; diff --git a/src/pages/Instance/Instance.js b/src/pages/Instance/Instance.js index bf61a70d5..29785e5f5 100644 --- a/src/pages/Instance/Instance.js +++ b/src/pages/Instance/Instance.js @@ -64,6 +64,8 @@ class Instance extends Component { isAdmin, isSuperAdmin, hasThreshold, + isOrganizational, + isExam, links: { ADMIN_EDIT_INSTANCE_URI_FACTORY }, intl: { locale }, } = this.props; @@ -146,6 +148,8 @@ class Instance extends Component { collapsable isOpen={false} hasThreshold={hasThreshold} + isOrganizational={isOrganizational} + isExam={isExam} isSuperAdmin={isSuperAdmin} /> )} @@ -173,6 +177,8 @@ Instance.propTypes = { isSuperAdmin: PropTypes.bool.isRequired, links: PropTypes.object.isRequired, hasThreshold: PropTypes.bool, + isOrganizational: PropTypes.bool, + isExam: PropTypes.bool, intl: PropTypes.shape({ locale: PropTypes.string.isRequired }).isRequired, }; @@ -190,6 +196,8 @@ export default withLinks( isAdmin: isAdminOfInstance(userId, instanceId)(state), isSuperAdmin: isLoggedAsSuperAdmin(state), hasThreshold: addGroupFormSelector(state, 'hasThreshold'), + isOrganizational: addGroupFormSelector(state, 'isOrganizational'), + isExam: addGroupFormSelector(state, 'isExam'), }; }, (dispatch, { params: { instanceId } }) => ({