From 9c23516835c5557dbbb38748eb9a47286d42777d Mon Sep 17 00:00:00 2001 From: Igor Richter Date: Fri, 27 Oct 2023 14:35:17 +0200 Subject: [PATCH 1/3] replace classes with new classes in administration and sidebar --- helpers/handlebars/middleware.js | 12 ++++++------ locales/de.json | 1 - locales/en.json | 1 - locales/es.json | 1 - locales/uk.json | 1 - views/administration/dashboard.hbs | 4 +++- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/helpers/handlebars/middleware.js b/helpers/handlebars/middleware.js index c3549eede1..6d9a1a8477 100644 --- a/helpers/handlebars/middleware.js +++ b/helpers/handlebars/middleware.js @@ -209,8 +209,8 @@ module.exports = (req, res, next) => { ]; if (newClassViewEnabled) { - teacherChildren.splice(3, 0, { - name: res.$t('global.sidebar.link.administrationClassesNew'), + teacherChildren.splice(2, 1, { + name: res.$t('global.sidebar.link.administrationClasses'), testId: 'Klassen (neu)', icon: // eslint-disable-next-line max-len '', @@ -218,8 +218,8 @@ module.exports = (req, res, next) => { link: '/administration/groups/classes', }); - teacherChildrenWithoutStudents.splice(2, 0, { - name: res.$t('global.sidebar.link.administrationClassesNew'), + teacherChildrenWithoutStudents.splice(1, 1, { + name: res.$t('global.sidebar.link.administrationClasses'), testId: 'Klassen (neu)', icon: // eslint-disable-next-line max-len '', @@ -298,8 +298,8 @@ module.exports = (req, res, next) => { ]; if (newClassViewEnabled) { - adminChildItems.splice(4, 0, { - name: res.$t('global.sidebar.link.administrationClassesNew'), + adminChildItems.splice(3, 1, { + name: res.$t('global.sidebar.link.administrationClasses'), testId: 'Klassen (neu)', icon: // eslint-disable-next-line max-len '', diff --git a/locales/de.json b/locales/de.json index 6405bed5de..de63425483 100644 --- a/locales/de.json +++ b/locales/de.json @@ -1751,7 +1751,6 @@ "addons": "Add-ons", "administration": "Administration", "administrationClasses": "Klassen", - "administrationClassesNew": "Klassen (neu)", "administrationCourses": "Kurse" } }, diff --git a/locales/en.json b/locales/en.json index 526a7536ba..0714ed1d09 100644 --- a/locales/en.json +++ b/locales/en.json @@ -1751,7 +1751,6 @@ "addons": "Add-ons", "administration": "Administration", "administrationClasses": "Classes", - "administrationClassesNew": "Classes (new)", "administrationCourses": "Courses" } }, diff --git a/locales/es.json b/locales/es.json index 77376893ce..f0d165ae14 100644 --- a/locales/es.json +++ b/locales/es.json @@ -1751,7 +1751,6 @@ "addons": "Complementos", "administration": "Administración", "administrationClasses": "Clases", - "administrationClassesNew": "Clases (nuevo)", "administrationCourses": "Cursos" } }, diff --git a/locales/uk.json b/locales/uk.json index 967cae688c..e1fda3bc27 100644 --- a/locales/uk.json +++ b/locales/uk.json @@ -252,7 +252,6 @@ "link": { "addons": "Доповнення", "administrationClasses": "Класи", - "administrationClassesNew": "Класи (новий)", "administrationCourses": "Курси", "administration": "Адміністрація" } diff --git a/views/administration/dashboard.hbs b/views/administration/dashboard.hbs index b1500eb561..d16d3df93e 100644 --- a/views/administration/dashboard.hbs +++ b/views/administration/dashboard.hbs @@ -48,6 +48,7 @@ {{/userHasPermission}} {{#userHasPermission 'CLASS_LIST'}} + {{#unless (getConfig "FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED")}}
+ {{/unless}} {{/userHasPermission}} {{#userHasPermission 'CLASS_LIST'}} {{#if (getConfig "FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED")}} @@ -64,7 +66,7 @@ From b2292b0b0daef09b969c956a802227da106c9217 Mon Sep 17 00:00:00 2001 From: Igor Richter Date: Thu, 2 Nov 2023 11:46:29 +0100 Subject: [PATCH 2/3] redirects admin correctly when creating a class --- controllers/administration.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/administration.js b/controllers/administration.js index 8594ab4e7f..2f87dfff69 100644 --- a/controllers/administration.js +++ b/controllers/administration.js @@ -1955,7 +1955,7 @@ router.post( 'ADMIN_VIEW', ); if (isAdmin) { - res.redirect('/administration/classes/'); + Configuration.get('FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED') ? res.redirect('/administration/groups/classes/') : res.redirect('/administration/classes/'); } else { res.redirect(`/administration/classes/${data._id}/manage`); } From 73ccf38a219476112595c67da6da589ed84299ac Mon Sep 17 00:00:00 2001 From: Igor Richter Date: Thu, 2 Nov 2023 15:57:21 +0100 Subject: [PATCH 3/3] request changes --- helpers/handlebars/middleware.js | 6 ++--- views/administration/dashboard.hbs | 37 +++++++++++++----------------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/helpers/handlebars/middleware.js b/helpers/handlebars/middleware.js index 6d9a1a8477..a6f02c45b2 100644 --- a/helpers/handlebars/middleware.js +++ b/helpers/handlebars/middleware.js @@ -211,7 +211,7 @@ module.exports = (req, res, next) => { if (newClassViewEnabled) { teacherChildren.splice(2, 1, { name: res.$t('global.sidebar.link.administrationClasses'), - testId: 'Klassen (neu)', + testId: 'Klassen', icon: // eslint-disable-next-line max-len '', isExternalIcon: true, @@ -220,7 +220,7 @@ module.exports = (req, res, next) => { teacherChildrenWithoutStudents.splice(1, 1, { name: res.$t('global.sidebar.link.administrationClasses'), - testId: 'Klassen (neu)', + testId: 'Klassen', icon: // eslint-disable-next-line max-len '', isExternalIcon: true, @@ -300,7 +300,7 @@ module.exports = (req, res, next) => { if (newClassViewEnabled) { adminChildItems.splice(3, 1, { name: res.$t('global.sidebar.link.administrationClasses'), - testId: 'Klassen (neu)', + testId: 'Klassen', icon: // eslint-disable-next-line max-len '', isExternalIcon: true, diff --git a/views/administration/dashboard.hbs b/views/administration/dashboard.hbs index d16d3df93e..3aeda8814c 100644 --- a/views/administration/dashboard.hbs +++ b/views/administration/dashboard.hbs @@ -47,31 +47,26 @@ {{/userHasPermission}} - {{#userHasPermission 'CLASS_LIST'}} - {{#unless (getConfig "FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED")}} -
- -
- {{/unless}} - {{/userHasPermission}} {{#userHasPermission 'CLASS_LIST'}} - {{#if (getConfig "FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED")}} -
-