Skip to content

Commit

Permalink
Revert "BC-4121 - Replace old with new school adminstration page (#3247
Browse files Browse the repository at this point in the history
…)" (#3399)

This reverts commit d3d9ab0.
  • Loading branch information
davwas authored Jan 29, 2024
1 parent 035eeac commit 8dd29e1
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 13 deletions.
5 changes: 5 additions & 0 deletions config/default.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions config/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const {
SC_SUPERHERO_USER_NAME = '[email protected]',
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,
Expand Down Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions controllers/administration.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ const createSystemHandler = (req, res, next) => {
},
})
.then(() => {
res.redirect('/administration/school-settings');
res.redirect('/administration/school');
})
.catch((err) => {
next(err);
Expand Down Expand Up @@ -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}`, {
Expand All @@ -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) => {
Expand All @@ -2816,7 +2816,7 @@ router.delete('/rss/:id', async (req, res) => {
},
});

res.redirect('/administration/school-settings');
res.redirect('/administration/school');
});

router.use(
Expand Down Expand Up @@ -3047,7 +3047,7 @@ router.post('/terminateschoolyear', async (req, res) => {
},
});

res.redirect('/administration/school-settings');
res.redirect('/administration/school');
});

// Start
Expand All @@ -3058,7 +3058,7 @@ router.use('/startschoolyear', async (req, res) => {
},
});

res.redirect('/administration/school-settings');
res.redirect('/administration/school');
});

// Start preview LDAP
Expand Down Expand Up @@ -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 = {
Expand Down
6 changes: 5 additions & 1 deletion helpers/handlebars/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -289,7 +291,9 @@ module.exports = (req, res, next) => {
icon: // eslint-disable-next-line max-len
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M22 22V11H17V2L2 7V22H22ZM4 8.3736L15 4.91206V11H10V20H4V8.3736ZM15 20H12V13H20V20H17V17H15V20Z"/></svg>',
isExternalIcon: true,
link: '/administration/school-settings/',
link: newSchoolAdminPageAsDefault
? '/administration/school-settings/'
: '/administration/school/',
},
];

Expand Down
2 changes: 1 addition & 1 deletion locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href=\"/administration/school-settings/\"> hier das neue Schuljahr ein!</a>",
"schoolInTransferPhaseStartNew": "Die Schule befindet sich in der Transferphase zum neuen Schuljahr. Es können keine Klassen und Nutzer:innen angelegt werden. Bitte läute <a href=\"/administration/school/\"> hier das neue Schuljahr ein!</a>",
"schoolInMigrationModeStarted": "Die Schule befindet sich im Modus der Benutzermigration. Um die Migration der Benutzer durchzuführen, besuchen Sie bitte <a href=\"/administration/migration/\">diese Seite</a>.",
"schoolInMigrationMode": "Die Schule kann Benutzerkonten von Schulportal importieren. Um die Migration der Benutzer durchzuführen, besuchen Sie bitte <a href=\"/administration/migration/\">diese Seite</a>."
}
Expand Down
2 changes: 1 addition & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href=\"/administration/school-settings/\"> the new school year here!</a>",
"schoolInTransferPhaseStartNew": "The school is in the transfer phase to the new school year. No classes and users can be created. Please ring in <a href=\"/administration/school/\"> the new school year here!</a>",
"schoolInMigrationModeStarted": "The school is in user migration mode. To migrate users, please go to <a href=\"/administration/migration/\">this page</a>.",
"schoolInMigrationMode": "The school can import user accounts from Schulportal. To migrate users, please go to <a href=\"/administration/migration/\">this page</a>."
}
Expand Down
2 changes: 1 addition & 1 deletion locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href=\"/administration/school-settings/\">nuevo año escolar aquí!</a>",
"schoolInTransferPhaseStartNew": "La escuela está en fase de transferencia al nuevo año escolar. No se pueden crear clases ni usuarios. ¡Accede al <a href=\"/administration/school/\">nuevo año escolar aquí!</a>",
"schoolInMigrationModeStarted": "La escuela está en modo de migración de usuarios. Para migrar los usuarios, por favor vaya a <a href=\"/administration/migration/\">esta página</a>.",
"schoolInMigrationMode": "La escuela puede importar cuentas de usuario de Schulportal. Para migrar los usuarios, por favor vaya a <a href=\"/administration/migration/\">esta página</a>."
}
Expand Down
2 changes: 1 addition & 1 deletion locales/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -2124,7 +2124,7 @@
"newFeaturesAvailable": "Доступні нові функції",
"schoolInMigrationModeStarted": "Школа перебуває в режимі міграції користувачів. Щоб перенести користувачів, перейдіть на <a href=\"/administration/migration/\">цю сторінку</a>.",
"schoolInTransferPhaseContactAdmin": "Школа перебуває у фазі переходу до нового навчального року. Не можна створювати класи та користувачів.",
"schoolInTransferPhaseStartNew": "Школа перебуває у фазі переходу до нового навчального року. Не можна створювати класи та користувачів. Зателефонуйте в <a href=\"/administration/school-settings/\"> новий навчальний рік тут!</a>",
"schoolInTransferPhaseStartNew": "Школа перебуває у фазі переходу до нового навчального року. Не можна створювати класи та користувачів. Зателефонуйте в <a href=\"/administration/school/\"> новий навчальний рік тут!</a>",
"schoolInMigrationMode": "Школа перебуває в режимі міграції користувачів. Щоб перенести користувачів, перейдіть на <a href=\"/administration/migration/\">цю сторінку</a>."
}
},
Expand Down
12 changes: 11 additions & 1 deletion views/administration/dashboard.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,23 @@
</div>
</div>
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="card h-100 teacher-option locationlink" data-loclink="/administration/school-settings" data-testid="school_administration_card">
{{#if (getConfig "FEATURE_NEW_SCHOOL_ADMINISTRATION_PAGE_AS_DEFAULT_ENABLED")}}
<div class="card h-100 teacher-option locationlink" data-loclink="/administration/school-settings" data-testid="school_administration_card">
<div class="card-block homework">
<div class="card-text">
<h2 class="h4"><i class="fa fa-building"></i> {{$t "administration.dashboard.headline.manageSchool" }}</h2>
</div>
</div>
</div>
{{else}}
<div class="card h-100 teacher-option locationlink" data-loclink="/administration/school" data-testid="school_administration_card">
<div class="card-block homework">
<div class="card-text">
<h2 class="h4"><i class="fa fa-building"></i> {{$t "administration.dashboard.headline.manageSchool" }}</h2>
</div>
</div>
</div>
{{/if}}
</div>
{{/userHasPermission}}
{{#ifConfig "FEATURE_USER_MIGRATION_ENABLED" true}}
Expand Down

0 comments on commit 8dd29e1

Please sign in to comment.