From 8dd29e1e6ec71ed92a726d6674611203afeecaeb Mon Sep 17 00:00:00 2001 From: davwas Date: Mon, 29 Jan 2024 15:13:27 +0100 Subject: [PATCH] Revert "BC-4121 - Replace old with new school adminstration page (#3247)" (#3399) This reverts commit d3d9ab04f4af0576ea742b1d685f38f47ad1ccf1. --- config/default.schema.json | 5 +++++ config/global.js | 2 ++ controllers/administration.js | 14 +++++++------- helpers/handlebars/middleware.js | 6 +++++- locales/de.json | 2 +- locales/en.json | 2 +- locales/es.json | 2 +- locales/uk.json | 2 +- views/administration/dashboard.hbs | 12 +++++++++++- 9 files changed, 34 insertions(+), 13 deletions(-) diff --git a/config/default.schema.json b/config/default.schema.json index a90d953a99..54a54a0195 100644 --- a/config/default.schema.json +++ b/config/default.schema.json @@ -583,6 +583,11 @@ "default": true, "description": "Determines if consent is necessary during registration." }, + "FEATURE_NEW_SCHOOL_ADMINISTRATION_PAGE_AS_DEFAULT_ENABLED": { + "type": "boolean", + "default": false, + "description": "Makes the new school administration page the default page" + }, "FEATURE_CLIENT_USER_LOGIN_MIGRATION_ENABLED": { "type": "boolean", "default": false, diff --git a/config/global.js b/config/global.js index 508bcff91b..38a81cdfb4 100644 --- a/config/global.js +++ b/config/global.js @@ -36,6 +36,7 @@ const { SC_SUPERHERO_USER_NAME = 'superhero@schul-cloud.org', FEATURE_NUXT_SCHOOL_ADMIN_BETA, ALERT_STATUS_URL = 'https://status.dbildungscloud.de', + FEATURE_NEW_SCHOOL_ADMINISTRATION_PAGE_AS_DEFAULT_ENABLED, FEATURE_ALERTS_ON_HOMEPAGE_ENABLED, FEATURE_BUTTONS_ON_LOGINPAGE_ENABLED, FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED, @@ -79,6 +80,7 @@ const exp = { SC_SUPERHERO_USER_NAME, FEATURE_NUXT_SCHOOL_ADMIN_BETA, ALERT_STATUS_URL, + FEATURE_NEW_SCHOOL_ADMINISTRATION_PAGE_AS_DEFAULT_ENABLED, FEATURE_ALERTS_ON_HOMEPAGE_ENABLED, FEATURE_BUTTONS_ON_LOGINPAGE_ENABLED, FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED, diff --git a/controllers/administration.js b/controllers/administration.js index ce48c1155f..01dc74285c 100644 --- a/controllers/administration.js +++ b/controllers/administration.js @@ -512,7 +512,7 @@ const createSystemHandler = (req, res, next) => { }, }) .then(() => { - res.redirect('/administration/school-settings'); + res.redirect('/administration/school'); }) .catch((err) => { next(err); @@ -2794,7 +2794,7 @@ router.post('/rss/', async (req, res) => { school.rssFeeds && school.rssFeeds.find((el) => el.url === req.body.rssURL) ) { - return res.redirect('/administration/school-settings'); + return res.redirect('/administration/school'); } await api(req).patch(`/schools/${req.body.schoolId}`, { @@ -2804,7 +2804,7 @@ router.post('/rss/', async (req, res) => { }, }, }); - return res.redirect('/administration/school-settings'); + return res.redirect('/administration/school'); }); router.delete('/rss/:id', async (req, res) => { @@ -2816,7 +2816,7 @@ router.delete('/rss/:id', async (req, res) => { }, }); - res.redirect('/administration/school-settings'); + res.redirect('/administration/school'); }); router.use( @@ -3047,7 +3047,7 @@ router.post('/terminateschoolyear', async (req, res) => { }, }); - res.redirect('/administration/school-settings'); + res.redirect('/administration/school'); }); // Start @@ -3058,7 +3058,7 @@ router.use('/startschoolyear', async (req, res) => { }, }); - res.redirect('/administration/school-settings'); + res.redirect('/administration/school'); }); // Start preview LDAP @@ -3151,7 +3151,7 @@ router.post( if (system.length === 1) { // LDAP System already available, do not create another one - res.redirect('/administration/school-settings'); + res.redirect('/administration/school'); } else { // Create System for LDAP const ldapTemplate = { diff --git a/helpers/handlebars/middleware.js b/helpers/handlebars/middleware.js index 7bbd2c1293..a6f02c45b2 100644 --- a/helpers/handlebars/middleware.js +++ b/helpers/handlebars/middleware.js @@ -6,6 +6,7 @@ const { FEATURE_EXTENSIONS_ENABLED, NOTIFICATION_SERVICE_ENABLED, FEATURE_TEAMS_ENABLED, + FEATURE_NEW_SCHOOL_ADMINISTRATION_PAGE_AS_DEFAULT_ENABLED, FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED, } = require('../../config/global'); @@ -248,6 +249,7 @@ module.exports = (req, res, next) => { }); // admin views + const newSchoolAdminPageAsDefault = FEATURE_NEW_SCHOOL_ADMINISTRATION_PAGE_AS_DEFAULT_ENABLED === 'true'; const adminChildItems = [ { name: res.$t('global.link.administrationStudents'), @@ -289,7 +291,9 @@ module.exports = (req, res, next) => { icon: // eslint-disable-next-line max-len '', isExternalIcon: true, - link: '/administration/school-settings/', + link: newSchoolAdminPageAsDefault + ? '/administration/school-settings/' + : '/administration/school/', }, ]; diff --git a/locales/de.json b/locales/de.json index 0737f77d59..eb4b4e99d9 100644 --- a/locales/de.json +++ b/locales/de.json @@ -2462,7 +2462,7 @@ "text": { "newFeaturesAvailable": "Neue Features sind verfügbar", "schoolInTransferPhaseContactAdmin": "Die Schule befindet sich in der Transferphase zum neuen Schuljahr. Es können keine Klassen und Nutzer:innen angelegt werden. Bitte kontaktiere deinen Schul-Admin!", - "schoolInTransferPhaseStartNew": "Die Schule befindet sich in der Transferphase zum neuen Schuljahr. Es können keine Klassen und Nutzer:innen angelegt werden. Bitte läute hier das neue Schuljahr ein!", + "schoolInTransferPhaseStartNew": "Die Schule befindet sich in der Transferphase zum neuen Schuljahr. Es können keine Klassen und Nutzer:innen angelegt werden. Bitte läute hier das neue Schuljahr ein!", "schoolInMigrationModeStarted": "Die Schule befindet sich im Modus der Benutzermigration. Um die Migration der Benutzer durchzuführen, besuchen Sie bitte diese Seite.", "schoolInMigrationMode": "Die Schule kann Benutzerkonten von Schulportal importieren. Um die Migration der Benutzer durchzuführen, besuchen Sie bitte diese Seite." } diff --git a/locales/en.json b/locales/en.json index d0c9358989..85ef95044e 100644 --- a/locales/en.json +++ b/locales/en.json @@ -2462,7 +2462,7 @@ "text": { "newFeaturesAvailable": "New features are available", "schoolInTransferPhaseContactAdmin": "The school is in the transfer phase to the new school year. No classes and users can be created. Please contact the school administrator!", - "schoolInTransferPhaseStartNew": "The school is in the transfer phase to the new school year. No classes and users can be created. Please ring in the new school year here!", + "schoolInTransferPhaseStartNew": "The school is in the transfer phase to the new school year. No classes and users can be created. Please ring in the new school year here!", "schoolInMigrationModeStarted": "The school is in user migration mode. To migrate users, please go to this page.", "schoolInMigrationMode": "The school can import user accounts from Schulportal. To migrate users, please go to this page." } diff --git a/locales/es.json b/locales/es.json index cd306245b2..e5064fddbb 100644 --- a/locales/es.json +++ b/locales/es.json @@ -2462,7 +2462,7 @@ "text": { "newFeaturesAvailable": "Nuevas funciones disponibles", "schoolInTransferPhaseContactAdmin": "La escuela está en fase de transferencia al nuevo año escolar. No se pueden crear clases ni usuarios. ¡Ponte en contacto con el administrador de la escuela!", - "schoolInTransferPhaseStartNew": "La escuela está en fase de transferencia al nuevo año escolar. No se pueden crear clases ni usuarios. ¡Accede al nuevo año escolar aquí!", + "schoolInTransferPhaseStartNew": "La escuela está en fase de transferencia al nuevo año escolar. No se pueden crear clases ni usuarios. ¡Accede al nuevo año escolar aquí!", "schoolInMigrationModeStarted": "La escuela está en modo de migración de usuarios. Para migrar los usuarios, por favor vaya a esta página.", "schoolInMigrationMode": "La escuela puede importar cuentas de usuario de Schulportal. Para migrar los usuarios, por favor vaya a esta página." } diff --git a/locales/uk.json b/locales/uk.json index d684c51e25..fb5acaad4d 100644 --- a/locales/uk.json +++ b/locales/uk.json @@ -2124,7 +2124,7 @@ "newFeaturesAvailable": "Доступні нові функції", "schoolInMigrationModeStarted": "Школа перебуває в режимі міграції користувачів. Щоб перенести користувачів, перейдіть на цю сторінку.", "schoolInTransferPhaseContactAdmin": "Школа перебуває у фазі переходу до нового навчального року. Не можна створювати класи та користувачів.", - "schoolInTransferPhaseStartNew": "Школа перебуває у фазі переходу до нового навчального року. Не можна створювати класи та користувачів. Зателефонуйте в новий навчальний рік тут!", + "schoolInTransferPhaseStartNew": "Школа перебуває у фазі переходу до нового навчального року. Не можна створювати класи та користувачів. Зателефонуйте в новий навчальний рік тут!", "schoolInMigrationMode": "Школа перебуває в режимі міграції користувачів. Щоб перенести користувачів, перейдіть на цю сторінку." } }, diff --git a/views/administration/dashboard.hbs b/views/administration/dashboard.hbs index f6b728c666..0529ddf2fd 100644 --- a/views/administration/dashboard.hbs +++ b/views/administration/dashboard.hbs @@ -79,13 +79,23 @@
- {{/userHasPermission}} {{#ifConfig "FEATURE_USER_MIGRATION_ENABLED" true}}