@conduction/nextcloud-vue 2.56.0-beta.37 → 2.56.0-beta.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/CnAdvancedFormDialog/CnMetadataTab.vue.js +1 -1
- package/dist/esm/components/CnAdvancedFormDialog/CnMetadataTab.vue2.js +3 -2
- package/dist/esm/components/CnAdvancedFormDialog/CnMetadataTab.vue2.js.map +1 -1
- package/dist/esm/components/CnAdvancedFormDialog/CnMetadataTab.vue3.js.map +1 -1
- package/dist/esm/components/CnAdvancedFormDialog/CnPropertyValueCell.vue.js +1 -1
- package/dist/esm/components/CnAdvancedFormDialog/CnPropertyValueCell.vue2.js +5 -4
- package/dist/esm/components/CnAdvancedFormDialog/CnPropertyValueCell.vue2.js.map +1 -1
- package/dist/esm/components/CnAdvancedFormDialog/CnPropertyValueCell.vue3.js.map +1 -1
- package/dist/esm/components/CnAnalyticsReportPicker/CnAnalyticsReportPicker.vue.js +1 -1
- package/dist/esm/components/CnAnalyticsReportPicker/CnAnalyticsReportPicker.vue2.js +2 -1
- package/dist/esm/components/CnAnalyticsReportPicker/CnAnalyticsReportPicker.vue2.js.map +1 -1
- package/dist/esm/components/CnAnalyticsReportPicker/CnAnalyticsReportPicker.vue3.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue.js +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js +2 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js.map +1 -1
- package/dist/esm/components/CnBoardView/CnBoardView.vue.js +1 -1
- package/dist/esm/components/CnBoardView/CnBoardView.vue2.js +156 -14
- package/dist/esm/components/CnBoardView/CnBoardView.vue2.js.map +1 -1
- package/dist/esm/components/CnBoardView/CnBoardView.vue3.js +105 -74
- package/dist/esm/components/CnBoardView/CnBoardView.vue3.js.map +1 -1
- package/dist/esm/components/CnCalendarEventPicker/CnCalendarEventPicker.vue.js +1 -1
- package/dist/esm/components/CnCalendarEventPicker/CnCalendarEventPicker.vue2.js +2 -1
- package/dist/esm/components/CnCalendarEventPicker/CnCalendarEventPicker.vue2.js.map +1 -1
- package/dist/esm/components/CnCalendarEventPicker/CnCalendarEventPicker.vue3.js.map +1 -1
- package/dist/esm/components/CnCalendarWidget/CnCalendarWidget.vue.js +1 -1
- package/dist/esm/components/CnCalendarWidget/CnCalendarWidget.vue2.js +2 -1
- package/dist/esm/components/CnCalendarWidget/CnCalendarWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnCalendarWidget/CnCalendarWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue.js +1 -1
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js +6 -5
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnCollectivePagePicker/CnCollectivePagePicker.vue.js +1 -1
- package/dist/esm/components/CnCollectivePagePicker/CnCollectivePagePicker.vue2.js +2 -1
- package/dist/esm/components/CnCollectivePagePicker/CnCollectivePagePicker.vue2.js.map +1 -1
- package/dist/esm/components/CnCollectivePagePicker/CnCollectivePagePicker.vue3.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue.js +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue2.js +2 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue2.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue3.js.map +1 -1
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue.js +1 -1
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js +2 -1
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +2 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue.js +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js +3 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js.map +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailHeaderChips.vue2.js +2 -1
- package/dist/esm/components/CnDetailPage/CnDetailHeaderChips.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailHeaderChips.vue3.js.map +1 -1
- package/dist/esm/components/CnEmailPicker/CnEmailPicker.vue.js +1 -1
- package/dist/esm/components/CnEmailPicker/CnEmailPicker.vue2.js +2 -1
- package/dist/esm/components/CnEmailPicker/CnEmailPicker.vue2.js.map +1 -1
- package/dist/esm/components/CnEmailPicker/CnEmailPicker.vue3.js.map +1 -1
- package/dist/esm/components/CnFederationStatus/CnFederationStatus.vue.js +1 -1
- package/dist/esm/components/CnFederationStatus/CnFederationStatus.vue2.js +3 -1
- package/dist/esm/components/CnFederationStatus/CnFederationStatus.vue2.js.map +1 -1
- package/dist/esm/components/CnFederationStatus/CnFederationStatus.vue3.js.map +1 -1
- package/dist/esm/components/CnFileManager/CnFileManager.vue.js +1 -1
- package/dist/esm/components/CnFileManager/CnFileManager.vue2.js +3 -1
- package/dist/esm/components/CnFileManager/CnFileManager.vue2.js.map +1 -1
- package/dist/esm/components/CnFileManager/CnFileManager.vue3.js.map +1 -1
- package/dist/esm/components/CnFilePreview/CnFilePreview.vue.js +1 -1
- package/dist/esm/components/CnFilePreview/CnFilePreview.vue2.js +2 -1
- package/dist/esm/components/CnFilePreview/CnFilePreview.vue2.js.map +1 -1
- package/dist/esm/components/CnFilePreview/CnFilePreview.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue.js +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +49 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +3 -3
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
- package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue.js +1 -1
- package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue2.js +2 -1
- package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue2.js.map +1 -1
- package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +30 -5
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue.js +1 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue2.js +2 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue2.js.map +1 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectCalendar/CnObjectCalendar.vue.js +1 -1
- package/dist/esm/components/CnObjectCalendar/CnObjectCalendar.vue2.js +3 -2
- package/dist/esm/components/CnObjectCalendar/CnObjectCalendar.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectCalendar/CnObjectCalendar.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js +28 -0
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js +82 -75
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectMetadataWidget/CnObjectMetadataWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectMetadataWidget/CnObjectMetadataWidget.vue2.js +5 -4
- package/dist/esm/components/CnObjectMetadataWidget/CnObjectMetadataWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectMetadataWidget/CnObjectMetadataWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnAuditTrailTab.vue.js +1 -1
- package/dist/esm/components/CnObjectSidebar/CnAuditTrailTab.vue2.js +2 -1
- package/dist/esm/components/CnObjectSidebar/CnAuditTrailTab.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnAuditTrailTab.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnFlowTasksPanel.vue.js +1 -1
- package/dist/esm/components/CnObjectSidebar/CnFlowTasksPanel.vue2.js +2 -1
- package/dist/esm/components/CnObjectSidebar/CnFlowTasksPanel.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnFlowTasksPanel.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue.js +1 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js +2 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnTasksTab.vue.js +1 -1
- package/dist/esm/components/CnObjectSidebar/CnTasksTab.vue2.js +2 -1
- package/dist/esm/components/CnObjectSidebar/CnTasksTab.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnTasksTab.vue3.js.map +1 -1
- package/dist/esm/components/CnPropertySourceField/CnPropertySourceField.vue.js +1 -1
- package/dist/esm/components/CnPropertySourceField/CnPropertySourceField.vue2.js +2 -1
- package/dist/esm/components/CnPropertySourceField/CnPropertySourceField.vue2.js.map +1 -1
- package/dist/esm/components/CnPropertySourceField/CnPropertySourceField.vue3.js.map +1 -1
- package/dist/esm/components/CnRoadmapItem/CnRoadmapItem.vue.js +1 -1
- package/dist/esm/components/CnRoadmapItem/CnRoadmapItem.vue2.js +2 -1
- package/dist/esm/components/CnRoadmapItem/CnRoadmapItem.vue2.js.map +1 -1
- package/dist/esm/components/CnRoadmapItem/CnRoadmapItem.vue3.js.map +1 -1
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaFormDialog.vue2.js +2 -0
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaFormDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaFormDialog.vue3.js +2 -2
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaFormDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnStatsBlock/CnStatsBlock.vue.js +1 -1
- package/dist/esm/components/CnStatsBlock/CnStatsBlock.vue2.js +2 -1
- package/dist/esm/components/CnStatsBlock/CnStatsBlock.vue2.js.map +1 -1
- package/dist/esm/components/CnStatsBlock/CnStatsBlock.vue3.js.map +1 -1
- package/dist/esm/components/CnSummaryAggregates/CnSummaryAggregates.vue.js +1 -1
- package/dist/esm/components/CnSummaryAggregates/CnSummaryAggregates.vue2.js +2 -1
- package/dist/esm/components/CnSummaryAggregates/CnSummaryAggregates.vue2.js.map +1 -1
- package/dist/esm/components/CnSummaryAggregates/CnSummaryAggregates.vue3.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue.js +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js +36 -0
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js +55 -40
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnTasksCard/CnTasksCard.vue.js +1 -1
- package/dist/esm/components/CnTasksCard/CnTasksCard.vue2.js +2 -1
- package/dist/esm/components/CnTasksCard/CnTasksCard.vue2.js.map +1 -1
- package/dist/esm/components/CnTasksCard/CnTasksCard.vue3.js.map +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue.js +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue2.js +2 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnTranslatedBadge/CnTranslatedBadge.vue.js +1 -1
- package/dist/esm/components/CnTranslatedBadge/CnTranslatedBadge.vue2.js +2 -1
- package/dist/esm/components/CnTranslatedBadge/CnTranslatedBadge.vue2.js.map +1 -1
- package/dist/esm/components/CnVersionHistory/CnVersionHistory.vue.js +1 -1
- package/dist/esm/components/CnVersionHistory/CnVersionHistory.vue2.js +2 -1
- package/dist/esm/components/CnVersionHistory/CnVersionHistory.vue2.js.map +1 -1
- package/dist/esm/components/CnVersionHistory/CnVersionHistory.vue3.js.map +1 -1
- package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue.js +1 -1
- package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue2.js +3 -26
- package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue2.js.map +1 -1
- package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue3.js.map +1 -1
- package/dist/esm/dialogs/CnNoteHistoryDialog.vue.js +1 -1
- package/dist/esm/dialogs/CnNoteHistoryDialog.vue2.js +2 -1
- package/dist/esm/dialogs/CnNoteHistoryDialog.vue2.js.map +1 -1
- package/dist/esm/dialogs/CnNoteHistoryDialog.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/activity/CnActivityCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/activity/CnActivityCard.vue2.js +3 -2
- package/dist/esm/integrations/builtin/activity/CnActivityCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/activity/CnActivityCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/activity/CnActivityTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/activity/CnActivityTab.vue2.js +4 -3
- package/dist/esm/integrations/builtin/activity/CnActivityTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/activity/CnActivityTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue2.js +3 -2
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/analytics/CnAnalyticsTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/calendar/CnCalendarCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/calendar/CnCalendarCard.vue2.js +2 -1
- package/dist/esm/integrations/builtin/calendar/CnCalendarCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/calendar/CnCalendarCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/calendar/CnCalendarTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/calendar/CnCalendarTab.vue2.js +6 -5
- package/dist/esm/integrations/builtin/calendar/CnCalendarTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/calendar/CnCalendarTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/contactmoment/CnContactmomentCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/contactmoment/CnContactmomentCard.vue2.js +2 -1
- package/dist/esm/integrations/builtin/contactmoment/CnContactmomentCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/contactmoment/CnContactmomentCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/cospend/CnCospendTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/cospend/CnCospendTab.vue2.js +2 -1
- package/dist/esm/integrations/builtin/cospend/CnCospendTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/cospend/CnCospendTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/deck/CnDeckTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/deck/CnDeckTab.vue2.js +2 -1
- package/dist/esm/integrations/builtin/deck/CnDeckTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/deck/CnDeckTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailCard.vue2.js +2 -1
- package/dist/esm/integrations/builtin/email/CnEmailCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionCard.vue.js +1 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionCard.vue2.js +2 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionCard.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionCard.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionTab.vue2.js +2 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionTab.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue2.js +2 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/photos/CnPhotosTab.vue3.js.map +1 -1
- package/dist/esm/l10n/en.json.js +35 -2
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +38 -2
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +1068 -962
- package/dist/esm/store/useObjectStore.js +7 -2
- package/dist/esm/store/useObjectStore.js.map +1 -1
- package/dist/esm/utils/boardColumns.js +50 -1
- package/dist/esm/utils/boardColumns.js.map +1 -1
- package/dist/esm/utils/boardReferenceColumns.js +115 -4
- package/dist/esm/utils/boardReferenceColumns.js.map +1 -1
- package/dist/esm/utils/contentHeaderLink.js +48 -1
- package/dist/esm/utils/contentHeaderLink.js.map +1 -1
- package/dist/esm/utils/schema.js +5 -4
- package/dist/esm/utils/schema.js.map +1 -1
- package/dist/esm/utils/userLocale.js +30 -0
- package/dist/esm/utils/userLocale.js.map +1 -0
- package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
- package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +1088 -476
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +1068 -962
- package/l10n/en.json +35 -2
- package/l10n/nl.json +38 -2
- package/package.json +1 -1
- package/src/components/CnAdvancedFormDialog/CnMetadataTab.vue +3 -2
- package/src/components/CnAdvancedFormDialog/CnPropertyValueCell.vue +5 -4
- package/src/components/CnAnalyticsReportPicker/CnAnalyticsReportPicker.vue +2 -1
- package/src/components/CnAuditTrailCard/CnAuditTrailCard.vue +2 -1
- package/src/components/CnBoardView/CnBoardView.vue +189 -24
- package/src/components/CnCalendarEventPicker/CnCalendarEventPicker.vue +2 -1
- package/src/components/CnCalendarWidget/CnCalendarWidget.vue +2 -1
- package/src/components/CnChartWidget/CnChartWidget.vue +6 -5
- package/src/components/CnCollectivePagePicker/CnCollectivePagePicker.vue +2 -1
- package/src/components/CnConversationThread/CnConversationThread.vue +2 -1
- package/src/components/CnCountdownWidget/CnCountdownWidget.vue +2 -1
- package/src/components/CnDashboardPage/CnDashboardPage.vue +2 -1
- package/src/components/CnDataMatrix/CnDataMatrix.vue +2 -1
- package/src/components/CnDetailPage/CnDetailHeaderChips.vue +2 -1
- package/src/components/CnEmailPicker/CnEmailPicker.vue +2 -1
- package/src/components/CnFederationStatus/CnFederationStatus.vue +3 -1
- package/src/components/CnFileManager/CnFileManager.vue +2 -1
- package/src/components/CnFilePreview/CnFilePreview.vue +2 -1
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +54 -6
- package/src/components/CnFollowToggle/CnFollowToggle.vue +2 -1
- package/src/components/CnIndexPage/CnIndexPage.vue +30 -4
- package/src/components/CnNotesCard/CnNotesCard.vue +2 -1
- package/src/components/CnObjectCalendar/CnObjectCalendar.vue +3 -2
- package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +36 -0
- package/src/components/CnObjectMetadataWidget/CnObjectMetadataWidget.vue +5 -4
- package/src/components/CnObjectSidebar/CnAuditTrailTab.vue +2 -1
- package/src/components/CnObjectSidebar/CnFlowTasksPanel.vue +2 -1
- package/src/components/CnObjectSidebar/CnNotesTab.vue +2 -1
- package/src/components/CnObjectSidebar/CnTasksTab.vue +2 -1
- package/src/components/CnPropertySourceField/CnPropertySourceField.vue +2 -1
- package/src/components/CnRoadmapItem/CnRoadmapItem.vue +2 -1
- package/src/components/CnSchemaFormDialog/CnSchemaFormDialog.vue +4 -2
- package/src/components/CnStatsBlock/CnStatsBlock.vue +2 -1
- package/src/components/CnSummaryAggregates/CnSummaryAggregates.vue +2 -1
- package/src/components/CnTabsWidget/CnTabsWidget.vue +71 -0
- package/src/components/CnTasksCard/CnTasksCard.vue +2 -1
- package/src/components/CnTimelineWidget/CnTimelineWidget.vue +2 -1
- package/src/components/CnTranslatedBadge/CnTranslatedBadge.vue +2 -1
- package/src/components/CnVersionHistory/CnVersionHistory.vue +2 -1
- package/src/components/CnWidgetWrapper/CnWidgetWrapper.vue +3 -26
- package/src/css/board.css +40 -0
- package/src/dialogs/CnNoteHistoryDialog.vue +2 -1
- package/src/integrations/builtin/activity/CnActivityCard.vue +3 -2
- package/src/integrations/builtin/activity/CnActivityTab.vue +4 -3
- package/src/integrations/builtin/analytics/CnAnalyticsTab.vue +3 -2
- package/src/integrations/builtin/calendar/CnCalendarCard.vue +2 -1
- package/src/integrations/builtin/calendar/CnCalendarTab.vue +6 -5
- package/src/integrations/builtin/contactmoment/CnContactmomentCard.vue +2 -1
- package/src/integrations/builtin/cospend/CnCospendTab.vue +2 -1
- package/src/integrations/builtin/deck/CnDeckTab.vue +2 -1
- package/src/integrations/builtin/email/CnEmailCard.vue +2 -1
- package/src/integrations/builtin/field-inspection/CnFieldInspectionCard.vue +2 -1
- package/src/integrations/builtin/field-inspection/CnFieldInspectionTab.vue +2 -1
- package/src/integrations/builtin/photos/CnPhotosTab.vue +2 -1
- package/src/schemas/app-manifest-v2.schema.json +4 -1
- package/src/store/useObjectStore.js +7 -2
- package/src/utils/boardColumns.js +49 -0
- package/src/utils/boardReferenceColumns.js +114 -3
- package/src/utils/contentHeaderLink.js +47 -0
- package/src/utils/schema.js +5 -4
- package/src/utils/userLocale.js +26 -0
- package/src/utils/validateManifestV2.compiled.js +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnNotesTab.vue3.js","sources":["../../../../src/components/CnObjectSidebar/CnNotesTab.vue?vue&type=template&id=32297b04&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-sidebar-tab\">\n\t\t<!-- Add / Edit note -->\n\t\t<div class=\"cn-sidebar-tab__action\">\n\t\t\t<!-- Replying: the composer says to whom, and a reply to a reply goes to the top of its thread. -->\n\t\t\t<p\n\t\t\t\tv-if=\"replyTo\"\n\t\t\t\tclass=\"cn-sidebar-tab__replying\"\n\t\t\t\trole=\"status\"\n\t\t\t\tdata-testid=\"cn-notes-replying\">\n\t\t\t\t{{ replyingLabel }}\n\t\t\t\t<NcButton variant=\"tertiary\" @click=\"cancelReply\">\n\t\t\t\t\t{{ cancelLabel }}\n\t\t\t\t</NcButton>\n\t\t\t</p>\n\t\t\t<!-- @slot composer-before An app's own control above the composer, e.g. a template picker. Scope: `{ setText, text }`; `setText(text)` fills the composer, `text` is what it holds now. -->\n\t\t\t<slot name=\"composer-before\" :setText=\"setComposerText\" :text=\"newNoteText\" />\n\t\t\t<CnNoteComposer\n\t\t\t\tclass=\"cn-sidebar-tab__composer\"\n\t\t\t\t:modelValue=\"newNoteText\"\n\t\t\t\t:placeholder=\"addNotePlaceholder\"\n\t\t\t\t:register=\"register\"\n\t\t\t\t:schema=\"schema\"\n\t\t\t\t:objectId=\"objectId\"\n\t\t\t\t:apiBase=\"apiBase\"\n\t\t\t\t@update:modelValue=\"newNoteText = $event\"\n\t\t\t\t@submit=\"submitComposer\" />\n\t\t\t<div class=\"cn-sidebar-tab__action--row\">\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"editingNoteId\"\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t@click=\"cancelEdit\">\n\t\t\t\t\t{{ cancelLabel }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t:disabled=\"!newNoteText.trim() || saving\"\n\t\t\t\t\t@click=\"editingNoteId ? saveEdit() : addNote()\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Send :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ editingNoteId ? saveLabel : addNoteLabel }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!-- Notes list -->\n\t\t<!-- Standalone spinner: give it an accessible name so screen readers\n\t\t announce the loading state (WCAG 1.1.1 / 4.1.2 — a bare\n\t\t NcLoadingIcon renders an unlabelled role=\"img\"). -->\n\t\t<NcLoadingIcon v-if=\"loading\" :name=\"loadingLabel\" />\n\t\t<div v-else-if=\"notes.length === 0\" class=\"cn-sidebar-tab__empty\">\n\t\t\t{{ noNotesLabel }}\n\t\t</div>\n\t\t<!-- <ul>, not <div>: NcListItem renders an <li>, which WCAG 1.3.1\n\t\t requires to be contained in a <ul>/<ol> (axe \"listitem\"). -->\n\t\t<ul v-else class=\"cn-sidebar-tab__list\">\n\t\t\t<!-- One <li> per thread; inside it the note first, then its replies (oldest first), as a nested list named after the note. -->\n\t\t\t<li v-for=\"thread in threads\" :key=\"thread.note.id\" class=\"cn-notes-tab__thread\">\n\t\t\t\t<ul class=\"cn-notes-tab__thread-list\" :aria-label=\"threadLabel(thread.note)\">\n\t\t\t\t\t<NcListItem\n\t\t\t\t\t\tv-for=\"row in threadRows(thread)\"\n\t\t\t\t\t\t:key=\"row.note.id\"\n\t\t\t\t\t\t:class=\"{ 'cn-notes-tab__reply': row.isReply }\"\n\t\t\t\t\t\t:name=\"row.note.actorDisplayName || row.note.author || 'Unknown'\"\n\t\t\t\t\t\t:bold=\"false\"\n\t\t\t\t\t\t:forceDisplayActions=\"true\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<CommentTextOutline :size=\"32\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template #subname>\n\t\t\t\t\t\t\t<span class=\"cn-sidebar-tab__message\">\n\t\t\t\t\t\t\t\t<span v-if=\"row.quote\" class=\"cn-notes-tab__quote\" data-testid=\"cn-note-quote\">{{ row.quote }}</span>\n\t\t\t\t\t\t\t\t<CnNoteBody :message=\"row.note.message || row.note.content || ''\" :record=\"record\" :names=\"mentionNames\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template #details>\n\t\t\t\t\t\t\t{{ formatDate(row.note.creationDateTime || row.note.created) }}\n\t\t\t\t\t\t\t<!-- An edited note says so where its time is, because that\n\t\t\t\t\t\t\t is where a reader already looks to date what they are\n\t\t\t\t\t\t\t reading. The line names the editor, so nobody has to\n\t\t\t\t\t\t\t open the history to learn who changed it. -->\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tv-if=\"wasEdited(row.note)\"\n\t\t\t\t\t\t\t\tclass=\"cn-notes-tab__edited\"\n\t\t\t\t\t\t\t\tdata-testid=\"cn-note-edited\">{{ editedLine(row.note) }}</span>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template v-if=\"canReply || canDelete(row.note) || wasEdited(row.note) || noteActions.length > 0\" #actions>\n\t\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\t\tv-if=\"canReply\"\n\t\t\t\t\t\t\t\t:aria-label=\"replyAria(row.note)\"\n\t\t\t\t\t\t\t\tdata-testid=\"cn-note-reply-action\"\n\t\t\t\t\t\t\t\t@click=\"startReply(row.note)\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<Reply :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t{{ replyLabel }}\n\t\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t\t<NcActionButton v-if=\"canDelete(row.note)\" @click=\"startEdit(row.note)\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<Pencil :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t{{ editLabel }}\n\t\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\t\tv-if=\"wasEdited(row.note)\"\n\t\t\t\t\t\t\t\tdata-testid=\"cn-note-history-action\"\n\t\t\t\t\t\t\t\t@click=\"openHistory(row.note)\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<HistoryIcon :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t{{ historyLabel }}\n\t\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t\t<NcActionButton v-if=\"canDelete(row.note)\" @click=\"deleteNote(row.note)\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t{{ deleteLabel }}\n\t\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t\t<!-- The consuming app's own per-note actions, after the\n\t\t\t\t\t\t\t library's. They render inside this NcActions and emit\n\t\t\t\t\t\t\t `note-action`; nothing about what they DO lives here. -->\n\t\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\t\tv-for=\"action in noteActions\"\n\t\t\t\t\t\t\t\t:key=\"`${row.note.id}-${action.id}`\"\n\t\t\t\t\t\t\t\t:data-testid=\"`cn-note-action-${action.id}`\"\n\t\t\t\t\t\t\t\t@click=\"$emit('note-action', { action: action.id, note: row.note })\">\n\t\t\t\t\t\t\t\t<template v-if=\"action.icon\" #icon>\n\t\t\t\t\t\t\t\t\t<component :is=\"action.icon\" :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t{{ action.label }}\n\t\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcListItem>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t</ul>\n\n\t\t<CnNoteHistoryDialog\n\t\t\tv-if=\"historyNoteId\"\n\t\t\t:open=\"true\"\n\t\t\t:noteId=\"historyNoteId\"\n\t\t\t:objectId=\"objectId\"\n\t\t\t:register=\"register\"\n\t\t\t:schema=\"schema\"\n\t\t\t:apiBase=\"apiBase\"\n\t\t\t@update:open=\"historyNoteId = null\" />\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcButton, NcListItem, NcLoadingIcon } from '@nextcloud/vue'\nimport CommentTextOutline from 'vue-material-design-icons/CommentTextOutline.vue'\nimport Delete from 'vue-material-design-icons/Delete.vue'\nimport HistoryIcon from 'vue-material-design-icons/History.vue'\nimport Pencil from 'vue-material-design-icons/Pencil.vue'\nimport Reply from 'vue-material-design-icons/Reply.vue'\nimport Send from 'vue-material-design-icons/Send.vue'\nimport CnNoteHistoryDialog from '../../dialogs/CnNoteHistoryDialog.vue'\nimport CnNoteBody from '../CnNoteBody/CnNoteBody.vue'\nimport CnNoteComposer from '../CnNoteComposer/CnNoteComposer.vue'\nimport { buildHeaders, prefixUrl } from '../../utils/index.js'\nimport { extractMentionedGroupIds, extractMentionedIds } from '../../utils/mentions.js'\nimport { quoteFor, supportsReplies, threadNotes, threadRootId } from '../../utils/noteThreads.js'\nimport { searchNextcloudUsers } from '../../utils/userAutocomplete.js'\n\nexport default {\n\tname: 'CnNotesTab',\n\n\tcomponents: { NcButton, NcListItem, NcActionButton, NcLoadingIcon, CnNoteBody, CnNoteComposer, CnNoteHistoryDialog, CommentTextOutline, Send, Pencil, Delete, HistoryIcon, Reply },\n\n\tprops: {\n\t\t/** ID of the object this tab belongs to */\n\t\tobjectId: { type: String, required: true },\n\t\t/** OpenRegister register slug */\n\t\tregister: { type: String, default: '' },\n\t\t/** JSON Schema definition for the object */\n\t\tschema: { type: String, default: '' },\n\t\t/** Base URL for the OpenRegister API */\n\t\tapiBase: { type: String, default: '/apps/openregister/api' },\n\t\t/** Label for the add note button */\n\t\taddNoteLabel: { type: String, default: () => t('nextcloud-vue', 'Add note') },\n\t\t/** Placeholder text for the note input field */\n\t\taddNotePlaceholder: { type: String, default: () => t('nextcloud-vue', 'Write a note…') },\n\t\t/** Label for the edit action */\n\t\teditLabel: { type: String, default: () => t('nextcloud-vue', 'Edit') },\n\t\t/** Label for the save action */\n\t\tsaveLabel: { type: String, default: () => t('nextcloud-vue', 'Save') },\n\t\t/** Label for the cancel button */\n\t\tcancelLabel: { type: String, default: () => t('nextcloud-vue', 'Cancel') },\n\t\t/** Label for the delete action */\n\t\tdeleteLabel: { type: String, default: () => t('nextcloud-vue', 'Delete') },\n\t\t/** Text shown when there are no notes */\n\t\tnoNotesLabel: { type: String, default: () => t('nextcloud-vue', 'No notes yet') },\n\t\t/** Text shown while the notes are being fetched */\n\t\tloadingLabel: { type: String, default: () => t('nextcloud-vue', 'Loading notes…') },\n\t\t/** Label for the Reply action (shown only when the backend supports replies) */\n\t\treplyLabel: { type: String, default: () => t('nextcloud-vue', 'Reply') },\n\t\t/** Label for the action that opens a note's earlier versions */\n\t\thistoryLabel: { type: String, default: () => t('nextcloud-vue', 'Show earlier versions') },\n\t\t// WHY THIS PROP EXISTS, since a seam nobody asked for is the kind that\n\t\t// rots. An app-specific act on ONE note had nowhere to live: this\n\t\t// component rendered edit, history and delete and offered no fourth\n\t\t// place. Dossiq sends a single case note to a neighbouring ZGW\n\t\t// register, and its endpoint, guard, route and tests were all in place\n\t\t// while no page could call any of them. Its own change wrote that down\n\t\t// as a blocker rather than declaring a prop nothing read.\n\t\t//\n\t\t// `label` stays the app's to write and translate, so nc-vue phrases\n\t\t// nothing for somebody else's domain and adds no catalogue string here.\n\t\t/**\n\t\t * Per-note actions the consuming app owns, `[{ id, label, icon? }]`.\n\t\t * Each entry renders one NcActionButton in every note's action menu,\n\t\t * after the library's own, and clicking it emits `note-action`. Empty\n\t\t * by default, and an empty list changes nothing. `icon` is optional\n\t\t * and takes an icon component.\n\t\t */\n\t\tnoteActions: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t\tvalidator: (actions) => actions.every((action) => action\n\t\t\t\t&& typeof action.id === 'string' && action.id !== ''\n\t\t\t\t&& typeof action.label === 'string' && action.label !== ''),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted after a note containing at least one `@mention` was\n\t\t * successfully created or edited, with payload\n\t\t * `{ objectId, register, schema, noteId, mentionedUserIds }`, plus\n\t\t * `mentionedGroupIds` when the note mentions a group (`@\"group/<gid>\"`).\n\t\t * The event also fires for a note that mentions only groups. Expanding a\n\t\t * group to its members is the listener's job.\n\t\t * nc-vue never dispatches server-side notifications itself —\n\t\t * consuming apps listen to this event and notify from their own\n\t\t * backend.\n\t\t */\n\t\t'mention',\n\t\t/**\n\t\t * Emitted when one of the consuming app's `noteActions` is clicked,\n\t\t * with payload `{ action, note }`: the entry's `id` and the whole note\n\t\t * as the backend answered it. The library does the rendering and\n\t\t * nothing else, so what the action means stays in the app.\n\t\t */\n\t\t'note-action',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tnotes: [],\n\t\t\tloading: false,\n\t\t\tnewNoteText: '',\n\t\t\tsaving: false,\n\t\t\teditingNoteId: null,\n\t\t\t/** The note whose earlier versions are open, or null. */\n\t\t\thistoryNoteId: null,\n\t\t\t/**\n\t\t\t * Per-instance cache of mentioned-user display names, keyed by\n\t\t\t * user id. `null` marks an id that could not be resolved (unknown\n\t\t\t * or deleted user) so it is only looked up once.\n\t\t\t */\n\t\t\tmentionNames: {},\n\t\t\t/** The note a reply is being written to, or null. */\n\t\t\treplyTo: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {{apiBase: string, register: string, schema: string, objectId: string}} Where this record's files live, for pasted images. */\n\t\trecord() {\n\t\t\treturn { apiBase: this.apiBase, register: this.register, schema: this.schema, objectId: this.objectId }\n\t\t},\n\n\t\t/** @return {boolean} Whether the backend supports replies: its notes carry a `parentId` key. */\n\t\tcanReply() {\n\t\t\treturn supportsReplies(this.notes)\n\t\t},\n\n\t\t/** @return {Array<{note: object, replies: object[]}>} The notes as threads, in the order they came. */\n\t\tthreads() {\n\t\t\treturn threadNotes(this.notes)\n\t\t},\n\n\t\t/** @return {string} The line above the composer while replying. */\n\t\treplyingLabel() {\n\t\t\treturn this.replyTo ? t('nextcloud-vue', 'Replying to {author}', { author: this.authorOf(this.replyTo) }) : ''\n\t\t},\n\t},\n\n\twatch: {\n\t\tobjectId: {\n\t\t\timmediate: true,\n\t\t\thandler(id) {\n\t\t\t\tif (id) {\n\t\t\t\t\tthis.fetchNotes()\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync fetchNotes() {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes`),\n\t\t\t\t\t{ headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tthis.notes = data.results || data || []\n\t\t\t\t\tthis.resolveMentionNames()\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to fetch notes', err)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Resolve display names for every mentioned id across the current\n\t\t * notes list. Each id is looked up at most once per component\n\t\t * instance; unresolvable ids are cached as `null`.\n\t\t */\n\t\tasync resolveMentionNames() {\n\t\t\tconst ids = new Set()\n\t\t\tfor (const note of this.notes) {\n\t\t\t\tfor (const id of extractMentionedIds(note.message || note.content || '')) {\n\t\t\t\t\tids.add(id)\n\t\t\t\t}\n\t\t\t}\n\t\t\tawait Promise.all([...ids]\n\t\t\t\t.filter((id) => !(id in this.mentionNames))\n\t\t\t\t.map(async (id) => {\n\t\t\t\t\t// Mark as pending (null) first so concurrent calls skip it.\n\t\t\t\t\tthis.mentionNames[id] = null\n\t\t\t\t\tconst results = await searchNextcloudUsers(id)\n\t\t\t\t\tconst match = results.find((user) => user.id === id)\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tthis.mentionNames[id] = match.label\n\t\t\t\t\t}\n\t\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * Emit the `mention` notification hook for a successfully saved note.\n\t\t *\n\t\t * @param {string} savedText The note text that was persisted.\n\t\t * @param {string|null} noteId The created/edited note's id.\n\t\t */\n\t\temitMentionEvent(savedText, noteId) {\n\t\t\tconst mentionedUserIds = extractMentionedIds(savedText)\n\t\t\tconst mentionedGroupIds = extractMentionedGroupIds(savedText)\n\t\t\tif (mentionedUserIds.length === 0 && mentionedGroupIds.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.$emit('mention', {\n\t\t\t\tobjectId: this.objectId,\n\t\t\t\tregister: this.register,\n\t\t\t\tschema: this.schema,\n\t\t\t\tnoteId,\n\t\t\t\tmentionedUserIds,\n\t\t\t\t// Only when a group is mentioned: a note that names none keeps the payload it always had.\n\t\t\t\t...(mentionedGroupIds.length > 0 ? { mentionedGroupIds } : {}),\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Save from the composer (Ctrl/Cmd+Enter): the same as the button.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tsubmitComposer() {\n\t\t\tif (!this.newNoteText.trim() || this.saving) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.editingNoteId) {\n\t\t\t\tthis.saveEdit()\n\t\t\t} else {\n\t\t\t\tthis.addNote()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @param {object} note A note.\n\t\t * @return {string} Its author's name.\n\t\t */\n\t\tauthorOf(note) {\n\t\t\treturn note.actorDisplayName || note.author || 'Unknown'\n\t\t},\n\n\t\t/**\n\t\t * Write a reply to a note. A reply to a reply goes to the top of its thread.\n\t\t *\n\t\t * @param {object} note The note answered.\n\t\t * @return {void}\n\t\t */\n\t\tstartReply(note) {\n\t\t\tthis.editingNoteId = null\n\t\t\tthis.replyTo = note\n\t\t},\n\n\t\tcancelReply() {\n\t\t\tthis.replyTo = null\n\t\t},\n\n\t\t/**\n\t\t * The rows of one thread: the note, then its replies. A reply whose parent\n\t\t * is far up the list carries a one-line quote of it.\n\t\t *\n\t\t * @param {{note: object, replies: object[]}} thread The thread.\n\t\t * @return {Array<{note: object, isReply: boolean, quote: string}>} The rows.\n\t\t */\n\t\tthreadRows(thread) {\n\t\t\tconst flat = this.threads.flatMap((t2) => [t2.note, ...t2.replies])\n\t\t\treturn [\n\t\t\t\t{ note: thread.note, isReply: false, quote: '' },\n\t\t\t\t...thread.replies.map((reply) => ({ note: reply, isReply: true, quote: quoteFor(reply, flat) })),\n\t\t\t]\n\t\t},\n\n\t\t/**\n\t\t * @param {object} note A top-level note.\n\t\t * @return {string} The name of its thread for assistive technology.\n\t\t */\n\t\tthreadLabel(note) {\n\t\t\treturn t('nextcloud-vue', 'Note by {author} and its replies', { author: this.authorOf(note) })\n\t\t},\n\n\t\t/**\n\t\t * @param {object} note The note a Reply button answers.\n\t\t * @return {string} The button's accessible name, naming the author.\n\t\t */\n\t\treplyAria(note) {\n\t\t\treturn t('nextcloud-vue', 'Reply to {author}', { author: this.authorOf(note) })\n\t\t},\n\n\t\tasync addNote() {\n\t\t\tif (!this.newNoteText.trim()) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\tconst savedText = this.newNoteText.trim()\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify(this.replyTo\n\t\t\t\t\t\t\t? { message: savedText, parentId: threadRootId(this.replyTo, this.notes) }\n\t\t\t\t\t\t\t: { message: savedText }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tlet noteId = null\n\t\t\t\ttry {\n\t\t\t\t\tconst created = await response.json()\n\t\t\t\t\tnoteId = (created && (created.id || (created.results && created.results.id))) || null\n\t\t\t\t} catch {\n\t\t\t\t\t// Body not JSON — the event still fires with noteId null.\n\t\t\t\t}\n\t\t\t\tthis.emitMentionEvent(savedText, noteId)\n\t\t\t\tthis.newNoteText = ''\n\t\t\t\tthis.replyTo = null\n\t\t\t\tawait this.fetchNotes()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to add note', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Fill the composer from outside, for the `composer-before` slot.\n\t\t *\n\t\t * The app decides what goes in (a template body, a quoted line); the\n\t\t * composer stays the one place the text lives, so sending, editing and\n\t\t * the mention picker all see it exactly as if it had been typed.\n\t\t *\n\t\t * @param {string} text The text the composer should hold.\n\t\t * @return {void}\n\t\t */\n\t\tsetComposerText(text) {\n\t\t\tthis.newNoteText = (text === null || text === undefined) ? '' : String(text)\n\t\t},\n\n\t\tstartEdit(note) {\n\t\t\tthis.replyTo = null\n\t\t\tthis.editingNoteId = note.id\n\t\t\tthis.newNoteText = note.message || note.content || ''\n\t\t},\n\n\t\tcancelEdit() {\n\t\t\tthis.editingNoteId = null\n\t\t\tthis.newNoteText = ''\n\t\t},\n\n\t\tasync saveEdit() {\n\t\t\tif (!this.newNoteText.trim() || !this.editingNoteId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\tconst savedText = this.newNoteText.trim()\n\t\t\tconst noteId = this.editingNoteId\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes/${noteId}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify({ message: savedText }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.emitMentionEvent(savedText, noteId)\n\t\t\t\tthis.editingNoteId = null\n\t\t\t\tthis.newNoteText = ''\n\t\t\t\tawait this.fetchNotes()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to update note', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\tcanDelete(note) {\n\t\t\treturn note.actorId === OC?.currentUser || note.author === OC?.currentUser\n\t\t},\n\n\t\t/**\n\t\t * Whether this note carries a history to show.\n\t\t *\n\t\t * Read off `versionCount` rather than off `editedAt`: a note edited by\n\t\t * a since-deleted account still has its prior texts, and a marker that\n\t\t * depended on the editor still existing would quietly vanish.\n\t\t *\n\t\t * @param {object} note The note from the backend.\n\t\t * @return {boolean} True when at least one earlier version exists.\n\t\t */\n\t\twasEdited(note) {\n\t\t\treturn Number(note.versionCount || 0) > 0\n\t\t},\n\n\t\t/**\n\t\t * The \"edited\" line beside a note's time.\n\t\t *\n\t\t * @param {object} note The note from the backend.\n\t\t * @return {string} The rendered line.\n\t\t */\n\t\teditedLine(note) {\n\t\t\tconst editor = note.editedByDisplayName || note.editedBy\n\t\t\tif (!editor) {\n\t\t\t\treturn t('nextcloud-vue', 'Edited')\n\t\t\t}\n\t\t\treturn t('nextcloud-vue', 'Edited by {editor}', { editor })\n\t\t},\n\n\t\t/**\n\t\t * Open the earlier versions of one note.\n\t\t *\n\t\t * @param {object} note The note to open.\n\t\t */\n\t\topenHistory(note) {\n\t\t\tthis.historyNoteId = note.id\n\t\t},\n\n\t\tasync deleteNote(note) {\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes/${note.id}`),\n\t\t\t\t\t{ method: 'DELETE', headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tthis.notes = this.notes.filter((n) => n.id !== note.id)\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to delete note', err)\n\t\t\t}\n\t\t},\n\n\t\tformatDate(dateStr) {\n\t\t\tif (!dateStr) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new Date(dateStr).toLocaleString(undefined, {\n\t\t\t\t\tyear: 'numeric',\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t\tday: 'numeric',\n\t\t\t\t\thour: '2-digit',\n\t\t\t\t\tminute: '2-digit',\n\t\t\t\t})\n\t\t\t} catch {\n\t\t\t\treturn dateStr\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-sidebar-tab { padding: 12px; }\n\n.cn-sidebar-tab__action { margin-bottom: 16px; }\n\n.cn-sidebar-tab__action--row { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }\n\n.cn-sidebar-tab__composer {\n\twidth: 100%;\n}\n\n.cn-sidebar-tab__empty {\n\ttext-align: center;\n\tpadding: 24px 12px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-sidebar-tab__list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }\n\n.cn-notes-tab__thread { list-style: none; }\n\n.cn-notes-tab__thread-list { margin: 0; padding: 0; list-style: none; }\n\n.cn-notes-tab__reply { margin-inline-start: 24px; }\n\n.cn-notes-tab__quote {\n\tdisplay: block;\n\tmargin-bottom: 2px;\n\tpadding-inline-start: 8px;\n\tborder-inline-start: 2px solid var(--color-border-dark);\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.9em;\n}\n\n.cn-sidebar-tab__replying {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tmargin: 0 0 4px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-notes-tab__edited {\n\tcolor: var(--color-text-maxcontrast);\n\tmargin-inline-start: 6px;\n\tfont-style: italic;\n}\n\n</style>\n"],"names":["_openBlock","_createElementBlock","_createTextVNode","_toDisplayString","_createVNode","_renderSlot","_createElementVNode","_createBlock","_Fragment","_renderList","_normalizeClass","_resolveDynamicComponent"],"mappings":";;AAWM,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,gBAAK,GAAA;AAEV,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,wBAAG,GAAA;;;AAIX,EAAA,KAAI,EAAC,0BAAW;AACjB,EAAA,IAAI,EAAC,QAAK;AACV,EAAA,aAAE,EAAA,mBAAA;;AAkBE,MAAA,UAAA,GAAA,EAAA,K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EAAA,CAAA,EAAK,GAAC,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA,EAAA,MAAA,CAAA,EAAA,CAAA,CAAA;kCACT,aAAW,EAAA,CAAA,eAAA,EAAK,MAAA,CAAA,EAAA,CAAA,CAAA;kCAChB,OAAK,EAAA,MAAA,KAAE,UAAK,CAAE,aAAA,EAAA,EAAA,MAAA,EAAA,MAAA,CAAA,EAAA,EAAA,IAAA,EAAA,GAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;mDAGf,MACD;oDADC,GACD,GAAAJ,eAAA,CAAA,MAAA,CAAA,KAAA,CAAA,EAAA,CAAA,YAAA;;;;AAHS,kCAAA,CAAA,MAAA,CAAA,IAAA;;8CAAA,MAAA;oDACP,MAAQ;AAAR,2CAAAH,SAAA,EAAA,EAAAO,WAAA,CAAQI,wBAAA,MAAA,CAAA,IAAA,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;KAWR,KAAS,CAAA,aAAA;sBADfJ;;AAEC,UAAA,IAAI,EAAE,IAAI;AACV,UAAA,MAAM,EAAE,KAAa,CAAA,aAAA;AACrB,UAAA,QAAE,EAAA,MAAA,CAAA,QAAA;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"CnNotesTab.vue3.js","sources":["../../../../src/components/CnObjectSidebar/CnNotesTab.vue?vue&type=template&id=2d5259c0&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-sidebar-tab\">\n\t\t<!-- Add / Edit note -->\n\t\t<div class=\"cn-sidebar-tab__action\">\n\t\t\t<!-- Replying: the composer says to whom, and a reply to a reply goes to the top of its thread. -->\n\t\t\t<p\n\t\t\t\tv-if=\"replyTo\"\n\t\t\t\tclass=\"cn-sidebar-tab__replying\"\n\t\t\t\trole=\"status\"\n\t\t\t\tdata-testid=\"cn-notes-replying\">\n\t\t\t\t{{ replyingLabel }}\n\t\t\t\t<NcButton variant=\"tertiary\" @click=\"cancelReply\">\n\t\t\t\t\t{{ cancelLabel }}\n\t\t\t\t</NcButton>\n\t\t\t</p>\n\t\t\t<!-- @slot composer-before An app's own control above the composer, e.g. a template picker. Scope: `{ setText, text }`; `setText(text)` fills the composer, `text` is what it holds now. -->\n\t\t\t<slot name=\"composer-before\" :setText=\"setComposerText\" :text=\"newNoteText\" />\n\t\t\t<CnNoteComposer\n\t\t\t\tclass=\"cn-sidebar-tab__composer\"\n\t\t\t\t:modelValue=\"newNoteText\"\n\t\t\t\t:placeholder=\"addNotePlaceholder\"\n\t\t\t\t:register=\"register\"\n\t\t\t\t:schema=\"schema\"\n\t\t\t\t:objectId=\"objectId\"\n\t\t\t\t:apiBase=\"apiBase\"\n\t\t\t\t@update:modelValue=\"newNoteText = $event\"\n\t\t\t\t@submit=\"submitComposer\" />\n\t\t\t<div class=\"cn-sidebar-tab__action--row\">\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"editingNoteId\"\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t@click=\"cancelEdit\">\n\t\t\t\t\t{{ cancelLabel }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t:disabled=\"!newNoteText.trim() || saving\"\n\t\t\t\t\t@click=\"editingNoteId ? saveEdit() : addNote()\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Send :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ editingNoteId ? saveLabel : addNoteLabel }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!-- Notes list -->\n\t\t<!-- Standalone spinner: give it an accessible name so screen readers\n\t\t announce the loading state (WCAG 1.1.1 / 4.1.2 — a bare\n\t\t NcLoadingIcon renders an unlabelled role=\"img\"). -->\n\t\t<NcLoadingIcon v-if=\"loading\" :name=\"loadingLabel\" />\n\t\t<div v-else-if=\"notes.length === 0\" class=\"cn-sidebar-tab__empty\">\n\t\t\t{{ noNotesLabel }}\n\t\t</div>\n\t\t<!-- <ul>, not <div>: NcListItem renders an <li>, which WCAG 1.3.1\n\t\t requires to be contained in a <ul>/<ol> (axe \"listitem\"). -->\n\t\t<ul v-else class=\"cn-sidebar-tab__list\">\n\t\t\t<!-- One <li> per thread; inside it the note first, then its replies (oldest first), as a nested list named after the note. -->\n\t\t\t<li v-for=\"thread in threads\" :key=\"thread.note.id\" class=\"cn-notes-tab__thread\">\n\t\t\t\t<ul class=\"cn-notes-tab__thread-list\" :aria-label=\"threadLabel(thread.note)\">\n\t\t\t\t\t<NcListItem\n\t\t\t\t\t\tv-for=\"row in threadRows(thread)\"\n\t\t\t\t\t\t:key=\"row.note.id\"\n\t\t\t\t\t\t:class=\"{ 'cn-notes-tab__reply': row.isReply }\"\n\t\t\t\t\t\t:name=\"row.note.actorDisplayName || row.note.author || 'Unknown'\"\n\t\t\t\t\t\t:bold=\"false\"\n\t\t\t\t\t\t:forceDisplayActions=\"true\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<CommentTextOutline :size=\"32\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template #subname>\n\t\t\t\t\t\t\t<span class=\"cn-sidebar-tab__message\">\n\t\t\t\t\t\t\t\t<span v-if=\"row.quote\" class=\"cn-notes-tab__quote\" data-testid=\"cn-note-quote\">{{ row.quote }}</span>\n\t\t\t\t\t\t\t\t<CnNoteBody :message=\"row.note.message || row.note.content || ''\" :record=\"record\" :names=\"mentionNames\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template #details>\n\t\t\t\t\t\t\t{{ formatDate(row.note.creationDateTime || row.note.created) }}\n\t\t\t\t\t\t\t<!-- An edited note says so where its time is, because that\n\t\t\t\t\t\t\t is where a reader already looks to date what they are\n\t\t\t\t\t\t\t reading. The line names the editor, so nobody has to\n\t\t\t\t\t\t\t open the history to learn who changed it. -->\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tv-if=\"wasEdited(row.note)\"\n\t\t\t\t\t\t\t\tclass=\"cn-notes-tab__edited\"\n\t\t\t\t\t\t\t\tdata-testid=\"cn-note-edited\">{{ editedLine(row.note) }}</span>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template v-if=\"canReply || canDelete(row.note) || wasEdited(row.note) || noteActions.length > 0\" #actions>\n\t\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\t\tv-if=\"canReply\"\n\t\t\t\t\t\t\t\t:aria-label=\"replyAria(row.note)\"\n\t\t\t\t\t\t\t\tdata-testid=\"cn-note-reply-action\"\n\t\t\t\t\t\t\t\t@click=\"startReply(row.note)\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<Reply :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t{{ replyLabel }}\n\t\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t\t<NcActionButton v-if=\"canDelete(row.note)\" @click=\"startEdit(row.note)\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<Pencil :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t{{ editLabel }}\n\t\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\t\tv-if=\"wasEdited(row.note)\"\n\t\t\t\t\t\t\t\tdata-testid=\"cn-note-history-action\"\n\t\t\t\t\t\t\t\t@click=\"openHistory(row.note)\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<HistoryIcon :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t{{ historyLabel }}\n\t\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t\t<NcActionButton v-if=\"canDelete(row.note)\" @click=\"deleteNote(row.note)\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t{{ deleteLabel }}\n\t\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t\t<!-- The consuming app's own per-note actions, after the\n\t\t\t\t\t\t\t library's. They render inside this NcActions and emit\n\t\t\t\t\t\t\t `note-action`; nothing about what they DO lives here. -->\n\t\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\t\tv-for=\"action in noteActions\"\n\t\t\t\t\t\t\t\t:key=\"`${row.note.id}-${action.id}`\"\n\t\t\t\t\t\t\t\t:data-testid=\"`cn-note-action-${action.id}`\"\n\t\t\t\t\t\t\t\t@click=\"$emit('note-action', { action: action.id, note: row.note })\">\n\t\t\t\t\t\t\t\t<template v-if=\"action.icon\" #icon>\n\t\t\t\t\t\t\t\t\t<component :is=\"action.icon\" :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t{{ action.label }}\n\t\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcListItem>\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t</ul>\n\n\t\t<CnNoteHistoryDialog\n\t\t\tv-if=\"historyNoteId\"\n\t\t\t:open=\"true\"\n\t\t\t:noteId=\"historyNoteId\"\n\t\t\t:objectId=\"objectId\"\n\t\t\t:register=\"register\"\n\t\t\t:schema=\"schema\"\n\t\t\t:apiBase=\"apiBase\"\n\t\t\t@update:open=\"historyNoteId = null\" />\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcButton, NcListItem, NcLoadingIcon } from '@nextcloud/vue'\nimport CommentTextOutline from 'vue-material-design-icons/CommentTextOutline.vue'\nimport Delete from 'vue-material-design-icons/Delete.vue'\nimport HistoryIcon from 'vue-material-design-icons/History.vue'\nimport Pencil from 'vue-material-design-icons/Pencil.vue'\nimport Reply from 'vue-material-design-icons/Reply.vue'\nimport Send from 'vue-material-design-icons/Send.vue'\nimport CnNoteHistoryDialog from '../../dialogs/CnNoteHistoryDialog.vue'\nimport CnNoteBody from '../CnNoteBody/CnNoteBody.vue'\nimport CnNoteComposer from '../CnNoteComposer/CnNoteComposer.vue'\nimport { buildHeaders, prefixUrl } from '../../utils/index.js'\nimport { extractMentionedGroupIds, extractMentionedIds } from '../../utils/mentions.js'\nimport { quoteFor, supportsReplies, threadNotes, threadRootId } from '../../utils/noteThreads.js'\nimport { searchNextcloudUsers } from '../../utils/userAutocomplete.js'\nimport { userLocale } from '../../utils/userLocale.js'\n\nexport default {\n\tname: 'CnNotesTab',\n\n\tcomponents: { NcButton, NcListItem, NcActionButton, NcLoadingIcon, CnNoteBody, CnNoteComposer, CnNoteHistoryDialog, CommentTextOutline, Send, Pencil, Delete, HistoryIcon, Reply },\n\n\tprops: {\n\t\t/** ID of the object this tab belongs to */\n\t\tobjectId: { type: String, required: true },\n\t\t/** OpenRegister register slug */\n\t\tregister: { type: String, default: '' },\n\t\t/** JSON Schema definition for the object */\n\t\tschema: { type: String, default: '' },\n\t\t/** Base URL for the OpenRegister API */\n\t\tapiBase: { type: String, default: '/apps/openregister/api' },\n\t\t/** Label for the add note button */\n\t\taddNoteLabel: { type: String, default: () => t('nextcloud-vue', 'Add note') },\n\t\t/** Placeholder text for the note input field */\n\t\taddNotePlaceholder: { type: String, default: () => t('nextcloud-vue', 'Write a note…') },\n\t\t/** Label for the edit action */\n\t\teditLabel: { type: String, default: () => t('nextcloud-vue', 'Edit') },\n\t\t/** Label for the save action */\n\t\tsaveLabel: { type: String, default: () => t('nextcloud-vue', 'Save') },\n\t\t/** Label for the cancel button */\n\t\tcancelLabel: { type: String, default: () => t('nextcloud-vue', 'Cancel') },\n\t\t/** Label for the delete action */\n\t\tdeleteLabel: { type: String, default: () => t('nextcloud-vue', 'Delete') },\n\t\t/** Text shown when there are no notes */\n\t\tnoNotesLabel: { type: String, default: () => t('nextcloud-vue', 'No notes yet') },\n\t\t/** Text shown while the notes are being fetched */\n\t\tloadingLabel: { type: String, default: () => t('nextcloud-vue', 'Loading notes…') },\n\t\t/** Label for the Reply action (shown only when the backend supports replies) */\n\t\treplyLabel: { type: String, default: () => t('nextcloud-vue', 'Reply') },\n\t\t/** Label for the action that opens a note's earlier versions */\n\t\thistoryLabel: { type: String, default: () => t('nextcloud-vue', 'Show earlier versions') },\n\t\t// WHY THIS PROP EXISTS, since a seam nobody asked for is the kind that\n\t\t// rots. An app-specific act on ONE note had nowhere to live: this\n\t\t// component rendered edit, history and delete and offered no fourth\n\t\t// place. Dossiq sends a single case note to a neighbouring ZGW\n\t\t// register, and its endpoint, guard, route and tests were all in place\n\t\t// while no page could call any of them. Its own change wrote that down\n\t\t// as a blocker rather than declaring a prop nothing read.\n\t\t//\n\t\t// `label` stays the app's to write and translate, so nc-vue phrases\n\t\t// nothing for somebody else's domain and adds no catalogue string here.\n\t\t/**\n\t\t * Per-note actions the consuming app owns, `[{ id, label, icon? }]`.\n\t\t * Each entry renders one NcActionButton in every note's action menu,\n\t\t * after the library's own, and clicking it emits `note-action`. Empty\n\t\t * by default, and an empty list changes nothing. `icon` is optional\n\t\t * and takes an icon component.\n\t\t */\n\t\tnoteActions: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t\tvalidator: (actions) => actions.every((action) => action\n\t\t\t\t&& typeof action.id === 'string' && action.id !== ''\n\t\t\t\t&& typeof action.label === 'string' && action.label !== ''),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted after a note containing at least one `@mention` was\n\t\t * successfully created or edited, with payload\n\t\t * `{ objectId, register, schema, noteId, mentionedUserIds }`, plus\n\t\t * `mentionedGroupIds` when the note mentions a group (`@\"group/<gid>\"`).\n\t\t * The event also fires for a note that mentions only groups. Expanding a\n\t\t * group to its members is the listener's job.\n\t\t * nc-vue never dispatches server-side notifications itself —\n\t\t * consuming apps listen to this event and notify from their own\n\t\t * backend.\n\t\t */\n\t\t'mention',\n\t\t/**\n\t\t * Emitted when one of the consuming app's `noteActions` is clicked,\n\t\t * with payload `{ action, note }`: the entry's `id` and the whole note\n\t\t * as the backend answered it. The library does the rendering and\n\t\t * nothing else, so what the action means stays in the app.\n\t\t */\n\t\t'note-action',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tnotes: [],\n\t\t\tloading: false,\n\t\t\tnewNoteText: '',\n\t\t\tsaving: false,\n\t\t\teditingNoteId: null,\n\t\t\t/** The note whose earlier versions are open, or null. */\n\t\t\thistoryNoteId: null,\n\t\t\t/**\n\t\t\t * Per-instance cache of mentioned-user display names, keyed by\n\t\t\t * user id. `null` marks an id that could not be resolved (unknown\n\t\t\t * or deleted user) so it is only looked up once.\n\t\t\t */\n\t\t\tmentionNames: {},\n\t\t\t/** The note a reply is being written to, or null. */\n\t\t\treplyTo: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {{apiBase: string, register: string, schema: string, objectId: string}} Where this record's files live, for pasted images. */\n\t\trecord() {\n\t\t\treturn { apiBase: this.apiBase, register: this.register, schema: this.schema, objectId: this.objectId }\n\t\t},\n\n\t\t/** @return {boolean} Whether the backend supports replies: its notes carry a `parentId` key. */\n\t\tcanReply() {\n\t\t\treturn supportsReplies(this.notes)\n\t\t},\n\n\t\t/** @return {Array<{note: object, replies: object[]}>} The notes as threads, in the order they came. */\n\t\tthreads() {\n\t\t\treturn threadNotes(this.notes)\n\t\t},\n\n\t\t/** @return {string} The line above the composer while replying. */\n\t\treplyingLabel() {\n\t\t\treturn this.replyTo ? t('nextcloud-vue', 'Replying to {author}', { author: this.authorOf(this.replyTo) }) : ''\n\t\t},\n\t},\n\n\twatch: {\n\t\tobjectId: {\n\t\t\timmediate: true,\n\t\t\thandler(id) {\n\t\t\t\tif (id) {\n\t\t\t\t\tthis.fetchNotes()\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync fetchNotes() {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes`),\n\t\t\t\t\t{ headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tthis.notes = data.results || data || []\n\t\t\t\t\tthis.resolveMentionNames()\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to fetch notes', err)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Resolve display names for every mentioned id across the current\n\t\t * notes list. Each id is looked up at most once per component\n\t\t * instance; unresolvable ids are cached as `null`.\n\t\t */\n\t\tasync resolveMentionNames() {\n\t\t\tconst ids = new Set()\n\t\t\tfor (const note of this.notes) {\n\t\t\t\tfor (const id of extractMentionedIds(note.message || note.content || '')) {\n\t\t\t\t\tids.add(id)\n\t\t\t\t}\n\t\t\t}\n\t\t\tawait Promise.all([...ids]\n\t\t\t\t.filter((id) => !(id in this.mentionNames))\n\t\t\t\t.map(async (id) => {\n\t\t\t\t\t// Mark as pending (null) first so concurrent calls skip it.\n\t\t\t\t\tthis.mentionNames[id] = null\n\t\t\t\t\tconst results = await searchNextcloudUsers(id)\n\t\t\t\t\tconst match = results.find((user) => user.id === id)\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tthis.mentionNames[id] = match.label\n\t\t\t\t\t}\n\t\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * Emit the `mention` notification hook for a successfully saved note.\n\t\t *\n\t\t * @param {string} savedText The note text that was persisted.\n\t\t * @param {string|null} noteId The created/edited note's id.\n\t\t */\n\t\temitMentionEvent(savedText, noteId) {\n\t\t\tconst mentionedUserIds = extractMentionedIds(savedText)\n\t\t\tconst mentionedGroupIds = extractMentionedGroupIds(savedText)\n\t\t\tif (mentionedUserIds.length === 0 && mentionedGroupIds.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.$emit('mention', {\n\t\t\t\tobjectId: this.objectId,\n\t\t\t\tregister: this.register,\n\t\t\t\tschema: this.schema,\n\t\t\t\tnoteId,\n\t\t\t\tmentionedUserIds,\n\t\t\t\t// Only when a group is mentioned: a note that names none keeps the payload it always had.\n\t\t\t\t...(mentionedGroupIds.length > 0 ? { mentionedGroupIds } : {}),\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Save from the composer (Ctrl/Cmd+Enter): the same as the button.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tsubmitComposer() {\n\t\t\tif (!this.newNoteText.trim() || this.saving) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.editingNoteId) {\n\t\t\t\tthis.saveEdit()\n\t\t\t} else {\n\t\t\t\tthis.addNote()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @param {object} note A note.\n\t\t * @return {string} Its author's name.\n\t\t */\n\t\tauthorOf(note) {\n\t\t\treturn note.actorDisplayName || note.author || 'Unknown'\n\t\t},\n\n\t\t/**\n\t\t * Write a reply to a note. A reply to a reply goes to the top of its thread.\n\t\t *\n\t\t * @param {object} note The note answered.\n\t\t * @return {void}\n\t\t */\n\t\tstartReply(note) {\n\t\t\tthis.editingNoteId = null\n\t\t\tthis.replyTo = note\n\t\t},\n\n\t\tcancelReply() {\n\t\t\tthis.replyTo = null\n\t\t},\n\n\t\t/**\n\t\t * The rows of one thread: the note, then its replies. A reply whose parent\n\t\t * is far up the list carries a one-line quote of it.\n\t\t *\n\t\t * @param {{note: object, replies: object[]}} thread The thread.\n\t\t * @return {Array<{note: object, isReply: boolean, quote: string}>} The rows.\n\t\t */\n\t\tthreadRows(thread) {\n\t\t\tconst flat = this.threads.flatMap((t2) => [t2.note, ...t2.replies])\n\t\t\treturn [\n\t\t\t\t{ note: thread.note, isReply: false, quote: '' },\n\t\t\t\t...thread.replies.map((reply) => ({ note: reply, isReply: true, quote: quoteFor(reply, flat) })),\n\t\t\t]\n\t\t},\n\n\t\t/**\n\t\t * @param {object} note A top-level note.\n\t\t * @return {string} The name of its thread for assistive technology.\n\t\t */\n\t\tthreadLabel(note) {\n\t\t\treturn t('nextcloud-vue', 'Note by {author} and its replies', { author: this.authorOf(note) })\n\t\t},\n\n\t\t/**\n\t\t * @param {object} note The note a Reply button answers.\n\t\t * @return {string} The button's accessible name, naming the author.\n\t\t */\n\t\treplyAria(note) {\n\t\t\treturn t('nextcloud-vue', 'Reply to {author}', { author: this.authorOf(note) })\n\t\t},\n\n\t\tasync addNote() {\n\t\t\tif (!this.newNoteText.trim()) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\tconst savedText = this.newNoteText.trim()\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify(this.replyTo\n\t\t\t\t\t\t\t? { message: savedText, parentId: threadRootId(this.replyTo, this.notes) }\n\t\t\t\t\t\t\t: { message: savedText }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tlet noteId = null\n\t\t\t\ttry {\n\t\t\t\t\tconst created = await response.json()\n\t\t\t\t\tnoteId = (created && (created.id || (created.results && created.results.id))) || null\n\t\t\t\t} catch {\n\t\t\t\t\t// Body not JSON — the event still fires with noteId null.\n\t\t\t\t}\n\t\t\t\tthis.emitMentionEvent(savedText, noteId)\n\t\t\t\tthis.newNoteText = ''\n\t\t\t\tthis.replyTo = null\n\t\t\t\tawait this.fetchNotes()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to add note', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Fill the composer from outside, for the `composer-before` slot.\n\t\t *\n\t\t * The app decides what goes in (a template body, a quoted line); the\n\t\t * composer stays the one place the text lives, so sending, editing and\n\t\t * the mention picker all see it exactly as if it had been typed.\n\t\t *\n\t\t * @param {string} text The text the composer should hold.\n\t\t * @return {void}\n\t\t */\n\t\tsetComposerText(text) {\n\t\t\tthis.newNoteText = (text === null || text === undefined) ? '' : String(text)\n\t\t},\n\n\t\tstartEdit(note) {\n\t\t\tthis.replyTo = null\n\t\t\tthis.editingNoteId = note.id\n\t\t\tthis.newNoteText = note.message || note.content || ''\n\t\t},\n\n\t\tcancelEdit() {\n\t\t\tthis.editingNoteId = null\n\t\t\tthis.newNoteText = ''\n\t\t},\n\n\t\tasync saveEdit() {\n\t\t\tif (!this.newNoteText.trim() || !this.editingNoteId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\tconst savedText = this.newNoteText.trim()\n\t\t\tconst noteId = this.editingNoteId\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes/${noteId}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify({ message: savedText }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.emitMentionEvent(savedText, noteId)\n\t\t\t\tthis.editingNoteId = null\n\t\t\t\tthis.newNoteText = ''\n\t\t\t\tawait this.fetchNotes()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to update note', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\tcanDelete(note) {\n\t\t\treturn note.actorId === OC?.currentUser || note.author === OC?.currentUser\n\t\t},\n\n\t\t/**\n\t\t * Whether this note carries a history to show.\n\t\t *\n\t\t * Read off `versionCount` rather than off `editedAt`: a note edited by\n\t\t * a since-deleted account still has its prior texts, and a marker that\n\t\t * depended on the editor still existing would quietly vanish.\n\t\t *\n\t\t * @param {object} note The note from the backend.\n\t\t * @return {boolean} True when at least one earlier version exists.\n\t\t */\n\t\twasEdited(note) {\n\t\t\treturn Number(note.versionCount || 0) > 0\n\t\t},\n\n\t\t/**\n\t\t * The \"edited\" line beside a note's time.\n\t\t *\n\t\t * @param {object} note The note from the backend.\n\t\t * @return {string} The rendered line.\n\t\t */\n\t\teditedLine(note) {\n\t\t\tconst editor = note.editedByDisplayName || note.editedBy\n\t\t\tif (!editor) {\n\t\t\t\treturn t('nextcloud-vue', 'Edited')\n\t\t\t}\n\t\t\treturn t('nextcloud-vue', 'Edited by {editor}', { editor })\n\t\t},\n\n\t\t/**\n\t\t * Open the earlier versions of one note.\n\t\t *\n\t\t * @param {object} note The note to open.\n\t\t */\n\t\topenHistory(note) {\n\t\t\tthis.historyNoteId = note.id\n\t\t},\n\n\t\tasync deleteNote(note) {\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes/${note.id}`),\n\t\t\t\t\t{ method: 'DELETE', headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tthis.notes = this.notes.filter((n) => n.id !== note.id)\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to delete note', err)\n\t\t\t}\n\t\t},\n\n\t\tformatDate(dateStr) {\n\t\t\tif (!dateStr) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new Date(dateStr).toLocaleString(userLocale(), {\n\t\t\t\t\tyear: 'numeric',\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t\tday: 'numeric',\n\t\t\t\t\thour: '2-digit',\n\t\t\t\t\tminute: '2-digit',\n\t\t\t\t})\n\t\t\t} catch {\n\t\t\t\treturn dateStr\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-sidebar-tab { padding: 12px; }\n\n.cn-sidebar-tab__action { margin-bottom: 16px; }\n\n.cn-sidebar-tab__action--row { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }\n\n.cn-sidebar-tab__composer {\n\twidth: 100%;\n}\n\n.cn-sidebar-tab__empty {\n\ttext-align: center;\n\tpadding: 24px 12px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-sidebar-tab__list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }\n\n.cn-notes-tab__thread { list-style: none; }\n\n.cn-notes-tab__thread-list { margin: 0; padding: 0; list-style: none; }\n\n.cn-notes-tab__reply { margin-inline-start: 24px; }\n\n.cn-notes-tab__quote {\n\tdisplay: block;\n\tmargin-bottom: 2px;\n\tpadding-inline-start: 8px;\n\tborder-inline-start: 2px solid var(--color-border-dark);\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.9em;\n}\n\n.cn-sidebar-tab__replying {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tmargin: 0 0 4px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-notes-tab__edited {\n\tcolor: var(--color-text-maxcontrast);\n\tmargin-inline-start: 6px;\n\tfont-style: italic;\n}\n\n</style>\n"],"names":["_openBlock","_createElementBlock","_createTextVNode","_toDisplayString","_createVNode","_renderSlot","_createElementVNode","_createBlock","_Fragment","_renderList","_normalizeClass","_resolveDynamicComponent"],"mappings":";;AAWM,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,gBAAK,GAAA;AAEV,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,wBAAG,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F,CAAAO,QAAA,EAAA,IAAA,EAAAC,UAAA,CARmB,MAAW,CAAA,WAAA,EAAA,CAArB,MAAM,KAAA;qDADbF,WASF,CAAA,yBAAA,EAAA;kCAPG,GAAG,EAAA,CAAA,EAAK,GAAC,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA,EAAA,MAAA,CAAA,EAAA,CAAA,CAAA;kCACT,aAAW,EAAA,CAAA,eAAA,EAAK,MAAA,CAAA,EAAA,CAAA,CAAA;kCAChB,OAAK,EAAA,MAAA,KAAE,UAAK,CAAE,aAAA,EAAA,EAAA,MAAA,EAAA,MAAA,CAAA,EAAA,EAAA,IAAA,EAAA,GAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;mDAGf,MACD;oDADC,GACD,GAAAJ,eAAA,CAAA,MAAA,CAAA,KAAA,CAAA,EAAA,CAAA,YAAA;;;;AAHS,kCAAA,CAAA,MAAA,CAAA,IAAA;;8CAAA,MAAA;oDACP,MAAQ;AAAR,2CAAAH,SAAA,EAAA,EAAAO,WAAA,CAAQI,wBAAA,MAAA,CAAA,IAAA,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;KAWR,KAAS,CAAA,aAAA;sBADfJ;;AAEC,UAAA,IAAI,EAAE,IAAI;AACV,UAAA,MAAM,EAAE,KAAa,CAAA,aAAA;AACrB,UAAA,QAAE,EAAA,MAAA,CAAA,QAAA;;;;;;;;;;;;"}
|
|
@@ -8,6 +8,7 @@ import Delete from 'vue-material-design-icons/Delete.vue';
|
|
|
8
8
|
import Pencil from 'vue-material-design-icons/Pencil.vue';
|
|
9
9
|
import Plus from 'vue-material-design-icons/Plus.vue';
|
|
10
10
|
import __sfc_main from './CnFlowTasksPanel.vue.js';
|
|
11
|
+
import { userLocale } from '../../utils/userLocale.js';
|
|
11
12
|
import { prefixUrl, buildHeaders } from '../../utils/headers.js';
|
|
12
13
|
|
|
13
14
|
var script = {
|
|
@@ -335,7 +336,7 @@ var script = {
|
|
|
335
336
|
return ''
|
|
336
337
|
}
|
|
337
338
|
try {
|
|
338
|
-
return new Date(dateStr).toLocaleDateString(
|
|
339
|
+
return new Date(dateStr).toLocaleDateString(userLocale(), {
|
|
339
340
|
day: 'numeric',
|
|
340
341
|
month: 'short',
|
|
341
342
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnTasksTab.vue2.js","sources":["../../../../src/components/CnObjectSidebar/CnTasksTab.vue"],"sourcesContent":["<template>\n\t<!-- OpenRegister flow tasks anchored on the record (source=\"flow-tasks\") -->\n\t<CnFlowTasksPanel\n\t\tv-if=\"source === 'flow-tasks'\"\n\t\t:objectId=\"objectId\"\n\t\t:register=\"register\"\n\t\t:schema=\"schema\"\n\t\t@count=\"(n) => $emit('count', n)\" />\n\t<div v-else class=\"cn-sidebar-tab\">\n\t\t<!-- Add / Edit task -->\n\t\t<div class=\"cn-sidebar-tab__section\">\n\t\t\t<div class=\"cn-sidebar-tab__action--row\">\n\t\t\t\t<NcTextField\n\t\t\t\t\tv-model=\"newTaskSummary\"\n\t\t\t\t\t:label=\"editingTaskId ? editLabel : addTaskPlaceholder\"\n\t\t\t\t\t@keyup.enter=\"editingTaskId ? saveEdit() : addTask()\" />\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"editingTaskId\"\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t:aria-label=\"cancelLabel\"\n\t\t\t\t\t@click=\"cancelEdit\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Close :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t:aria-label=\"editingTaskId ? saveLabel : addTaskPlaceholder\"\n\t\t\t\t\t:disabled=\"!newTaskSummary.trim() || saving\"\n\t\t\t\t\t@click=\"editingTaskId ? saveEdit() : addTask()\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Plus v-if=\"!editingTaskId\" :size=\"20\" />\n\t\t\t\t\t\t<ContentSave v-else :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t\t<div class=\"cn-sidebar-tab__grid\">\n\t\t\t\t<NcDateTimePickerNative\n\t\t\t\t\tid=\"task-deadline\"\n\t\t\t\t\tv-model=\"newTaskDue\"\n\t\t\t\t\t:label=\"deadlineLabel\"\n\t\t\t\t\ttype=\"date\" />\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-model=\"newTaskAssignee\"\n\t\t\t\t\t:options=\"userList\"\n\t\t\t\t\t:placeholder=\"assigneeLabel\"\n\t\t\t\t\t:inputLabel=\"assigneeLabel\"\n\t\t\t\t\tlabel=\"displayName\"\n\t\t\t\t\ttrackBy=\"userId\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!-- Filters -->\n\t\t<div v-if=\"tasks.length > 0 || filterStatus || filterAssignee\" class=\"cn-sidebar-tab__section cn-sidebar-tab__section--filters\">\n\t\t\t<div class=\"cn-sidebar-tab__grid\">\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-model=\"filterStatus\"\n\t\t\t\t\t:options=\"statusOptions\"\n\t\t\t\t\t:placeholder=\"statusFilterLabel\"\n\t\t\t\t\t:inputLabel=\"statusFilterLabel\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-model=\"filterAssignee\"\n\t\t\t\t\t:options=\"assigneeOptions\"\n\t\t\t\t\t:placeholder=\"assigneeFilterLabel\"\n\t\t\t\t\t:inputLabel=\"assigneeFilterLabel\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!-- Tasks list -->\n\t\t<NcLoadingIcon v-if=\"loading\" />\n\t\t<div v-else-if=\"filteredTasks.length === 0\" class=\"cn-sidebar-tab__empty\">\n\t\t\t{{ noTasksLabel }}\n\t\t</div>\n\t\t<div v-else class=\"cn-sidebar-tab__list\">\n\t\t\t<NcListItem\n\t\t\t\tv-for=\"task in filteredTasks\"\n\t\t\t\t:key=\"task.id\"\n\t\t\t\t:name=\"task.summary || task.title || task.name\"\n\t\t\t\t:bold=\"false\"\n\t\t\t\t:forceDisplayActions=\"true\"\n\t\t\t\t:class=\"{ 'cn-sidebar-tab__task--overdue': isOverdue(task) }\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<button class=\"cn-sidebar-tab__task-checkbox\" @click.stop=\"toggleTask(task)\">\n\t\t\t\t\t\t<CheckboxMarkedOutline v-if=\"task.status === 'completed'\" :size=\"32\" class=\"cn-sidebar-tab__task-done\" />\n\t\t\t\t\t\t<CheckboxBlankOutline v-else :size=\"32\" :class=\"{ 'cn-sidebar-tab__task-overdue-icon': isOverdue(task) }\" />\n\t\t\t\t\t</button>\n\t\t\t\t</template>\n\t\t\t\t<template #subname>\n\t\t\t\t\t{{ extractAssignee(task) }}\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"task.due\" #details>\n\t\t\t\t\t<span :class=\"{ 'cn-sidebar-tab__task-overdue-date': isOverdue(task) }\">\n\t\t\t\t\t\t{{ formatShortDate(task.due) }}\n\t\t\t\t\t</span>\n\t\t\t\t</template>\n\t\t\t\t<template #actions>\n\t\t\t\t\t<NcActionButton @click=\"startEdit(task)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Pencil :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ editLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton v-if=\"task.status !== 'completed'\" @click=\"completeTask(task)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<CheckboxMarkedOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ completeLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton @click=\"deleteTask(task)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ deleteLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</template>\n\t\t\t</NcListItem>\n\t\t</div>\n\t\t<NcButton\n\t\t\tv-if=\"tasks.length < total\"\n\t\t\tvariant=\"tertiary\"\n\t\t\t:wide=\"true\"\n\t\t\t:disabled=\"loadingMore\"\n\t\t\tclass=\"cn-sidebar-tab__load-more\"\n\t\t\t@click=\"loadMore\">\n\t\t\t<template v-if=\"loadingMore\" #icon>\n\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t</template>\n\t\t\t{{ loadMoreLabel }}\n\t\t</NcButton>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcButton, NcDateTimePickerNative, NcListItem, NcLoadingIcon, NcSelect, NcTextField } from '@nextcloud/vue'\nimport CheckboxBlankOutline from 'vue-material-design-icons/CheckboxBlankOutline.vue'\nimport CheckboxMarkedOutline from 'vue-material-design-icons/CheckboxMarkedOutline.vue'\nimport Close from 'vue-material-design-icons/Close.vue'\nimport ContentSave from 'vue-material-design-icons/ContentSave.vue'\nimport Delete from 'vue-material-design-icons/Delete.vue'\nimport Pencil from 'vue-material-design-icons/Pencil.vue'\nimport Plus from 'vue-material-design-icons/Plus.vue'\nimport CnFlowTasksPanel from './CnFlowTasksPanel.vue'\nimport { buildHeaders, prefixUrl } from '../../utils/index.js'\n\nexport default {\n\tname: 'CnTasksTab',\n\n\tcomponents: {\n\t\tCnFlowTasksPanel,\n\t\tNcButton,\n\t\tNcTextField,\n\t\tNcListItem,\n\t\tNcActionButton,\n\t\tNcLoadingIcon,\n\t\tNcDateTimePickerNative,\n\t\tNcSelect,\n\t\tPlus,\n\t\tDelete,\n\t\tPencil,\n\t\tClose,\n\t\tContentSave,\n\t\tCheckboxMarkedOutline,\n\t\tCheckboxBlankOutline,\n\t},\n\n\tprops: {\n\t\t/** ID of the object this tab belongs to */\n\t\tobjectId: { type: String, required: true },\n\t\t/** OpenRegister register slug */\n\t\tregister: { type: String, default: '' },\n\t\t/** JSON Schema definition for the object */\n\t\tschema: { type: String, default: '' },\n\t\t/** Base URL for the OpenRegister API */\n\t\tapiBase: { type: String, default: '/apps/openregister/api' },\n\t\t/**\n\t\t * Where the tasks come from: `vtodo` (default, the record's linked\n\t\t * Nextcloud tasks) or `flow-tasks` (the OpenRegister flow tasks anchored\n\t\t * on the record, with create and per-row verbs).\n\t\t *\n\t\t * @type {'vtodo'|'flow-tasks'}\n\t\t */\n\t\tsource: { type: String, default: 'vtodo', validator: (v) => ['vtodo', 'flow-tasks'].includes(v) },\n\t\t/** Placeholder text for the task input */\n\t\taddTaskPlaceholder: { type: String, default: () => t('nextcloud-vue', 'Add task…') },\n\t\t/** Label for the task deadline field */\n\t\tdeadlineLabel: { type: String, default: () => t('nextcloud-vue', 'Deadline') },\n\t\t/** Label for the task assignee field */\n\t\tassigneeLabel: { type: String, default: () => t('nextcloud-vue', 'Assignee') },\n\t\t/** Label for the complete task action */\n\t\tcompleteLabel: { type: String, default: () => t('nextcloud-vue', 'Complete') },\n\t\t/** Label for the edit action */\n\t\teditLabel: { type: String, default: () => t('nextcloud-vue', 'Edit') },\n\t\t/** Label for the delete action */\n\t\tdeleteLabel: { type: String, default: () => t('nextcloud-vue', 'Delete') },\n\t\t/** Text shown when no tasks are linked */\n\t\tnoTasksLabel: { type: String, default: () => t('nextcloud-vue', 'No linked tasks') },\n\t\t/** Label for the load-more button */\n\t\tloadMoreLabel: { type: String, default: () => t('nextcloud-vue', 'Load more') },\n\t\t/** Label for the status filter control */\n\t\tstatusFilterLabel: { type: String, default: () => t('nextcloud-vue', 'Status') },\n\t\t/** Label for the assignee filter control */\n\t\tassigneeFilterLabel: { type: String, default: () => t('nextcloud-vue', 'Assignee') },\n\t},\n\n\temits: ['count'],\n\n\tdata() {\n\t\treturn {\n\t\t\ttasks: [],\n\t\t\tloading: false,\n\t\t\tloadingMore: false,\n\t\t\tnewTaskSummary: '',\n\t\t\tnewTaskDue: null,\n\t\t\tnewTaskAssignee: null,\n\t\t\tsaving: false,\n\t\t\teditingTaskId: null,\n\t\t\tuserList: [],\n\t\t\tpage: 1,\n\t\t\ttotal: 0,\n\t\t\tlimit: 20,\n\t\t\tfilterStatus: null,\n\t\t\tfilterAssignee: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tstatusOptions() {\n\t\t\treturn [...new Set(this.tasks.map((t) => t.status).filter(Boolean))]\n\t\t},\n\n\t\tassigneeOptions() {\n\t\t\treturn [...new Set(this.tasks.map((t) => this.extractAssignee(t)).filter(Boolean))]\n\t\t},\n\n\t\tfilteredTasks() {\n\t\t\tlet result = this.tasks\n\t\t\tif (this.filterStatus) {\n\t\t\t\tresult = result.filter((t) => t.status === this.filterStatus)\n\t\t\t}\n\t\t\tif (this.filterAssignee) {\n\t\t\t\tresult = result.filter((t) => this.extractAssignee(t) === this.filterAssignee)\n\t\t\t}\n\t\t\treturn result\n\t\t},\n\t},\n\n\twatch: {\n\t\tobjectId: {\n\t\t\timmediate: true,\n\t\t\thandler(id) {\n\t\t\t\tif (id && this.source !== 'flow-tasks') {\n\t\t\t\t\tthis.fetchTasks()\n\t\t\t\t\tthis.fetchUsers()\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync fetchTasks(append = false) {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (append) {\n\t\t\t\tthis.loadingMore = true\n\t\t\t} else {\n\t\t\t\tthis.loading = true\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst params = new URLSearchParams({ limit: this.limit, _page: this.page })\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks?${params}`),\n\t\t\t\t\t{ headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tconst results = data.results || data || []\n\t\t\t\t\tthis.tasks = append ? [...this.tasks, ...results] : results\n\t\t\t\t\tthis.total = data.total || this.tasks.length\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to fetch tasks', err)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t\tthis.loadingMore = false\n\t\t\t}\n\t\t},\n\n\t\tloadMore() {\n\t\t\tthis.page++\n\t\t\tthis.fetchTasks(true)\n\t\t},\n\n\t\tisOverdue(task) {\n\t\t\tif (!task.due || task.status === 'completed') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn new Date(task.due) < new Date()\n\t\t},\n\n\t\tasync fetchUsers() {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(prefixUrl('/ocs/v2.php/cloud/users/details?format=json&limit=50'), {\n\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t})\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tconst users = data.ocs?.data?.users || {}\n\t\t\t\t\tthis.userList = Object.entries(users).map(([id, user]) => ({\n\t\t\t\t\t\tuserId: id,\n\t\t\t\t\t\tdisplayName: user.displayname || id,\n\t\t\t\t\t}))\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to fetch users', err)\n\t\t\t}\n\t\t},\n\n\t\tasync addTask() {\n\t\t\tif (!this.newTaskSummary.trim() || !this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\ttry {\n\t\t\t\tconst taskData = { summary: this.newTaskSummary.trim() }\n\t\t\t\tif (this.newTaskDue) {\n\t\t\t\t\ttaskData.due = new Date(this.newTaskDue).toISOString()\n\t\t\t\t}\n\t\t\t\tif (this.newTaskAssignee) {\n\t\t\t\t\ttaskData.description = 'Assigned to: ' + this.newTaskAssignee.displayName\n\t\t\t\t}\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify(taskData),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.clearForm()\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to add task', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\tstartEdit(task) {\n\t\t\tthis.editingTaskId = task.id\n\t\t\tthis.newTaskSummary = task.summary || task.title || task.name || ''\n\t\t\tthis.newTaskDue = task.due ? new Date(task.due).toISOString().split('T')[0] : null\n\t\t\tconst assigneeName = this.extractAssignee(task)\n\t\t\tthis.newTaskAssignee = this.userList.find((u) => u.displayName === assigneeName) || null\n\t\t},\n\n\t\tcancelEdit() {\n\t\t\tthis.editingTaskId = null\n\t\t\tthis.clearForm()\n\t\t},\n\n\t\tasync saveEdit() {\n\t\t\tif (!this.newTaskSummary.trim() || !this.editingTaskId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\ttry {\n\t\t\t\tconst taskData = { summary: this.newTaskSummary.trim() }\n\t\t\t\tif (this.newTaskDue) {\n\t\t\t\t\ttaskData.due = new Date(this.newTaskDue).toISOString()\n\t\t\t\t} else {\n\t\t\t\t\ttaskData.due = ''\n\t\t\t\t}\n\t\t\t\tif (this.newTaskAssignee) {\n\t\t\t\t\ttaskData.description = 'Assigned to: ' + this.newTaskAssignee.displayName\n\t\t\t\t} else {\n\t\t\t\t\ttaskData.description = ''\n\t\t\t\t}\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(this.editingTaskId)}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify(taskData),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.editingTaskId = null\n\t\t\t\tthis.clearForm()\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to update task', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\tclearForm() {\n\t\t\tthis.newTaskSummary = ''\n\t\t\tthis.newTaskDue = null\n\t\t\tthis.newTaskAssignee = null\n\t\t},\n\n\t\tasync toggleTask(task) {\n\t\t\tconst newStatus = task.status === 'completed' ? 'NEEDS-ACTION' : 'COMPLETED'\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(task.id)}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify({ status: newStatus }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to toggle task', err)\n\t\t\t}\n\t\t},\n\n\t\tasync completeTask(task) {\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(task.id)}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify({ status: 'COMPLETED' }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to complete task', err)\n\t\t\t}\n\t\t},\n\n\t\tasync deleteTask(task) {\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(task.id)}`),\n\t\t\t\t\t{ method: 'DELETE', headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tthis.tasks = this.tasks.filter((t) => t.id !== task.id)\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to delete task', err)\n\t\t\t}\n\t\t},\n\n\t\textractAssignee(task) {\n\t\t\tif (task.description?.startsWith('Assigned to: ')) {\n\t\t\t\treturn task.description.replace('Assigned to: ', '')\n\t\t\t}\n\t\t\treturn task.description || ''\n\t\t},\n\n\t\tformatShortDate(dateStr) {\n\t\t\tif (!dateStr) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new Date(dateStr).toLocaleDateString(undefined, {\n\t\t\t\t\tday: 'numeric',\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t})\n\t\t\t} catch {\n\t\t\t\treturn dateStr\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-sidebar-tab {\n\tpadding: 12px;\n\toverflow-x: hidden;\n}\n\n.cn-sidebar-tab__section {\n\tmargin-bottom: 12px;\n}\n\n.cn-sidebar-tab__section--filters {\n\tpadding-top: 12px;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-sidebar-tab__action--row {\n\tdisplay: flex;\n\tgap: 8px;\n\talign-items: flex-end;\n\tmargin-bottom: 8px;\n}\n\n.cn-sidebar-tab__grid {\n\tdisplay: grid;\n\tgrid-template-columns: 1fr 1fr;\n\tgap: 8px;\n}\n\n.cn-sidebar-tab__grid > * {\n\tmin-width: 0;\n}\n\n.cn-sidebar-tab__empty {\n\ttext-align: center;\n\tpadding: 24px 12px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-sidebar-tab__list {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n}\n\n.cn-sidebar-tab__load-more { margin-top: 8px; }\n\n.cn-sidebar-tab__task-checkbox {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground: none;\n\tborder: none;\n\tpadding: 0;\n\tcursor: pointer;\n\tcolor: inherit;\n}\n\n.cn-sidebar-tab__task-done { color: var(--color-success); }\n\n.cn-sidebar-tab__task-overdue-icon { color: var(--color-error, #e53935); }\n\n.cn-sidebar-tab__task-overdue-date { color: var(--color-error, #e53935); font-weight: 500; }\n</style>\n"],"names":["CnFlowTasksPanel","t"],"mappings":";;;;;;;;;;;;AAoJA,aAAe;AACd,CAAA,IAAI,EAAE,YAAY;;CAElB,UAAU,EAAE;AACX,oBAAAA,UAAgB;AAChB,EAAA,QAAQ;EACR,WAAW;EACX,UAAU;AACV,EAAA,cAAc;EACd,aAAa;EACb,sBAAsB;AACtB,EAAA,QAAQ;EACR,IAAI;AACJ,EAAA,MAAM;AACN,EAAA,MAAM;EACN,KAAK;EACL,WAAW;AACX,EAAA,qBAAqB;AACrB,EAAA,oBAAoB;EACpB;;AAED,CAAA,KAAK,EAAE;AACN;AACA,EAAA,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;AAE1C,EAAA,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI;AACvC;AACA,EAAA,MAAM,EAAE,EAAE,IAAI,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OAAO,EAAE;GACxB,IAAI,CAAC,OAAO,EAAE;AACb,IAAA,OAAO,EAAC;AACT,IAAA;AACA,GAAA,IAAI;IACH,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;KACtD,GAAG,EAAE,SAAS;KACd,KAAK,EAAE,OAAO;KACd,CAAA;AACF,IAAA,CAAE,MAAM;IACP,OAAO,OAAM;AACd,IAAA;GACA;EACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CnTasksTab.vue2.js","sources":["../../../../src/components/CnObjectSidebar/CnTasksTab.vue"],"sourcesContent":["<template>\n\t<!-- OpenRegister flow tasks anchored on the record (source=\"flow-tasks\") -->\n\t<CnFlowTasksPanel\n\t\tv-if=\"source === 'flow-tasks'\"\n\t\t:objectId=\"objectId\"\n\t\t:register=\"register\"\n\t\t:schema=\"schema\"\n\t\t@count=\"(n) => $emit('count', n)\" />\n\t<div v-else class=\"cn-sidebar-tab\">\n\t\t<!-- Add / Edit task -->\n\t\t<div class=\"cn-sidebar-tab__section\">\n\t\t\t<div class=\"cn-sidebar-tab__action--row\">\n\t\t\t\t<NcTextField\n\t\t\t\t\tv-model=\"newTaskSummary\"\n\t\t\t\t\t:label=\"editingTaskId ? editLabel : addTaskPlaceholder\"\n\t\t\t\t\t@keyup.enter=\"editingTaskId ? saveEdit() : addTask()\" />\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"editingTaskId\"\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t:aria-label=\"cancelLabel\"\n\t\t\t\t\t@click=\"cancelEdit\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Close :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t:aria-label=\"editingTaskId ? saveLabel : addTaskPlaceholder\"\n\t\t\t\t\t:disabled=\"!newTaskSummary.trim() || saving\"\n\t\t\t\t\t@click=\"editingTaskId ? saveEdit() : addTask()\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Plus v-if=\"!editingTaskId\" :size=\"20\" />\n\t\t\t\t\t\t<ContentSave v-else :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t\t<div class=\"cn-sidebar-tab__grid\">\n\t\t\t\t<NcDateTimePickerNative\n\t\t\t\t\tid=\"task-deadline\"\n\t\t\t\t\tv-model=\"newTaskDue\"\n\t\t\t\t\t:label=\"deadlineLabel\"\n\t\t\t\t\ttype=\"date\" />\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-model=\"newTaskAssignee\"\n\t\t\t\t\t:options=\"userList\"\n\t\t\t\t\t:placeholder=\"assigneeLabel\"\n\t\t\t\t\t:inputLabel=\"assigneeLabel\"\n\t\t\t\t\tlabel=\"displayName\"\n\t\t\t\t\ttrackBy=\"userId\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!-- Filters -->\n\t\t<div v-if=\"tasks.length > 0 || filterStatus || filterAssignee\" class=\"cn-sidebar-tab__section cn-sidebar-tab__section--filters\">\n\t\t\t<div class=\"cn-sidebar-tab__grid\">\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-model=\"filterStatus\"\n\t\t\t\t\t:options=\"statusOptions\"\n\t\t\t\t\t:placeholder=\"statusFilterLabel\"\n\t\t\t\t\t:inputLabel=\"statusFilterLabel\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-model=\"filterAssignee\"\n\t\t\t\t\t:options=\"assigneeOptions\"\n\t\t\t\t\t:placeholder=\"assigneeFilterLabel\"\n\t\t\t\t\t:inputLabel=\"assigneeFilterLabel\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!-- Tasks list -->\n\t\t<NcLoadingIcon v-if=\"loading\" />\n\t\t<div v-else-if=\"filteredTasks.length === 0\" class=\"cn-sidebar-tab__empty\">\n\t\t\t{{ noTasksLabel }}\n\t\t</div>\n\t\t<div v-else class=\"cn-sidebar-tab__list\">\n\t\t\t<NcListItem\n\t\t\t\tv-for=\"task in filteredTasks\"\n\t\t\t\t:key=\"task.id\"\n\t\t\t\t:name=\"task.summary || task.title || task.name\"\n\t\t\t\t:bold=\"false\"\n\t\t\t\t:forceDisplayActions=\"true\"\n\t\t\t\t:class=\"{ 'cn-sidebar-tab__task--overdue': isOverdue(task) }\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<button class=\"cn-sidebar-tab__task-checkbox\" @click.stop=\"toggleTask(task)\">\n\t\t\t\t\t\t<CheckboxMarkedOutline v-if=\"task.status === 'completed'\" :size=\"32\" class=\"cn-sidebar-tab__task-done\" />\n\t\t\t\t\t\t<CheckboxBlankOutline v-else :size=\"32\" :class=\"{ 'cn-sidebar-tab__task-overdue-icon': isOverdue(task) }\" />\n\t\t\t\t\t</button>\n\t\t\t\t</template>\n\t\t\t\t<template #subname>\n\t\t\t\t\t{{ extractAssignee(task) }}\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"task.due\" #details>\n\t\t\t\t\t<span :class=\"{ 'cn-sidebar-tab__task-overdue-date': isOverdue(task) }\">\n\t\t\t\t\t\t{{ formatShortDate(task.due) }}\n\t\t\t\t\t</span>\n\t\t\t\t</template>\n\t\t\t\t<template #actions>\n\t\t\t\t\t<NcActionButton @click=\"startEdit(task)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Pencil :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ editLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton v-if=\"task.status !== 'completed'\" @click=\"completeTask(task)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<CheckboxMarkedOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ completeLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton @click=\"deleteTask(task)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ deleteLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</template>\n\t\t\t</NcListItem>\n\t\t</div>\n\t\t<NcButton\n\t\t\tv-if=\"tasks.length < total\"\n\t\t\tvariant=\"tertiary\"\n\t\t\t:wide=\"true\"\n\t\t\t:disabled=\"loadingMore\"\n\t\t\tclass=\"cn-sidebar-tab__load-more\"\n\t\t\t@click=\"loadMore\">\n\t\t\t<template v-if=\"loadingMore\" #icon>\n\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t</template>\n\t\t\t{{ loadMoreLabel }}\n\t\t</NcButton>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcButton, NcDateTimePickerNative, NcListItem, NcLoadingIcon, NcSelect, NcTextField } from '@nextcloud/vue'\nimport CheckboxBlankOutline from 'vue-material-design-icons/CheckboxBlankOutline.vue'\nimport CheckboxMarkedOutline from 'vue-material-design-icons/CheckboxMarkedOutline.vue'\nimport Close from 'vue-material-design-icons/Close.vue'\nimport ContentSave from 'vue-material-design-icons/ContentSave.vue'\nimport Delete from 'vue-material-design-icons/Delete.vue'\nimport Pencil from 'vue-material-design-icons/Pencil.vue'\nimport Plus from 'vue-material-design-icons/Plus.vue'\nimport CnFlowTasksPanel from './CnFlowTasksPanel.vue'\nimport { buildHeaders, prefixUrl } from '../../utils/index.js'\nimport { userLocale } from '../../utils/userLocale.js'\n\nexport default {\n\tname: 'CnTasksTab',\n\n\tcomponents: {\n\t\tCnFlowTasksPanel,\n\t\tNcButton,\n\t\tNcTextField,\n\t\tNcListItem,\n\t\tNcActionButton,\n\t\tNcLoadingIcon,\n\t\tNcDateTimePickerNative,\n\t\tNcSelect,\n\t\tPlus,\n\t\tDelete,\n\t\tPencil,\n\t\tClose,\n\t\tContentSave,\n\t\tCheckboxMarkedOutline,\n\t\tCheckboxBlankOutline,\n\t},\n\n\tprops: {\n\t\t/** ID of the object this tab belongs to */\n\t\tobjectId: { type: String, required: true },\n\t\t/** OpenRegister register slug */\n\t\tregister: { type: String, default: '' },\n\t\t/** JSON Schema definition for the object */\n\t\tschema: { type: String, default: '' },\n\t\t/** Base URL for the OpenRegister API */\n\t\tapiBase: { type: String, default: '/apps/openregister/api' },\n\t\t/**\n\t\t * Where the tasks come from: `vtodo` (default, the record's linked\n\t\t * Nextcloud tasks) or `flow-tasks` (the OpenRegister flow tasks anchored\n\t\t * on the record, with create and per-row verbs).\n\t\t *\n\t\t * @type {'vtodo'|'flow-tasks'}\n\t\t */\n\t\tsource: { type: String, default: 'vtodo', validator: (v) => ['vtodo', 'flow-tasks'].includes(v) },\n\t\t/** Placeholder text for the task input */\n\t\taddTaskPlaceholder: { type: String, default: () => t('nextcloud-vue', 'Add task…') },\n\t\t/** Label for the task deadline field */\n\t\tdeadlineLabel: { type: String, default: () => t('nextcloud-vue', 'Deadline') },\n\t\t/** Label for the task assignee field */\n\t\tassigneeLabel: { type: String, default: () => t('nextcloud-vue', 'Assignee') },\n\t\t/** Label for the complete task action */\n\t\tcompleteLabel: { type: String, default: () => t('nextcloud-vue', 'Complete') },\n\t\t/** Label for the edit action */\n\t\teditLabel: { type: String, default: () => t('nextcloud-vue', 'Edit') },\n\t\t/** Label for the delete action */\n\t\tdeleteLabel: { type: String, default: () => t('nextcloud-vue', 'Delete') },\n\t\t/** Text shown when no tasks are linked */\n\t\tnoTasksLabel: { type: String, default: () => t('nextcloud-vue', 'No linked tasks') },\n\t\t/** Label for the load-more button */\n\t\tloadMoreLabel: { type: String, default: () => t('nextcloud-vue', 'Load more') },\n\t\t/** Label for the status filter control */\n\t\tstatusFilterLabel: { type: String, default: () => t('nextcloud-vue', 'Status') },\n\t\t/** Label for the assignee filter control */\n\t\tassigneeFilterLabel: { type: String, default: () => t('nextcloud-vue', 'Assignee') },\n\t},\n\n\temits: ['count'],\n\n\tdata() {\n\t\treturn {\n\t\t\ttasks: [],\n\t\t\tloading: false,\n\t\t\tloadingMore: false,\n\t\t\tnewTaskSummary: '',\n\t\t\tnewTaskDue: null,\n\t\t\tnewTaskAssignee: null,\n\t\t\tsaving: false,\n\t\t\teditingTaskId: null,\n\t\t\tuserList: [],\n\t\t\tpage: 1,\n\t\t\ttotal: 0,\n\t\t\tlimit: 20,\n\t\t\tfilterStatus: null,\n\t\t\tfilterAssignee: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tstatusOptions() {\n\t\t\treturn [...new Set(this.tasks.map((t) => t.status).filter(Boolean))]\n\t\t},\n\n\t\tassigneeOptions() {\n\t\t\treturn [...new Set(this.tasks.map((t) => this.extractAssignee(t)).filter(Boolean))]\n\t\t},\n\n\t\tfilteredTasks() {\n\t\t\tlet result = this.tasks\n\t\t\tif (this.filterStatus) {\n\t\t\t\tresult = result.filter((t) => t.status === this.filterStatus)\n\t\t\t}\n\t\t\tif (this.filterAssignee) {\n\t\t\t\tresult = result.filter((t) => this.extractAssignee(t) === this.filterAssignee)\n\t\t\t}\n\t\t\treturn result\n\t\t},\n\t},\n\n\twatch: {\n\t\tobjectId: {\n\t\t\timmediate: true,\n\t\t\thandler(id) {\n\t\t\t\tif (id && this.source !== 'flow-tasks') {\n\t\t\t\t\tthis.fetchTasks()\n\t\t\t\t\tthis.fetchUsers()\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync fetchTasks(append = false) {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (append) {\n\t\t\t\tthis.loadingMore = true\n\t\t\t} else {\n\t\t\t\tthis.loading = true\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst params = new URLSearchParams({ limit: this.limit, _page: this.page })\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks?${params}`),\n\t\t\t\t\t{ headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tconst results = data.results || data || []\n\t\t\t\t\tthis.tasks = append ? [...this.tasks, ...results] : results\n\t\t\t\t\tthis.total = data.total || this.tasks.length\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to fetch tasks', err)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t\tthis.loadingMore = false\n\t\t\t}\n\t\t},\n\n\t\tloadMore() {\n\t\t\tthis.page++\n\t\t\tthis.fetchTasks(true)\n\t\t},\n\n\t\tisOverdue(task) {\n\t\t\tif (!task.due || task.status === 'completed') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn new Date(task.due) < new Date()\n\t\t},\n\n\t\tasync fetchUsers() {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(prefixUrl('/ocs/v2.php/cloud/users/details?format=json&limit=50'), {\n\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t})\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tconst users = data.ocs?.data?.users || {}\n\t\t\t\t\tthis.userList = Object.entries(users).map(([id, user]) => ({\n\t\t\t\t\t\tuserId: id,\n\t\t\t\t\t\tdisplayName: user.displayname || id,\n\t\t\t\t\t}))\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to fetch users', err)\n\t\t\t}\n\t\t},\n\n\t\tasync addTask() {\n\t\t\tif (!this.newTaskSummary.trim() || !this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\ttry {\n\t\t\t\tconst taskData = { summary: this.newTaskSummary.trim() }\n\t\t\t\tif (this.newTaskDue) {\n\t\t\t\t\ttaskData.due = new Date(this.newTaskDue).toISOString()\n\t\t\t\t}\n\t\t\t\tif (this.newTaskAssignee) {\n\t\t\t\t\ttaskData.description = 'Assigned to: ' + this.newTaskAssignee.displayName\n\t\t\t\t}\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify(taskData),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.clearForm()\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to add task', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\tstartEdit(task) {\n\t\t\tthis.editingTaskId = task.id\n\t\t\tthis.newTaskSummary = task.summary || task.title || task.name || ''\n\t\t\tthis.newTaskDue = task.due ? new Date(task.due).toISOString().split('T')[0] : null\n\t\t\tconst assigneeName = this.extractAssignee(task)\n\t\t\tthis.newTaskAssignee = this.userList.find((u) => u.displayName === assigneeName) || null\n\t\t},\n\n\t\tcancelEdit() {\n\t\t\tthis.editingTaskId = null\n\t\t\tthis.clearForm()\n\t\t},\n\n\t\tasync saveEdit() {\n\t\t\tif (!this.newTaskSummary.trim() || !this.editingTaskId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\ttry {\n\t\t\t\tconst taskData = { summary: this.newTaskSummary.trim() }\n\t\t\t\tif (this.newTaskDue) {\n\t\t\t\t\ttaskData.due = new Date(this.newTaskDue).toISOString()\n\t\t\t\t} else {\n\t\t\t\t\ttaskData.due = ''\n\t\t\t\t}\n\t\t\t\tif (this.newTaskAssignee) {\n\t\t\t\t\ttaskData.description = 'Assigned to: ' + this.newTaskAssignee.displayName\n\t\t\t\t} else {\n\t\t\t\t\ttaskData.description = ''\n\t\t\t\t}\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(this.editingTaskId)}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify(taskData),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.editingTaskId = null\n\t\t\t\tthis.clearForm()\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to update task', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\tclearForm() {\n\t\t\tthis.newTaskSummary = ''\n\t\t\tthis.newTaskDue = null\n\t\t\tthis.newTaskAssignee = null\n\t\t},\n\n\t\tasync toggleTask(task) {\n\t\t\tconst newStatus = task.status === 'completed' ? 'NEEDS-ACTION' : 'COMPLETED'\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(task.id)}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify({ status: newStatus }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to toggle task', err)\n\t\t\t}\n\t\t},\n\n\t\tasync completeTask(task) {\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(task.id)}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify({ status: 'COMPLETED' }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to complete task', err)\n\t\t\t}\n\t\t},\n\n\t\tasync deleteTask(task) {\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(task.id)}`),\n\t\t\t\t\t{ method: 'DELETE', headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tthis.tasks = this.tasks.filter((t) => t.id !== task.id)\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to delete task', err)\n\t\t\t}\n\t\t},\n\n\t\textractAssignee(task) {\n\t\t\tif (task.description?.startsWith('Assigned to: ')) {\n\t\t\t\treturn task.description.replace('Assigned to: ', '')\n\t\t\t}\n\t\t\treturn task.description || ''\n\t\t},\n\n\t\tformatShortDate(dateStr) {\n\t\t\tif (!dateStr) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new Date(dateStr).toLocaleDateString(userLocale(), {\n\t\t\t\t\tday: 'numeric',\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t})\n\t\t\t} catch {\n\t\t\t\treturn dateStr\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-sidebar-tab {\n\tpadding: 12px;\n\toverflow-x: hidden;\n}\n\n.cn-sidebar-tab__section {\n\tmargin-bottom: 12px;\n}\n\n.cn-sidebar-tab__section--filters {\n\tpadding-top: 12px;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-sidebar-tab__action--row {\n\tdisplay: flex;\n\tgap: 8px;\n\talign-items: flex-end;\n\tmargin-bottom: 8px;\n}\n\n.cn-sidebar-tab__grid {\n\tdisplay: grid;\n\tgrid-template-columns: 1fr 1fr;\n\tgap: 8px;\n}\n\n.cn-sidebar-tab__grid > * {\n\tmin-width: 0;\n}\n\n.cn-sidebar-tab__empty {\n\ttext-align: center;\n\tpadding: 24px 12px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-sidebar-tab__list {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n}\n\n.cn-sidebar-tab__load-more { margin-top: 8px; }\n\n.cn-sidebar-tab__task-checkbox {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground: none;\n\tborder: none;\n\tpadding: 0;\n\tcursor: pointer;\n\tcolor: inherit;\n}\n\n.cn-sidebar-tab__task-done { color: var(--color-success); }\n\n.cn-sidebar-tab__task-overdue-icon { color: var(--color-error, #e53935); }\n\n.cn-sidebar-tab__task-overdue-date { color: var(--color-error, #e53935); font-weight: 500; }\n</style>\n"],"names":["CnFlowTasksPanel","t"],"mappings":";;;;;;;;;;;;;AAqJA,aAAe;AACd,CAAA,IAAI,EAAE,YAAY;;CAElB,UAAU,EAAE;AACX,oBAAAA,UAAgB;AAChB,EAAA,QAAQ;EACR,WAAW;EACX,UAAU;AACV,EAAA,cAAc;EACd,aAAa;EACb,sBAAsB;AACtB,EAAA,QAAQ;EACR,IAAI;AACJ,EAAA,MAAM;AACN,EAAA,MAAM;EACN,KAAK;EACL,WAAW;AACX,EAAA,qBAAqB;AACrB,EAAA,oBAAoB;EACpB;;AAED,CAAA,KAAK,EAAE;AACN;AACA,EAAA,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM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AC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAA;AACpD,IAAA;GACA,OAAO,IAAI,CAAC,WAAU,IAAK,EAAC;GAC5B;;EAED,eAAe,CAAC,OAAO,EAAE;GACxB,IAAI,CAAC,OAAO,EAAE;AACb,IAAA,OAAO,EAAC;AACT,IAAA;AACA,GAAA,IAAI;IACH,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE,EAAE;KACzD,GAAG,EAAE,SAAS;KACd,KAAK,EAAE,OAAO;KACd,CAAA;AACF,IAAA,CAAE,MAAM;IACP,OAAO,OAAM;AACd,IAAA;GACA;EACD;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnTasksTab.vue3.js","sources":["../../../../src/components/CnObjectSidebar/CnTasksTab.vue?vue&type=template&id=50e816bc&lang.js"],"sourcesContent":["<template>\n\t<!-- OpenRegister flow tasks anchored on the record (source=\"flow-tasks\") -->\n\t<CnFlowTasksPanel\n\t\tv-if=\"source === 'flow-tasks'\"\n\t\t:objectId=\"objectId\"\n\t\t:register=\"register\"\n\t\t:schema=\"schema\"\n\t\t@count=\"(n) => $emit('count', n)\" />\n\t<div v-else class=\"cn-sidebar-tab\">\n\t\t<!-- Add / Edit task -->\n\t\t<div class=\"cn-sidebar-tab__section\">\n\t\t\t<div class=\"cn-sidebar-tab__action--row\">\n\t\t\t\t<NcTextField\n\t\t\t\t\tv-model=\"newTaskSummary\"\n\t\t\t\t\t:label=\"editingTaskId ? editLabel : addTaskPlaceholder\"\n\t\t\t\t\t@keyup.enter=\"editingTaskId ? saveEdit() : addTask()\" />\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"editingTaskId\"\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t:aria-label=\"cancelLabel\"\n\t\t\t\t\t@click=\"cancelEdit\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Close :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t:aria-label=\"editingTaskId ? saveLabel : addTaskPlaceholder\"\n\t\t\t\t\t:disabled=\"!newTaskSummary.trim() || saving\"\n\t\t\t\t\t@click=\"editingTaskId ? saveEdit() : addTask()\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Plus v-if=\"!editingTaskId\" :size=\"20\" />\n\t\t\t\t\t\t<ContentSave v-else :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t\t<div class=\"cn-sidebar-tab__grid\">\n\t\t\t\t<NcDateTimePickerNative\n\t\t\t\t\tid=\"task-deadline\"\n\t\t\t\t\tv-model=\"newTaskDue\"\n\t\t\t\t\t:label=\"deadlineLabel\"\n\t\t\t\t\ttype=\"date\" />\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-model=\"newTaskAssignee\"\n\t\t\t\t\t:options=\"userList\"\n\t\t\t\t\t:placeholder=\"assigneeLabel\"\n\t\t\t\t\t:inputLabel=\"assigneeLabel\"\n\t\t\t\t\tlabel=\"displayName\"\n\t\t\t\t\ttrackBy=\"userId\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!-- Filters -->\n\t\t<div v-if=\"tasks.length > 0 || filterStatus || filterAssignee\" class=\"cn-sidebar-tab__section cn-sidebar-tab__section--filters\">\n\t\t\t<div class=\"cn-sidebar-tab__grid\">\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-model=\"filterStatus\"\n\t\t\t\t\t:options=\"statusOptions\"\n\t\t\t\t\t:placeholder=\"statusFilterLabel\"\n\t\t\t\t\t:inputLabel=\"statusFilterLabel\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-model=\"filterAssignee\"\n\t\t\t\t\t:options=\"assigneeOptions\"\n\t\t\t\t\t:placeholder=\"assigneeFilterLabel\"\n\t\t\t\t\t:inputLabel=\"assigneeFilterLabel\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!-- Tasks list -->\n\t\t<NcLoadingIcon v-if=\"loading\" />\n\t\t<div v-else-if=\"filteredTasks.length === 0\" class=\"cn-sidebar-tab__empty\">\n\t\t\t{{ noTasksLabel }}\n\t\t</div>\n\t\t<div v-else class=\"cn-sidebar-tab__list\">\n\t\t\t<NcListItem\n\t\t\t\tv-for=\"task in filteredTasks\"\n\t\t\t\t:key=\"task.id\"\n\t\t\t\t:name=\"task.summary || task.title || task.name\"\n\t\t\t\t:bold=\"false\"\n\t\t\t\t:forceDisplayActions=\"true\"\n\t\t\t\t:class=\"{ 'cn-sidebar-tab__task--overdue': isOverdue(task) }\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<button class=\"cn-sidebar-tab__task-checkbox\" @click.stop=\"toggleTask(task)\">\n\t\t\t\t\t\t<CheckboxMarkedOutline v-if=\"task.status === 'completed'\" :size=\"32\" class=\"cn-sidebar-tab__task-done\" />\n\t\t\t\t\t\t<CheckboxBlankOutline v-else :size=\"32\" :class=\"{ 'cn-sidebar-tab__task-overdue-icon': isOverdue(task) }\" />\n\t\t\t\t\t</button>\n\t\t\t\t</template>\n\t\t\t\t<template #subname>\n\t\t\t\t\t{{ extractAssignee(task) }}\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"task.due\" #details>\n\t\t\t\t\t<span :class=\"{ 'cn-sidebar-tab__task-overdue-date': isOverdue(task) }\">\n\t\t\t\t\t\t{{ formatShortDate(task.due) }}\n\t\t\t\t\t</span>\n\t\t\t\t</template>\n\t\t\t\t<template #actions>\n\t\t\t\t\t<NcActionButton @click=\"startEdit(task)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Pencil :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ editLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton v-if=\"task.status !== 'completed'\" @click=\"completeTask(task)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<CheckboxMarkedOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ completeLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton @click=\"deleteTask(task)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ deleteLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</template>\n\t\t\t</NcListItem>\n\t\t</div>\n\t\t<NcButton\n\t\t\tv-if=\"tasks.length < total\"\n\t\t\tvariant=\"tertiary\"\n\t\t\t:wide=\"true\"\n\t\t\t:disabled=\"loadingMore\"\n\t\t\tclass=\"cn-sidebar-tab__load-more\"\n\t\t\t@click=\"loadMore\">\n\t\t\t<template v-if=\"loadingMore\" #icon>\n\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t</template>\n\t\t\t{{ loadMoreLabel }}\n\t\t</NcButton>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcButton, NcDateTimePickerNative, NcListItem, NcLoadingIcon, NcSelect, NcTextField } from '@nextcloud/vue'\nimport CheckboxBlankOutline from 'vue-material-design-icons/CheckboxBlankOutline.vue'\nimport CheckboxMarkedOutline from 'vue-material-design-icons/CheckboxMarkedOutline.vue'\nimport Close from 'vue-material-design-icons/Close.vue'\nimport ContentSave from 'vue-material-design-icons/ContentSave.vue'\nimport Delete from 'vue-material-design-icons/Delete.vue'\nimport Pencil from 'vue-material-design-icons/Pencil.vue'\nimport Plus from 'vue-material-design-icons/Plus.vue'\nimport CnFlowTasksPanel from './CnFlowTasksPanel.vue'\nimport { buildHeaders, prefixUrl } from '../../utils/index.js'\n\nexport default {\n\tname: 'CnTasksTab',\n\n\tcomponents: {\n\t\tCnFlowTasksPanel,\n\t\tNcButton,\n\t\tNcTextField,\n\t\tNcListItem,\n\t\tNcActionButton,\n\t\tNcLoadingIcon,\n\t\tNcDateTimePickerNative,\n\t\tNcSelect,\n\t\tPlus,\n\t\tDelete,\n\t\tPencil,\n\t\tClose,\n\t\tContentSave,\n\t\tCheckboxMarkedOutline,\n\t\tCheckboxBlankOutline,\n\t},\n\n\tprops: {\n\t\t/** ID of the object this tab belongs to */\n\t\tobjectId: { type: String, required: true },\n\t\t/** OpenRegister register slug */\n\t\tregister: { type: String, default: '' },\n\t\t/** JSON Schema definition for the object */\n\t\tschema: { type: String, default: '' },\n\t\t/** Base URL for the OpenRegister API */\n\t\tapiBase: { type: String, default: '/apps/openregister/api' },\n\t\t/**\n\t\t * Where the tasks come from: `vtodo` (default, the record's linked\n\t\t * Nextcloud tasks) or `flow-tasks` (the OpenRegister flow tasks anchored\n\t\t * on the record, with create and per-row verbs).\n\t\t *\n\t\t * @type {'vtodo'|'flow-tasks'}\n\t\t */\n\t\tsource: { type: String, default: 'vtodo', validator: (v) => ['vtodo', 'flow-tasks'].includes(v) },\n\t\t/** Placeholder text for the task input */\n\t\taddTaskPlaceholder: { type: String, default: () => t('nextcloud-vue', 'Add task…') },\n\t\t/** Label for the task deadline field */\n\t\tdeadlineLabel: { type: String, default: () => t('nextcloud-vue', 'Deadline') },\n\t\t/** Label for the task assignee field */\n\t\tassigneeLabel: { type: String, default: () => t('nextcloud-vue', 'Assignee') },\n\t\t/** Label for the complete task action */\n\t\tcompleteLabel: { type: String, default: () => t('nextcloud-vue', 'Complete') },\n\t\t/** Label for the edit action */\n\t\teditLabel: { type: String, default: () => t('nextcloud-vue', 'Edit') },\n\t\t/** Label for the delete action */\n\t\tdeleteLabel: { type: String, default: () => t('nextcloud-vue', 'Delete') },\n\t\t/** Text shown when no tasks are linked */\n\t\tnoTasksLabel: { type: String, default: () => t('nextcloud-vue', 'No linked tasks') },\n\t\t/** Label for the load-more button */\n\t\tloadMoreLabel: { type: String, default: () => t('nextcloud-vue', 'Load more') },\n\t\t/** Label for the status filter control */\n\t\tstatusFilterLabel: { type: String, default: () => t('nextcloud-vue', 'Status') },\n\t\t/** Label for the assignee filter control */\n\t\tassigneeFilterLabel: { type: String, default: () => t('nextcloud-vue', 'Assignee') },\n\t},\n\n\temits: ['count'],\n\n\tdata() {\n\t\treturn {\n\t\t\ttasks: [],\n\t\t\tloading: false,\n\t\t\tloadingMore: false,\n\t\t\tnewTaskSummary: '',\n\t\t\tnewTaskDue: null,\n\t\t\tnewTaskAssignee: null,\n\t\t\tsaving: false,\n\t\t\teditingTaskId: null,\n\t\t\tuserList: [],\n\t\t\tpage: 1,\n\t\t\ttotal: 0,\n\t\t\tlimit: 20,\n\t\t\tfilterStatus: null,\n\t\t\tfilterAssignee: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tstatusOptions() {\n\t\t\treturn [...new Set(this.tasks.map((t) => t.status).filter(Boolean))]\n\t\t},\n\n\t\tassigneeOptions() {\n\t\t\treturn [...new Set(this.tasks.map((t) => this.extractAssignee(t)).filter(Boolean))]\n\t\t},\n\n\t\tfilteredTasks() {\n\t\t\tlet result = this.tasks\n\t\t\tif (this.filterStatus) {\n\t\t\t\tresult = result.filter((t) => t.status === this.filterStatus)\n\t\t\t}\n\t\t\tif (this.filterAssignee) {\n\t\t\t\tresult = result.filter((t) => this.extractAssignee(t) === this.filterAssignee)\n\t\t\t}\n\t\t\treturn result\n\t\t},\n\t},\n\n\twatch: {\n\t\tobjectId: {\n\t\t\timmediate: true,\n\t\t\thandler(id) {\n\t\t\t\tif (id && this.source !== 'flow-tasks') {\n\t\t\t\t\tthis.fetchTasks()\n\t\t\t\t\tthis.fetchUsers()\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync fetchTasks(append = false) {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (append) {\n\t\t\t\tthis.loadingMore = true\n\t\t\t} else {\n\t\t\t\tthis.loading = true\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst params = new URLSearchParams({ limit: this.limit, _page: this.page })\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks?${params}`),\n\t\t\t\t\t{ headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tconst results = data.results || data || []\n\t\t\t\t\tthis.tasks = append ? [...this.tasks, ...results] : results\n\t\t\t\t\tthis.total = data.total || this.tasks.length\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to fetch tasks', err)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t\tthis.loadingMore = false\n\t\t\t}\n\t\t},\n\n\t\tloadMore() {\n\t\t\tthis.page++\n\t\t\tthis.fetchTasks(true)\n\t\t},\n\n\t\tisOverdue(task) {\n\t\t\tif (!task.due || task.status === 'completed') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn new Date(task.due) < new Date()\n\t\t},\n\n\t\tasync fetchUsers() {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(prefixUrl('/ocs/v2.php/cloud/users/details?format=json&limit=50'), {\n\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t})\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tconst users = data.ocs?.data?.users || {}\n\t\t\t\t\tthis.userList = Object.entries(users).map(([id, user]) => ({\n\t\t\t\t\t\tuserId: id,\n\t\t\t\t\t\tdisplayName: user.displayname || id,\n\t\t\t\t\t}))\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to fetch users', err)\n\t\t\t}\n\t\t},\n\n\t\tasync addTask() {\n\t\t\tif (!this.newTaskSummary.trim() || !this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\ttry {\n\t\t\t\tconst taskData = { summary: this.newTaskSummary.trim() }\n\t\t\t\tif (this.newTaskDue) {\n\t\t\t\t\ttaskData.due = new Date(this.newTaskDue).toISOString()\n\t\t\t\t}\n\t\t\t\tif (this.newTaskAssignee) {\n\t\t\t\t\ttaskData.description = 'Assigned to: ' + this.newTaskAssignee.displayName\n\t\t\t\t}\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify(taskData),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.clearForm()\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to add task', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\tstartEdit(task) {\n\t\t\tthis.editingTaskId = task.id\n\t\t\tthis.newTaskSummary = task.summary || task.title || task.name || ''\n\t\t\tthis.newTaskDue = task.due ? new Date(task.due).toISOString().split('T')[0] : null\n\t\t\tconst assigneeName = this.extractAssignee(task)\n\t\t\tthis.newTaskAssignee = this.userList.find((u) => u.displayName === assigneeName) || null\n\t\t},\n\n\t\tcancelEdit() {\n\t\t\tthis.editingTaskId = null\n\t\t\tthis.clearForm()\n\t\t},\n\n\t\tasync saveEdit() {\n\t\t\tif (!this.newTaskSummary.trim() || !this.editingTaskId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\ttry {\n\t\t\t\tconst taskData = { summary: this.newTaskSummary.trim() }\n\t\t\t\tif (this.newTaskDue) {\n\t\t\t\t\ttaskData.due = new Date(this.newTaskDue).toISOString()\n\t\t\t\t} else {\n\t\t\t\t\ttaskData.due = ''\n\t\t\t\t}\n\t\t\t\tif (this.newTaskAssignee) {\n\t\t\t\t\ttaskData.description = 'Assigned to: ' + this.newTaskAssignee.displayName\n\t\t\t\t} else {\n\t\t\t\t\ttaskData.description = ''\n\t\t\t\t}\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(this.editingTaskId)}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify(taskData),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.editingTaskId = null\n\t\t\t\tthis.clearForm()\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to update task', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\tclearForm() {\n\t\t\tthis.newTaskSummary = ''\n\t\t\tthis.newTaskDue = null\n\t\t\tthis.newTaskAssignee = null\n\t\t},\n\n\t\tasync toggleTask(task) {\n\t\t\tconst newStatus = task.status === 'completed' ? 'NEEDS-ACTION' : 'COMPLETED'\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(task.id)}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify({ status: newStatus }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to toggle task', err)\n\t\t\t}\n\t\t},\n\n\t\tasync completeTask(task) {\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(task.id)}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify({ status: 'COMPLETED' }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to complete task', err)\n\t\t\t}\n\t\t},\n\n\t\tasync deleteTask(task) {\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(task.id)}`),\n\t\t\t\t\t{ method: 'DELETE', headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tthis.tasks = this.tasks.filter((t) => t.id !== task.id)\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to delete task', err)\n\t\t\t}\n\t\t},\n\n\t\textractAssignee(task) {\n\t\t\tif (task.description?.startsWith('Assigned to: ')) {\n\t\t\t\treturn task.description.replace('Assigned to: ', '')\n\t\t\t}\n\t\t\treturn task.description || ''\n\t\t},\n\n\t\tformatShortDate(dateStr) {\n\t\t\tif (!dateStr) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new Date(dateStr).toLocaleDateString(undefined, {\n\t\t\t\t\tday: 'numeric',\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t})\n\t\t\t} catch {\n\t\t\t\treturn dateStr\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-sidebar-tab {\n\tpadding: 12px;\n\toverflow-x: hidden;\n}\n\n.cn-sidebar-tab__section {\n\tmargin-bottom: 12px;\n}\n\n.cn-sidebar-tab__section--filters {\n\tpadding-top: 12px;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-sidebar-tab__action--row {\n\tdisplay: flex;\n\tgap: 8px;\n\talign-items: flex-end;\n\tmargin-bottom: 8px;\n}\n\n.cn-sidebar-tab__grid {\n\tdisplay: grid;\n\tgrid-template-columns: 1fr 1fr;\n\tgap: 8px;\n}\n\n.cn-sidebar-tab__grid > * {\n\tmin-width: 0;\n}\n\n.cn-sidebar-tab__empty {\n\ttext-align: center;\n\tpadding: 24px 12px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-sidebar-tab__list {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n}\n\n.cn-sidebar-tab__load-more { margin-top: 8px; }\n\n.cn-sidebar-tab__task-checkbox {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground: none;\n\tborder: none;\n\tpadding: 0;\n\tcursor: pointer;\n\tcolor: inherit;\n}\n\n.cn-sidebar-tab__task-done { color: var(--color-success); }\n\n.cn-sidebar-tab__task-overdue-icon { color: var(--color-error, #e53935); }\n\n.cn-sidebar-tab__task-overdue-date { color: var(--color-error, #e53935); font-weight: 500; }\n</style>\n"],"names":["_createBlock","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_withKeys","_toDisplayString","_Fragment","_renderList","_normalizeClass","_withModifiers","_createTextVNode"],"mappings":";;;;AAQa,EAAA,KAAK,EAAC,gBAAgB;;AAE5B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,yBAAyB,GAAA;AAC9B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,6BAA6B,GAAA;AAyBnC,MAAA,UAAA,GAAA,EAAA,KAAK,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AAA,mBAAA,EAAA;;AATT,cAAA,OAAO,EAAC,UAAS;AAChB,cAAA,IAAI,EAAE,IAAI;AACV,cAAA,QAAQ,EAAE,KAAW,CAAA,WAAA;AACtB,cAAA,KAAK,EAAC,2BAA0B;AAC/B,cAAA,OAAK,EAAE,QAAQ,CAAA,QAAA;;+BAGN,MACV;AADU,gBAAAW,eAAA,CAAA,GACV,mBAAG;;;;eAHa,KAAW,CAAA,WAAA;;0BAAG,MAAI;gCACjC,MAA2B;sBAA3BP,WAA2B,CAAA,wBAAA,EAAA,EAAX,IAAI,EAAE,EAAE,EAAA,CAAA;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"CnTasksTab.vue3.js","sources":["../../../../src/components/CnObjectSidebar/CnTasksTab.vue?vue&type=template&id=a3b743c8&lang.js"],"sourcesContent":["<template>\n\t<!-- OpenRegister flow tasks anchored on the record (source=\"flow-tasks\") -->\n\t<CnFlowTasksPanel\n\t\tv-if=\"source === 'flow-tasks'\"\n\t\t:objectId=\"objectId\"\n\t\t:register=\"register\"\n\t\t:schema=\"schema\"\n\t\t@count=\"(n) => $emit('count', n)\" />\n\t<div v-else class=\"cn-sidebar-tab\">\n\t\t<!-- Add / Edit task -->\n\t\t<div class=\"cn-sidebar-tab__section\">\n\t\t\t<div class=\"cn-sidebar-tab__action--row\">\n\t\t\t\t<NcTextField\n\t\t\t\t\tv-model=\"newTaskSummary\"\n\t\t\t\t\t:label=\"editingTaskId ? editLabel : addTaskPlaceholder\"\n\t\t\t\t\t@keyup.enter=\"editingTaskId ? saveEdit() : addTask()\" />\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"editingTaskId\"\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t:aria-label=\"cancelLabel\"\n\t\t\t\t\t@click=\"cancelEdit\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Close :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t:aria-label=\"editingTaskId ? saveLabel : addTaskPlaceholder\"\n\t\t\t\t\t:disabled=\"!newTaskSummary.trim() || saving\"\n\t\t\t\t\t@click=\"editingTaskId ? saveEdit() : addTask()\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Plus v-if=\"!editingTaskId\" :size=\"20\" />\n\t\t\t\t\t\t<ContentSave v-else :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t\t<div class=\"cn-sidebar-tab__grid\">\n\t\t\t\t<NcDateTimePickerNative\n\t\t\t\t\tid=\"task-deadline\"\n\t\t\t\t\tv-model=\"newTaskDue\"\n\t\t\t\t\t:label=\"deadlineLabel\"\n\t\t\t\t\ttype=\"date\" />\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-model=\"newTaskAssignee\"\n\t\t\t\t\t:options=\"userList\"\n\t\t\t\t\t:placeholder=\"assigneeLabel\"\n\t\t\t\t\t:inputLabel=\"assigneeLabel\"\n\t\t\t\t\tlabel=\"displayName\"\n\t\t\t\t\ttrackBy=\"userId\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!-- Filters -->\n\t\t<div v-if=\"tasks.length > 0 || filterStatus || filterAssignee\" class=\"cn-sidebar-tab__section cn-sidebar-tab__section--filters\">\n\t\t\t<div class=\"cn-sidebar-tab__grid\">\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-model=\"filterStatus\"\n\t\t\t\t\t:options=\"statusOptions\"\n\t\t\t\t\t:placeholder=\"statusFilterLabel\"\n\t\t\t\t\t:inputLabel=\"statusFilterLabel\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-model=\"filterAssignee\"\n\t\t\t\t\t:options=\"assigneeOptions\"\n\t\t\t\t\t:placeholder=\"assigneeFilterLabel\"\n\t\t\t\t\t:inputLabel=\"assigneeFilterLabel\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!-- Tasks list -->\n\t\t<NcLoadingIcon v-if=\"loading\" />\n\t\t<div v-else-if=\"filteredTasks.length === 0\" class=\"cn-sidebar-tab__empty\">\n\t\t\t{{ noTasksLabel }}\n\t\t</div>\n\t\t<div v-else class=\"cn-sidebar-tab__list\">\n\t\t\t<NcListItem\n\t\t\t\tv-for=\"task in filteredTasks\"\n\t\t\t\t:key=\"task.id\"\n\t\t\t\t:name=\"task.summary || task.title || task.name\"\n\t\t\t\t:bold=\"false\"\n\t\t\t\t:forceDisplayActions=\"true\"\n\t\t\t\t:class=\"{ 'cn-sidebar-tab__task--overdue': isOverdue(task) }\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<button class=\"cn-sidebar-tab__task-checkbox\" @click.stop=\"toggleTask(task)\">\n\t\t\t\t\t\t<CheckboxMarkedOutline v-if=\"task.status === 'completed'\" :size=\"32\" class=\"cn-sidebar-tab__task-done\" />\n\t\t\t\t\t\t<CheckboxBlankOutline v-else :size=\"32\" :class=\"{ 'cn-sidebar-tab__task-overdue-icon': isOverdue(task) }\" />\n\t\t\t\t\t</button>\n\t\t\t\t</template>\n\t\t\t\t<template #subname>\n\t\t\t\t\t{{ extractAssignee(task) }}\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"task.due\" #details>\n\t\t\t\t\t<span :class=\"{ 'cn-sidebar-tab__task-overdue-date': isOverdue(task) }\">\n\t\t\t\t\t\t{{ formatShortDate(task.due) }}\n\t\t\t\t\t</span>\n\t\t\t\t</template>\n\t\t\t\t<template #actions>\n\t\t\t\t\t<NcActionButton @click=\"startEdit(task)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Pencil :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ editLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton v-if=\"task.status !== 'completed'\" @click=\"completeTask(task)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<CheckboxMarkedOutline :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ completeLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton @click=\"deleteTask(task)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ deleteLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</template>\n\t\t\t</NcListItem>\n\t\t</div>\n\t\t<NcButton\n\t\t\tv-if=\"tasks.length < total\"\n\t\t\tvariant=\"tertiary\"\n\t\t\t:wide=\"true\"\n\t\t\t:disabled=\"loadingMore\"\n\t\t\tclass=\"cn-sidebar-tab__load-more\"\n\t\t\t@click=\"loadMore\">\n\t\t\t<template v-if=\"loadingMore\" #icon>\n\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t</template>\n\t\t\t{{ loadMoreLabel }}\n\t\t</NcButton>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcButton, NcDateTimePickerNative, NcListItem, NcLoadingIcon, NcSelect, NcTextField } from '@nextcloud/vue'\nimport CheckboxBlankOutline from 'vue-material-design-icons/CheckboxBlankOutline.vue'\nimport CheckboxMarkedOutline from 'vue-material-design-icons/CheckboxMarkedOutline.vue'\nimport Close from 'vue-material-design-icons/Close.vue'\nimport ContentSave from 'vue-material-design-icons/ContentSave.vue'\nimport Delete from 'vue-material-design-icons/Delete.vue'\nimport Pencil from 'vue-material-design-icons/Pencil.vue'\nimport Plus from 'vue-material-design-icons/Plus.vue'\nimport CnFlowTasksPanel from './CnFlowTasksPanel.vue'\nimport { buildHeaders, prefixUrl } from '../../utils/index.js'\nimport { userLocale } from '../../utils/userLocale.js'\n\nexport default {\n\tname: 'CnTasksTab',\n\n\tcomponents: {\n\t\tCnFlowTasksPanel,\n\t\tNcButton,\n\t\tNcTextField,\n\t\tNcListItem,\n\t\tNcActionButton,\n\t\tNcLoadingIcon,\n\t\tNcDateTimePickerNative,\n\t\tNcSelect,\n\t\tPlus,\n\t\tDelete,\n\t\tPencil,\n\t\tClose,\n\t\tContentSave,\n\t\tCheckboxMarkedOutline,\n\t\tCheckboxBlankOutline,\n\t},\n\n\tprops: {\n\t\t/** ID of the object this tab belongs to */\n\t\tobjectId: { type: String, required: true },\n\t\t/** OpenRegister register slug */\n\t\tregister: { type: String, default: '' },\n\t\t/** JSON Schema definition for the object */\n\t\tschema: { type: String, default: '' },\n\t\t/** Base URL for the OpenRegister API */\n\t\tapiBase: { type: String, default: '/apps/openregister/api' },\n\t\t/**\n\t\t * Where the tasks come from: `vtodo` (default, the record's linked\n\t\t * Nextcloud tasks) or `flow-tasks` (the OpenRegister flow tasks anchored\n\t\t * on the record, with create and per-row verbs).\n\t\t *\n\t\t * @type {'vtodo'|'flow-tasks'}\n\t\t */\n\t\tsource: { type: String, default: 'vtodo', validator: (v) => ['vtodo', 'flow-tasks'].includes(v) },\n\t\t/** Placeholder text for the task input */\n\t\taddTaskPlaceholder: { type: String, default: () => t('nextcloud-vue', 'Add task…') },\n\t\t/** Label for the task deadline field */\n\t\tdeadlineLabel: { type: String, default: () => t('nextcloud-vue', 'Deadline') },\n\t\t/** Label for the task assignee field */\n\t\tassigneeLabel: { type: String, default: () => t('nextcloud-vue', 'Assignee') },\n\t\t/** Label for the complete task action */\n\t\tcompleteLabel: { type: String, default: () => t('nextcloud-vue', 'Complete') },\n\t\t/** Label for the edit action */\n\t\teditLabel: { type: String, default: () => t('nextcloud-vue', 'Edit') },\n\t\t/** Label for the delete action */\n\t\tdeleteLabel: { type: String, default: () => t('nextcloud-vue', 'Delete') },\n\t\t/** Text shown when no tasks are linked */\n\t\tnoTasksLabel: { type: String, default: () => t('nextcloud-vue', 'No linked tasks') },\n\t\t/** Label for the load-more button */\n\t\tloadMoreLabel: { type: String, default: () => t('nextcloud-vue', 'Load more') },\n\t\t/** Label for the status filter control */\n\t\tstatusFilterLabel: { type: String, default: () => t('nextcloud-vue', 'Status') },\n\t\t/** Label for the assignee filter control */\n\t\tassigneeFilterLabel: { type: String, default: () => t('nextcloud-vue', 'Assignee') },\n\t},\n\n\temits: ['count'],\n\n\tdata() {\n\t\treturn {\n\t\t\ttasks: [],\n\t\t\tloading: false,\n\t\t\tloadingMore: false,\n\t\t\tnewTaskSummary: '',\n\t\t\tnewTaskDue: null,\n\t\t\tnewTaskAssignee: null,\n\t\t\tsaving: false,\n\t\t\teditingTaskId: null,\n\t\t\tuserList: [],\n\t\t\tpage: 1,\n\t\t\ttotal: 0,\n\t\t\tlimit: 20,\n\t\t\tfilterStatus: null,\n\t\t\tfilterAssignee: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tstatusOptions() {\n\t\t\treturn [...new Set(this.tasks.map((t) => t.status).filter(Boolean))]\n\t\t},\n\n\t\tassigneeOptions() {\n\t\t\treturn [...new Set(this.tasks.map((t) => this.extractAssignee(t)).filter(Boolean))]\n\t\t},\n\n\t\tfilteredTasks() {\n\t\t\tlet result = this.tasks\n\t\t\tif (this.filterStatus) {\n\t\t\t\tresult = result.filter((t) => t.status === this.filterStatus)\n\t\t\t}\n\t\t\tif (this.filterAssignee) {\n\t\t\t\tresult = result.filter((t) => this.extractAssignee(t) === this.filterAssignee)\n\t\t\t}\n\t\t\treturn result\n\t\t},\n\t},\n\n\twatch: {\n\t\tobjectId: {\n\t\t\timmediate: true,\n\t\t\thandler(id) {\n\t\t\t\tif (id && this.source !== 'flow-tasks') {\n\t\t\t\t\tthis.fetchTasks()\n\t\t\t\t\tthis.fetchUsers()\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync fetchTasks(append = false) {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (append) {\n\t\t\t\tthis.loadingMore = true\n\t\t\t} else {\n\t\t\t\tthis.loading = true\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst params = new URLSearchParams({ limit: this.limit, _page: this.page })\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks?${params}`),\n\t\t\t\t\t{ headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tconst results = data.results || data || []\n\t\t\t\t\tthis.tasks = append ? [...this.tasks, ...results] : results\n\t\t\t\t\tthis.total = data.total || this.tasks.length\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to fetch tasks', err)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t\tthis.loadingMore = false\n\t\t\t}\n\t\t},\n\n\t\tloadMore() {\n\t\t\tthis.page++\n\t\t\tthis.fetchTasks(true)\n\t\t},\n\n\t\tisOverdue(task) {\n\t\t\tif (!task.due || task.status === 'completed') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn new Date(task.due) < new Date()\n\t\t},\n\n\t\tasync fetchUsers() {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(prefixUrl('/ocs/v2.php/cloud/users/details?format=json&limit=50'), {\n\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t})\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tconst users = data.ocs?.data?.users || {}\n\t\t\t\t\tthis.userList = Object.entries(users).map(([id, user]) => ({\n\t\t\t\t\t\tuserId: id,\n\t\t\t\t\t\tdisplayName: user.displayname || id,\n\t\t\t\t\t}))\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to fetch users', err)\n\t\t\t}\n\t\t},\n\n\t\tasync addTask() {\n\t\t\tif (!this.newTaskSummary.trim() || !this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\ttry {\n\t\t\t\tconst taskData = { summary: this.newTaskSummary.trim() }\n\t\t\t\tif (this.newTaskDue) {\n\t\t\t\t\ttaskData.due = new Date(this.newTaskDue).toISOString()\n\t\t\t\t}\n\t\t\t\tif (this.newTaskAssignee) {\n\t\t\t\t\ttaskData.description = 'Assigned to: ' + this.newTaskAssignee.displayName\n\t\t\t\t}\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify(taskData),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.clearForm()\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to add task', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\tstartEdit(task) {\n\t\t\tthis.editingTaskId = task.id\n\t\t\tthis.newTaskSummary = task.summary || task.title || task.name || ''\n\t\t\tthis.newTaskDue = task.due ? new Date(task.due).toISOString().split('T')[0] : null\n\t\t\tconst assigneeName = this.extractAssignee(task)\n\t\t\tthis.newTaskAssignee = this.userList.find((u) => u.displayName === assigneeName) || null\n\t\t},\n\n\t\tcancelEdit() {\n\t\t\tthis.editingTaskId = null\n\t\t\tthis.clearForm()\n\t\t},\n\n\t\tasync saveEdit() {\n\t\t\tif (!this.newTaskSummary.trim() || !this.editingTaskId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\ttry {\n\t\t\t\tconst taskData = { summary: this.newTaskSummary.trim() }\n\t\t\t\tif (this.newTaskDue) {\n\t\t\t\t\ttaskData.due = new Date(this.newTaskDue).toISOString()\n\t\t\t\t} else {\n\t\t\t\t\ttaskData.due = ''\n\t\t\t\t}\n\t\t\t\tif (this.newTaskAssignee) {\n\t\t\t\t\ttaskData.description = 'Assigned to: ' + this.newTaskAssignee.displayName\n\t\t\t\t} else {\n\t\t\t\t\ttaskData.description = ''\n\t\t\t\t}\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(this.editingTaskId)}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify(taskData),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.editingTaskId = null\n\t\t\t\tthis.clearForm()\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to update task', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\tclearForm() {\n\t\t\tthis.newTaskSummary = ''\n\t\t\tthis.newTaskDue = null\n\t\t\tthis.newTaskAssignee = null\n\t\t},\n\n\t\tasync toggleTask(task) {\n\t\t\tconst newStatus = task.status === 'completed' ? 'NEEDS-ACTION' : 'COMPLETED'\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(task.id)}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify({ status: newStatus }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to toggle task', err)\n\t\t\t}\n\t\t},\n\n\t\tasync completeTask(task) {\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(task.id)}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify({ status: 'COMPLETED' }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tawait this.fetchTasks()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to complete task', err)\n\t\t\t}\n\t\t},\n\n\t\tasync deleteTask(task) {\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/tasks/${encodeURIComponent(task.id)}`),\n\t\t\t\t\t{ method: 'DELETE', headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tthis.tasks = this.tasks.filter((t) => t.id !== task.id)\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnTasksTab: Failed to delete task', err)\n\t\t\t}\n\t\t},\n\n\t\textractAssignee(task) {\n\t\t\tif (task.description?.startsWith('Assigned to: ')) {\n\t\t\t\treturn task.description.replace('Assigned to: ', '')\n\t\t\t}\n\t\t\treturn task.description || ''\n\t\t},\n\n\t\tformatShortDate(dateStr) {\n\t\t\tif (!dateStr) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new Date(dateStr).toLocaleDateString(userLocale(), {\n\t\t\t\t\tday: 'numeric',\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t})\n\t\t\t} catch {\n\t\t\t\treturn dateStr\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-sidebar-tab {\n\tpadding: 12px;\n\toverflow-x: hidden;\n}\n\n.cn-sidebar-tab__section {\n\tmargin-bottom: 12px;\n}\n\n.cn-sidebar-tab__section--filters {\n\tpadding-top: 12px;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-sidebar-tab__action--row {\n\tdisplay: flex;\n\tgap: 8px;\n\talign-items: flex-end;\n\tmargin-bottom: 8px;\n}\n\n.cn-sidebar-tab__grid {\n\tdisplay: grid;\n\tgrid-template-columns: 1fr 1fr;\n\tgap: 8px;\n}\n\n.cn-sidebar-tab__grid > * {\n\tmin-width: 0;\n}\n\n.cn-sidebar-tab__empty {\n\ttext-align: center;\n\tpadding: 24px 12px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-sidebar-tab__list {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n}\n\n.cn-sidebar-tab__load-more { margin-top: 8px; }\n\n.cn-sidebar-tab__task-checkbox {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground: none;\n\tborder: none;\n\tpadding: 0;\n\tcursor: pointer;\n\tcolor: inherit;\n}\n\n.cn-sidebar-tab__task-done { color: var(--color-success); }\n\n.cn-sidebar-tab__task-overdue-icon { color: var(--color-error, #e53935); }\n\n.cn-sidebar-tab__task-overdue-date { color: var(--color-error, #e53935); font-weight: 500; }\n</style>\n"],"names":["_createBlock","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_withKeys","_toDisplayString","_Fragment","_renderList","_normalizeClass","_withModifiers","_createTextVNode"],"mappings":";;;;AAQa,EAAA,KAAK,EAAC,gBAAgB;;AAE5B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,yBAAyB,GAAA;AAC9B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,6BAA6B,GAAA;AAyBnC,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,sBAAsB,G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A;;AATT,cAAA,OAAO,EAAC,UAAS;AAChB,cAAA,IAAI,EAAE,IAAI;AACV,cAAA,QAAQ,EAAE,KAAW,CAAA,WAAA;AACtB,cAAA,KAAK,EAAC,2BAA0B;AAC/B,cAAA,OAAK,EAAE,QAAQ,CAAA,QAAA;;+BAGN,MACV;AADU,gBAAAW,eAAA,CAAA,GACV,mBAAG;;;;eAHa,KAAW,CAAA,WAAA;;0BAAG,MAAI;gCACjC,MAA2B;sBAA3BP,WAA2B,CAAA,wBAAA,EAAA,EAAX,IAAI,EAAE,EAAE,EAAA,CAAA;;;;;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import script from './CnPropertySourceField.vue2.js';
|
|
|
2
2
|
import { render } from './CnPropertySourceField.vue3.js';
|
|
3
3
|
|
|
4
4
|
script.render = render;
|
|
5
|
-
script.__scopeId = "data-v-
|
|
5
|
+
script.__scopeId = "data-v-41cdf4a8";
|
|
6
6
|
const __sfc_main = script;
|
|
7
7
|
|
|
8
8
|
export { __sfc_main as default };
|
|
@@ -3,6 +3,7 @@ import { translate } from '@nextcloud/l10n';
|
|
|
3
3
|
import { generateUrl } from '@nextcloud/router';
|
|
4
4
|
import { NcSelect, NcTextField } from '@nextcloud/vue';
|
|
5
5
|
import { isAppInstalled } from '../../utils/appInstalled.js';
|
|
6
|
+
import { userLocale } from '../../utils/userLocale.js';
|
|
6
7
|
|
|
7
8
|
const BASE = '/apps/integriq/api/property-sources';
|
|
8
9
|
|
|
@@ -165,7 +166,7 @@ var script = {
|
|
|
165
166
|
methods: {
|
|
166
167
|
formatTime(iso) {
|
|
167
168
|
const d = new Date(iso);
|
|
168
|
-
return Number.isNaN(d.getTime()) ? String(iso) : d.toLocaleString()
|
|
169
|
+
return Number.isNaN(d.getTime()) ? String(iso) : d.toLocaleString(userLocale())
|
|
169
170
|
},
|
|
170
171
|
|
|
171
172
|
url(path) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnPropertySourceField.vue2.js","sources":["../../../../src/components/CnPropertySourceField/CnPropertySourceField.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-property-source-field\">\n\t\t<NcTextField\n\t\t\tv-if=\"plain\"\n\t\t\t:label=\"inputLabel\"\n\t\t\t:modelValue=\"modelValue != null ? String(modelValue) : ''\"\n\t\t\t:disabled=\"disabled\"\n\t\t\t:error=\"error\"\n\t\t\t:helperText=\"reason\"\n\t\t\t@update:modelValue=\"onPlainInput\" />\n\t\t<template v-else>\n\t\t\t<NcSelect\n\t\t\t\t:inputId=\"inputId\"\n\t\t\t\t:inputLabel=\"inputLabel\"\n\t\t\t\t:modelValue=\"selectedOption\"\n\t\t\t\t:options=\"options\"\n\t\t\t\t:loading=\"loading\"\n\t\t\t\t:clearable=\"clearable\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:filterable=\"false\"\n\t\t\t\tlabel=\"label\"\n\t\t\t\t@search=\"onSearch\"\n\t\t\t\t@update:modelValue=\"onPick\" />\n\t\t\t<p v-if=\"reason\" class=\"cn-property-source-field__reason\" data-testid=\"cn-property-source-reason\">\n\t\t\t\t{{ reason }}\n\t\t\t</p>\n\t\t</template>\n\t\t<p\n\t\t\tv-if=\"provenanceLine\"\n\t\t\tclass=\"cn-property-source-field__provenance\"\n\t\t\tdata-testid=\"cn-property-source-provenance\">\n\t\t\t{{ provenanceLine }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { NcSelect, NcTextField } from '@nextcloud/vue'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\n\nconst BASE = '/apps/integriq/api/property-sources'\n\n/**\n * CnPropertySourceField — a type-ahead over a registry (integriq\n * `registry-field-source`) for a schema property that declares\n * `x-openregister-property-source`.\n *\n * From `minChars` typed characters it asks the provider for suggestions; on a\n * pick it resolves the identifier and only then sets the value (the\n * identifier). `resolved` carries the answer so a form can fill sibling\n * fields. Without integriq, an unknown provider, a missing permission or an\n * unreachable source the field turns into a plain text input with a one-line\n * reason, and the form still saves.\n *\n * Example:\n * ```vue\n * <CnPropertySourceField provider=\"kvk\" input-label=\"KvK number\"\n * :model-value=\"kvk\" @update:modelValue=\"kvk = $event\" @resolved=\"onResolved\" />\n * ```\n */\nexport default {\n\tname: 'CnPropertySourceField',\n\n\tcomponents: { NcSelect, NcTextField },\n\n\tprops: {\n\t\t/** Registry provider id, e.g. `kvk`, `bag` or `brp`. */\n\t\tprovider: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Stored identifier (v-model). */\n\t\tmodelValue: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Declaration mode: `live` reads the source where it is shown, `default` is a one-off copy. */\n\t\tmode: {\n\t\t\ttype: String,\n\t\t\tdefault: 'live',\n\t\t},\n\n\t\t/** Accessible label of the field. */\n\t\tinputLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** DOM id of the input. */\n\t\tinputId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Placeholder text. */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Whether the value can be cleared. */\n\t\tclearable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Disable the field. */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Show the field in its error state. */\n\t\terror: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Characters needed before the first suggest request. */\n\t\tminChars: {\n\t\t\ttype: Number,\n\t\t\tdefault: 3,\n\t\t},\n\n\t\t/** Milliseconds to wait after typing before suggesting. */\n\t\tdebounce: {\n\t\t\ttype: Number,\n\t\t\tdefault: 300,\n\t\t},\n\n\t\t/** Human name of the provider for the provenance line; defaults to the provider id. */\n\t\tproviderLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['update:modelValue', 'resolved'],\n\n\tdata() {\n\t\treturn {\n\t\t\toptions: [],\n\t\t\tloading: false,\n\t\t\tselected: null,\n\t\t\tplain: !isAppInstalled('integriq'),\n\t\t\treason: isAppInstalled('integriq') ? '' : t('nextcloud-vue', 'Registry lookup is not available on this server.'),\n\t\t\tprovenance: null,\n\t\t\ttimer: null,\n\t\t\tseq: 0,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tselectedOption() {\n\t\t\tif (this.selected && String(this.selected.identifier) === String(this.modelValue)) {\n\t\t\t\treturn this.selected\n\t\t\t}\n\t\t\tif (this.modelValue === '' || this.modelValue === null || this.modelValue === undefined) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn { identifier: String(this.modelValue), label: String(this.modelValue) }\n\t\t},\n\n\t\tprovenanceLine() {\n\t\t\tconst p = this.provenance\n\t\t\tif (!p) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst name = this.providerLabel || p.provider || this.provider\n\t\t\tlet line = p.readAt\n\t\t\t\t? t('nextcloud-vue', 'From {provider}, read {time}', { provider: name, time: this.formatTime(p.readAt) })\n\t\t\t\t: t('nextcloud-vue', 'From {provider}', { provider: name })\n\t\t\tif (p.unreachable) {\n\t\t\t\tline += '. ' + t('nextcloud-vue', 'Source unreachable.')\n\t\t\t} else if (p.origin === 'cache') {\n\t\t\t\tline += '. ' + t('nextcloud-vue', 'From cache.')\n\t\t\t}\n\t\t\treturn line\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Live mode on an existing record: resolve the stored identifier once to show label and provenance.\n\t\tif (!this.plain && this.mode === 'live' && this.modelValue !== '' && this.modelValue !== null && this.modelValue !== undefined) {\n\t\t\tthis.resolve(String(this.modelValue)).then((res) => {\n\t\t\t\tif (res) {\n\t\t\t\t\tthis.provenance = res.provenance || null\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t},\n\n\tbeforeUnmount() {\n\t\tclearTimeout(this.timer)\n\t},\n\n\tmethods: {\n\t\tformatTime(iso) {\n\t\t\tconst d = new Date(iso)\n\t\t\treturn Number.isNaN(d.getTime()) ? String(iso) : d.toLocaleString()\n\t\t},\n\n\t\turl(path) {\n\t\t\treturn generateUrl(`${BASE}/${encodeURIComponent(this.provider)}/${path}`)\n\t\t},\n\n\t\tdegrade(reason) {\n\t\t\tthis.plain = true\n\t\t\tthis.reason = reason\n\t\t\tthis.options = []\n\t\t},\n\n\t\tonPlainInput(value) {\n\t\t\t/** @event update:modelValue Emitted with the identifier (or typed text in plain mode). */\n\t\t\tthis.$emit('update:modelValue', value)\n\t\t},\n\n\t\tonSearch(query) {\n\t\t\tclearTimeout(this.timer)\n\t\t\tif (typeof query !== 'string' || query.trim().length < this.minChars) {\n\t\t\t\tthis.options = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.timer = setTimeout(() => this.suggest(query.trim()), this.debounce)\n\t\t},\n\n\t\tasync suggest(q) {\n\t\t\tconst seq = ++this.seq\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\tconst res = await axios.get(this.url('suggest'), { params: { q } })\n\t\t\t\tif (seq !== this.seq) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst results = (res && res.data && Array.isArray(res.data.results)) ? res.data.results : []\n\t\t\t\tthis.options = results.map((r) => ({ ...r, label: String(r.label ?? r.identifier) }))\n\t\t\t} catch (err) {\n\t\t\t\tconst status = err && err.response && err.response.status\n\t\t\t\tif (status === 404) {\n\t\t\t\t\tthis.degrade(t('nextcloud-vue', 'The registry \"{provider}\" is not available.', { provider: this.providerLabel || this.provider }))\n\t\t\t\t} else if (status === 401 || status === 403) {\n\t\t\t\t\tthis.degrade(t('nextcloud-vue', 'You cannot look this up.'))\n\t\t\t\t} else {\n\t\t\t\t\tthis.degrade(t('nextcloud-vue', 'The source did not answer; type the value.'))\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (seq === this.seq) {\n\t\t\t\t\tthis.loading = false\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tasync resolve(identifier) {\n\t\t\ttry {\n\t\t\t\tconst res = await axios.get(this.url('resolve'), { params: { identifier } })\n\t\t\t\treturn (res && res.data) || null\n\t\t\t} catch (err) {\n\t\t\t\tconst status = err && err.response && err.response.status\n\t\t\t\tthis.reason = (status === 401 || status === 403)\n\t\t\t\t\t? t('nextcloud-vue', 'You cannot look this up.')\n\t\t\t\t\t: (status === 404\n\t\t\t\t\t\t\t? t('nextcloud-vue', 'The registry \"{provider}\" is not available.', { provider: this.providerLabel || this.provider })\n\t\t\t\t\t\t\t: t('nextcloud-vue', 'The source did not answer; type the value.'))\n\t\t\t\treturn null\n\t\t\t}\n\t\t},\n\n\t\tasync onPick(option) {\n\t\t\tthis.reason = ''\n\t\t\tif (!option) {\n\t\t\t\tthis.selected = null\n\t\t\t\tthis.provenance = null\n\t\t\t\tthis.$emit('update:modelValue', '')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst identifier = String(option.identifier)\n\t\t\tthis.selected = option\n\t\t\tconst answer = await this.resolve(identifier)\n\t\t\t// The identifier is kept even when the resolve fails: the user picked it.\n\t\t\tthis.$emit('update:modelValue', identifier)\n\t\t\tif (!answer) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.provenance = answer.provenance || null\n\t\t\tif (answer.provenance && answer.provenance.unreachable && (answer.value === undefined || answer.value === null)) {\n\t\t\t\tthis.reason = t('nextcloud-vue', 'The source did not answer; type the value.')\n\t\t\t\treturn\n\t\t\t}\n\t\t\t/**\n\t\t\t * @event resolved Emitted after a successful resolve of a pick.\n\t\t\t * @type {{identifier: string, value: *, provenance: object|null}}\n\t\t\t */\n\t\t\tthis.$emit('resolved', { identifier, value: answer.value, provenance: answer.provenance || null })\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-property-source-field__reason,\n.cn-property-source-field__provenance {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: var(--default-font-size);\n}\n</style>\n"],"names":["t","axios"],"mappings":";;;;;;AAgDA,MAAM,OAAO,sCAAoC;;AAEjD;;;AAGC;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAED,aAAe;CACd,IAAI,EAAE,uBAAuB;;AAE7B,CAAA,UAAU,EAAE,EAAE,QAAQ,EAAE,aAAa;;AAErC,CAAA,KAAK,EAAE;;AAEN,EAAA,QAAQ,EAAE;GACT,IAAI,EAAE,MAAM;GACZ,QAAQ,EAAE,IAAI;GACd;;AAED;EACA,UAAU,EAAE;AACX,GAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;GACtB,OAAO,EAAE,EAAE;GACX;;AAED;EACA,IAAI,EAAE;GACL,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,MAAM;GACf;;AAED;EACA,UAAU,EAAE;GACX,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;GACX;;AAED;AACA,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;GACX;;AAED;EACA,WAAW,EAAE;GACZ,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;GACX;;AAED;EACA,SAAS,EAAE;GACV,IAAI,EAAE,OAAO;GACb,OAAO,EAAE,IAAI;GACb;;AAED;AACA,EAAA,QAAQ,EAAE;GACT,IAAI,EAAE,OAAO;GACb,OAAO,EAAE,KAAK;GACd;;AAED;AACA,EAAA,KAAK,EAAE;GACN,IAAI,EAAE,OAAO;GACb,OAAO,EAAE,KAAK;GACd;;;AAGD,EAAA,QAAQ,EAAE;GACT,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,CA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AA,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,UAAU,EAAA;GAC1C,IAAI,CAAC,MAAM,EAAE;IACZ,MAAK;AACN,IAAA;AACA,GAAA,IAAI,CAAC,UAAW,GAAE,MAAM,CAAC,UAAW,IAAG,KAAG;GAC1C,IAAI,MAAM,CAAC,UAAS,IAAK,MAAM,CAAC,UAAU,CAAC,gBAAgB,MAAM,CAAC,KAAI,KAAM,SAAU,IAAG,MAAM,CAAC,KAAI,KAAM,IAAI,CAAC,EAAE;AAChH,IAAA,IAAI,CAAC,MAAK,GAAIA,SAAC,CAAC,eAAe,EAAE,4CAA4C,EAAA;IAC7E,MAAK;AACN,IAAA;AACA;;;;AAIA,GAAA,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,cAAc,MAAM,EAAA;GACjG;EACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CnPropertySourceField.vue2.js","sources":["../../../../src/components/CnPropertySourceField/CnPropertySourceField.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-property-source-field\">\n\t\t<NcTextField\n\t\t\tv-if=\"plain\"\n\t\t\t:label=\"inputLabel\"\n\t\t\t:modelValue=\"modelValue != null ? String(modelValue) : ''\"\n\t\t\t:disabled=\"disabled\"\n\t\t\t:error=\"error\"\n\t\t\t:helperText=\"reason\"\n\t\t\t@update:modelValue=\"onPlainInput\" />\n\t\t<template v-else>\n\t\t\t<NcSelect\n\t\t\t\t:inputId=\"inputId\"\n\t\t\t\t:inputLabel=\"inputLabel\"\n\t\t\t\t:modelValue=\"selectedOption\"\n\t\t\t\t:options=\"options\"\n\t\t\t\t:loading=\"loading\"\n\t\t\t\t:clearable=\"clearable\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:filterable=\"false\"\n\t\t\t\tlabel=\"label\"\n\t\t\t\t@search=\"onSearch\"\n\t\t\t\t@update:modelValue=\"onPick\" />\n\t\t\t<p v-if=\"reason\" class=\"cn-property-source-field__reason\" data-testid=\"cn-property-source-reason\">\n\t\t\t\t{{ reason }}\n\t\t\t</p>\n\t\t</template>\n\t\t<p\n\t\t\tv-if=\"provenanceLine\"\n\t\t\tclass=\"cn-property-source-field__provenance\"\n\t\t\tdata-testid=\"cn-property-source-provenance\">\n\t\t\t{{ provenanceLine }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { NcSelect, NcTextField } from '@nextcloud/vue'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\nimport { userLocale } from '../../utils/userLocale.js'\n\nconst BASE = '/apps/integriq/api/property-sources'\n\n/**\n * CnPropertySourceField — a type-ahead over a registry (integriq\n * `registry-field-source`) for a schema property that declares\n * `x-openregister-property-source`.\n *\n * From `minChars` typed characters it asks the provider for suggestions; on a\n * pick it resolves the identifier and only then sets the value (the\n * identifier). `resolved` carries the answer so a form can fill sibling\n * fields. Without integriq, an unknown provider, a missing permission or an\n * unreachable source the field turns into a plain text input with a one-line\n * reason, and the form still saves.\n *\n * Example:\n * ```vue\n * <CnPropertySourceField provider=\"kvk\" input-label=\"KvK number\"\n * :model-value=\"kvk\" @update:modelValue=\"kvk = $event\" @resolved=\"onResolved\" />\n * ```\n */\nexport default {\n\tname: 'CnPropertySourceField',\n\n\tcomponents: { NcSelect, NcTextField },\n\n\tprops: {\n\t\t/** Registry provider id, e.g. `kvk`, `bag` or `brp`. */\n\t\tprovider: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Stored identifier (v-model). */\n\t\tmodelValue: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Declaration mode: `live` reads the source where it is shown, `default` is a one-off copy. */\n\t\tmode: {\n\t\t\ttype: String,\n\t\t\tdefault: 'live',\n\t\t},\n\n\t\t/** Accessible label of the field. */\n\t\tinputLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** DOM id of the input. */\n\t\tinputId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Placeholder text. */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Whether the value can be cleared. */\n\t\tclearable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Disable the field. */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Show the field in its error state. */\n\t\terror: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Characters needed before the first suggest request. */\n\t\tminChars: {\n\t\t\ttype: Number,\n\t\t\tdefault: 3,\n\t\t},\n\n\t\t/** Milliseconds to wait after typing before suggesting. */\n\t\tdebounce: {\n\t\t\ttype: Number,\n\t\t\tdefault: 300,\n\t\t},\n\n\t\t/** Human name of the provider for the provenance line; defaults to the provider id. */\n\t\tproviderLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['update:modelValue', 'resolved'],\n\n\tdata() {\n\t\treturn {\n\t\t\toptions: [],\n\t\t\tloading: false,\n\t\t\tselected: null,\n\t\t\tplain: !isAppInstalled('integriq'),\n\t\t\treason: isAppInstalled('integriq') ? '' : t('nextcloud-vue', 'Registry lookup is not available on this server.'),\n\t\t\tprovenance: null,\n\t\t\ttimer: null,\n\t\t\tseq: 0,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tselectedOption() {\n\t\t\tif (this.selected && String(this.selected.identifier) === String(this.modelValue)) {\n\t\t\t\treturn this.selected\n\t\t\t}\n\t\t\tif (this.modelValue === '' || this.modelValue === null || this.modelValue === undefined) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn { identifier: String(this.modelValue), label: String(this.modelValue) }\n\t\t},\n\n\t\tprovenanceLine() {\n\t\t\tconst p = this.provenance\n\t\t\tif (!p) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst name = this.providerLabel || p.provider || this.provider\n\t\t\tlet line = p.readAt\n\t\t\t\t? t('nextcloud-vue', 'From {provider}, read {time}', { provider: name, time: this.formatTime(p.readAt) })\n\t\t\t\t: t('nextcloud-vue', 'From {provider}', { provider: name })\n\t\t\tif (p.unreachable) {\n\t\t\t\tline += '. ' + t('nextcloud-vue', 'Source unreachable.')\n\t\t\t} else if (p.origin === 'cache') {\n\t\t\t\tline += '. ' + t('nextcloud-vue', 'From cache.')\n\t\t\t}\n\t\t\treturn line\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Live mode on an existing record: resolve the stored identifier once to show label and provenance.\n\t\tif (!this.plain && this.mode === 'live' && this.modelValue !== '' && this.modelValue !== null && this.modelValue !== undefined) {\n\t\t\tthis.resolve(String(this.modelValue)).then((res) => {\n\t\t\t\tif (res) {\n\t\t\t\t\tthis.provenance = res.provenance || null\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t},\n\n\tbeforeUnmount() {\n\t\tclearTimeout(this.timer)\n\t},\n\n\tmethods: {\n\t\tformatTime(iso) {\n\t\t\tconst d = new Date(iso)\n\t\t\treturn Number.isNaN(d.getTime()) ? String(iso) : d.toLocaleString(userLocale())\n\t\t},\n\n\t\turl(path) {\n\t\t\treturn generateUrl(`${BASE}/${encodeURIComponent(this.provider)}/${path}`)\n\t\t},\n\n\t\tdegrade(reason) {\n\t\t\tthis.plain = true\n\t\t\tthis.reason = reason\n\t\t\tthis.options = []\n\t\t},\n\n\t\tonPlainInput(value) {\n\t\t\t/** @event update:modelValue Emitted with the identifier (or typed text in plain mode). */\n\t\t\tthis.$emit('update:modelValue', value)\n\t\t},\n\n\t\tonSearch(query) {\n\t\t\tclearTimeout(this.timer)\n\t\t\tif (typeof query !== 'string' || query.trim().length < this.minChars) {\n\t\t\t\tthis.options = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.timer = setTimeout(() => this.suggest(query.trim()), this.debounce)\n\t\t},\n\n\t\tasync suggest(q) {\n\t\t\tconst seq = ++this.seq\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\tconst res = await axios.get(this.url('suggest'), { params: { q } })\n\t\t\t\tif (seq !== this.seq) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst results = (res && res.data && Array.isArray(res.data.results)) ? res.data.results : []\n\t\t\t\tthis.options = results.map((r) => ({ ...r, label: String(r.label ?? r.identifier) }))\n\t\t\t} catch (err) {\n\t\t\t\tconst status = err && err.response && err.response.status\n\t\t\t\tif (status === 404) {\n\t\t\t\t\tthis.degrade(t('nextcloud-vue', 'The registry \"{provider}\" is not available.', { provider: this.providerLabel || this.provider }))\n\t\t\t\t} else if (status === 401 || status === 403) {\n\t\t\t\t\tthis.degrade(t('nextcloud-vue', 'You cannot look this up.'))\n\t\t\t\t} else {\n\t\t\t\t\tthis.degrade(t('nextcloud-vue', 'The source did not answer; type the value.'))\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (seq === this.seq) {\n\t\t\t\t\tthis.loading = false\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tasync resolve(identifier) {\n\t\t\ttry {\n\t\t\t\tconst res = await axios.get(this.url('resolve'), { params: { identifier } })\n\t\t\t\treturn (res && res.data) || null\n\t\t\t} catch (err) {\n\t\t\t\tconst status = err && err.response && err.response.status\n\t\t\t\tthis.reason = (status === 401 || status === 403)\n\t\t\t\t\t? t('nextcloud-vue', 'You cannot look this up.')\n\t\t\t\t\t: (status === 404\n\t\t\t\t\t\t\t? t('nextcloud-vue', 'The registry \"{provider}\" is not available.', { provider: this.providerLabel || this.provider })\n\t\t\t\t\t\t\t: t('nextcloud-vue', 'The source did not answer; type the value.'))\n\t\t\t\treturn null\n\t\t\t}\n\t\t},\n\n\t\tasync onPick(option) {\n\t\t\tthis.reason = ''\n\t\t\tif (!option) {\n\t\t\t\tthis.selected = null\n\t\t\t\tthis.provenance = null\n\t\t\t\tthis.$emit('update:modelValue', '')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst identifier = String(option.identifier)\n\t\t\tthis.selected = option\n\t\t\tconst answer = await this.resolve(identifier)\n\t\t\t// The identifier is kept even when the resolve fails: the user picked it.\n\t\t\tthis.$emit('update:modelValue', identifier)\n\t\t\tif (!answer) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.provenance = answer.provenance || null\n\t\t\tif (answer.provenance && answer.provenance.unreachable && (answer.value === undefined || answer.value === null)) {\n\t\t\t\tthis.reason = t('nextcloud-vue', 'The source did not answer; type the value.')\n\t\t\t\treturn\n\t\t\t}\n\t\t\t/**\n\t\t\t * @event resolved Emitted after a successful resolve of a pick.\n\t\t\t * @type {{identifier: string, value: *, provenance: object|null}}\n\t\t\t */\n\t\t\tthis.$emit('resolved', { identifier, value: answer.value, provenance: answer.provenance || null })\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-property-source-field__reason,\n.cn-property-source-field__provenance {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: var(--default-font-size);\n}\n</style>\n"],"names":["t","axios"],"mappings":";;;;;;;AAiDA,MAAM,OAAO,sCAAoC;;AAEjD;;;AAGC;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAED,aAAe;CACd,IAAI,EAAE,uBAAuB;;AAE7B,CAAA,UAAU,EAAE,EAAE,QAAQ,EAAE,aAAa;;AAErC,CAAA,KAAK,EAAE;;AAEN,EAAA,QAAQ,EAAE;GACT,IAAI,EAAE,MAAM;GACZ,QAAQ,EAAE,IAAI;GACd;;AAED;EACA,UAAU,EAAE;AACX,GAAA,IAAI,EAAE,CA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