@nivaro/react 0.3.113 → 0.3.115
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/components/ScreenShareHost.js +24 -0
- package/dist/full.css +50 -2
- package/dist/hooks/useSessionRecorder.js +61 -60
- package/dist/index.d.ts +1727 -19
- package/dist/index.js +1091 -950
- package/dist/shared/components/ActivityEntry.js +209 -97
- package/dist/shared/components/AgentPresenceChip.js +51 -0
- package/dist/shared/components/AnnouncementBanner.js +56 -41
- package/dist/shared/components/AutolinkedText.js +98 -85
- package/dist/shared/components/BroadcastView.js +149 -141
- package/dist/shared/components/CacheStamp.js +78 -30
- package/dist/shared/components/CollectionBrowserView.js +4088 -3592
- package/dist/shared/components/ConfigChangeStrip.js +63 -0
- package/dist/shared/components/ConfigReachNote.js +107 -0
- package/dist/shared/components/ConformanceView.js +389 -319
- package/dist/shared/components/DataTable.js +544 -504
- package/dist/shared/components/DelegateCoverLine.js +164 -0
- package/dist/shared/components/EnvironmentNotice.js +56 -65
- package/dist/shared/components/FilePreviewLightbox.js +89 -43
- package/dist/shared/components/FindingFixedMark.js +23 -0
- package/dist/shared/components/GridPresenceLine.js +100 -0
- package/dist/shared/components/IdleReloadWatcher.js +82 -43
- package/dist/shared/components/InStep.js +46 -0
- package/dist/shared/components/ItemEditForm.js +5504 -4889
- package/dist/shared/components/LiveAnnouncer.js +62 -0
- package/dist/shared/components/LiveCount.js +54 -0
- package/dist/shared/components/LiveFigure.js +28 -0
- package/dist/shared/components/LiveListControls.js +114 -0
- package/dist/shared/components/LiveNewMatchesPill.js +25 -0
- package/dist/shared/components/LiveOffNote.js +44 -0
- package/dist/shared/components/LivePreferenceHost.js +42 -0
- package/dist/shared/components/LiveRowMark.js +25 -20
- package/dist/shared/components/LiveTraceView.js +257 -0
- package/dist/shared/components/MapView.js +30 -29
- package/dist/shared/components/MatrixEditor.js +497 -462
- package/dist/shared/components/MyWorkView.js +346 -272
- package/dist/shared/components/NotificationBell.js +215 -201
- package/dist/shared/components/PageRenderer.js +636 -599
- package/dist/shared/components/PresenceDot.js +21 -0
- package/dist/shared/components/ProfileView.js +656 -536
- package/dist/shared/components/RealtimeStatusBanner.js +25 -25
- package/dist/shared/components/RecentRecordsRail.js +51 -48
- package/dist/shared/components/RecordCompare.js +241 -150
- package/dist/shared/components/RecordDrilldownSheet.js +66 -64
- package/dist/shared/components/RecordGridEditor.js +350 -311
- package/dist/shared/components/RecordHoverCard.js +147 -0
- package/dist/shared/components/RecordPeekHost.js +111 -0
- package/dist/shared/components/RecordReadView.js +414 -412
- package/dist/shared/components/RelativeTime.js +16 -0
- package/dist/shared/components/ReportView.js +1396 -1304
- package/dist/shared/components/ScreenRefreshButton.js +77 -0
- package/dist/shared/components/TabCountHost.js +10 -0
- package/dist/shared/components/TickerNumber.js +19 -18
- package/dist/shared/components/TipLayer.js +70 -58
- package/dist/shared/components/WidgetImageMenu.js +59 -0
- package/dist/shared/components/WidgetSlot.js +571 -524
- package/dist/shared/components/activity/RecordActivityStream.js +317 -0
- package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
- package/dist/shared/components/cbv/approval-changed.js +20 -0
- package/dist/shared/components/cbv/changed-by-others.js +251 -0
- package/dist/shared/components/cbv/column-totals.js +75 -67
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
- package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
- package/dist/shared/components/change-proposals/types.js +4 -0
- package/dist/shared/components/chat/ChatPanel.js +1571 -1528
- package/dist/shared/components/chat/Composer.js +276 -298
- package/dist/shared/components/chat/room-due.js +13 -0
- package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
- package/dist/shared/components/collections-directory/directory-data.js +75 -63
- package/dist/shared/components/imports/ImportConsole.js +159 -155
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
- package/dist/shared/components/integrations/SendStatus.js +202 -0
- package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
- package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
- package/dist/shared/components/integrations/console/api.js +161 -117
- package/dist/shared/components/integrations/console/tone.js +15 -12
- package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
- package/dist/shared/components/item-edit/CloneDialog.js +208 -206
- package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
- package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
- package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
- package/dist/shared/components/item-edit/FieldComments.js +159 -116
- package/dist/shared/components/item-edit/FieldPointer.js +132 -0
- package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
- package/dist/shared/components/item-edit/FieldRow.js +519 -439
- package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
- package/dist/shared/components/item-edit/FilePickerField.js +454 -369
- package/dist/shared/components/item-edit/GroupSection.js +618 -567
- package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
- package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
- package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
- package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
- package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
- package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
- package/dist/shared/components/item-edit/PickerBadges.js +52 -0
- package/dist/shared/components/item-edit/PlanGrid.js +434 -439
- package/dist/shared/components/item-edit/RecalcValue.js +55 -0
- package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
- package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
- package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
- package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
- package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
- package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
- package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
- package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
- package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
- package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
- package/dist/shared/components/item-edit/SectionPresence.js +78 -0
- package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
- package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
- package/dist/shared/components/item-edit/coedit/collab.js +84 -0
- package/dist/shared/components/item-edit/coedit/context.js +24 -0
- package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
- package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
- package/dist/shared/components/item-edit/coedit/session.js +382 -0
- package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
- package/dist/shared/components/item-edit/file-live.js +77 -0
- package/dist/shared/components/item-edit/file-processing.js +87 -0
- package/dist/shared/components/item-edit/layout-switch.js +148 -0
- package/dist/shared/components/item-edit/live-related.js +23 -0
- package/dist/shared/components/item-edit/live-title.js +66 -0
- package/dist/shared/components/item-edit/partner-needs.js +142 -0
- package/dist/shared/components/item-edit/removed-line.js +58 -0
- package/dist/shared/components/item-edit/render-stability.js +70 -59
- package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
- package/dist/shared/components/layout-editor/CollabParts.js +72 -70
- package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
- package/dist/shared/components/list/InlineEdit.js +504 -208
- package/dist/shared/components/list/ListViewers.js +81 -0
- package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
- package/dist/shared/components/merge/MergeWithFlow.js +290 -0
- package/dist/shared/components/merge/merge-values.js +110 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
- package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
- package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
- package/dist/shared/components/notifications/bundles.js +21 -19
- package/dist/shared/components/notifications/resolved-line.js +25 -0
- package/dist/shared/components/ops/OpsTasksView.js +45 -44
- package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
- package/dist/shared/components/panels/AlertBanners.js +132 -0
- package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
- package/dist/shared/components/panels/BranchLanes.js +82 -54
- package/dist/shared/components/panels/CommentAwareness.js +332 -0
- package/dist/shared/components/panels/CommentImages.js +219 -0
- package/dist/shared/components/panels/CommentPanel.js +649 -530
- package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
- package/dist/shared/components/panels/NewSinceChip.js +16 -0
- package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
- package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
- package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
- package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
- package/dist/shared/components/panels/SlaClock.js +130 -99
- package/dist/shared/components/panels/TaskPanel.js +308 -287
- package/dist/shared/components/panels/unseen-move-check.js +101 -0
- package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
- package/dist/shared/components/profile/AgentNameField.js +141 -0
- package/dist/shared/components/profile/AgentsPanel.js +55 -46
- package/dist/shared/components/profile/PersonAccess.js +398 -330
- package/dist/shared/components/profile/PersonAdminTools.js +127 -113
- package/dist/shared/components/profile/PersonProfile.js +81 -73
- package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
- package/dist/shared/components/queue/QueueBulkBar.js +101 -84
- package/dist/shared/components/queue/QueueItemSheet.js +66 -66
- package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
- package/dist/shared/components/queue/QueueWorklist.js +2076 -1686
- package/dist/shared/components/queue/queue-totals.js +92 -0
- package/dist/shared/components/queue/worklist-helpers.js +18 -14
- package/dist/shared/components/send-view/SendViewButton.js +136 -0
- package/dist/shared/components/send-view/SentViewCards.js +147 -0
- package/dist/shared/components/support/ReportProblem.js +1 -0
- package/dist/shared/components/support/ScreenShare.js +554 -0
- package/dist/shared/components/support/SupportView.js +160 -129
- package/dist/shared/components/support/TicketDetailSheet.js +101 -89
- package/dist/shared/components/watch-list/WatchDock.js +1044 -0
- package/dist/shared/components/watch-list/WatchExtras.js +723 -0
- package/dist/shared/components/watch-list/WatchListButton.js +46 -0
- package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
- package/dist/shared/components/watch-list/WatchRows.js +348 -0
- package/dist/shared/lib/activity-sentence.js +87 -75
- package/dist/shared/lib/agent-presence.js +46 -0
- package/dist/shared/lib/approval-progress.js +49 -0
- package/dist/shared/lib/attention-prefs.js +27 -0
- package/dist/shared/lib/cell-locks.js +56 -0
- package/dist/shared/lib/co-edit.js +166 -0
- package/dist/shared/lib/coedit-registry.js +44 -0
- package/dist/shared/lib/comment-awareness.js +124 -0
- package/dist/shared/lib/comment-images.js +45 -0
- package/dist/shared/lib/config-watch.js +94 -0
- package/dist/shared/lib/copy-rules.js +65 -0
- package/dist/shared/lib/count-step.js +30 -0
- package/dist/shared/lib/deadline-ticker.js +68 -0
- package/dist/shared/lib/derived-causes.js +115 -0
- package/dist/shared/lib/draft-store.js +114 -85
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/field-merge.js +126 -0
- package/dist/shared/lib/filter-sentence.js +10 -10
- package/dist/shared/lib/focus-mode.js +16 -12
- package/dist/shared/lib/grid-cursors.js +77 -0
- package/dist/shared/lib/grid-presence.js +182 -0
- package/dist/shared/lib/idle-reload.js +100 -73
- package/dist/shared/lib/in-step.js +45 -0
- package/dist/shared/lib/integration-chip.js +19 -18
- package/dist/shared/lib/line-locks.js +141 -0
- package/dist/shared/lib/line-split.js +41 -0
- package/dist/shared/lib/linked-changes.js +150 -0
- package/dist/shared/lib/list-link.js +56 -50
- package/dist/shared/lib/list-return.js +231 -0
- package/dist/shared/lib/list-viewers.js +52 -0
- package/dist/shared/lib/live-announcer.js +86 -0
- package/dist/shared/lib/live-counts.js +85 -0
- package/dist/shared/lib/live-data-changed.js +108 -0
- package/dist/shared/lib/live-deltas.js +81 -0
- package/dist/shared/lib/live-findings.js +113 -0
- package/dist/shared/lib/live-groups.js +122 -0
- package/dist/shared/lib/live-link-labels.js +162 -0
- package/dist/shared/lib/live-list-flow.js +334 -0
- package/dist/shared/lib/live-list.js +143 -129
- package/dist/shared/lib/live-moves.js +51 -0
- package/dist/shared/lib/live-ops.js +26 -26
- package/dist/shared/lib/live-pickers.js +7 -0
- package/dist/shared/lib/live-preference.js +184 -0
- package/dist/shared/lib/live-queries.js +226 -181
- package/dist/shared/lib/live-screen.js +333 -0
- package/dist/shared/lib/live-search.js +108 -0
- package/dist/shared/lib/live-seen.js +35 -0
- package/dist/shared/lib/live-views.js +100 -0
- package/dist/shared/lib/live.js +159 -133
- package/dist/shared/lib/missed-updates.js +198 -0
- package/dist/shared/lib/newer-file.js +56 -0
- package/dist/shared/lib/notification-sound.js +42 -20
- package/dist/shared/lib/own-writes.js +59 -41
- package/dist/shared/lib/picker-badges.js +94 -0
- package/dist/shared/lib/presence-signals.js +131 -84
- package/dist/shared/lib/realtime.js +49 -24
- package/dist/shared/lib/record-gaps.js +85 -0
- package/dist/shared/lib/record-outbox.js +369 -222
- package/dist/shared/lib/record-peek.js +75 -0
- package/dist/shared/lib/record-tabs.js +92 -72
- package/dist/shared/lib/relative-ticker.js +42 -0
- package/dist/shared/lib/request-gate.js +119 -119
- package/dist/shared/lib/rollup-recalc.js +107 -0
- package/dist/shared/lib/room-gaps.js +40 -36
- package/dist/shared/lib/rum.js +137 -87
- package/dist/shared/lib/save-progress.js +20 -0
- package/dist/shared/lib/scheduled-countdown.js +67 -0
- package/dist/shared/lib/screen-refresh.js +160 -0
- package/dist/shared/lib/screen-share.js +234 -0
- package/dist/shared/lib/seen-since.js +74 -0
- package/dist/shared/lib/selection-watch.js +205 -0
- package/dist/shared/lib/send-status.js +132 -0
- package/dist/shared/lib/send-view.js +23 -0
- package/dist/shared/lib/socket-liveness.js +155 -0
- package/dist/shared/lib/socket-realtime.js +168 -140
- package/dist/shared/lib/state-census.js +53 -0
- package/dist/shared/lib/summary-mode.js +61 -39
- package/dist/shared/lib/tab-attention.js +143 -32
- package/dist/shared/lib/table-density.js +64 -0
- package/dist/shared/lib/track-travel.js +40 -0
- package/dist/shared/lib/unseen-changes.js +68 -0
- package/dist/shared/lib/upload-file.js +33 -0
- package/dist/shared/lib/upload-presence.js +127 -0
- package/dist/shared/lib/urgent-chime.js +65 -0
- package/dist/shared/lib/use-online-users.js +32 -11
- package/dist/shared/lib/user-sync.js +155 -39
- package/dist/shared/lib/waiting-count.js +44 -0
- package/dist/shared/lib/watch-desktop.js +83 -0
- package/dist/shared/lib/watch-list.js +447 -0
- package/dist/shared/lib/widget-image-render.js +64 -0
- package/dist/shared/lib/widget-image.js +111 -0
- package/dist/shared/lib/worker-socket.js +130 -104
- package/dist/shared/lib/write-to-screen.js +133 -0
- package/package.json +1 -1
- package/styles.css +49 -1
|
@@ -1,28 +1,33 @@
|
|
|
1
|
-
import { jsxs as n, jsx as t, Fragment as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { ClipboardList as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as O, useItemEditAuth as
|
|
7
|
-
import { get as
|
|
8
|
-
import { OPEN_TASK_STATUSES as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { jsxs as n, jsx as t, Fragment as Ie } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as Le, useQuery as F, useMutation as K } from "@tanstack/react-query";
|
|
3
|
+
import { ClipboardList as We, ChevronDown as me, X as te, Plus as Oe, Bot as je, Users as Ue, History as Ke, Pencil as Me, RotateCcw as Re, ChevronsUpDown as be, Check as He } from "lucide-react";
|
|
4
|
+
import { useState as P, useMemo as ke, useEffect as ue } from "react";
|
|
5
|
+
import { toast as w } from "sonner";
|
|
6
|
+
import { useNivaroClient as O, useItemEditAuth as Be } from "../../context.js";
|
|
7
|
+
import { get as D, post as Z, patch as Ve, del as ze } from "../../lib/commands.js";
|
|
8
|
+
import { OPEN_TASK_STATUSES as pe, invalidateRecordTasks as Ge } from "../../lib/record-tasks.js";
|
|
9
|
+
import { useNewSince as Je } from "../../lib/seen-since.js";
|
|
10
|
+
import { usePresenceStates as Xe } from "../../lib/use-online-users.js";
|
|
11
|
+
import { useStartsOpen as Qe } from "../../lib/use-starts-open.js";
|
|
12
|
+
import { formatDate as ee, cn as M, formatDateTime as ye } from "../../lib/utils.js";
|
|
13
|
+
import { TaskDoButton as Ye } from "../ai/TaskDo.js";
|
|
14
|
+
import { PresenceDot as Ze } from "../PresenceDot.js";
|
|
15
|
+
import { RelativeTime as Ne } from "../RelativeTime.js";
|
|
12
16
|
import { Button as V } from "../ui/button.js";
|
|
13
|
-
import { Checkbox as
|
|
14
|
-
import { Command as
|
|
15
|
-
import { Input as
|
|
17
|
+
import { Checkbox as he } from "../ui/checkbox.js";
|
|
18
|
+
import { Command as ve, CommandInput as _e, CommandList as we, CommandEmpty as Ce, CommandGroup as ae, CommandItem as Se } from "../ui/command.js";
|
|
19
|
+
import { Input as ne } from "../ui/input.js";
|
|
16
20
|
import { Label as W } from "../ui/label.js";
|
|
17
|
-
import { Popover as
|
|
21
|
+
import { Popover as Pe, PopoverTrigger as $e, PopoverContent as qe } from "../ui/popover.js";
|
|
18
22
|
import { SimpleSelect as G } from "../ui/SimpleSelect.js";
|
|
19
|
-
import { Textarea as
|
|
20
|
-
|
|
23
|
+
import { Textarea as et } from "../ui/textarea.js";
|
|
24
|
+
import { NewSinceChip as tt } from "./NewSinceChip.js";
|
|
25
|
+
const at = "id,first_name,last_name,email,is_out_of_office,ooo_end,delegate_id";
|
|
21
26
|
function z(a) {
|
|
22
27
|
return a && ([a.first_name, a.last_name].filter(Boolean).join(" ") || a.email) || "Unknown";
|
|
23
28
|
}
|
|
24
|
-
const
|
|
25
|
-
function
|
|
29
|
+
const E = (a, o) => a != null && o != null && String(a).toUpperCase() === String(o).toUpperCase();
|
|
30
|
+
function Te(a) {
|
|
26
31
|
if (!a) return [];
|
|
27
32
|
try {
|
|
28
33
|
const o = JSON.parse(a);
|
|
@@ -31,13 +36,13 @@ function Se(a) {
|
|
|
31
36
|
return [];
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
|
-
function
|
|
39
|
+
function nt(a, o) {
|
|
35
40
|
return a.map((d) => {
|
|
36
41
|
const m = o.get(d.field) ?? d.field.replace(/_/g, " ");
|
|
37
42
|
return d.op === "nnull" ? `${m} is filled in` : d.op === "eq" ? `${m} is ${String(d.value ?? "")}` : d.op === "null" ? `${m} is empty` : `${m} ${d.op} ${String(d.value ?? "")}`.trim();
|
|
38
43
|
}).join(" and ");
|
|
39
44
|
}
|
|
40
|
-
function
|
|
45
|
+
function ge({ priority: a }) {
|
|
41
46
|
return !a || a === "normal" ? null : /* @__PURE__ */ t(
|
|
42
47
|
"span",
|
|
43
48
|
{
|
|
@@ -46,102 +51,103 @@ function ue({ priority: a }) {
|
|
|
46
51
|
}
|
|
47
52
|
);
|
|
48
53
|
}
|
|
49
|
-
function
|
|
54
|
+
function st({
|
|
50
55
|
collection: a,
|
|
51
56
|
item: o,
|
|
52
57
|
value: d,
|
|
53
58
|
valueLabel: m,
|
|
54
|
-
onChange:
|
|
59
|
+
onChange: l
|
|
55
60
|
}) {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
return () => clearTimeout(
|
|
61
|
+
const p = O(), [g, c] = P(!1), [h, r] = P(""), [f, b] = P("");
|
|
62
|
+
ue(() => {
|
|
63
|
+
const i = setTimeout(() => b(h.trim()), 250);
|
|
64
|
+
return () => clearTimeout(i);
|
|
60
65
|
}, [h]);
|
|
61
|
-
const
|
|
66
|
+
const I = F({
|
|
62
67
|
queryKey: ["task-people", a, o],
|
|
63
|
-
queryFn: () =>
|
|
64
|
-
enabled:
|
|
68
|
+
queryFn: () => p.request(D("/tasks/people", { collection: a, item: o })).then((i) => i.data).catch(() => []),
|
|
69
|
+
enabled: g && !!o && o !== "new",
|
|
65
70
|
staleTime: 6e4
|
|
66
|
-
}),
|
|
67
|
-
queryKey: ["task-people-search",
|
|
68
|
-
queryFn: () =>
|
|
69
|
-
|
|
71
|
+
}), $ = F({
|
|
72
|
+
queryKey: ["task-people-search", f],
|
|
73
|
+
queryFn: () => p.request(
|
|
74
|
+
D("/users", {
|
|
70
75
|
limit: 25,
|
|
71
76
|
people: 1,
|
|
72
|
-
fields:
|
|
73
|
-
...
|
|
77
|
+
fields: at,
|
|
78
|
+
...f ? { search: f } : {}
|
|
74
79
|
})
|
|
75
|
-
).then((
|
|
76
|
-
enabled:
|
|
80
|
+
).then((i) => i.data).catch(() => []),
|
|
81
|
+
enabled: g,
|
|
77
82
|
staleTime: 6e4
|
|
78
|
-
}), N =
|
|
79
|
-
(
|
|
80
|
-
),
|
|
81
|
-
|
|
82
|
-
y((
|
|
83
|
-
}, [
|
|
84
|
-
const { data: j } =
|
|
85
|
-
queryKey: ["task-open-counts",
|
|
86
|
-
queryFn: () =>
|
|
87
|
-
|
|
88
|
-
).then((
|
|
89
|
-
enabled:
|
|
83
|
+
}), N = I.data ?? [], q = new Set(N.map((i) => String(i.id).toUpperCase())), T = f.toLowerCase(), s = N.filter(
|
|
84
|
+
(i) => !T || `${z(i)} ${i.email ?? ""}`.toLowerCase().includes(T)
|
|
85
|
+
), x = ($.data ?? []).filter((i) => !q.has(String(i.id).toUpperCase())), k = [...s, ...x].map((i) => i.id), [J, y] = P(""), L = k.join(",");
|
|
86
|
+
ue(() => {
|
|
87
|
+
y((i) => k.includes(i) ? i : k[0] ?? "");
|
|
88
|
+
}, [L]);
|
|
89
|
+
const { data: j } = F({
|
|
90
|
+
queryKey: ["task-open-counts", k.join(",")],
|
|
91
|
+
queryFn: () => p.request(
|
|
92
|
+
D("/tasks/open-counts", { ids: k.join(",") })
|
|
93
|
+
).then((i) => i.data).catch(() => ({})),
|
|
94
|
+
enabled: g && k.length > 0,
|
|
90
95
|
staleTime: 6e4
|
|
91
|
-
}),
|
|
92
|
-
const
|
|
96
|
+
}), X = Xe(g), R = (i, _) => {
|
|
97
|
+
const C = (j == null ? void 0 : j[String(i.id).toUpperCase()]) ?? 0;
|
|
93
98
|
return /* @__PURE__ */ n(
|
|
94
|
-
|
|
99
|
+
Se,
|
|
95
100
|
{
|
|
96
|
-
value:
|
|
101
|
+
value: i.id,
|
|
97
102
|
onSelect: () => {
|
|
98
|
-
|
|
103
|
+
l(E(i.id, d) ? null : i.id, E(i.id, d) ? null : i), c(!1);
|
|
99
104
|
},
|
|
100
105
|
className: "text-[12px]",
|
|
101
|
-
"data-task-person":
|
|
106
|
+
"data-task-person": i.id,
|
|
102
107
|
children: [
|
|
103
108
|
/* @__PURE__ */ t(
|
|
104
|
-
|
|
109
|
+
He,
|
|
105
110
|
{
|
|
106
|
-
className: M("mr-2 h-3.5 w-3.5",
|
|
111
|
+
className: M("mr-2 h-3.5 w-3.5", E(d, i.id) ? "opacity-100" : "opacity-0")
|
|
107
112
|
}
|
|
108
113
|
),
|
|
114
|
+
/* @__PURE__ */ t(Ze, { state: X.get(String(i.id).toUpperCase()), className: "mr-1.5" }),
|
|
109
115
|
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate", children: [
|
|
110
|
-
z(
|
|
111
|
-
|
|
116
|
+
z(i),
|
|
117
|
+
_ != null && _.length ? /* @__PURE__ */ t("span", { className: "ml-1.5 text-[10.5px] text-muted-foreground", children: _.join(", ") }) : null
|
|
112
118
|
] }),
|
|
113
|
-
|
|
114
|
-
|
|
119
|
+
i.is_out_of_office ? /* @__PURE__ */ t("span", { className: "ml-2 shrink-0 text-[10px] text-amber-600 dark:text-amber-400", children: "out" }) : null,
|
|
120
|
+
C > 0 && /* @__PURE__ */ t(
|
|
115
121
|
"span",
|
|
116
122
|
{
|
|
117
123
|
className: "ml-2 shrink-0 rounded-full bg-slate-100 px-1.5 text-[10px] font-semibold tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400",
|
|
118
|
-
title: `${
|
|
119
|
-
children:
|
|
124
|
+
title: `${C} open task${C === 1 ? "" : "s"} already assigned`,
|
|
125
|
+
children: C
|
|
120
126
|
}
|
|
121
127
|
)
|
|
122
128
|
]
|
|
123
129
|
},
|
|
124
|
-
|
|
130
|
+
i.id
|
|
125
131
|
);
|
|
126
132
|
};
|
|
127
|
-
return /* @__PURE__ */ n(
|
|
128
|
-
/* @__PURE__ */ t(
|
|
133
|
+
return /* @__PURE__ */ n(Pe, { open: g, onOpenChange: c, children: [
|
|
134
|
+
/* @__PURE__ */ t($e, { asChild: !0, children: /* @__PURE__ */ n(
|
|
129
135
|
V,
|
|
130
136
|
{
|
|
131
137
|
variant: "outline",
|
|
132
138
|
role: "combobox",
|
|
133
|
-
"aria-expanded":
|
|
139
|
+
"aria-expanded": g,
|
|
134
140
|
"data-task-assignee-picker": !0,
|
|
135
141
|
className: "h-8 w-full justify-between px-2.5 text-[12px] font-normal",
|
|
136
142
|
children: [
|
|
137
143
|
/* @__PURE__ */ t("span", { className: M("truncate", !d && "text-muted-foreground"), children: d ? m ?? "Selected" : "Assign to…" }),
|
|
138
|
-
/* @__PURE__ */ t(
|
|
144
|
+
/* @__PURE__ */ t(be, { className: "ml-1 h-3.5 w-3.5 shrink-0 opacity-50" })
|
|
139
145
|
]
|
|
140
146
|
}
|
|
141
147
|
) }),
|
|
142
|
-
/* @__PURE__ */ t(
|
|
148
|
+
/* @__PURE__ */ t(qe, { className: "w-[300px] p-0", align: "start", children: /* @__PURE__ */ n(ve, { shouldFilter: !1, value: J, onValueChange: y, children: [
|
|
143
149
|
/* @__PURE__ */ t(
|
|
144
|
-
|
|
150
|
+
_e,
|
|
145
151
|
{
|
|
146
152
|
placeholder: "Search people…",
|
|
147
153
|
className: "h-8 text-[12px]",
|
|
@@ -149,24 +155,24 @@ function Qe({
|
|
|
149
155
|
onValueChange: r
|
|
150
156
|
}
|
|
151
157
|
),
|
|
152
|
-
/* @__PURE__ */ n(
|
|
153
|
-
/* @__PURE__ */ t(
|
|
154
|
-
|
|
155
|
-
|
|
158
|
+
/* @__PURE__ */ n(we, { children: [
|
|
159
|
+
/* @__PURE__ */ t(Ce, { className: "py-3 text-center text-[12px] text-muted-foreground", children: $.isFetching ? "Searching…" : "No one matches" }),
|
|
160
|
+
s.length > 0 && /* @__PURE__ */ t(ae, { heading: "On this record", children: s.map((i) => R(i, i.reasons)) }),
|
|
161
|
+
x.length > 0 && /* @__PURE__ */ t(ae, { heading: f ? "Everyone" : "Everyone (type to search)", children: x.map((i) => R(i)) })
|
|
156
162
|
] })
|
|
157
163
|
] }) })
|
|
158
164
|
] });
|
|
159
165
|
}
|
|
160
|
-
function
|
|
166
|
+
function lt(a) {
|
|
161
167
|
const o = O();
|
|
162
|
-
return
|
|
168
|
+
return F({
|
|
163
169
|
queryKey: ["task-agents"],
|
|
164
|
-
queryFn: () => o.request(
|
|
170
|
+
queryFn: () => o.request(D("/tasks/agents")).then((d) => d.data ?? []).catch(() => []),
|
|
165
171
|
enabled: a,
|
|
166
172
|
staleTime: 5 * 6e4
|
|
167
173
|
});
|
|
168
174
|
}
|
|
169
|
-
function
|
|
175
|
+
function rt({
|
|
170
176
|
agents: a,
|
|
171
177
|
value: o,
|
|
172
178
|
onChange: d
|
|
@@ -175,7 +181,7 @@ function Ze({
|
|
|
175
181
|
G,
|
|
176
182
|
{
|
|
177
183
|
value: o ?? "",
|
|
178
|
-
onChange: (m) => d(a.find((
|
|
184
|
+
onChange: (m) => d(a.find((l) => l.conn === m) ?? null),
|
|
179
185
|
ariaLabel: "Agent",
|
|
180
186
|
options: [
|
|
181
187
|
{ value: "", label: a.length ? "Choose an agent…" : "No agents connected" },
|
|
@@ -187,90 +193,90 @@ function Ze({
|
|
|
187
193
|
}
|
|
188
194
|
);
|
|
189
195
|
}
|
|
190
|
-
function
|
|
196
|
+
function it({
|
|
191
197
|
value: a,
|
|
192
198
|
onChange: o
|
|
193
199
|
}) {
|
|
194
|
-
const d = O(), { data: m = [] } =
|
|
200
|
+
const d = O(), { data: m = [] } = F({
|
|
195
201
|
queryKey: ["user-groups", "task-picker"],
|
|
196
|
-
queryFn: () => d.request(
|
|
202
|
+
queryFn: () => d.request(D("/user-groups")).then((l) => l.data).catch(() => []),
|
|
197
203
|
staleTime: 5 * 6e4
|
|
198
204
|
});
|
|
199
205
|
return /* @__PURE__ */ t(
|
|
200
206
|
G,
|
|
201
207
|
{
|
|
202
208
|
value: a == null ? "" : String(a),
|
|
203
|
-
onChange: (
|
|
204
|
-
const
|
|
205
|
-
o(
|
|
209
|
+
onChange: (l) => {
|
|
210
|
+
const p = m.find((g) => String(g.id) === l) ?? null;
|
|
211
|
+
o(p ? p.id : null, p);
|
|
206
212
|
},
|
|
207
213
|
ariaLabel: "Team",
|
|
208
214
|
options: [
|
|
209
215
|
{ value: "", label: m.length ? "Choose a team…" : "No teams yet" },
|
|
210
|
-
...m.map((
|
|
211
|
-
value: String(
|
|
212
|
-
label: `${
|
|
216
|
+
...m.map((l) => ({
|
|
217
|
+
value: String(l.id),
|
|
218
|
+
label: `${l.name}${l.member_count ? ` · ${l.member_count}` : ""}`
|
|
213
219
|
}))
|
|
214
220
|
]
|
|
215
221
|
}
|
|
216
222
|
);
|
|
217
223
|
}
|
|
218
|
-
function
|
|
219
|
-
const o = O(), { data: d } =
|
|
224
|
+
function Ae(a) {
|
|
225
|
+
const o = O(), { data: d } = F({
|
|
220
226
|
queryKey: ["task-field-labels", a],
|
|
221
|
-
queryFn: () => o.request(
|
|
227
|
+
queryFn: () => o.request(D(`/collections/${a}`)).then((p) => p.data.fields ?? []).catch(() => []),
|
|
222
228
|
staleTime: 10 * 6e4
|
|
223
229
|
}), m = (d ?? []).filter(
|
|
224
|
-
(
|
|
225
|
-
),
|
|
226
|
-
() => new Map(m.map((
|
|
230
|
+
(p) => !p.hidden && p.field !== "id" && p.type !== "alias" && !p.field.startsWith("__")
|
|
231
|
+
), l = ke(
|
|
232
|
+
() => new Map(m.map((p) => [p.field, p.label || p.field.replace(/_/g, " ")])),
|
|
227
233
|
[m]
|
|
228
234
|
);
|
|
229
|
-
return { fields: m, labels:
|
|
235
|
+
return { fields: m, labels: l };
|
|
230
236
|
}
|
|
231
|
-
function
|
|
237
|
+
function ot({
|
|
232
238
|
collection: a,
|
|
233
239
|
value: o,
|
|
234
240
|
onChange: d
|
|
235
241
|
}) {
|
|
236
|
-
const { fields: m, labels:
|
|
242
|
+
const { fields: m, labels: l } = Ae(a), [p, g] = P(!1), c = o[0] ?? null;
|
|
237
243
|
return /* @__PURE__ */ n("div", { className: "space-y-1.5", "data-task-done-when": !0, children: [
|
|
238
244
|
/* @__PURE__ */ t(W, { className: "block text-[11px]", children: "Close automatically when (optional)" }),
|
|
239
245
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
240
|
-
/* @__PURE__ */ n(
|
|
241
|
-
/* @__PURE__ */ t(
|
|
246
|
+
/* @__PURE__ */ n(Pe, { open: p, onOpenChange: g, children: [
|
|
247
|
+
/* @__PURE__ */ t($e, { asChild: !0, children: /* @__PURE__ */ n(
|
|
242
248
|
V,
|
|
243
249
|
{
|
|
244
250
|
variant: "outline",
|
|
245
251
|
className: "h-8 max-w-[220px] justify-between px-2.5 text-[12px] font-normal",
|
|
246
252
|
children: [
|
|
247
|
-
/* @__PURE__ */ t("span", { className: M("truncate", !c && "text-muted-foreground"), children: c ?
|
|
248
|
-
/* @__PURE__ */ t(
|
|
253
|
+
/* @__PURE__ */ t("span", { className: M("truncate", !c && "text-muted-foreground"), children: c ? l.get(c.field) ?? c.field : "A field on this record…" }),
|
|
254
|
+
/* @__PURE__ */ t(be, { className: "ml-1 h-3.5 w-3.5 shrink-0 opacity-50" })
|
|
249
255
|
]
|
|
250
256
|
}
|
|
251
257
|
) }),
|
|
252
|
-
/* @__PURE__ */ t(
|
|
253
|
-
/* @__PURE__ */ t(
|
|
254
|
-
/* @__PURE__ */ n(
|
|
255
|
-
/* @__PURE__ */ t(
|
|
256
|
-
/* @__PURE__ */ t(
|
|
257
|
-
|
|
258
|
+
/* @__PURE__ */ t(qe, { className: "w-[260px] p-0", align: "start", children: /* @__PURE__ */ n(ve, { children: [
|
|
259
|
+
/* @__PURE__ */ t(_e, { placeholder: "Search fields…", className: "h-8 text-[12px]" }),
|
|
260
|
+
/* @__PURE__ */ n(we, { children: [
|
|
261
|
+
/* @__PURE__ */ t(Ce, { className: "py-3 text-center text-[12px] text-muted-foreground", children: "No field" }),
|
|
262
|
+
/* @__PURE__ */ t(ae, { children: m.map((h) => /* @__PURE__ */ t(
|
|
263
|
+
Se,
|
|
258
264
|
{
|
|
259
|
-
value: `${
|
|
265
|
+
value: `${l.get(h.field)} ${h.field}`,
|
|
260
266
|
onSelect: () => {
|
|
261
267
|
d([
|
|
262
268
|
{ field: h.field, op: (c == null ? void 0 : c.op) ?? "nnull", value: (c == null ? void 0 : c.value) ?? null }
|
|
263
|
-
]),
|
|
269
|
+
]), g(!1);
|
|
264
270
|
},
|
|
265
271
|
className: "text-[12px]",
|
|
266
|
-
children:
|
|
272
|
+
children: l.get(h.field)
|
|
267
273
|
},
|
|
268
274
|
h.field
|
|
269
275
|
)) })
|
|
270
276
|
] })
|
|
271
277
|
] }) })
|
|
272
278
|
] }),
|
|
273
|
-
c && /* @__PURE__ */ n(
|
|
279
|
+
c && /* @__PURE__ */ n(Ie, { children: [
|
|
274
280
|
/* @__PURE__ */ t("div", { className: "w-[130px]", children: /* @__PURE__ */ t(
|
|
275
281
|
G,
|
|
276
282
|
{
|
|
@@ -283,7 +289,7 @@ function tt({
|
|
|
283
289
|
}
|
|
284
290
|
) }),
|
|
285
291
|
c.op === "eq" && /* @__PURE__ */ t(
|
|
286
|
-
|
|
292
|
+
ne,
|
|
287
293
|
{
|
|
288
294
|
value: String(c.value ?? ""),
|
|
289
295
|
onChange: (h) => d([{ ...c, value: h.target.value }]),
|
|
@@ -298,14 +304,14 @@ function tt({
|
|
|
298
304
|
onClick: () => d([]),
|
|
299
305
|
className: "rounded p-1 text-slate-400 hover:text-slate-600",
|
|
300
306
|
"aria-label": "Remove condition",
|
|
301
|
-
children: /* @__PURE__ */ t(
|
|
307
|
+
children: /* @__PURE__ */ t(te, { className: "h-3.5 w-3.5" })
|
|
302
308
|
}
|
|
303
309
|
)
|
|
304
310
|
] })
|
|
305
311
|
] })
|
|
306
312
|
] });
|
|
307
313
|
}
|
|
308
|
-
const
|
|
314
|
+
const dt = () => ({
|
|
309
315
|
title: "",
|
|
310
316
|
description: "",
|
|
311
317
|
mode: "person",
|
|
@@ -320,7 +326,7 @@ const at = () => ({
|
|
|
320
326
|
priority: "normal",
|
|
321
327
|
doneWhen: []
|
|
322
328
|
});
|
|
323
|
-
function
|
|
329
|
+
function ct(a) {
|
|
324
330
|
return {
|
|
325
331
|
title: a.title,
|
|
326
332
|
description: a.description ?? "",
|
|
@@ -334,22 +340,22 @@ function nt(a) {
|
|
|
334
340
|
teamName: a.team_name ?? null,
|
|
335
341
|
due: a.due_date ? String(a.due_date).slice(0, 10) : "",
|
|
336
342
|
priority: a.priority ?? "normal",
|
|
337
|
-
doneWhen:
|
|
343
|
+
doneWhen: Te(a.done_when)
|
|
338
344
|
};
|
|
339
345
|
}
|
|
340
|
-
function
|
|
346
|
+
function xe({
|
|
341
347
|
collection: a,
|
|
342
348
|
item: o,
|
|
343
349
|
initial: d,
|
|
344
350
|
submitLabel: m,
|
|
345
|
-
busy:
|
|
346
|
-
allowTeam:
|
|
347
|
-
allowAgent:
|
|
351
|
+
busy: l,
|
|
352
|
+
allowTeam: p,
|
|
353
|
+
allowAgent: g = !1,
|
|
348
354
|
onSubmit: c,
|
|
349
355
|
onCancel: h
|
|
350
356
|
}) {
|
|
351
|
-
var
|
|
352
|
-
const [r,
|
|
357
|
+
var T;
|
|
358
|
+
const [r, f] = P(d), b = (s, x) => f((k) => ({ ...k, [s]: x })), I = lt(g).data ?? [], $ = g && (I.length > 0 || r.mode === "agent"), N = r.mode === "team" ? r.teamId != null : r.mode === "agent" ? !!r.agent : !!r.assignee, q = r.mode === "person" && ((T = r.assigneePerson) != null && T.is_out_of_office) ? r.assigneePerson : null;
|
|
353
359
|
return /* @__PURE__ */ n(
|
|
354
360
|
"div",
|
|
355
361
|
{
|
|
@@ -359,10 +365,10 @@ function pe({
|
|
|
359
365
|
/* @__PURE__ */ n("div", { children: [
|
|
360
366
|
/* @__PURE__ */ t(W, { className: "mb-1 block text-[11px]", children: "Title" }),
|
|
361
367
|
/* @__PURE__ */ t(
|
|
362
|
-
|
|
368
|
+
ne,
|
|
363
369
|
{
|
|
364
370
|
value: r.title,
|
|
365
|
-
onChange: (
|
|
371
|
+
onChange: (s) => b("title", s.target.value),
|
|
366
372
|
className: "h-8 bg-white text-[12px] dark:bg-background",
|
|
367
373
|
placeholder: "What needs to be done?",
|
|
368
374
|
autoFocus: !0,
|
|
@@ -373,10 +379,10 @@ function pe({
|
|
|
373
379
|
/* @__PURE__ */ n("div", { children: [
|
|
374
380
|
/* @__PURE__ */ t(W, { className: "mb-1 block text-[11px]", children: "Details (optional)" }),
|
|
375
381
|
/* @__PURE__ */ t(
|
|
376
|
-
|
|
382
|
+
et,
|
|
377
383
|
{
|
|
378
384
|
value: r.description,
|
|
379
|
-
onChange: (
|
|
385
|
+
onChange: (s) => b("description", s.target.value),
|
|
380
386
|
className: "min-h-[56px] bg-white text-[12px] dark:bg-background",
|
|
381
387
|
placeholder: "Anything the person needs to know",
|
|
382
388
|
rows: 2,
|
|
@@ -392,51 +398,51 @@ function pe({
|
|
|
392
398
|
/* @__PURE__ */ t("span", { "aria-hidden": !0, className: "ml-0.5 text-red-500", "data-task-required": !0, children: "*" })
|
|
393
399
|
] }),
|
|
394
400
|
/* @__PURE__ */ t("span", { className: "flex items-center gap-2", children: ["person", "team", "agent"].filter(
|
|
395
|
-
(
|
|
396
|
-
).map((
|
|
401
|
+
(s) => s !== r.mode && (s !== "team" || p) && (s !== "agent" || $)
|
|
402
|
+
).map((s) => /* @__PURE__ */ t(
|
|
397
403
|
"button",
|
|
398
404
|
{
|
|
399
405
|
type: "button",
|
|
400
|
-
"data-task-mode":
|
|
401
|
-
onClick: () =>
|
|
406
|
+
"data-task-mode": s,
|
|
407
|
+
onClick: () => b("mode", s),
|
|
402
408
|
className: "text-[10.5px] text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200",
|
|
403
|
-
children:
|
|
409
|
+
children: s === "person" ? "A person" : s === "team" ? "A team" : "An agent"
|
|
404
410
|
},
|
|
405
|
-
|
|
411
|
+
s
|
|
406
412
|
)) })
|
|
407
413
|
] }),
|
|
408
414
|
r.mode === "agent" ? /* @__PURE__ */ t(
|
|
409
|
-
|
|
415
|
+
rt,
|
|
410
416
|
{
|
|
411
|
-
agents:
|
|
417
|
+
agents: I,
|
|
412
418
|
value: r.agent,
|
|
413
|
-
onChange: (
|
|
419
|
+
onChange: (s) => f((x) => ({ ...x, agent: (s == null ? void 0 : s.conn) ?? null, agentName: (s == null ? void 0 : s.name) ?? null }))
|
|
414
420
|
}
|
|
415
421
|
) : r.mode === "team" ? /* @__PURE__ */ t(
|
|
416
|
-
|
|
422
|
+
it,
|
|
417
423
|
{
|
|
418
424
|
value: r.teamId,
|
|
419
|
-
onChange: (
|
|
425
|
+
onChange: (s, x) => f((k) => ({ ...k, teamId: s, teamName: (x == null ? void 0 : x.name) ?? null }))
|
|
420
426
|
}
|
|
421
427
|
) : /* @__PURE__ */ t(
|
|
422
|
-
|
|
428
|
+
st,
|
|
423
429
|
{
|
|
424
430
|
collection: a,
|
|
425
431
|
item: o,
|
|
426
432
|
value: r.assignee,
|
|
427
433
|
valueLabel: r.assigneeName,
|
|
428
|
-
onChange: (
|
|
429
|
-
...
|
|
430
|
-
assignee:
|
|
431
|
-
assigneeName:
|
|
432
|
-
assigneePerson:
|
|
434
|
+
onChange: (s, x) => f((k) => ({
|
|
435
|
+
...k,
|
|
436
|
+
assignee: s,
|
|
437
|
+
assigneeName: x ? z(x) : null,
|
|
438
|
+
assigneePerson: x
|
|
433
439
|
}))
|
|
434
440
|
}
|
|
435
441
|
),
|
|
436
|
-
|
|
437
|
-
z(
|
|
442
|
+
q && /* @__PURE__ */ n("p", { className: "mt-1 rounded bg-amber-50 px-2 py-1 text-[11px] text-amber-700 dark:bg-amber-400/10 dark:text-amber-400", children: [
|
|
443
|
+
z(q),
|
|
438
444
|
" is out of office",
|
|
439
|
-
|
|
445
|
+
q.ooo_end ? ` until ${String(q.ooo_end).slice(0, 10)}` : "",
|
|
440
446
|
" — the task goes to their delegate if one is set."
|
|
441
447
|
] }),
|
|
442
448
|
r.mode === "team" && /* @__PURE__ */ t("p", { className: "mt-1 text-[11px] text-muted-foreground", children: "Waits with the team until one of them picks it up." }),
|
|
@@ -445,11 +451,11 @@ function pe({
|
|
|
445
451
|
/* @__PURE__ */ n("div", { children: [
|
|
446
452
|
/* @__PURE__ */ t(W, { className: "mb-1 block text-[11px]", children: "Due date" }),
|
|
447
453
|
/* @__PURE__ */ t(
|
|
448
|
-
|
|
454
|
+
ne,
|
|
449
455
|
{
|
|
450
456
|
type: "date",
|
|
451
457
|
value: r.due,
|
|
452
|
-
onChange: (
|
|
458
|
+
onChange: (s) => b("due", s.target.value),
|
|
453
459
|
className: "h-8 bg-white text-[12px] dark:bg-background",
|
|
454
460
|
"data-task-due": !0
|
|
455
461
|
}
|
|
@@ -461,7 +467,7 @@ function pe({
|
|
|
461
467
|
G,
|
|
462
468
|
{
|
|
463
469
|
value: r.priority,
|
|
464
|
-
onChange: (
|
|
470
|
+
onChange: (s) => b("priority", s),
|
|
465
471
|
options: [
|
|
466
472
|
{ value: "low", label: "Low" },
|
|
467
473
|
{ value: "normal", label: "Normal" },
|
|
@@ -472,11 +478,11 @@ function pe({
|
|
|
472
478
|
] })
|
|
473
479
|
] }),
|
|
474
480
|
/* @__PURE__ */ t(
|
|
475
|
-
|
|
481
|
+
ot,
|
|
476
482
|
{
|
|
477
483
|
collection: a,
|
|
478
484
|
value: r.doneWhen,
|
|
479
|
-
onChange: (
|
|
485
|
+
onChange: (s) => b("doneWhen", s)
|
|
480
486
|
}
|
|
481
487
|
),
|
|
482
488
|
/* @__PURE__ */ n("div", { className: "flex justify-end gap-2", children: [
|
|
@@ -495,7 +501,7 @@ function pe({
|
|
|
495
501
|
"span",
|
|
496
502
|
{
|
|
497
503
|
className: "inline-flex",
|
|
498
|
-
"data-tip":
|
|
504
|
+
"data-tip": l ? void 0 : r.title.trim() ? N ? void 0 : r.mode === "team" ? "Pick a team first" : r.mode === "agent" ? "Pick an agent first" : "Pick an assignee first" : "Write what needs to be done first",
|
|
499
505
|
children: [
|
|
500
506
|
/* @__PURE__ */ t(
|
|
501
507
|
V,
|
|
@@ -503,14 +509,14 @@ function pe({
|
|
|
503
509
|
type: "button",
|
|
504
510
|
size: "sm",
|
|
505
511
|
className: "h-7 text-[12px]",
|
|
506
|
-
disabled: !r.title.trim() || !N ||
|
|
507
|
-
"aria-describedby": !
|
|
512
|
+
disabled: !r.title.trim() || !N || l,
|
|
513
|
+
"aria-describedby": !l && r.title.trim() && !N ? "task-submit-why" : void 0,
|
|
508
514
|
onClick: () => c(r),
|
|
509
515
|
"data-task-submit": !0,
|
|
510
|
-
children:
|
|
516
|
+
children: l ? "Saving…" : m
|
|
511
517
|
}
|
|
512
518
|
),
|
|
513
|
-
!
|
|
519
|
+
!l && r.title.trim() && !N && /* @__PURE__ */ t(
|
|
514
520
|
"span",
|
|
515
521
|
{
|
|
516
522
|
id: "task-submit-why",
|
|
@@ -527,10 +533,10 @@ function pe({
|
|
|
527
533
|
}
|
|
528
534
|
);
|
|
529
535
|
}
|
|
530
|
-
function
|
|
531
|
-
const o = O(), { data: d = [], isLoading: m } =
|
|
536
|
+
function fe({ taskId: a }) {
|
|
537
|
+
const o = O(), { data: d = [], isLoading: m } = F({
|
|
532
538
|
queryKey: ["task-history", a],
|
|
533
|
-
queryFn: () => o.request(
|
|
539
|
+
queryFn: () => o.request(D(`/tasks/${a}/history`)).then((l) => l.data),
|
|
534
540
|
staleTime: 3e4
|
|
535
541
|
});
|
|
536
542
|
return m ? /* @__PURE__ */ t("p", { className: "mt-1 text-[11px] text-muted-foreground", children: "Loading history…" }) : d.length ? /* @__PURE__ */ t(
|
|
@@ -538,37 +544,51 @@ function he({ taskId: a }) {
|
|
|
538
544
|
{
|
|
539
545
|
className: "mt-1.5 space-y-1 border-l border-slate-200 pl-3 dark:border-border",
|
|
540
546
|
"data-task-history": !0,
|
|
541
|
-
children: d.map((
|
|
542
|
-
/* @__PURE__ */ t("span", { className: "text-slate-800 dark:text-slate-200", children:
|
|
547
|
+
children: d.map((l) => /* @__PURE__ */ n("li", { className: "text-[11px] text-slate-600 dark:text-slate-400", children: [
|
|
548
|
+
/* @__PURE__ */ t("span", { className: "text-slate-800 dark:text-slate-200", children: l.text }),
|
|
543
549
|
/* @__PURE__ */ n("span", { className: "text-slate-400", children: [
|
|
544
550
|
" ",
|
|
545
551
|
"· ",
|
|
546
|
-
|
|
547
|
-
/* @__PURE__ */ t("span", { title:
|
|
552
|
+
l.user_name ? `${l.user_name}, ` : "",
|
|
553
|
+
/* @__PURE__ */ t("span", { title: ye(l.at), children: /* @__PURE__ */ t(Ne, { value: l.at }) })
|
|
548
554
|
] })
|
|
549
|
-
] },
|
|
555
|
+
] }, l.id))
|
|
550
556
|
}
|
|
551
557
|
) : /* @__PURE__ */ t("p", { className: "mt-1 text-[11px] text-muted-foreground", children: "No history yet." });
|
|
552
558
|
}
|
|
553
|
-
function
|
|
559
|
+
function It({
|
|
554
560
|
collection: a,
|
|
555
561
|
item: o,
|
|
556
562
|
title: d,
|
|
557
563
|
defaultExpanded: m,
|
|
558
|
-
queuedTasks:
|
|
559
|
-
onQueueTask:
|
|
560
|
-
onRemoveQueuedTask:
|
|
564
|
+
queuedTasks: l,
|
|
565
|
+
onQueueTask: p,
|
|
566
|
+
onRemoveQueuedTask: g
|
|
561
567
|
}) {
|
|
562
|
-
const c = O(), h =
|
|
568
|
+
const c = O(), h = Le(), { isAdmin: r, userId: f } = Be(), [b, I] = Qe(m, !1), [$, N] = P(!1), [q, T] = P(null), [s, x] = P(null), [k, J] = P(!1), y = !o || o === "new", { data: L = [], isSuccess: j } = F({
|
|
563
569
|
queryKey: ["tasks", a, o],
|
|
564
|
-
queryFn: () => c.request(
|
|
570
|
+
queryFn: () => c.request(D("/tasks", { collection: a, item: o })).then((e) => e.data),
|
|
565
571
|
enabled: !!a && !y
|
|
566
|
-
}), { labels:
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
+
}), { labels: X } = Ae(a), R = ke(
|
|
573
|
+
() => L.flatMap((e) => {
|
|
574
|
+
const u = e, S = [{ at: u.created_at, by: u.created_by }];
|
|
575
|
+
return u.completed_at && S.push({ at: u.completed_at, by: u.completed_by ?? null }), S;
|
|
576
|
+
}),
|
|
577
|
+
[L]
|
|
578
|
+
), i = Je({
|
|
579
|
+
userId: f,
|
|
580
|
+
collection: a,
|
|
581
|
+
item: o,
|
|
582
|
+
tab: "tasks",
|
|
583
|
+
open: b,
|
|
584
|
+
entries: R,
|
|
585
|
+
ready: !y && j
|
|
586
|
+
}), _ = () => {
|
|
587
|
+
Ge(h, a, o), h.invalidateQueries({ queryKey: ["task-history"] });
|
|
588
|
+
}, C = (e, u) => {
|
|
589
|
+
var S;
|
|
590
|
+
return ((S = e == null ? void 0 : e.response) == null ? void 0 : S.error) ?? (e instanceof Error && e.message ? e.message : u);
|
|
591
|
+
}, se = (e) => ({
|
|
572
592
|
title: e.title.trim(),
|
|
573
593
|
description: e.description.trim() || null,
|
|
574
594
|
assignee: e.mode === "person" ? e.assignee : null,
|
|
@@ -577,46 +597,46 @@ function _t({
|
|
|
577
597
|
due_date: e.due || null,
|
|
578
598
|
priority: e.priority,
|
|
579
599
|
done_when: e.doneWhen.length ? e.doneWhen : null
|
|
580
|
-
}),
|
|
600
|
+
}), le = K({
|
|
581
601
|
mutationFn: (e) => c.request(
|
|
582
|
-
|
|
602
|
+
Z("/tasks", { collection: a, item: o, ...se(e) })
|
|
583
603
|
),
|
|
584
604
|
onSuccess: (e) => {
|
|
585
|
-
var
|
|
586
|
-
|
|
587
|
-
(
|
|
605
|
+
var u;
|
|
606
|
+
_(), N(!1), w.success(
|
|
607
|
+
(u = e == null ? void 0 : e.data) != null && u.delegated_from ? "Task created — it went to their delegate" : "Task created"
|
|
588
608
|
);
|
|
589
609
|
},
|
|
590
|
-
onError: (e) =>
|
|
591
|
-
}), H =
|
|
592
|
-
mutationFn: ({ id: e, body:
|
|
593
|
-
onSuccess: (e,
|
|
594
|
-
|
|
610
|
+
onError: (e) => w.error(C(e, "Could not create the task"))
|
|
611
|
+
}), H = K({
|
|
612
|
+
mutationFn: ({ id: e, body: u }) => c.request(Ve(`/tasks/${e}`, u)),
|
|
613
|
+
onSuccess: (e, u) => {
|
|
614
|
+
_(), T(null), u.body.status === "open" ? w.success("Task reopened") : w.success("Task updated");
|
|
595
615
|
},
|
|
596
|
-
onError: (e) =>
|
|
597
|
-
}),
|
|
598
|
-
mutationFn: (e) => c.request(
|
|
616
|
+
onError: (e) => w.error(C(e, "Could not update the task"))
|
|
617
|
+
}), re = K({
|
|
618
|
+
mutationFn: (e) => c.request(Z(`/tasks/${e}/complete`, {})),
|
|
599
619
|
onSuccess: () => {
|
|
600
|
-
|
|
620
|
+
_(), w.success("Task completed");
|
|
601
621
|
},
|
|
602
|
-
onError: (e) =>
|
|
603
|
-
}),
|
|
604
|
-
mutationFn: (e) => c.request(
|
|
622
|
+
onError: (e) => w.error(C(e, "Could not complete the task"))
|
|
623
|
+
}), ie = K({
|
|
624
|
+
mutationFn: (e) => c.request(Z(`/tasks/${e}/claim`, {})),
|
|
605
625
|
onSuccess: () => {
|
|
606
|
-
|
|
626
|
+
_(), w.success("It’s yours");
|
|
607
627
|
},
|
|
608
|
-
onError: (e) =>
|
|
609
|
-
}),
|
|
610
|
-
mutationFn: (e) => c.request(
|
|
628
|
+
onError: (e) => w.error(C(e, "Could not pick it up"))
|
|
629
|
+
}), oe = K({
|
|
630
|
+
mutationFn: (e) => c.request(ze(`/tasks/${e}`)),
|
|
611
631
|
onSuccess: () => {
|
|
612
|
-
|
|
632
|
+
_(), w.success("Task deleted");
|
|
613
633
|
},
|
|
614
|
-
onError: (e) =>
|
|
634
|
+
onError: (e) => w.error(C(e, "Could not delete the task"))
|
|
615
635
|
});
|
|
616
636
|
if (!a) return null;
|
|
617
|
-
const v =
|
|
618
|
-
function
|
|
619
|
-
|
|
637
|
+
const v = L.filter((e) => pe.has(e.status)), Q = L.filter((e) => !pe.has(e.status)), Ee = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), Y = (e) => r || E(e.assignee, f) || E(e.created_by, f), Fe = (e) => r || E(e.created_by, f);
|
|
638
|
+
function De(e) {
|
|
639
|
+
p == null || p({
|
|
620
640
|
title: e.title.trim(),
|
|
621
641
|
description: e.description.trim() || void 0,
|
|
622
642
|
assignee: e.mode === "person" ? e.assignee : null,
|
|
@@ -627,17 +647,17 @@ function _t({
|
|
|
627
647
|
priority: e.priority
|
|
628
648
|
}), N(!1);
|
|
629
649
|
}
|
|
630
|
-
const
|
|
631
|
-
const
|
|
650
|
+
const de = (e, u) => {
|
|
651
|
+
const S = !u && !!e.due_date && String(e.due_date).slice(0, 10) < Ee;
|
|
632
652
|
return /* @__PURE__ */ n("div", { className: "mt-0.5 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[11px] text-slate-400", children: [
|
|
633
|
-
/* @__PURE__ */ t(
|
|
653
|
+
/* @__PURE__ */ t(ge, { priority: e.priority }),
|
|
634
654
|
e.agent_assignee ? /* @__PURE__ */ n(
|
|
635
655
|
"span",
|
|
636
656
|
{
|
|
637
657
|
className: "inline-flex items-center gap-1 text-[#0e7490] dark:text-[#67e8f9]",
|
|
638
658
|
"data-task-agent": e.agent_assignee,
|
|
639
659
|
children: [
|
|
640
|
-
/* @__PURE__ */ t(
|
|
660
|
+
/* @__PURE__ */ t(je, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
641
661
|
e.agent_name ?? "An agent",
|
|
642
662
|
e.assignee_name && /* @__PURE__ */ n("span", { className: "text-slate-400", children: [
|
|
643
663
|
"for ",
|
|
@@ -646,52 +666,52 @@ function _t({
|
|
|
646
666
|
]
|
|
647
667
|
}
|
|
648
668
|
) : e.assignee ? /* @__PURE__ */ t("span", { children: e.assignee_name ?? "Someone" }) : e.team_id != null ? /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1", children: [
|
|
649
|
-
/* @__PURE__ */ t(
|
|
669
|
+
/* @__PURE__ */ t(Ue, { className: "h-3 w-3" }),
|
|
650
670
|
"Waiting for ",
|
|
651
671
|
e.team_name ?? "the team"
|
|
652
672
|
] }) : null,
|
|
653
|
-
!
|
|
673
|
+
!u && e.due_date && /* @__PURE__ */ n("span", { className: M(S && "font-medium text-red-500"), children: [
|
|
654
674
|
"Due ",
|
|
655
|
-
|
|
656
|
-
|
|
675
|
+
ee(e.due_date),
|
|
676
|
+
S && " (overdue)"
|
|
657
677
|
] }),
|
|
658
|
-
|
|
678
|
+
u && e.completed_at && /* @__PURE__ */ n("span", { "data-task-completed-by": !0, children: [
|
|
659
679
|
e.status === "cancelled" ? "Cancelled" : `Done${e.completed_by_name ? ` by ${e.completed_by_name}` : ""}`,
|
|
660
680
|
" ",
|
|
661
|
-
/* @__PURE__ */ t("span", { title:
|
|
681
|
+
/* @__PURE__ */ t("span", { title: ye(e.completed_at), children: /* @__PURE__ */ t(Ne, { value: e.completed_at }) })
|
|
662
682
|
] }),
|
|
663
|
-
e.created_by_name && !
|
|
683
|
+
e.created_by_name && !E(e.created_by, e.assignee) && /* @__PURE__ */ n("span", { children: [
|
|
664
684
|
"Asked by ",
|
|
665
685
|
e.created_by_name
|
|
666
686
|
] })
|
|
667
687
|
] });
|
|
668
|
-
},
|
|
669
|
-
!
|
|
688
|
+
}, ce = (e, u) => /* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
689
|
+
!u && /* @__PURE__ */ t(Ye, { task: e, compact: !0, onTaskChanged: _ }),
|
|
670
690
|
/* @__PURE__ */ t(
|
|
671
691
|
"button",
|
|
672
692
|
{
|
|
673
693
|
type: "button",
|
|
674
|
-
onClick: () =>
|
|
694
|
+
onClick: () => x(s === e.id ? null : e.id),
|
|
675
695
|
className: "rounded p-1 text-slate-300 transition-colors hover:bg-muted hover:text-slate-600",
|
|
676
696
|
"aria-label": `History of ${e.title}`,
|
|
677
697
|
title: "History",
|
|
678
698
|
"data-task-history-toggle": e.id,
|
|
679
|
-
children: /* @__PURE__ */ t(
|
|
699
|
+
children: /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5" })
|
|
680
700
|
}
|
|
681
701
|
),
|
|
682
|
-
!
|
|
702
|
+
!u && Y(e) && /* @__PURE__ */ t(
|
|
683
703
|
"button",
|
|
684
704
|
{
|
|
685
705
|
type: "button",
|
|
686
|
-
onClick: () =>
|
|
706
|
+
onClick: () => T(q === e.id ? null : e.id),
|
|
687
707
|
className: "rounded p-1 text-slate-300 transition-colors hover:bg-muted hover:text-slate-600",
|
|
688
708
|
"aria-label": `Edit ${e.title}`,
|
|
689
709
|
title: "Edit",
|
|
690
710
|
"data-task-edit": e.id,
|
|
691
|
-
children: /* @__PURE__ */ t(
|
|
711
|
+
children: /* @__PURE__ */ t(Me, { className: "h-3.5 w-3.5" })
|
|
692
712
|
}
|
|
693
713
|
),
|
|
694
|
-
|
|
714
|
+
u && Y(e) && /* @__PURE__ */ n(
|
|
695
715
|
"button",
|
|
696
716
|
{
|
|
697
717
|
type: "button",
|
|
@@ -700,21 +720,21 @@ function _t({
|
|
|
700
720
|
className: "inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-slate-500 transition-colors hover:bg-muted hover:text-slate-800 dark:hover:text-slate-200",
|
|
701
721
|
"data-task-reopen": e.id,
|
|
702
722
|
children: [
|
|
703
|
-
/* @__PURE__ */ t(
|
|
723
|
+
/* @__PURE__ */ t(Re, { className: "h-3 w-3" }),
|
|
704
724
|
"Reopen"
|
|
705
725
|
]
|
|
706
726
|
}
|
|
707
727
|
),
|
|
708
|
-
|
|
728
|
+
Fe(e) && /* @__PURE__ */ t(
|
|
709
729
|
"button",
|
|
710
730
|
{
|
|
711
731
|
type: "button",
|
|
712
|
-
onClick: () =>
|
|
713
|
-
disabled:
|
|
732
|
+
onClick: () => oe.mutate(e.id),
|
|
733
|
+
disabled: oe.isPending,
|
|
714
734
|
className: "rounded p-1 text-slate-300 transition-colors hover:bg-red-50 hover:text-red-400 disabled:opacity-40 dark:hover:bg-red-500/10",
|
|
715
735
|
"aria-label": `Delete ${e.title}`,
|
|
716
736
|
title: "Delete",
|
|
717
|
-
children: /* @__PURE__ */ t(
|
|
737
|
+
children: /* @__PURE__ */ t(te, { className: "h-3.5 w-3.5" })
|
|
718
738
|
}
|
|
719
739
|
)
|
|
720
740
|
] });
|
|
@@ -723,42 +743,43 @@ function _t({
|
|
|
723
743
|
"button",
|
|
724
744
|
{
|
|
725
745
|
type: "button",
|
|
726
|
-
onClick: () =>
|
|
727
|
-
"aria-expanded":
|
|
728
|
-
"data-task-panel-toggle":
|
|
746
|
+
onClick: () => I((e) => !e),
|
|
747
|
+
"aria-expanded": b,
|
|
748
|
+
"data-task-panel-toggle": b ? "open" : "closed",
|
|
729
749
|
className: "flex w-full flex-col px-5 py-3.5 text-left transition-colors hover:bg-slate-50/50 dark:hover:bg-white/[0.02]",
|
|
730
750
|
children: [
|
|
731
751
|
/* @__PURE__ */ n("span", { className: "flex w-full items-center gap-2.5", children: [
|
|
732
|
-
/* @__PURE__ */ t(
|
|
752
|
+
/* @__PURE__ */ t(We, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
733
753
|
/* @__PURE__ */ t("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: d || "Tasks" }),
|
|
734
|
-
(y ? (
|
|
754
|
+
(y ? (l ?? []).length : v.length) > 0 && /* @__PURE__ */ t("span", { className: "rounded-full bg-slate-100 px-1.5 py-px text-[10.5px] font-semibold tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400", children: y ? `${(l ?? []).length} queued` : `${v.length} open` }),
|
|
755
|
+
/* @__PURE__ */ t(tt, { count: i, tab: "tasks" }),
|
|
735
756
|
/* @__PURE__ */ t(
|
|
736
|
-
|
|
757
|
+
me,
|
|
737
758
|
{
|
|
738
|
-
className: `ml-auto h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150${
|
|
759
|
+
className: `ml-auto h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150${b ? " rotate-180" : ""}`
|
|
739
760
|
}
|
|
740
761
|
)
|
|
741
762
|
] }),
|
|
742
|
-
!
|
|
763
|
+
!b && v.length > 0 && /* @__PURE__ */ n("span", { className: "mt-1 w-full truncate pl-6 text-[11.5px] text-slate-400", children: [
|
|
743
764
|
v[v.length - 1].title,
|
|
744
765
|
v[v.length - 1].due_date && /* @__PURE__ */ n("span", { className: "text-slate-400/80", children: [
|
|
745
766
|
" ",
|
|
746
767
|
"· due ",
|
|
747
|
-
|
|
768
|
+
ee(v[v.length - 1].due_date)
|
|
748
769
|
] })
|
|
749
770
|
] })
|
|
750
771
|
]
|
|
751
772
|
}
|
|
752
773
|
),
|
|
753
|
-
|
|
754
|
-
y && (
|
|
774
|
+
b && /* @__PURE__ */ t("div", { className: "border-t border-slate-100 dark:border-border/60", children: /* @__PURE__ */ n("div", { className: "space-y-3 px-5 py-3", children: [
|
|
775
|
+
y && (l ?? []).length > 0 && /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: (l ?? []).map((e, u) => (
|
|
755
776
|
// biome-ignore lint/suspicious/noArrayIndexKey: queued rows have no id yet
|
|
756
777
|
/* @__PURE__ */ n("div", { className: "flex items-start gap-2.5 py-2", children: [
|
|
757
778
|
/* @__PURE__ */ t("span", { className: "mt-0.5 inline-flex shrink-0 items-center rounded-full bg-amber-100 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 dark:bg-amber-500/15 dark:text-amber-400", children: "Pending" }),
|
|
758
779
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
759
780
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: e.title }),
|
|
760
781
|
/* @__PURE__ */ n("div", { className: "mt-0.5 flex items-center gap-3 text-[11px] text-slate-400", children: [
|
|
761
|
-
/* @__PURE__ */ t(
|
|
782
|
+
/* @__PURE__ */ t(ge, { priority: e.priority }),
|
|
762
783
|
e.assignee_name && /* @__PURE__ */ t("span", { children: e.assignee_name }),
|
|
763
784
|
e.team_name && /* @__PURE__ */ n("span", { children: [
|
|
764
785
|
"Team: ",
|
|
@@ -766,87 +787,87 @@ function _t({
|
|
|
766
787
|
] }),
|
|
767
788
|
e.due_date && /* @__PURE__ */ n("span", { children: [
|
|
768
789
|
"Due ",
|
|
769
|
-
|
|
790
|
+
ee(e.due_date)
|
|
770
791
|
] })
|
|
771
792
|
] })
|
|
772
793
|
] }),
|
|
773
|
-
|
|
794
|
+
g && /* @__PURE__ */ t(
|
|
774
795
|
"button",
|
|
775
796
|
{
|
|
776
797
|
type: "button",
|
|
777
|
-
onClick: () =>
|
|
798
|
+
onClick: () => g(u),
|
|
778
799
|
className: "shrink-0 rounded p-1 text-slate-300 hover:text-red-400",
|
|
779
800
|
"aria-label": `Remove ${e.title}`,
|
|
780
|
-
children: /* @__PURE__ */ t(
|
|
801
|
+
children: /* @__PURE__ */ t(te, { className: "h-3.5 w-3.5" })
|
|
781
802
|
}
|
|
782
803
|
)
|
|
783
|
-
] },
|
|
804
|
+
] }, u)
|
|
784
805
|
)) }),
|
|
785
|
-
y && (
|
|
786
|
-
!y && v.length === 0 &&
|
|
806
|
+
y && (l ?? []).length === 0 && !$ && /* @__PURE__ */ t("p", { className: "py-1 text-[12px] text-slate-400", children: "Tasks are created once the record is saved." }),
|
|
807
|
+
!y && v.length === 0 && !$ && /* @__PURE__ */ t("p", { className: "py-1 text-[13px] text-slate-400", children: "No open tasks" }),
|
|
787
808
|
!y && v.length > 0 && /* @__PURE__ */ t("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: v.map((e) => {
|
|
788
|
-
const
|
|
809
|
+
const u = Te(e.done_when), S = !e.assignee && e.team_id != null;
|
|
789
810
|
return /* @__PURE__ */ n("div", { className: "nvr-rise-in py-2", "data-task-row": e.id, children: [
|
|
790
811
|
/* @__PURE__ */ n("div", { className: "flex items-start gap-2.5", children: [
|
|
791
812
|
/* @__PURE__ */ t(
|
|
792
|
-
|
|
813
|
+
he,
|
|
793
814
|
{
|
|
794
815
|
className: "mt-0.5",
|
|
795
816
|
checked: !1,
|
|
796
|
-
onCheckedChange: () =>
|
|
797
|
-
disabled:
|
|
817
|
+
onCheckedChange: () => re.mutate(e.id),
|
|
818
|
+
disabled: re.isPending || !Y(e),
|
|
798
819
|
"aria-label": `Complete task: ${e.title}`
|
|
799
820
|
}
|
|
800
821
|
),
|
|
801
822
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
802
823
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: e.title }),
|
|
803
824
|
e.description && /* @__PURE__ */ t("p", { className: "mt-0.5 line-clamp-2 whitespace-pre-line text-[12px] text-slate-500", children: e.description }),
|
|
804
|
-
|
|
805
|
-
|
|
825
|
+
de(e, !1),
|
|
826
|
+
u.length > 0 && /* @__PURE__ */ n("p", { className: "mt-0.5 text-[11px] text-slate-500", "data-task-rule": !0, children: [
|
|
806
827
|
"Closes itself when ",
|
|
807
|
-
|
|
828
|
+
nt(u, X)
|
|
808
829
|
] }),
|
|
809
|
-
|
|
830
|
+
S && /* @__PURE__ */ t(
|
|
810
831
|
"button",
|
|
811
832
|
{
|
|
812
833
|
type: "button",
|
|
813
|
-
onClick: () =>
|
|
814
|
-
disabled:
|
|
834
|
+
onClick: () => ie.mutate(e.id),
|
|
835
|
+
disabled: ie.isPending,
|
|
815
836
|
className: "mt-1 rounded border border-slate-200 px-2 py-0.5 text-[11px] font-medium text-slate-700 hover:bg-muted dark:border-border dark:text-slate-300",
|
|
816
837
|
"data-task-claim": e.id,
|
|
817
838
|
children: "Pick it up"
|
|
818
839
|
}
|
|
819
840
|
)
|
|
820
841
|
] }),
|
|
821
|
-
|
|
842
|
+
ce(e, !1)
|
|
822
843
|
] }),
|
|
823
|
-
|
|
824
|
-
|
|
844
|
+
q === e.id && /* @__PURE__ */ t("div", { className: "mt-2 pl-6", children: /* @__PURE__ */ t(
|
|
845
|
+
xe,
|
|
825
846
|
{
|
|
826
847
|
collection: a,
|
|
827
848
|
item: o,
|
|
828
|
-
initial:
|
|
849
|
+
initial: ct(e),
|
|
829
850
|
submitLabel: "Save changes",
|
|
830
851
|
busy: H.isPending,
|
|
831
852
|
allowTeam: !1,
|
|
832
853
|
allowAgent: !0,
|
|
833
|
-
onCancel: () =>
|
|
834
|
-
onSubmit: (
|
|
835
|
-
const
|
|
836
|
-
title:
|
|
837
|
-
description:
|
|
838
|
-
due_date:
|
|
839
|
-
priority:
|
|
840
|
-
done_when:
|
|
854
|
+
onCancel: () => T(null),
|
|
855
|
+
onSubmit: (A) => {
|
|
856
|
+
const U = se(A), B = {
|
|
857
|
+
title: U.title,
|
|
858
|
+
description: U.description,
|
|
859
|
+
due_date: U.due_date,
|
|
860
|
+
priority: U.priority,
|
|
861
|
+
done_when: U.done_when
|
|
841
862
|
};
|
|
842
|
-
|
|
863
|
+
A.mode === "agent" ? A.agent && A.agent !== e.agent_assignee && (B.agent = A.agent) : A.mode === "person" && (E(A.assignee, e.assignee) ? e.agent_assignee && (B.agent = null) : B.assignee = A.assignee), H.mutate({ id: e.id, body: B });
|
|
843
864
|
}
|
|
844
865
|
}
|
|
845
866
|
) }),
|
|
846
|
-
|
|
867
|
+
s === e.id && /* @__PURE__ */ t("div", { className: "pl-6", children: /* @__PURE__ */ t(fe, { taskId: e.id }) })
|
|
847
868
|
] }, e.id);
|
|
848
869
|
}) }),
|
|
849
|
-
|
|
870
|
+
!$ && /* @__PURE__ */ n(
|
|
850
871
|
"button",
|
|
851
872
|
{
|
|
852
873
|
type: "button",
|
|
@@ -854,26 +875,26 @@ function _t({
|
|
|
854
875
|
className: "flex items-center gap-1.5 text-[12px] text-slate-400 transition-colors hover:text-nvr-cyan",
|
|
855
876
|
"data-task-add": !0,
|
|
856
877
|
children: [
|
|
857
|
-
/* @__PURE__ */ t(
|
|
878
|
+
/* @__PURE__ */ t(Oe, { className: "h-3.5 w-3.5" }),
|
|
858
879
|
"Add task"
|
|
859
880
|
]
|
|
860
881
|
}
|
|
861
882
|
),
|
|
862
|
-
|
|
863
|
-
|
|
883
|
+
$ && /* @__PURE__ */ t(
|
|
884
|
+
xe,
|
|
864
885
|
{
|
|
865
886
|
collection: a,
|
|
866
887
|
item: o,
|
|
867
|
-
initial:
|
|
888
|
+
initial: dt(),
|
|
868
889
|
submitLabel: y ? "Queue task" : "Create task",
|
|
869
|
-
busy:
|
|
890
|
+
busy: le.isPending,
|
|
870
891
|
allowTeam: !0,
|
|
871
892
|
allowAgent: !y,
|
|
872
893
|
onCancel: () => N(!1),
|
|
873
|
-
onSubmit: (e) => y ?
|
|
894
|
+
onSubmit: (e) => y ? De(e) : le.mutate(e)
|
|
874
895
|
}
|
|
875
896
|
),
|
|
876
|
-
!y &&
|
|
897
|
+
!y && Q.length > 0 && /* @__PURE__ */ n("div", { children: [
|
|
877
898
|
/* @__PURE__ */ n(
|
|
878
899
|
"button",
|
|
879
900
|
{
|
|
@@ -882,24 +903,24 @@ function _t({
|
|
|
882
903
|
className: "flex items-center gap-1 text-[12px] text-slate-400 transition-colors hover:text-slate-600",
|
|
883
904
|
children: [
|
|
884
905
|
/* @__PURE__ */ t(
|
|
885
|
-
|
|
906
|
+
me,
|
|
886
907
|
{
|
|
887
908
|
className: M(
|
|
888
909
|
"h-3.5 w-3.5 transition-transform",
|
|
889
|
-
|
|
910
|
+
k && "rotate-180"
|
|
890
911
|
)
|
|
891
912
|
}
|
|
892
913
|
),
|
|
893
914
|
"Completed (",
|
|
894
|
-
|
|
915
|
+
Q.length,
|
|
895
916
|
")"
|
|
896
917
|
]
|
|
897
918
|
}
|
|
898
919
|
),
|
|
899
|
-
|
|
920
|
+
k && /* @__PURE__ */ t("div", { className: "mt-1 divide-y divide-slate-100 dark:divide-border/60", children: Q.map((e) => /* @__PURE__ */ n("div", { className: "nvr-rise-in py-2", "data-task-row": e.id, children: [
|
|
900
921
|
/* @__PURE__ */ n("div", { className: "flex items-start gap-2.5", children: [
|
|
901
922
|
/* @__PURE__ */ t(
|
|
902
|
-
|
|
923
|
+
he,
|
|
903
924
|
{
|
|
904
925
|
className: "mt-0.5 opacity-60",
|
|
905
926
|
checked: !0,
|
|
@@ -909,16 +930,16 @@ function _t({
|
|
|
909
930
|
),
|
|
910
931
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1 opacity-70", children: [
|
|
911
932
|
/* @__PURE__ */ t("p", { className: "text-[13px] text-slate-600 line-through dark:text-slate-400", children: e.title }),
|
|
912
|
-
|
|
933
|
+
de(e, !0)
|
|
913
934
|
] }),
|
|
914
|
-
|
|
935
|
+
ce(e, !0)
|
|
915
936
|
] }),
|
|
916
|
-
|
|
937
|
+
s === e.id && /* @__PURE__ */ t("div", { className: "pl-6", children: /* @__PURE__ */ t(fe, { taskId: e.id }) })
|
|
917
938
|
] }, e.id)) })
|
|
918
939
|
] })
|
|
919
940
|
] }) })
|
|
920
941
|
] });
|
|
921
942
|
}
|
|
922
943
|
export {
|
|
923
|
-
|
|
944
|
+
It as TaskPanel
|
|
924
945
|
};
|