diff --git a/config/default.schema.json b/config/default.schema.json index c8c1c304f9..c3eeca73b4 100644 --- a/config/default.schema.json +++ b/config/default.schema.json @@ -601,6 +601,11 @@ "default": false, "description": "Enables the new class list view" }, + "FEATURE_SHOW_NEW_ROOMS_VIEW_ENABLED": { + "type": "boolean", + "default": false, + "description": "Enables the new rooms view" + }, "FEATURE_GROUPS_IN_COURSE_ENABLED": { "type": "boolean", "default": false, diff --git a/controllers/administration.js b/controllers/administration.js index a97510134b..7588fc305e 100644 --- a/controllers/administration.js +++ b/controllers/administration.js @@ -2398,6 +2398,7 @@ router.all('/courses', (req, res, next) => { roles: ['student'], $limit: 1000, }); + const newRoomViewEnabled = Configuration.get('FEATURE_SHOW_NEW_ROOMS_VIEW_ENABLED'); Promise.all([ coursesPromise, @@ -2420,7 +2421,8 @@ router.all('/courses', (req, res, next) => { (item.teacherIds || []).map((item) => `${item.lastName}${item.outdatedSince ? ' ~~' : ''}`).join(', '), [ { - link: `/courses/${item._id}/edit?redirectUrl=/administration/courses`, + link: newRoomViewEnabled ? `/courses/${item._id}/edit?redirectUrl=/administration/rooms/new` + : `/courses/${item._id}/edit?redirectUrl=/administration/courses`, icon: 'edit', title: res.$t('administration.controller.link.editEntry'), }, diff --git a/helpers/handlebars/middleware.js b/helpers/handlebars/middleware.js index cd8d9636e2..76a3084471 100644 --- a/helpers/handlebars/middleware.js +++ b/helpers/handlebars/middleware.js @@ -279,6 +279,8 @@ module.exports = (req, res, next) => { // admin views const newSchoolAdminPageAsDefault = Configuration.get('FEATURE_NEW_SCHOOL_ADMINISTRATION_PAGE_AS_DEFAULT_ENABLED'); + const newRoomsViewEnabled = Configuration.get('FEATURE_SHOW_NEW_ROOMS_VIEW_ENABLED'); + const adminChildItems = [ { name: res.$t('global.link.administrationStudents'), @@ -326,6 +328,14 @@ module.exports = (req, res, next) => { }, ]; + if (newRoomsViewEnabled) { + adminChildItems.splice(2, 1, { + name: res.$t('global.sidebar.link.administrationCourses'), + testId: 'Kurse', + icon: 'school-outline', + link: '/administration/rooms/new', + }); + } if (newClassViewEnabled) { adminChildItems.splice(3, 1, { name: res.$t('global.sidebar.link.administrationClasses'), diff --git a/views/administration/dashboard.hbs b/views/administration/dashboard.hbs index 0529ddf2fd..5e4c0ef375 100644 --- a/views/administration/dashboard.hbs +++ b/views/administration/dashboard.hbs @@ -36,7 +36,18 @@ {{/userHasPermission}} - {{#userHasPermission 'ADMIN_VIEW'}} + {{#userHasPermission 'COURSE_ADMINISTRATION'}} + {{#if (getConfig "FEATURE_SHOW_NEW_ROOMS_VIEW_ENABLED")}} +