feat(dashboard): enhance widget availability and initialization
All checks were successful
Deploy to production / deploy (push) Successful in 3m2s
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user