@nivaro/react 0.3.114 → 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 +1717 -21
- 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 +1 -0
- 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/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 +1927 -1635
- 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-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
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsxs as u, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as p } from "@tanstack/react-query";
|
|
3
|
+
import { Eye as h } from "lucide-react";
|
|
4
|
+
import { useRef as k, useEffect as g, useCallback as m } from "react";
|
|
5
|
+
import { useNivaroClient as x } from "../../context.js";
|
|
6
|
+
import { get as b } from "../../lib/commands.js";
|
|
7
|
+
import { SeenLog as w, filterUnseen as S } from "../../lib/unseen-changes.js";
|
|
8
|
+
import { formatRelative as N } from "../../lib/utils.js";
|
|
9
|
+
const $ = 1500;
|
|
10
|
+
function I(t, s) {
|
|
11
|
+
const a = x(), n = p(), l = k(null);
|
|
12
|
+
g(() => {
|
|
13
|
+
const r = new w(t, String(s));
|
|
14
|
+
l.current = r;
|
|
15
|
+
const i = n.getQueryCache();
|
|
16
|
+
return r.seed(
|
|
17
|
+
i.getAll().filter((e) => e.state.status === "success").map((e) => ({ queryKey: e.queryKey, dataUpdatedAt: e.state.dataUpdatedAt }))
|
|
18
|
+
), i.subscribe((e) => {
|
|
19
|
+
if (e.type !== "updated") return;
|
|
20
|
+
const o = e.action;
|
|
21
|
+
o.type === "fetch" ? r.started(e.query.queryHash) : o.type === "success" && r.succeeded(e.query.queryHash, e.query.queryKey);
|
|
22
|
+
});
|
|
23
|
+
}, [n, t, s]);
|
|
24
|
+
const y = m(async () => {
|
|
25
|
+
const r = l.current, i = r == null ? void 0 : r.since();
|
|
26
|
+
if (!r || i == null) return [];
|
|
27
|
+
const e = r.fieldsSince();
|
|
28
|
+
try {
|
|
29
|
+
const o = await Promise.race([
|
|
30
|
+
a.request(
|
|
31
|
+
b(`/records/${t}/${encodeURIComponent(String(s))}/unseen`, {
|
|
32
|
+
since: new Date(i).toISOString(),
|
|
33
|
+
...e != null ? { fields_since: new Date(e).toISOString() } : {}
|
|
34
|
+
})
|
|
35
|
+
).then((d) => d.data),
|
|
36
|
+
new Promise((d) => setTimeout(() => d(null), $))
|
|
37
|
+
]);
|
|
38
|
+
return o ? S(o.changes ?? [], r.all()) : [];
|
|
39
|
+
} catch {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
}, [a, t, s]), f = m(() => {
|
|
43
|
+
const r = String(s);
|
|
44
|
+
n.invalidateQueries({
|
|
45
|
+
predicate: (i) => {
|
|
46
|
+
const e = i.queryKey;
|
|
47
|
+
return Array.isArray(e) ? (e[0] === "item" || e[0] === "rrv-record") && e[1] === t || e[0] === "item-heading-links" && e[1] === t ? String(e[2]) === r : e[0] === "o2m-rows" || e[0] === "m2m-items" ? String(e[3]) === r : e[0] === "files-meta" || e[0] === "child-summary" : !1;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}, [n, t, s]);
|
|
51
|
+
return { check: y, review: f };
|
|
52
|
+
}
|
|
53
|
+
function C(t) {
|
|
54
|
+
if (t.kind === "field") {
|
|
55
|
+
const s = t.from ?? "empty", a = t.to ?? "empty";
|
|
56
|
+
return `${t.by} changed ${t.label} ${s} → ${a}`;
|
|
57
|
+
}
|
|
58
|
+
return `${t.by} ${t.text ?? `changed ${t.label}`}`;
|
|
59
|
+
}
|
|
60
|
+
function Q({ changes: t }) {
|
|
61
|
+
if (t.length === 0) return null;
|
|
62
|
+
const s = t.slice(0, 5), a = t.length - s.length;
|
|
63
|
+
return /* @__PURE__ */ u(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
"data-unseen-changes": !0,
|
|
67
|
+
role: "status",
|
|
68
|
+
className: "rounded-md border border-sky-200 bg-sky-50 px-3 py-2 text-[12px] text-sky-900 dark:border-sky-500/30 dark:bg-sky-500/10 dark:text-sky-100",
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ u("p", { className: "mb-1 flex items-center gap-1.5 font-semibold", children: [
|
|
71
|
+
/* @__PURE__ */ c(h, { className: "h-3.5 w-3.5 shrink-0 text-sky-600 dark:text-sky-300", "aria-hidden": !0 }),
|
|
72
|
+
"Changed since you opened it"
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ c("ul", { className: "space-y-0.5", children: s.map((n) => /* @__PURE__ */ u(
|
|
75
|
+
"li",
|
|
76
|
+
{
|
|
77
|
+
className: "flex min-w-0 items-baseline gap-1.5",
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ c("span", { className: "min-w-0 flex-1 break-words", children: C(n) }),
|
|
80
|
+
/* @__PURE__ */ c("span", { className: "shrink-0 text-[11px] text-sky-700/80 dark:text-sky-200/70", children: N(n.at) })
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
`${n.scope}:${n.field ?? ""}:${n.at}`
|
|
84
|
+
)) }),
|
|
85
|
+
a > 0 && /* @__PURE__ */ u("p", { className: "mt-0.5 text-[11px] text-sky-700/80 dark:text-sky-200/70", children: [
|
|
86
|
+
"and ",
|
|
87
|
+
a,
|
|
88
|
+
" more ",
|
|
89
|
+
a === 1 ? "change" : "changes"
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ c("p", { className: "mt-1 text-[11.5px] text-sky-800/80 dark:text-sky-200/80", children: "Review shows them on the page first. Continue moves it as it is now." })
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
$ as UNSEEN_CHECK_MS,
|
|
98
|
+
Q as UnseenChangesNotice,
|
|
99
|
+
C as unseenLine,
|
|
100
|
+
I as useUnseenMoveCheck
|
|
101
|
+
};
|
|
@@ -6,23 +6,24 @@ import { createPortal as gt } from "react-dom";
|
|
|
6
6
|
import { toast as O } from "sonner";
|
|
7
7
|
import { useNivaroClient as re } from "../../context.js";
|
|
8
8
|
import { get as K, post as A, del as ce, patch as Fe } from "../../lib/commands.js";
|
|
9
|
-
import { queryKeys as be } from "../../lib/query-keys.js";
|
|
10
9
|
import { toastError as yt } from "../../lib/error-toast.js";
|
|
10
|
+
import { queryKeys as be } from "../../lib/query-keys.js";
|
|
11
|
+
import { ConfigReachNote as vt } from "../ConfigReachNote.js";
|
|
11
12
|
import { UserAvatar as Oe } from "../UserAvatar.js";
|
|
12
13
|
import { Button as Se } from "../ui/button.js";
|
|
13
14
|
import { Popover as Pe, PopoverTrigger as Ee, PopoverContent as Ke } from "../ui/popover.js";
|
|
14
|
-
import { OwnerRecordTrial as
|
|
15
|
-
import { draftDelta as
|
|
15
|
+
import { OwnerRecordTrial as Nt } from "./OwnerRecordTrial.js";
|
|
16
|
+
import { draftDelta as wt, draftAddUser as kt, draftAddTeam as _t, draftRemoveTeam as qt, draftCreateGroup as Ft, draftPatchGroup as Ye, draftRemoveUser as Ct, draftSaveOps as $t, cloneGroupsMap as St } from "./owner-matrix-draft.js";
|
|
16
17
|
import { findM2ORelation as Ce, findO2MRelation as Ze, renderDisplayTemplate as $e } from "./relations.js";
|
|
17
|
-
import { TeamScopeEditor as
|
|
18
|
-
import { useScopeDimensions as
|
|
19
|
-
function
|
|
18
|
+
import { TeamScopeEditor as jt } from "./TeamScopeEditor.js";
|
|
19
|
+
import { useScopeDimensions as It, rankTeamForFilters as at, tierOrder as et } from "./teamScopes.js";
|
|
20
|
+
function Tt(f) {
|
|
20
21
|
return [...f].sort((b, v) => {
|
|
21
22
|
const o = Number(b.label), N = Number(v.label);
|
|
22
23
|
return !Number.isNaN(o) && !Number.isNaN(N) ? o - N : b.label.localeCompare(v.label, void 0, { sensitivity: "base" });
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
+
function Ot({
|
|
26
27
|
label: f,
|
|
27
28
|
value: b,
|
|
28
29
|
options: v,
|
|
@@ -31,14 +32,14 @@ function Tt({
|
|
|
31
32
|
loading: c
|
|
32
33
|
}) {
|
|
33
34
|
var m;
|
|
34
|
-
const [y, _] = T(!1), [$, F] = T(""), j = ue(null), w = ue(null), C = de(() =>
|
|
35
|
+
const [y, _] = T(!1), [$, F] = T(""), j = ue(null), w = ue(null), C = de(() => Tt(v), [v]), x = ue(N);
|
|
35
36
|
x.current = N, ve(() => {
|
|
36
37
|
y ? setTimeout(() => {
|
|
37
38
|
var u;
|
|
38
39
|
return (u = j.current) == null ? void 0 : u.focus();
|
|
39
40
|
}, 50) : (F(""), x.current(""));
|
|
40
41
|
}, [y]);
|
|
41
|
-
const
|
|
42
|
+
const P = (u) => {
|
|
42
43
|
F(u), w.current && clearTimeout(w.current), w.current = setTimeout(() => N(u.trim()), 300);
|
|
43
44
|
}, W = b ? ((m = v.find((u) => u.value === b)) == null ? void 0 : m.label) ?? b : null;
|
|
44
45
|
return /* @__PURE__ */ l(Pe, { open: y, onOpenChange: _, children: [
|
|
@@ -71,7 +72,7 @@ function Tt({
|
|
|
71
72
|
{
|
|
72
73
|
ref: j,
|
|
73
74
|
value: $,
|
|
74
|
-
onChange: (u) =>
|
|
75
|
+
onChange: (u) => P(u.target.value),
|
|
75
76
|
placeholder: `Search ${f.toLowerCase()}…`,
|
|
76
77
|
className: "h-7 w-full rounded-md bg-slate-50 pl-7 pr-2 text-[12px] placeholder-slate-400 focus:outline-none focus:ring-1 focus:ring-nvr-cyan/40"
|
|
77
78
|
}
|
|
@@ -123,7 +124,7 @@ function le(f, b, v, o) {
|
|
|
123
124
|
const $ = _.id;
|
|
124
125
|
return typeof $ == "number" ? $ : typeof $ == "string" && Number($) || null;
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
+
function Pt(f, b, v) {
|
|
127
128
|
const o = f.split(".");
|
|
128
129
|
let N = { _eq: v };
|
|
129
130
|
for (let c = o.length - 1; c >= 1; c--) N = { [o[c]]: N };
|
|
@@ -141,7 +142,7 @@ function st() {
|
|
|
141
142
|
});
|
|
142
143
|
return b ?? null;
|
|
143
144
|
}
|
|
144
|
-
function
|
|
145
|
+
function Et(f) {
|
|
145
146
|
const b = re(), v = f.trim(), { data: o, isFetching: N } = V({
|
|
146
147
|
queryKey: ["people-search", v],
|
|
147
148
|
queryFn: () => b.request(
|
|
@@ -155,12 +156,12 @@ function Be(f) {
|
|
|
155
156
|
const b = [f.first_name, f.last_name].filter(Boolean);
|
|
156
157
|
return b.length ? b.map((v) => v[0]).join("").toUpperCase() : f.email[0].toUpperCase();
|
|
157
158
|
}
|
|
158
|
-
function
|
|
159
|
+
function ir({ templateId: f, states: b, bindings: v }) {
|
|
159
160
|
var He;
|
|
160
161
|
const o = re(), N = v.flatMap((e) => e.dimensions ?? []), c = N.find((e) => e.is_row_axis) ?? null, y = N.filter((e) => !e.is_row_axis), { data: _, isLoading: $ } = V({
|
|
161
162
|
queryKey: ["pipeline-all-owner-groups", f],
|
|
162
163
|
queryFn: () => o.request(K(`/pipelines/${f}/owner-groups`)).then((e) => e.data)
|
|
163
|
-
}), [F, j] = T(!1), [w, C] = T(null), x = w ?? _,
|
|
164
|
+
}), [F, j] = T(!1), [w, C] = T(null), x = w ?? _, P = de(() => wt(_, w), [_, w]), W = It(), m = ((He = v[0]) == null ? void 0 : He.collection) ?? "", { data: u } = V({
|
|
164
165
|
queryKey: be.collectionMeta(m),
|
|
165
166
|
queryFn: () => o.request(K(`/collections/${m}`)).then((e) => e.data),
|
|
166
167
|
enabled: !!m && (!!c || y.length > 0)
|
|
@@ -227,9 +228,9 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
227
228
|
i = k.one_collection ?? i;
|
|
228
229
|
}
|
|
229
230
|
return { relatedCollection: i, subField: e.leafField };
|
|
230
|
-
}), [
|
|
231
|
+
}), [E, it] = T({}), [ot, dt] = T({}), ct = (e) => (e.cascade ?? []).map((a) => {
|
|
231
232
|
const r = y.find((n) => n.field === a.parent_field);
|
|
232
|
-
return r ? `${a.parent_field}=${
|
|
233
|
+
return r ? `${a.parent_field}=${E[r.id] ?? ""}` : "";
|
|
233
234
|
}).join("&"), oe = qe({
|
|
234
235
|
queries: y.map((e, a) => {
|
|
235
236
|
const r = pe[a], n = ot[e.id] ?? "";
|
|
@@ -242,7 +243,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
242
243
|
for (const g of e.cascade ?? []) {
|
|
243
244
|
const s = y.findIndex((I) => I.field === g.parent_field);
|
|
244
245
|
if (s < 0) continue;
|
|
245
|
-
const k =
|
|
246
|
+
const k = E[y[s].id];
|
|
246
247
|
if (!k) continue;
|
|
247
248
|
const h = pe[s];
|
|
248
249
|
let S = k;
|
|
@@ -257,7 +258,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
257
258
|
if (I.length === 0) continue;
|
|
258
259
|
S = I[0].id;
|
|
259
260
|
}
|
|
260
|
-
d.push(
|
|
261
|
+
d.push(Pt(g.filter, g.via_many, S));
|
|
261
262
|
}
|
|
262
263
|
return o.request(
|
|
263
264
|
K(`/items/${r.relatedCollection}`, {
|
|
@@ -344,7 +345,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
344
345
|
if (!c || !x) return { group: null, isInherited: !1 };
|
|
345
346
|
const r = x[e] ?? [], n = { [c.field]: a };
|
|
346
347
|
for (const h of y)
|
|
347
|
-
|
|
348
|
+
E[h.id] && (n[h.field] = E[h.id]);
|
|
348
349
|
const i = r.filter((h) => {
|
|
349
350
|
const S = h.filters ?? [];
|
|
350
351
|
return S.some(
|
|
@@ -357,10 +358,10 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
357
358
|
const g = [...i].sort((h, S) => {
|
|
358
359
|
const I = (S.filters ?? []).length - (h.filters ?? []).length;
|
|
359
360
|
return I !== 0 ? I : (h.priority ?? 0) - (S.priority ?? 0);
|
|
360
|
-
})[0], s = y.filter((h) => !h.required &&
|
|
361
|
+
})[0], s = y.filter((h) => !h.required && E[h.id]), k = s.length > 0 && !s.every(
|
|
361
362
|
(h) => {
|
|
362
363
|
var S;
|
|
363
|
-
return (S = g.filters) == null ? void 0 : S.some((I) => I.field === h.field && String(I.value) ===
|
|
364
|
+
return (S = g.filters) == null ? void 0 : S.some((I) => I.field === h.field && String(I.value) === E[h.id]);
|
|
364
365
|
}
|
|
365
366
|
);
|
|
366
367
|
return { group: g, isInherited: k };
|
|
@@ -389,7 +390,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
389
390
|
last_name: n.last_name ?? null,
|
|
390
391
|
email: n.email
|
|
391
392
|
} : { id: r, first_name: null, last_name: null, email: r };
|
|
392
|
-
return C((S) => S &&
|
|
393
|
+
return C((S) => S && kt(S, { stateId: e, groupId: s, filters: k, user: h })), U;
|
|
393
394
|
}
|
|
394
395
|
const { group: i, isInherited: d } = se(e, a);
|
|
395
396
|
let g = d ? null : i;
|
|
@@ -401,11 +402,11 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
401
402
|
op: "eq",
|
|
402
403
|
value: a,
|
|
403
404
|
id_value: c ? le(c, a, X, void 0) : void 0
|
|
404
|
-
}, h = y.filter((D) =>
|
|
405
|
+
}, h = y.filter((D) => E[D.id]).map((D) => ({
|
|
405
406
|
field: D.field,
|
|
406
407
|
op: "eq",
|
|
407
|
-
value:
|
|
408
|
-
id_value: le(D,
|
|
408
|
+
value: E[D.id],
|
|
409
|
+
id_value: le(D, E[D.id], void 0, s)
|
|
409
410
|
})), S = [k, ...h];
|
|
410
411
|
g = (await o.request(
|
|
411
412
|
A(`/pipelines/states/${e}/owner-groups`, {
|
|
@@ -430,11 +431,11 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
430
431
|
op: "eq",
|
|
431
432
|
value: a,
|
|
432
433
|
id_value: c ? le(c, a, X, void 0) : void 0
|
|
433
|
-
}, i = y.filter((d) =>
|
|
434
|
+
}, i = y.filter((d) => E[d.id]).map((d) => ({
|
|
434
435
|
field: d.field,
|
|
435
436
|
op: "eq",
|
|
436
|
-
value:
|
|
437
|
-
id_value: le(d,
|
|
437
|
+
value: E[d.id],
|
|
438
|
+
id_value: le(d, E[d.id], void 0, r)
|
|
438
439
|
}));
|
|
439
440
|
return [n, ...i];
|
|
440
441
|
}, { data: Qe } = V({
|
|
@@ -454,7 +455,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
454
455
|
slug: "",
|
|
455
456
|
member_count: 0
|
|
456
457
|
}, s = Me(e, a), k = J(e, a);
|
|
457
|
-
return C((h) => h &&
|
|
458
|
+
return C((h) => h && _t(h, { stateId: e, groupId: s, filters: k, team: g })), U;
|
|
458
459
|
}
|
|
459
460
|
const { group: n, isInherited: i } = se(e, a);
|
|
460
461
|
let d = i ? null : n;
|
|
@@ -472,7 +473,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
472
473
|
},
|
|
473
474
|
onError: () => O.error("Failed to assign team")
|
|
474
475
|
}), pt = G({
|
|
475
|
-
mutationFn: async ({ groupId: e, teamId: a }) => w ? (C((r) => r &&
|
|
476
|
+
mutationFn: async ({ groupId: e, teamId: a }) => w ? (C((r) => r && qt(r, e, a)), U) : o.request(ce(`/pipelines/owner-groups/${e}/teams/${a}`)),
|
|
476
477
|
onSuccess: (e) => {
|
|
477
478
|
e !== U && (z(), O.success("Team unassigned"));
|
|
478
479
|
},
|
|
@@ -511,7 +512,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
511
512
|
mutationFn: async ({ stateId: e, rowValue: a }) => {
|
|
512
513
|
if (w) {
|
|
513
514
|
const g = J(e, a);
|
|
514
|
-
return C((s) => s &&
|
|
515
|
+
return C((s) => s && Ft(s, e, g)), U;
|
|
515
516
|
}
|
|
516
517
|
const r = oe.flatMap(
|
|
517
518
|
(g) => g.data ?? []
|
|
@@ -520,11 +521,11 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
520
521
|
op: "eq",
|
|
521
522
|
value: a,
|
|
522
523
|
id_value: le(c, a, X, void 0)
|
|
523
|
-
}, i = y.filter((g) =>
|
|
524
|
+
}, i = y.filter((g) => E[g.id]).map((g) => ({
|
|
524
525
|
field: g.field,
|
|
525
526
|
op: "eq",
|
|
526
|
-
value:
|
|
527
|
-
id_value: le(g,
|
|
527
|
+
value: E[g.id],
|
|
528
|
+
id_value: le(g, E[g.id], void 0, r)
|
|
528
529
|
})), d = [n, ...i];
|
|
529
530
|
return o.request(
|
|
530
531
|
A(`/pipelines/states/${e}/owner-groups`, {
|
|
@@ -552,7 +553,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
552
553
|
},
|
|
553
554
|
onError: () => O.error("Failed to update WIP limit")
|
|
554
555
|
}), bt = G({
|
|
555
|
-
mutationFn: async (e) => w ? (C((a) => a &&
|
|
556
|
+
mutationFn: async (e) => w ? (C((a) => a && Ct(a, e)), U) : o.request(ce(`/pipelines/owner-group-users/${e}`)),
|
|
556
557
|
onSuccess: (e) => {
|
|
557
558
|
e !== U && (z(), O.success("Owner removed"));
|
|
558
559
|
},
|
|
@@ -584,13 +585,13 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
584
585
|
onError: (e) => {
|
|
585
586
|
z(), yt(e, "Could not save the draft");
|
|
586
587
|
}
|
|
587
|
-
}), We = de(() =>
|
|
588
|
+
}), We = de(() => $t(_, w), [_, w]), Y = y.filter((e) => e.required && !E[e.id]);
|
|
588
589
|
return c ? $ ? /* @__PURE__ */ l("div", { className: "flex items-center gap-2 py-4 text-[13px] text-slate-400", children: [
|
|
589
590
|
/* @__PURE__ */ t(te, { className: "h-4 w-4 animate-spin" }),
|
|
590
591
|
"Loading matrix…"
|
|
591
592
|
] }) : /* @__PURE__ */ l("div", { className: "space-y-4", children: [
|
|
592
593
|
ze && /* @__PURE__ */ t(
|
|
593
|
-
|
|
594
|
+
At,
|
|
594
595
|
{
|
|
595
596
|
team: ze,
|
|
596
597
|
onClose: () => {
|
|
@@ -599,7 +600,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
599
600
|
}
|
|
600
601
|
),
|
|
601
602
|
F && /* @__PURE__ */ t(
|
|
602
|
-
|
|
603
|
+
Ut,
|
|
603
604
|
{
|
|
604
605
|
templateId: f,
|
|
605
606
|
groupsMap: _ ?? {},
|
|
@@ -628,10 +629,10 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
628
629
|
return /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
|
|
629
630
|
/* @__PURE__ */ t("span", { className: "text-[12px] font-medium text-slate-600", children: e.label }),
|
|
630
631
|
/* @__PURE__ */ t(
|
|
631
|
-
|
|
632
|
+
Ot,
|
|
632
633
|
{
|
|
633
634
|
label: e.label,
|
|
634
|
-
value:
|
|
635
|
+
value: E[e.id] ?? "",
|
|
635
636
|
options: d,
|
|
636
637
|
onChange: (h) => it((S) => {
|
|
637
638
|
const I = { ...S, [e.id]: h };
|
|
@@ -662,7 +663,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
662
663
|
type: "button",
|
|
663
664
|
"data-tip": "Edit the matrix without saving, and try the changes on a record first",
|
|
664
665
|
onClick: () => {
|
|
665
|
-
j(!1), C(
|
|
666
|
+
j(!1), C(St(_));
|
|
666
667
|
},
|
|
667
668
|
className: "inline-flex shrink-0 items-center gap-1.5 rounded-md border border-violet-300 bg-white px-2.5 py-1 text-[12px] font-medium text-violet-700 transition-colors hover:bg-violet-50 dark:border-violet-500/40 dark:bg-card dark:text-violet-300 dark:hover:bg-violet-500/10",
|
|
668
669
|
children: [
|
|
@@ -681,7 +682,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
681
682
|
children: [
|
|
682
683
|
/* @__PURE__ */ t(Xe, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
683
684
|
/* @__PURE__ */ t("span", { className: "font-semibold", children: "Draft mode" }),
|
|
684
|
-
/* @__PURE__ */ t("span", { className: "text-violet-800/80 dark:text-violet-200/80", children:
|
|
685
|
+
/* @__PURE__ */ t("span", { className: "text-violet-800/80 dark:text-violet-200/80", children: P.length === 0 ? "Edit cells as usual — nothing is saved until you say so." : `${P.length} owner group${P.length === 1 ? "" : "s"} changed, not saved yet.` }),
|
|
685
686
|
/* @__PURE__ */ l("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
686
687
|
/* @__PURE__ */ t(
|
|
687
688
|
Se,
|
|
@@ -691,7 +692,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
691
692
|
className: "h-7 text-[12px]",
|
|
692
693
|
disabled: he.isPending,
|
|
693
694
|
onClick: () => C(null),
|
|
694
|
-
children:
|
|
695
|
+
children: P.length === 0 ? "Leave draft mode" : "Discard draft"
|
|
695
696
|
}
|
|
696
697
|
),
|
|
697
698
|
/* @__PURE__ */ l(
|
|
@@ -707,16 +708,24 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
707
708
|
]
|
|
708
709
|
}
|
|
709
710
|
)
|
|
710
|
-
] })
|
|
711
|
+
] }),
|
|
712
|
+
P.length > 0 && // rt8 #25 — who the saved owners reach right now (administrators).
|
|
713
|
+
/* @__PURE__ */ t(
|
|
714
|
+
vt,
|
|
715
|
+
{
|
|
716
|
+
className: "basis-full",
|
|
717
|
+
collections: v.map((e) => e.collection)
|
|
718
|
+
}
|
|
719
|
+
)
|
|
711
720
|
]
|
|
712
721
|
}
|
|
713
722
|
),
|
|
714
723
|
/* @__PURE__ */ t(
|
|
715
|
-
|
|
724
|
+
Nt,
|
|
716
725
|
{
|
|
717
726
|
templateId: f,
|
|
718
727
|
collections: [...new Set(v.map((e) => e.collection))],
|
|
719
|
-
draft: w ?
|
|
728
|
+
draft: w ? P : null,
|
|
720
729
|
displayTemplates: { [m]: (u == null ? void 0 : u.display_template) ?? null }
|
|
721
730
|
}
|
|
722
731
|
),
|
|
@@ -760,7 +769,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
760
769
|
/* @__PURE__ */ l("tr", { className: "hover:bg-slate-50/50", children: [
|
|
761
770
|
/* @__PURE__ */ t("td", { className: "sticky left-0 z-10 bg-white dark:bg-card border-b border-r border-slate-200 dark:border-border px-3 py-2 font-medium text-slate-700 dark:text-slate-200 text-[13px]", children: e.label }),
|
|
762
771
|
b.map((a) => {
|
|
763
|
-
const { group: r, isInherited: n } = se(a.id, e.value), i = (r == null ? void 0 : r.users) ?? [], d = (L == null ? void 0 : L.stateId) === a.id && (L == null ? void 0 : L.rowValue) === e.value, g = !n && y.some((s) => !s.required) && y.every((s) => s.required || !
|
|
772
|
+
const { group: r, isInherited: n } = se(a.id, e.value), i = (r == null ? void 0 : r.users) ?? [], d = (L == null ? void 0 : L.stateId) === a.id && (L == null ? void 0 : L.rowValue) === e.value, g = !n && y.some((s) => !s.required) && y.every((s) => s.required || !E[s.id]) && mt(a.id, e.value);
|
|
764
773
|
return /* @__PURE__ */ t(
|
|
765
774
|
"td",
|
|
766
775
|
{
|
|
@@ -939,7 +948,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
939
948
|
)
|
|
940
949
|
] }, s.link_id)),
|
|
941
950
|
/* @__PURE__ */ t(
|
|
942
|
-
|
|
951
|
+
Kt,
|
|
943
952
|
{
|
|
944
953
|
templateId: f,
|
|
945
954
|
stateId: a.id,
|
|
@@ -947,7 +956,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
947
956
|
}
|
|
948
957
|
),
|
|
949
958
|
/* @__PURE__ */ t(
|
|
950
|
-
|
|
959
|
+
Bt,
|
|
951
960
|
{
|
|
952
961
|
stateId: a.id,
|
|
953
962
|
rowValue: e.value,
|
|
@@ -1036,7 +1045,7 @@ function sr({ templateId: f, states: b, bindings: v }) {
|
|
|
1036
1045
|
] }) })
|
|
1037
1046
|
] }) : null;
|
|
1038
1047
|
}
|
|
1039
|
-
function
|
|
1048
|
+
function Kt({
|
|
1040
1049
|
templateId: f,
|
|
1041
1050
|
stateId: b,
|
|
1042
1051
|
buildFilters: v
|
|
@@ -1081,7 +1090,7 @@ function Et({
|
|
|
1081
1090
|
}
|
|
1082
1091
|
) });
|
|
1083
1092
|
}
|
|
1084
|
-
function
|
|
1093
|
+
function Bt({
|
|
1085
1094
|
stateId: f,
|
|
1086
1095
|
rowValue: b,
|
|
1087
1096
|
existingUserIds: v,
|
|
@@ -1094,14 +1103,14 @@ function Kt({
|
|
|
1094
1103
|
onCreateTeam: F,
|
|
1095
1104
|
isPending: j
|
|
1096
1105
|
}) {
|
|
1097
|
-
const [w, C] = T(!1), [x,
|
|
1106
|
+
const [w, C] = T(!1), [x, P] = T(""), [W, m] = T(!1), [u, q] = T(""), Q = ue(null);
|
|
1098
1107
|
ve(() => {
|
|
1099
1108
|
w ? setTimeout(() => {
|
|
1100
1109
|
var p;
|
|
1101
1110
|
return (p = Q.current) == null ? void 0 : p.focus();
|
|
1102
|
-
}, 50) : (
|
|
1111
|
+
}, 50) : (P(""), m(!1), q(""));
|
|
1103
1112
|
}, [w]);
|
|
1104
|
-
const B = st(), { people: ae } =
|
|
1113
|
+
const B = st(), { people: ae } = Et(w ? x : ""), R = x.trim().toLowerCase(), M = (p) => [p.first_name, p.last_name].filter(Boolean).join(" ") || p.email, H = new Set(v.filter(Boolean).map((p) => String(p).toUpperCase())), Z = (R ? o.filter((p) => p.name.toLowerCase().includes(R)) : o).map((p) => ({
|
|
1105
1114
|
...p,
|
|
1106
1115
|
rank: at(p.scopes, N, c, y)
|
|
1107
1116
|
})).sort(
|
|
@@ -1166,7 +1175,7 @@ function Kt({
|
|
|
1166
1175
|
{
|
|
1167
1176
|
ref: Q,
|
|
1168
1177
|
value: x,
|
|
1169
|
-
onChange: (p) =>
|
|
1178
|
+
onChange: (p) => P(p.target.value),
|
|
1170
1179
|
placeholder: "Search teams and people…",
|
|
1171
1180
|
className: "h-7 w-full rounded-md bg-slate-50 pl-7 pr-2 text-[12px] placeholder-slate-400 focus:outline-none focus:ring-1 focus:ring-nvr-cyan/40 dark:bg-muted"
|
|
1172
1181
|
}
|
|
@@ -1246,17 +1255,17 @@ function Kt({
|
|
|
1246
1255
|
] })
|
|
1247
1256
|
] });
|
|
1248
1257
|
}
|
|
1249
|
-
function
|
|
1258
|
+
function Ut({
|
|
1250
1259
|
templateId: f,
|
|
1251
1260
|
groupsMap: b,
|
|
1252
1261
|
states: v,
|
|
1253
1262
|
onClose: o,
|
|
1254
1263
|
onDone: N
|
|
1255
1264
|
}) {
|
|
1256
|
-
const c = re(), [y, _] = T(""), [$, F] = T(""), [j, w] = T(/* @__PURE__ */ new Set()), [C, x] = T(!1), { data:
|
|
1265
|
+
const c = re(), [y, _] = T(""), [$, F] = T(""), [j, w] = T(/* @__PURE__ */ new Set()), [C, x] = T(!1), { data: P = [] } = V({
|
|
1257
1266
|
queryKey: ["bulk-matrix-users", y.trim()],
|
|
1258
1267
|
queryFn: () => c.request(K("/users", { limit: 50, sort: "first_name", search: y.trim() || void 0 })).then((u) => u.data)
|
|
1259
|
-
}), W =
|
|
1268
|
+
}), W = P.slice(0, 8), m = () => {
|
|
1260
1269
|
x(!0), c.request(
|
|
1261
1270
|
A(`/pipelines/${f}/owner-groups/bulk-add`, {
|
|
1262
1271
|
user_id: $,
|
|
@@ -1273,7 +1282,7 @@ function Bt({
|
|
|
1273
1282
|
"Adding",
|
|
1274
1283
|
" ",
|
|
1275
1284
|
/* @__PURE__ */ t("b", { children: (() => {
|
|
1276
|
-
const u =
|
|
1285
|
+
const u = P.find((q) => q.id === $);
|
|
1277
1286
|
return u ? [u.first_name, u.last_name].filter(Boolean).join(" ") || u.email : $;
|
|
1278
1287
|
})() }),
|
|
1279
1288
|
" ",
|
|
@@ -1345,7 +1354,7 @@ function Bt({
|
|
|
1345
1354
|
] })
|
|
1346
1355
|
] });
|
|
1347
1356
|
}
|
|
1348
|
-
function
|
|
1357
|
+
function At({
|
|
1349
1358
|
team: f,
|
|
1350
1359
|
onClose: b
|
|
1351
1360
|
}) {
|
|
@@ -1414,7 +1423,7 @@ function Ut({
|
|
|
1414
1423
|
(N ?? []).length === 0 && /* @__PURE__ */ t("p", { className: "py-2 text-[12px] text-slate-400", children: "No members yet — add people below." })
|
|
1415
1424
|
] }),
|
|
1416
1425
|
/* @__PURE__ */ t(
|
|
1417
|
-
|
|
1426
|
+
Mt,
|
|
1418
1427
|
{
|
|
1419
1428
|
teamId: f.id,
|
|
1420
1429
|
excludeIds: [...F],
|
|
@@ -1422,7 +1431,7 @@ function Ut({
|
|
|
1422
1431
|
onPick: (x) => _.mutate(x)
|
|
1423
1432
|
}
|
|
1424
1433
|
),
|
|
1425
|
-
/* @__PURE__ */ t("div", { className: "mt-3 border-t border-slate-100 pt-3 dark:border-border/60", children: /* @__PURE__ */ t(
|
|
1434
|
+
/* @__PURE__ */ t("div", { className: "mt-3 border-t border-slate-100 pt-3 dark:border-border/60", children: /* @__PURE__ */ t(jt, { teamId: f.id, scopes: w }) }),
|
|
1426
1435
|
/* @__PURE__ */ t("div", { className: "mt-3 flex justify-end", children: /* @__PURE__ */ t(Se, { size: "sm", variant: "outline", className: "h-7 text-[12px]", onClick: b, children: "Done" }) })
|
|
1427
1436
|
]
|
|
1428
1437
|
}
|
|
@@ -1432,12 +1441,12 @@ function Ut({
|
|
|
1432
1441
|
document.body
|
|
1433
1442
|
);
|
|
1434
1443
|
}
|
|
1435
|
-
const
|
|
1444
|
+
const Dt = {
|
|
1436
1445
|
match: "Matches team scope",
|
|
1437
1446
|
unrestricted: "No restrictions",
|
|
1438
1447
|
mismatch: "Outside team scope"
|
|
1439
1448
|
};
|
|
1440
|
-
function
|
|
1449
|
+
function Mt({
|
|
1441
1450
|
teamId: f,
|
|
1442
1451
|
excludeIds: b,
|
|
1443
1452
|
isPending: v,
|
|
@@ -1457,7 +1466,7 @@ function Dt({
|
|
|
1457
1466
|
).then((m) => m.data),
|
|
1458
1467
|
enabled: c,
|
|
1459
1468
|
staleTime: 6e4
|
|
1460
|
-
}), C = (m) => [m.first_name, m.last_name].filter(Boolean).join(" ") || m.email, x = new Set(b.map((m) => m.toUpperCase())),
|
|
1469
|
+
}), C = (m) => [m.first_name, m.last_name].filter(Boolean).join(" ") || m.email, x = new Set(b.map((m) => m.toUpperCase())), P = ((w == null ? void 0 : w.users) ?? []).filter((m) => !x.has(String(m.id).toUpperCase())), W = !!(w != null && w.ranked);
|
|
1461
1470
|
return /* @__PURE__ */ l(Pe, { open: c, onOpenChange: y, children: [
|
|
1462
1471
|
/* @__PURE__ */ t(Ee, { asChild: !0, children: /* @__PURE__ */ l(
|
|
1463
1472
|
"button",
|
|
@@ -1489,14 +1498,14 @@ function Dt({
|
|
|
1489
1498
|
)
|
|
1490
1499
|
] }) }),
|
|
1491
1500
|
/* @__PURE__ */ l("div", { className: "max-h-56 overflow-y-auto py-1", children: [
|
|
1492
|
-
|
|
1493
|
-
const q = m.scope_tier ?? "unrestricted", Q = W && (u === 0 || (
|
|
1501
|
+
P.map((m, u) => {
|
|
1502
|
+
const q = m.scope_tier ?? "unrestricted", Q = W && (u === 0 || (P[u - 1].scope_tier ?? "unrestricted") !== q);
|
|
1494
1503
|
return /* @__PURE__ */ l(rt, { children: [
|
|
1495
1504
|
Q && /* @__PURE__ */ t(
|
|
1496
1505
|
"p",
|
|
1497
1506
|
{
|
|
1498
1507
|
className: `px-3 pb-0.5 pt-1.5 text-[10px] font-semibold uppercase tracking-wide ${q === "mismatch" ? "text-amber-500" : q === "match" ? "text-emerald-600 dark:text-emerald-400" : "text-slate-400"}`,
|
|
1499
|
-
children:
|
|
1508
|
+
children: Dt[q]
|
|
1500
1509
|
}
|
|
1501
1510
|
),
|
|
1502
1511
|
/* @__PURE__ */ l(
|
|
@@ -1530,12 +1539,12 @@ function Dt({
|
|
|
1530
1539
|
)
|
|
1531
1540
|
] }, m.id);
|
|
1532
1541
|
}),
|
|
1533
|
-
|
|
1542
|
+
P.length === 0 && /* @__PURE__ */ t("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No matches — people already on the team are hidden" })
|
|
1534
1543
|
] })
|
|
1535
1544
|
] })
|
|
1536
1545
|
] });
|
|
1537
1546
|
}
|
|
1538
1547
|
export {
|
|
1539
|
-
|
|
1540
|
-
|
|
1548
|
+
Mt as MemberPickerCombobox,
|
|
1549
|
+
ir as OwnerMatrix
|
|
1541
1550
|
};
|