Contribute Calendar to Quick Access
This commit is contained in:
@@ -28,6 +28,8 @@ from govoplan_core.core.modules import (
|
||||
ModuleManifest,
|
||||
NavItem,
|
||||
PermissionDefinition,
|
||||
ProductAreaContribution,
|
||||
QuickAccessTool,
|
||||
RoleTemplate,
|
||||
)
|
||||
from govoplan_core.core.search import SearchSourceProviderRegistration
|
||||
@@ -554,6 +556,33 @@ manifest = ModuleManifest(
|
||||
),
|
||||
),
|
||||
documentation=(
|
||||
DocumentationTopic(
|
||||
id="calendar.quick-access-and-product-area",
|
||||
title="Calendar in product navigation and Quick Access",
|
||||
summary="Use Calendar in Meetings and decisions and keep an optional compact agenda beside current work.",
|
||||
body=(
|
||||
"Calendar contributes its workspace to Meetings and decisions. When Quick Access is enabled, "
|
||||
"the owner-rendered agenda shows authorized upcoming events in the Calendar category and links to the full workspace. "
|
||||
"View and Quick Access settings affect presentation only; Calendar reauthorizes every event read and action."
|
||||
),
|
||||
layer="configured",
|
||||
documentation_types=("user", "admin"),
|
||||
audience=("user", "calendar_manager", "administrator"),
|
||||
related_modules=("quick_access", "views"),
|
||||
translations={
|
||||
"de": {
|
||||
"title": "Kalender in Produktnavigation und Schnellzugriff",
|
||||
"summary": "Den Kalender unter Termine und Entscheidungen sowie optional als kompakte Agenda neben der aktuellen Arbeit verwenden.",
|
||||
"body": (
|
||||
"Calendar ordnet seinen Arbeitsbereich Termine und Entscheidungen zu. Ist der Schnellzugriff aktiviert, "
|
||||
"zeigt die vom Kalender gerenderte Agenda berechtigte anstehende Termine und verweist auf den vollständigen Arbeitsbereich. "
|
||||
"Ansichts- und Schnellzugriffseinstellungen ändern nur die Darstellung."
|
||||
),
|
||||
}
|
||||
},
|
||||
metadata={"kind": "reference", "help_contexts": ["calendar.quick_access.agenda"]},
|
||||
order=18,
|
||||
),
|
||||
DocumentationTopic(
|
||||
id="calendar.search.events",
|
||||
title="Search authorized calendar events",
|
||||
@@ -781,6 +810,39 @@ manifest = ModuleManifest(
|
||||
label="Calendar preferences",
|
||||
order=45,
|
||||
),
|
||||
ViewSurface(
|
||||
id="calendar.quick_access.agenda",
|
||||
module_id="calendar",
|
||||
kind="quick_access",
|
||||
label="Calendar Quick Access",
|
||||
order=50,
|
||||
),
|
||||
),
|
||||
product_areas=(
|
||||
ProductAreaContribution(
|
||||
id="meetings-decisions",
|
||||
module_id="calendar",
|
||||
label="i18n:govoplan-core.product_area.meetings_decisions",
|
||||
icon="calendar",
|
||||
description="i18n:govoplan-core.product_area.meetings_decisions_description",
|
||||
surface_ids=("calendar.nav.calendar", "calendar.route.calendar"),
|
||||
order=50,
|
||||
),
|
||||
),
|
||||
quick_access_tools=(
|
||||
QuickAccessTool(
|
||||
id="calendar.agenda",
|
||||
module_id="calendar",
|
||||
category_id="calendar",
|
||||
label="i18n:govoplan-calendar.calendar.adab5090",
|
||||
description="i18n:govoplan-calendar.quick_access_description",
|
||||
surface_id="calendar.quick_access.agenda",
|
||||
icon="calendar",
|
||||
full_page_path="/calendar",
|
||||
required_any=("calendar:event:read",),
|
||||
order=10,
|
||||
modes=("browse", "create"),
|
||||
),
|
||||
),
|
||||
),
|
||||
migration_spec=MigrationSpec(
|
||||
|
||||
@@ -26,6 +26,7 @@ class CalendarInterfaceDocumentationContractTests(unittest.TestCase):
|
||||
"calendar.outbox",
|
||||
"calendar.migration",
|
||||
"calendar.settings.preferences",
|
||||
"calendar.quick_access.agenda",
|
||||
"calendar.widget.upcoming",
|
||||
}
|
||||
self.assertEqual(expected, set(surfaces))
|
||||
|
||||
@@ -51,6 +51,7 @@ export const generatedTranslations: PlatformTranslations = {
|
||||
"i18n:govoplan-calendar.calendar_source_type.92cdb42f": "Calendar source type",
|
||||
"i18n:govoplan-calendar.calendar_views.9e6b9c2b": "Calendar views",
|
||||
"i18n:govoplan-calendar.calendar.adab5090": "Calendar",
|
||||
"i18n:govoplan-calendar.quick_access_description": "Upcoming events across visible calendars.",
|
||||
"i18n:govoplan-calendar.calendars_are_unavailable.f074c862": "Calendars are unavailable.",
|
||||
"i18n:govoplan-calendar.calendars.94445018": "Calendars",
|
||||
"i18n:govoplan-calendar.cancel.77dfd213": "Cancel",
|
||||
@@ -289,6 +290,7 @@ export const generatedTranslations: PlatformTranslations = {
|
||||
"i18n:govoplan-calendar.calendar_source_type.92cdb42f": "Calendar source type",
|
||||
"i18n:govoplan-calendar.calendar_views.9e6b9c2b": "Calendar views",
|
||||
"i18n:govoplan-calendar.calendar.adab5090": "Kalender",
|
||||
"i18n:govoplan-calendar.quick_access_description": "Anstehende Termine aus den sichtbaren Kalendern.",
|
||||
"i18n:govoplan-calendar.calendars_are_unavailable.f074c862": "Kalender sind nicht verfügbar.",
|
||||
"i18n:govoplan-calendar.calendars.94445018": "Calendars",
|
||||
"i18n:govoplan-calendar.cancel.77dfd213": "Abbrechen",
|
||||
|
||||
+26
-1
@@ -3,6 +3,7 @@ import type {
|
||||
CalendarPickerUiCapability,
|
||||
DashboardWidgetsUiCapability,
|
||||
PlatformWebModule,
|
||||
QuickAccessToolsUiCapability,
|
||||
SettingsSectionsUiCapability
|
||||
} from "@govoplan/core-webui";
|
||||
import "./styles/calendar.css";
|
||||
@@ -90,6 +91,22 @@ const calendarDashboardWidgets: DashboardWidgetsUiCapability = {
|
||||
}
|
||||
]
|
||||
};
|
||||
const calendarQuickAccessTools: QuickAccessToolsUiCapability = {
|
||||
tools: [
|
||||
{
|
||||
id: "calendar.agenda",
|
||||
render: ({ settings }) => createElement(UpcomingEventsWidget, {
|
||||
settings,
|
||||
refreshKey: 0,
|
||||
configuration: {
|
||||
maxItems: 7,
|
||||
daysAhead: 21,
|
||||
showLocation: true
|
||||
}
|
||||
})
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export const calendarModule: PlatformWebModule = {
|
||||
id: "calendar",
|
||||
@@ -122,6 +139,13 @@ export const calendarModule: PlatformWebModule = {
|
||||
kind: "section",
|
||||
label: "Calendar preferences",
|
||||
order: 45
|
||||
},
|
||||
{
|
||||
id: "calendar.quick_access.agenda",
|
||||
moduleId: "calendar",
|
||||
kind: "quick_access",
|
||||
label: "Calendar Quick Access",
|
||||
order: 50
|
||||
}
|
||||
],
|
||||
navItems: [{ to: "/calendar", label: "i18n:govoplan-calendar.calendar.adab5090", iconName: "calendar", anyOf: eventRead, order: 55, surfaceId: "calendar.navigation" }],
|
||||
@@ -130,7 +154,8 @@ export const calendarModule: PlatformWebModule = {
|
||||
uiCapabilities: {
|
||||
"calendar.picker": calendarPicker,
|
||||
"dashboard.widgets": calendarDashboardWidgets,
|
||||
"settings.sections": calendarSettingsSections
|
||||
"settings.sections": calendarSettingsSections,
|
||||
"quickAccess.tools": calendarQuickAccessTools
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user