feat(dashboard): enhance widget availability and initialization
All checks were successful
Deploy to production / deploy (push) Successful in 3m2s

- Updated `getAvailableWidgets` method in `DashboardService` to merge default widget types with database entries, ensuring immediate visibility of new widgets post-deployment.
- Introduced `DASHBOARD_WIDGET_TYPE_DEFAULTS` in `initializeWidgetTypes` for canonical widget types, facilitating API merging when database entries are absent.
- Modified `StatusBar.vue` to utilize a computed property for quick access children, improving menu item handling and visibility based on user context.
- Enhanced `LoggedInView.vue` to dynamically return localized widget labels, improving user experience with accurate translations.
This commit is contained in:
Torsten Schulz (local)
2026-04-02 15:19:08 +02:00
parent 5fcd55be43
commit 49713d957d
5 changed files with 95 additions and 20 deletions

View File

@@ -186,15 +186,18 @@ export default {
},
methods: {
getLocalizedWidgetLabel(endpoint, fallbackLabel = '') {
const ep = String(endpoint || '');
if (ep.startsWith('/api/news')) {
return this.$t('home.dashboard.widgetLabels.news');
}
const key = {
'/api/termine': 'home.dashboard.widgetLabels.appointments',
'/api/falukant/dashboard-widget': 'home.dashboard.widgetLabels.falukant',
'/api/news': 'home.dashboard.widgetLabels.news',
'/api/calendar/widget/birthdays': 'home.dashboard.widgetLabels.birthdays',
'/api/calendar/widget/upcoming': 'home.dashboard.widgetLabels.upcoming',
'/api/calendar/widget/mini': 'home.dashboard.widgetLabels.calendar',
'/api/vocab/dashboard-widget': 'home.dashboard.widgetLabels.vocabCourses'
}[endpoint];
}[ep];
return key ? this.$t(key) : fallbackLabel;
},
normalizeWidgetType(widgetType) {