Skip to content

Commit

Permalink
BC-7822 - Implement new sidebar option for rooms (#3500)
Browse files Browse the repository at this point in the history
* add rooms feature flag and sidebar item

* set FEATURE_ROOMS_ENABLED on local
  • Loading branch information
MartinSchuhmacher authored Aug 22, 2024
1 parent caf2633 commit eaf7992
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 2 deletions.
5 changes: 5 additions & 0 deletions config/default.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,11 @@
"type": "boolean",
"default": false,
"description": "Enables the media shelf feature"
},
"FEATURE_ROOMS_ENABLED": {
"type": "boolean",
"default": false,
"description": "Enables the rooms feature"
}
},
"allOf": [
Expand Down
3 changes: 2 additions & 1 deletion config/development.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"FEATURE_LOG_REQUEST": true,
"FEATURE_PROMETHEUS_ENABLED": true,
"FEATURE_ALERTS_ENABLED": true,
"PUBLIC_BACKEND_URL": "http://localhost:3030/api"
"PUBLIC_BACKEND_URL": "http://localhost:3030/api",
"FEATURE_ROOMS_ENABLED": true
}
13 changes: 12 additions & 1 deletion helpers/handlebars/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,17 @@ module.exports = (req, res, next) => {
});
}

// Rooms Feature Toggle
const roomsEnabled = Configuration.get('FEATURE_ROOMS_ENABLED');
if (roomsEnabled) {
res.locals.sidebarItems.splice(1, 0, {
name: res.$t('global.sidebar.link.rooms'),
testId: 'Rooms',
icon: 'account-supervisor-circle-outline',
link: '/rooms',
});
}

// teacher views
const newClassViewEnabled = Configuration.get('FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED');
const teacherChildren = [
Expand Down Expand Up @@ -339,7 +350,7 @@ module.exports = (req, res, next) => {
// team feature toggle
const teamsEnabled = FEATURE_TEAMS_ENABLED === 'true';
if (teamsEnabled) {
res.locals.sidebarItems.splice(2, 0, {
res.locals.sidebarItems.splice(roomsEnabled ? 3 : 2, 0, {
name: res.$t('global.link.teams'),
testId: 'Teams',
icon: 'account-group-outline',
Expand Down
1 change: 1 addition & 0 deletions locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,7 @@
"administration": "Administration",
"administrationClasses": "Klassen",
"administrationCourses": "Kurse",
"rooms": "Räume",
"system": "System",
"accessibility": "Barrierefreiheit",
"mediaShelf": "Medienregal"
Expand Down
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,7 @@
"administration": "Administration",
"administrationClasses": "Classes",
"administrationCourses": "Courses",
"rooms": "Rooms",
"system": "System",
"accessibility": "Accessibility",
"mediaShelf": "Media shelf"
Expand Down
1 change: 1 addition & 0 deletions locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,7 @@
"administration": "Administración",
"administrationClasses": "Clases",
"administrationCourses": "Cursos",
"rooms": "Salas",
"system": "Sistema",
"accessibility": "Accesibilidad",
"mediaShelf": "Estante multimedia"
Expand Down
1 change: 1 addition & 0 deletions locales/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
"administrationClasses": "Класи",
"administrationCourses": "Курси",
"administration": "Адміністрація",
"rooms": "Номери",
"system": "Cистема",
"accessibility": "Доступність",
"mediaShelf": "Полиця для медіа"
Expand Down

0 comments on commit eaf7992

Please sign in to comment.