@burdenoff/microfe-timecampus 2026.1203.1 → 2026.1204.1
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/timecampus/components/EmptyState.d.ts +7 -0
- package/dist/timecampus/components/EmptyState.js +3 -2
- package/dist/timecampus/components/EmptyState.js.map +1 -1
- package/dist/timecampus/components/FilterBar.js +1 -0
- package/dist/timecampus/components/Toast.js +1 -1
- package/dist/timecampus/components/Toast.js.map +1 -1
- package/dist/timecampus/components/charts/Heatmap.js +1 -1
- package/dist/timecampus/components/charts/Heatmap.js.map +1 -1
- package/dist/timecampus/components/maps/LocationGeofenceMap.js +3 -3
- package/dist/timecampus/components/maps/LocationGeofenceMap.js.map +1 -1
- package/dist/timecampus/pages/HomePage.js +1 -1
- package/dist/timecampus/pages/HomePage.js.map +1 -1
- package/dist/timecampus/pages/admin/AdminPage.js +283 -283
- package/dist/timecampus/pages/admin/AdminPage.js.map +1 -1
- package/dist/timecampus/pages/application-usage/ApplicationUsagePage.js +79 -79
- package/dist/timecampus/pages/application-usage/ApplicationUsagePage.js.map +1 -1
- package/dist/timecampus/pages/channels/ChannelsPage.js +8 -8
- package/dist/timecampus/pages/channels/ChannelsPage.js.map +1 -1
- package/dist/timecampus/pages/client-portal/ClientPortalPage.js +2 -2
- package/dist/timecampus/pages/client-portal/ClientPortalPage.js.map +1 -1
- package/dist/timecampus/pages/dashboard/ServerReportExports.js +34 -34
- package/dist/timecampus/pages/dashboard/ServerReportExports.js.map +1 -1
- package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js +49 -48
- package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/extend/AppletDeveloperPage.js +122 -117
- package/dist/timecampus/pages/extend/AppletDeveloperPage.js.map +1 -1
- package/dist/timecampus/pages/extend/AppletReviewPage.js +2 -2
- package/dist/timecampus/pages/extend/AppletReviewPage.js.map +1 -1
- package/dist/timecampus/pages/extend/AppletStorePage.js +2 -2
- package/dist/timecampus/pages/extend/AppletStorePage.js.map +1 -1
- package/dist/timecampus/pages/extend/MarketplaceCertificationPage.js +131 -126
- package/dist/timecampus/pages/extend/MarketplaceCertificationPage.js.map +1 -1
- package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js +94 -94
- package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js.map +1 -1
- package/dist/timecampus/pages/extend/TimeTriggersPage.js +98 -98
- package/dist/timecampus/pages/extend/TimeTriggersPage.js.map +1 -1
- package/dist/timecampus/pages/focus/FocusProtectionPage.js +121 -121
- package/dist/timecampus/pages/focus/FocusProtectionPage.js.map +1 -1
- package/dist/timecampus/pages/geofencing/GeofencingPage.js +348 -348
- package/dist/timecampus/pages/geofencing/GeofencingPage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/LifeBalancePage.js +3 -3
- package/dist/timecampus/pages/lifetime/LifeBalancePage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/LifeTimelinePage.js +25 -25
- package/dist/timecampus/pages/lifetime/LifeTimelinePage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/RecommendationsPage.js +297 -297
- package/dist/timecampus/pages/lifetime/RecommendationsPage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/ValuesGoalsPage.js +189 -189
- package/dist/timecampus/pages/lifetime/ValuesGoalsPage.js.map +1 -1
- package/dist/timecampus/pages/location-tracking/LocationTrackingPage.js +2 -2
- package/dist/timecampus/pages/location-tracking/LocationTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/meetings/ActionItemFormModal.js +47 -46
- package/dist/timecampus/pages/meetings/ActionItemFormModal.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingDetailPage.js +207 -207
- package/dist/timecampus/pages/meetings/MeetingDetailPage.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingFormModal.js +73 -72
- package/dist/timecampus/pages/meetings/MeetingFormModal.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingsPage.js +1 -1
- package/dist/timecampus/pages/meetings/MeetingsPage.js.map +1 -1
- package/dist/timecampus/pages/meetings/ParticipantFormModal.js +32 -31
- package/dist/timecampus/pages/meetings/ParticipantFormModal.js.map +1 -1
- package/dist/timecampus/pages/mobile/MobileScreen.js +1 -1
- package/dist/timecampus/pages/mobile/MobileScreen.js.map +1 -1
- package/dist/timecampus/pages/mobile/MobileTimelinePage.js +8 -8
- package/dist/timecampus/pages/mobile/MobileTimelinePage.js.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroAnalyticsPage.js +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroAnalyticsPage.js.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroPage.js +34 -34
- package/dist/timecampus/pages/pomodoro/PomodoroPage.js.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroSettingsPage.js +3 -3
- package/dist/timecampus/pages/pomodoro/PomodoroSettingsPage.js.map +1 -1
- package/dist/timecampus/pages/projects/ProjectDetailPage.js +163 -163
- package/dist/timecampus/pages/projects/ProjectDetailPage.js.map +1 -1
- package/dist/timecampus/pages/projects/ProjectsPage.js +193 -192
- package/dist/timecampus/pages/projects/ProjectsPage.js.map +1 -1
- package/dist/timecampus/pages/projects/TasksPage.js +92 -92
- package/dist/timecampus/pages/projects/TasksPage.js.map +1 -1
- package/dist/timecampus/pages/resource-planning/ResourcePlanningPage.js +66 -66
- package/dist/timecampus/pages/resource-planning/ResourcePlanningPage.js.map +1 -1
- package/dist/timecampus/pages/settings/IdleDetectionCard.js +33 -33
- package/dist/timecampus/pages/settings/IdleDetectionCard.js.map +1 -1
- package/dist/timecampus/pages/settings/PrivacySettingsPage.js +32 -32
- package/dist/timecampus/pages/settings/PrivacySettingsPage.js.map +1 -1
- package/dist/timecampus/pages/settings/SettingsPage.js +3 -3
- package/dist/timecampus/pages/settings/SettingsPage.js.map +1 -1
- package/dist/timecampus/pages/team/TeamMembersPage.js +1 -1
- package/dist/timecampus/pages/team/TeamMembersPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimeEntriesPage.js +169 -169
- package/dist/timecampus/pages/time/TimeEntriesPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimeTrackingPage.js +32 -32
- package/dist/timecampus/pages/time/TimeTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimerPage.js +85 -85
- package/dist/timecampus/pages/time/TimerPage.js.map +1 -1
- package/dist/timecampus/pages/time-approval/SubmitTimesheetModal.js +1 -1
- package/dist/timecampus/pages/time-approval/SubmitTimesheetModal.js.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.js +227 -227
- package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
- package/dist/timecampus/shared/hooks/useConfirmedAction.d.ts +10 -0
- package/dist/timecampus/shared/hooks/useConfirmedAction.js +14 -0
- package/dist/timecampus/shared/hooks/useConfirmedAction.js.map +1 -0
- package/package.json +6 -4
|
@@ -8,15 +8,15 @@ import { ToastContainer as o, useToast as s } from "../../components/Toast.js";
|
|
|
8
8
|
import { formatDate as c } from "../../utils/helpers.js";
|
|
9
9
|
import { useTimeCampus as ee } from "../../providers/TimeCampusProvider.js";
|
|
10
10
|
import { TimeCampusTriggerComparator as l, TimeCampusTriggerMetric as u } from "../../../generated/wspace-types.js";
|
|
11
|
-
import { ListMyTimeTriggersDocument as d, useCreateTimeTriggerMutation as
|
|
12
|
-
import { TRIGGER_METRIC_KEYS as
|
|
11
|
+
import { ListMyTimeTriggersDocument as d, useCreateTimeTriggerMutation as te, useDeleteTimeTriggerMutation as ne, useListMyTimeTriggersQuery as re, useRunTimeTriggerMutation as ie, useUpdateTimeTriggerMutation as f } from "../../../generated/wspace-operations.js";
|
|
12
|
+
import { TRIGGER_METRIC_KEYS as p, TRIGGER_PRESETS as ae, browserTimezone as m, describeRule as h, formatHour as g, formatMetric as _, isTriggerComparatorKey as v, isTriggerMetricKey as y, metricMeta as b, validateTriggerForm as oe, workflowLinkForTrigger as x } from "./triggerHelpers.js";
|
|
13
13
|
import { useOpenRoute as se } from "./useOpenRoute.js";
|
|
14
14
|
import { useMemo as S, useState as C } from "react";
|
|
15
15
|
import { BellRing as w, Pencil as T, Play as E, Plus as D, Store as ce, Trash2 as O, Workflow as k } from "lucide-react";
|
|
16
16
|
import { jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
17
|
-
import { GlassCard as M } from "@burdenoff/fe-libs/ui";
|
|
17
|
+
import { GlassCard as M, ThemedSelect as N } from "@burdenoff/fe-libs/ui";
|
|
18
18
|
// src/timecampus/pages/extend/TimeTriggersPage.tsx
|
|
19
|
-
var
|
|
19
|
+
var P = [{ query: d }], F = "inline-flex items-center justify-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50", I = "inline-flex items-center justify-center gap-1.5 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-surface-hover disabled:opacity-50", L = "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary", R = Array.from({ length: 24 }, (e, t) => t), le = {
|
|
20
20
|
TRACKED_HOURS: u.TrackedHours,
|
|
21
21
|
FOCUS_PERCENT: u.FocusPercent,
|
|
22
22
|
CONTEXT_SWITCHES: u.ContextSwitches,
|
|
@@ -24,7 +24,7 @@ var N = [{ query: d }], P = "inline-flex items-center justify-center gap-1.5 rou
|
|
|
24
24
|
}, ue = {
|
|
25
25
|
BELOW: l.Below,
|
|
26
26
|
ABOVE: l.Above
|
|
27
|
-
},
|
|
27
|
+
}, z = {
|
|
28
28
|
name: "",
|
|
29
29
|
metric: "TRACKED_HOURS",
|
|
30
30
|
comparator: "BELOW",
|
|
@@ -32,12 +32,12 @@ var N = [{ query: d }], P = "inline-flex items-center justify-center gap-1.5 rou
|
|
|
32
32
|
checkHour: 17,
|
|
33
33
|
message: ""
|
|
34
34
|
};
|
|
35
|
-
function
|
|
35
|
+
function B(e) {
|
|
36
36
|
return e instanceof Error && e.message ? e.message : "Something went wrong";
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function V(e) {
|
|
39
39
|
let { metric: t, comparator: n } = e;
|
|
40
|
-
return !
|
|
40
|
+
return !y(t) || !v(n) ? null : {
|
|
41
41
|
name: e.name,
|
|
42
42
|
metric: t,
|
|
43
43
|
comparator: n,
|
|
@@ -46,8 +46,8 @@ function B(e) {
|
|
|
46
46
|
message: e.message ?? ""
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
let n =
|
|
49
|
+
function H({ form: e, onChange: t }) {
|
|
50
|
+
let n = b(e.metric);
|
|
51
51
|
return /* @__PURE__ */ j("div", {
|
|
52
52
|
className: "flex flex-col gap-4",
|
|
53
53
|
children: [
|
|
@@ -57,7 +57,7 @@ function V({ form: e, onChange: t }) {
|
|
|
57
57
|
className: "font-medium text-text-primary",
|
|
58
58
|
children: "Name"
|
|
59
59
|
}), /* @__PURE__ */ A("input", {
|
|
60
|
-
className:
|
|
60
|
+
className: L,
|
|
61
61
|
value: e.name,
|
|
62
62
|
maxLength: 80,
|
|
63
63
|
onChange: (n) => t({
|
|
@@ -76,17 +76,17 @@ function V({ form: e, onChange: t }) {
|
|
|
76
76
|
children: [/* @__PURE__ */ A("span", {
|
|
77
77
|
className: "font-medium text-text-primary",
|
|
78
78
|
children: "When"
|
|
79
|
-
}), /* @__PURE__ */ A(
|
|
80
|
-
className:
|
|
79
|
+
}), /* @__PURE__ */ A(N, {
|
|
80
|
+
className: L,
|
|
81
81
|
value: e.metric,
|
|
82
82
|
"aria-label": "Metric",
|
|
83
83
|
onChange: (n) => t({
|
|
84
84
|
...e,
|
|
85
85
|
metric: n.target.value
|
|
86
86
|
}),
|
|
87
|
-
children:
|
|
87
|
+
children: p.map((e) => /* @__PURE__ */ A("option", {
|
|
88
88
|
value: e,
|
|
89
|
-
children:
|
|
89
|
+
children: b(e).label
|
|
90
90
|
}, e))
|
|
91
91
|
})]
|
|
92
92
|
}),
|
|
@@ -95,8 +95,8 @@ function V({ form: e, onChange: t }) {
|
|
|
95
95
|
children: [/* @__PURE__ */ A("span", {
|
|
96
96
|
className: "font-medium text-text-primary",
|
|
97
97
|
children: "is"
|
|
98
|
-
}), /* @__PURE__ */ j(
|
|
99
|
-
className:
|
|
98
|
+
}), /* @__PURE__ */ j(N, {
|
|
99
|
+
className: L,
|
|
100
100
|
value: e.comparator,
|
|
101
101
|
"aria-label": "Comparator",
|
|
102
102
|
onChange: (n) => t({
|
|
@@ -118,7 +118,7 @@ function V({ form: e, onChange: t }) {
|
|
|
118
118
|
className: "font-medium text-text-primary",
|
|
119
119
|
children: ["Threshold", n.unit ? ` (${n.unit})` : ""]
|
|
120
120
|
}), /* @__PURE__ */ A("input", {
|
|
121
|
-
className:
|
|
121
|
+
className: L,
|
|
122
122
|
type: "number",
|
|
123
123
|
min: 0,
|
|
124
124
|
max: n.max,
|
|
@@ -144,24 +144,24 @@ function V({ form: e, onChange: t }) {
|
|
|
144
144
|
className: "font-medium text-text-primary",
|
|
145
145
|
children: "Check from"
|
|
146
146
|
}),
|
|
147
|
-
/* @__PURE__ */ A(
|
|
148
|
-
className:
|
|
147
|
+
/* @__PURE__ */ A(N, {
|
|
148
|
+
className: L,
|
|
149
149
|
value: e.checkHour,
|
|
150
150
|
"aria-label": "Check from",
|
|
151
151
|
onChange: (n) => t({
|
|
152
152
|
...e,
|
|
153
153
|
checkHour: Number(n.target.value)
|
|
154
154
|
}),
|
|
155
|
-
children:
|
|
155
|
+
children: R.map((e) => /* @__PURE__ */ A("option", {
|
|
156
156
|
value: e,
|
|
157
|
-
children: e === 0 ? "Any time of day" : `${
|
|
157
|
+
children: e === 0 ? "Any time of day" : `${g(e)} onwards`
|
|
158
158
|
}, e))
|
|
159
159
|
}),
|
|
160
160
|
/* @__PURE__ */ j("span", {
|
|
161
161
|
className: "text-xs text-text-tertiary",
|
|
162
162
|
children: [
|
|
163
163
|
"Your day runs in ",
|
|
164
|
-
|
|
164
|
+
m(),
|
|
165
165
|
". Rules about falling short (for example below 6 h) work best with a late check hour."
|
|
166
166
|
]
|
|
167
167
|
})
|
|
@@ -173,7 +173,7 @@ function V({ form: e, onChange: t }) {
|
|
|
173
173
|
className: "font-medium text-text-primary",
|
|
174
174
|
children: "Note in the nudge (optional)"
|
|
175
175
|
}), /* @__PURE__ */ A("textarea", {
|
|
176
|
-
className:
|
|
176
|
+
className: L,
|
|
177
177
|
rows: 2,
|
|
178
178
|
maxLength: 280,
|
|
179
179
|
value: e.message,
|
|
@@ -187,7 +187,7 @@ function V({ form: e, onChange: t }) {
|
|
|
187
187
|
}),
|
|
188
188
|
/* @__PURE__ */ j("p", {
|
|
189
189
|
className: "rounded-md bg-bg-sunken px-3 py-2 text-sm text-text-secondary",
|
|
190
|
-
children: [
|
|
190
|
+
children: [h({
|
|
191
191
|
metric: e.metric,
|
|
192
192
|
comparator: e.comparator,
|
|
193
193
|
threshold: Number(e.threshold) || 0,
|
|
@@ -197,7 +197,7 @@ function V({ form: e, onChange: t }) {
|
|
|
197
197
|
]
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function de({ trigger: e, busy: t, onToggle: n, onRun: r, onEdit: i, onDelete: o, onUseInWorkflow: s }) {
|
|
201
201
|
return /* @__PURE__ */ j(M, {
|
|
202
202
|
treatment: "glass",
|
|
203
203
|
className: "flex h-full flex-col gap-3 p-5",
|
|
@@ -220,7 +220,7 @@ function H({ trigger: e, busy: t, onToggle: n, onRun: r, onEdit: i, onDelete: o,
|
|
|
220
220
|
children: e.name
|
|
221
221
|
}), /* @__PURE__ */ A("p", {
|
|
222
222
|
className: "text-sm text-text-secondary",
|
|
223
|
-
children:
|
|
223
|
+
children: h(e)
|
|
224
224
|
})]
|
|
225
225
|
}),
|
|
226
226
|
/* @__PURE__ */ A(a, {
|
|
@@ -243,7 +243,7 @@ function H({ trigger: e, busy: t, onToggle: n, onRun: r, onEdit: i, onDelete: o,
|
|
|
243
243
|
className: "grid grid-cols-2 gap-2 text-xs text-text-tertiary",
|
|
244
244
|
children: [/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("dt", { children: "Today so far" }), /* @__PURE__ */ A("dd", {
|
|
245
245
|
className: "text-sm font-medium text-text-primary",
|
|
246
|
-
children: e.lastValue == null ? "Not checked yet" :
|
|
246
|
+
children: e.lastValue == null ? "Not checked yet" : _(e.metric, e.lastValue)
|
|
247
247
|
})] }), /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("dt", { children: "Last fired" }), /* @__PURE__ */ j("dd", {
|
|
248
248
|
className: "text-sm font-medium text-text-primary",
|
|
249
249
|
children: [e.lastFiredAt ? c(e.lastFiredAt) : "Never", e.fireCount > 0 ? ` · ${e.fireCount}×` : ""]
|
|
@@ -254,7 +254,7 @@ function H({ trigger: e, busy: t, onToggle: n, onRun: r, onEdit: i, onDelete: o,
|
|
|
254
254
|
children: [
|
|
255
255
|
/* @__PURE__ */ j("button", {
|
|
256
256
|
type: "button",
|
|
257
|
-
className:
|
|
257
|
+
className: F,
|
|
258
258
|
onClick: r,
|
|
259
259
|
disabled: t,
|
|
260
260
|
"aria-label": `Check ${e.name} now`,
|
|
@@ -265,7 +265,7 @@ function H({ trigger: e, busy: t, onToggle: n, onRun: r, onEdit: i, onDelete: o,
|
|
|
265
265
|
}),
|
|
266
266
|
/* @__PURE__ */ j("button", {
|
|
267
267
|
type: "button",
|
|
268
|
-
className:
|
|
268
|
+
className: I,
|
|
269
269
|
onClick: i,
|
|
270
270
|
disabled: t,
|
|
271
271
|
"aria-label": `Edit ${e.name}`,
|
|
@@ -276,7 +276,7 @@ function H({ trigger: e, busy: t, onToggle: n, onRun: r, onEdit: i, onDelete: o,
|
|
|
276
276
|
}),
|
|
277
277
|
/* @__PURE__ */ j("button", {
|
|
278
278
|
type: "button",
|
|
279
|
-
className:
|
|
279
|
+
className: I,
|
|
280
280
|
onClick: s,
|
|
281
281
|
disabled: t,
|
|
282
282
|
"aria-label": `Use ${e.name} in a workflow`,
|
|
@@ -288,7 +288,7 @@ function H({ trigger: e, busy: t, onToggle: n, onRun: r, onEdit: i, onDelete: o,
|
|
|
288
288
|
}),
|
|
289
289
|
/* @__PURE__ */ j("button", {
|
|
290
290
|
type: "button",
|
|
291
|
-
className:
|
|
291
|
+
className: I,
|
|
292
292
|
onClick: o,
|
|
293
293
|
disabled: t,
|
|
294
294
|
"aria-label": `Delete ${e.name}`,
|
|
@@ -303,69 +303,69 @@ function H({ trigger: e, busy: t, onToggle: n, onRun: r, onEdit: i, onDelete: o,
|
|
|
303
303
|
});
|
|
304
304
|
}
|
|
305
305
|
function U() {
|
|
306
|
-
let { workspaceId: a = "" } = ee(), { toasts: c, addToast: l, dismissToast: u } = s(), d = se(), [
|
|
307
|
-
|
|
308
|
-
},
|
|
309
|
-
let t =
|
|
310
|
-
t ? (
|
|
306
|
+
let { workspaceId: a = "" } = ee(), { toasts: c, addToast: l, dismissToast: u } = s(), d = se(), [p, g] = C(null), [v, y] = C(!1), [b, w] = C(z), [T, E] = C(null), [M, N] = C(/* @__PURE__ */ new Set()), [L, R] = C(null), [U, W] = C(!1), { data: G, loading: fe, error: K } = re({ skip: !a }), [pe] = te({ refetchQueries: P }), [q] = f({ refetchQueries: P }), [me] = ne({ refetchQueries: P }), [he] = ie({ refetchQueries: P }), J = S(() => G?.timeCampusMyTimeTriggers ?? [], [G]), Y = G?.timeCampusMyTimeTriggerFirings ?? [], ge = S(() => new Map(J.map((e) => [e.id, e.name])), [J]), X = G?.timeCampusApplet.installed ?? !1, Z = (e) => {
|
|
307
|
+
g(null), w(e ?? z), E(null), y(!0);
|
|
308
|
+
}, Q = (e) => {
|
|
309
|
+
let t = V(e);
|
|
310
|
+
t ? (g(e), w(t), E(null), y(!0)) : l({
|
|
311
311
|
title: `${e.name} cannot be edited here`,
|
|
312
312
|
description: "It uses a rule this version of TimeCampus does not support yet. Reload the page to get the latest version.",
|
|
313
313
|
variant: "error"
|
|
314
314
|
});
|
|
315
315
|
}, _e = async () => {
|
|
316
|
-
let e =
|
|
316
|
+
let e = oe(b);
|
|
317
317
|
if (e) {
|
|
318
318
|
E(e);
|
|
319
319
|
return;
|
|
320
320
|
}
|
|
321
|
-
|
|
321
|
+
W(!0);
|
|
322
322
|
let t = {
|
|
323
|
-
name:
|
|
324
|
-
metric: le[
|
|
325
|
-
comparator: ue[
|
|
326
|
-
threshold: Number(
|
|
327
|
-
checkHour:
|
|
328
|
-
timezone:
|
|
329
|
-
message:
|
|
323
|
+
name: b.name.trim(),
|
|
324
|
+
metric: le[b.metric],
|
|
325
|
+
comparator: ue[b.comparator],
|
|
326
|
+
threshold: Number(b.threshold),
|
|
327
|
+
checkHour: b.checkHour,
|
|
328
|
+
timezone: m(),
|
|
329
|
+
message: b.message.trim()
|
|
330
330
|
};
|
|
331
331
|
try {
|
|
332
|
-
|
|
333
|
-
id:
|
|
332
|
+
p ? (await q({ variables: {
|
|
333
|
+
id: p.id,
|
|
334
334
|
input: t
|
|
335
335
|
} }), l({
|
|
336
336
|
title: `${t.name} saved`,
|
|
337
337
|
variant: "success"
|
|
338
|
-
})) : (await
|
|
338
|
+
})) : (await pe({ variables: { input: {
|
|
339
339
|
...t,
|
|
340
340
|
message: t.message || null
|
|
341
341
|
} } }), l({
|
|
342
342
|
title: `${t.name} created`,
|
|
343
343
|
variant: "success"
|
|
344
|
-
})),
|
|
344
|
+
})), y(!1);
|
|
345
345
|
} catch (e) {
|
|
346
|
-
E(
|
|
346
|
+
E(B(e));
|
|
347
347
|
} finally {
|
|
348
|
-
|
|
348
|
+
W(!1);
|
|
349
349
|
}
|
|
350
350
|
}, $ = async (e, t) => {
|
|
351
351
|
if (!M.has(e)) {
|
|
352
|
-
|
|
352
|
+
N((t) => new Set(t).add(e));
|
|
353
353
|
try {
|
|
354
354
|
await t();
|
|
355
355
|
} catch (e) {
|
|
356
356
|
l({
|
|
357
|
-
title:
|
|
357
|
+
title: B(e),
|
|
358
358
|
variant: "error"
|
|
359
359
|
});
|
|
360
360
|
} finally {
|
|
361
|
-
|
|
361
|
+
N((t) => {
|
|
362
362
|
let n = new Set(t);
|
|
363
363
|
return n.delete(e), n;
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
}, ve = (e, t) => $(e.id, async () => {
|
|
368
|
-
await
|
|
368
|
+
await q({ variables: {
|
|
369
369
|
id: e.id,
|
|
370
370
|
input: { enabled: t }
|
|
371
371
|
} }), l({
|
|
@@ -373,9 +373,9 @@ function U() {
|
|
|
373
373
|
variant: "success"
|
|
374
374
|
});
|
|
375
375
|
}), ye = (e) => $(e.id, async () => {
|
|
376
|
-
let t = (await
|
|
376
|
+
let t = (await he({ variables: { id: e.id } })).data?.runTimeCampusTimeTrigger;
|
|
377
377
|
if (!t) return;
|
|
378
|
-
let n =
|
|
378
|
+
let n = _(e.metric, t.value);
|
|
379
379
|
t.fired ? l({
|
|
380
380
|
title: `${e.name} fired`,
|
|
381
381
|
description: `Today is at ${n}. ${t.notified ? "A nudge is on its way." : "The nudge could not be delivered."}`,
|
|
@@ -393,8 +393,8 @@ function U() {
|
|
|
393
393
|
description: `Today is at ${n}, so the condition does not hold.`,
|
|
394
394
|
variant: "info"
|
|
395
395
|
});
|
|
396
|
-
}), be = (e) => (
|
|
397
|
-
await
|
|
396
|
+
}), be = (e) => (R(null), $(e.id, async () => {
|
|
397
|
+
await me({ variables: { id: e.id } }), l({
|
|
398
398
|
title: `${e.name} deleted`,
|
|
399
399
|
variant: "success"
|
|
400
400
|
});
|
|
@@ -403,10 +403,10 @@ function U() {
|
|
|
403
403
|
title: "Time Triggers",
|
|
404
404
|
description: "Nudges from your own time data",
|
|
405
405
|
purpose: "Write a rule over today's tracked time, focus or context switches. TimeCampus checks it through the day and nudges you once when it holds. Each firing is also published to FluidGrids, so a workflow can take it further.",
|
|
406
|
-
actions:
|
|
406
|
+
actions: X ? /* @__PURE__ */ j("button", {
|
|
407
407
|
type: "button",
|
|
408
|
-
className:
|
|
409
|
-
onClick: () =>
|
|
408
|
+
className: F,
|
|
409
|
+
onClick: () => Z(),
|
|
410
410
|
children: [/* @__PURE__ */ A(D, {
|
|
411
411
|
className: "h-4 w-4",
|
|
412
412
|
"aria-hidden": "true"
|
|
@@ -417,22 +417,22 @@ function U() {
|
|
|
417
417
|
toasts: c,
|
|
418
418
|
onDismiss: u
|
|
419
419
|
}),
|
|
420
|
-
|
|
420
|
+
fe && !G ? /* @__PURE__ */ A(n, {
|
|
421
421
|
variant: "card",
|
|
422
422
|
count: 3
|
|
423
|
-
}) :
|
|
423
|
+
}) : K ? /* @__PURE__ */ A(r, {
|
|
424
424
|
title: "Couldn't load your time triggers",
|
|
425
|
-
description:
|
|
425
|
+
description: K.message,
|
|
426
426
|
illustration: "error-state"
|
|
427
|
-
}) :
|
|
427
|
+
}) : X ? J.length === 0 ? /* @__PURE__ */ j("div", {
|
|
428
428
|
className: "flex flex-col gap-4",
|
|
429
429
|
children: [/* @__PURE__ */ A(r, {
|
|
430
430
|
title: "No time triggers yet",
|
|
431
431
|
description: "Start from one of these, or write your own.",
|
|
432
432
|
action: /* @__PURE__ */ j("button", {
|
|
433
433
|
type: "button",
|
|
434
|
-
className:
|
|
435
|
-
onClick: () =>
|
|
434
|
+
className: F,
|
|
435
|
+
onClick: () => Z(),
|
|
436
436
|
children: [/* @__PURE__ */ A(D, {
|
|
437
437
|
className: "h-4 w-4",
|
|
438
438
|
"aria-hidden": "true"
|
|
@@ -440,16 +440,16 @@ function U() {
|
|
|
440
440
|
})
|
|
441
441
|
}), /* @__PURE__ */ A("div", {
|
|
442
442
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-4",
|
|
443
|
-
children:
|
|
443
|
+
children: ae.map((e) => /* @__PURE__ */ j("button", {
|
|
444
444
|
type: "button",
|
|
445
|
-
onClick: () =>
|
|
446
|
-
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 text-
|
|
445
|
+
onClick: () => Z(e),
|
|
446
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 text-start hover:bg-bg-surface-hover",
|
|
447
447
|
children: [/* @__PURE__ */ A("p", {
|
|
448
448
|
className: "font-medium text-text-primary",
|
|
449
449
|
children: e.name
|
|
450
450
|
}), /* @__PURE__ */ A("p", {
|
|
451
451
|
className: "mt-1 text-sm text-text-secondary",
|
|
452
|
-
children:
|
|
452
|
+
children: h({
|
|
453
453
|
...e,
|
|
454
454
|
threshold: Number(e.threshold)
|
|
455
455
|
})
|
|
@@ -458,21 +458,21 @@ function U() {
|
|
|
458
458
|
})]
|
|
459
459
|
}) : /* @__PURE__ */ A("div", {
|
|
460
460
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",
|
|
461
|
-
children:
|
|
461
|
+
children: J.map((e) => /* @__PURE__ */ A(de, {
|
|
462
462
|
trigger: e,
|
|
463
463
|
busy: M.has(e.id),
|
|
464
464
|
onToggle: (t) => ve(e, t),
|
|
465
465
|
onRun: () => ye(e),
|
|
466
|
-
onEdit: () =>
|
|
467
|
-
onDelete: () =>
|
|
468
|
-
onUseInWorkflow: () => d(
|
|
466
|
+
onEdit: () => Q(e),
|
|
467
|
+
onDelete: () => R(e),
|
|
468
|
+
onUseInWorkflow: () => d(x(e))
|
|
469
469
|
}, e.id))
|
|
470
470
|
}) : /* @__PURE__ */ A(r, {
|
|
471
471
|
title: "Install the Time Triggers applet",
|
|
472
472
|
description: "Time triggers are an applet. A workspace admin can install it from the applet store; your triggers start running as soon as it is installed.",
|
|
473
473
|
action: /* @__PURE__ */ j("button", {
|
|
474
474
|
type: "button",
|
|
475
|
-
className:
|
|
475
|
+
className: F,
|
|
476
476
|
onClick: () => d("/timecampus/applets"),
|
|
477
477
|
children: [/* @__PURE__ */ A(ce, {
|
|
478
478
|
className: "h-4 w-4",
|
|
@@ -480,7 +480,7 @@ function U() {
|
|
|
480
480
|
}), "Open the applet store"]
|
|
481
481
|
})
|
|
482
482
|
}),
|
|
483
|
-
|
|
483
|
+
X && /* @__PURE__ */ j("section", {
|
|
484
484
|
className: "mt-8",
|
|
485
485
|
"aria-labelledby": "trigger-history-heading",
|
|
486
486
|
children: [/* @__PURE__ */ j("div", {
|
|
@@ -491,33 +491,33 @@ function U() {
|
|
|
491
491
|
children: "Recent firings"
|
|
492
492
|
}), /* @__PURE__ */ j("button", {
|
|
493
493
|
type: "button",
|
|
494
|
-
className:
|
|
494
|
+
className: I,
|
|
495
495
|
onClick: () => d("/workflows/list"),
|
|
496
496
|
children: [/* @__PURE__ */ A(k, {
|
|
497
497
|
className: "h-4 w-4",
|
|
498
498
|
"aria-hidden": "true"
|
|
499
499
|
}), "Automate with FluidGrids"]
|
|
500
500
|
})]
|
|
501
|
-
}),
|
|
501
|
+
}), Y.length === 0 ? /* @__PURE__ */ A("p", {
|
|
502
502
|
className: "text-sm text-text-tertiary",
|
|
503
503
|
children: "Nothing has fired yet."
|
|
504
504
|
}) : /* @__PURE__ */ A("ul", {
|
|
505
505
|
className: "divide-y divide-border-subtle rounded-lg border border-border-subtle bg-bg-surface",
|
|
506
|
-
children:
|
|
506
|
+
children: Y.map((e) => /* @__PURE__ */ j("li", {
|
|
507
507
|
className: "flex flex-wrap items-center justify-between gap-2 px-4 py-3 text-sm",
|
|
508
508
|
children: [
|
|
509
509
|
/* @__PURE__ */ A("span", {
|
|
510
510
|
className: "font-medium text-text-primary",
|
|
511
|
-
children:
|
|
511
|
+
children: ge.get(e.triggerId) ?? "Deleted trigger"
|
|
512
512
|
}),
|
|
513
513
|
/* @__PURE__ */ j("span", {
|
|
514
514
|
className: "text-text-secondary",
|
|
515
515
|
children: [
|
|
516
|
-
|
|
516
|
+
_(e.metric, e.value),
|
|
517
517
|
" (",
|
|
518
518
|
e.comparator === "BELOW" ? "below" : "above",
|
|
519
519
|
" ",
|
|
520
|
-
|
|
520
|
+
_(e.metric, e.threshold),
|
|
521
521
|
")"
|
|
522
522
|
]
|
|
523
523
|
}),
|
|
@@ -540,28 +540,28 @@ function U() {
|
|
|
540
540
|
})]
|
|
541
541
|
}),
|
|
542
542
|
/* @__PURE__ */ j(i, {
|
|
543
|
-
open:
|
|
544
|
-
onClose: () =>
|
|
545
|
-
title:
|
|
543
|
+
open: v,
|
|
544
|
+
onClose: () => y(!1),
|
|
545
|
+
title: p ? `Edit ${p.name}` : "New time trigger",
|
|
546
546
|
description: "Fires at most once a day, from the hour you choose.",
|
|
547
547
|
size: "lg",
|
|
548
548
|
footer: /* @__PURE__ */ j("div", {
|
|
549
549
|
className: "flex justify-end gap-2",
|
|
550
550
|
children: [/* @__PURE__ */ A("button", {
|
|
551
551
|
type: "button",
|
|
552
|
-
className:
|
|
553
|
-
onClick: () =>
|
|
552
|
+
className: I,
|
|
553
|
+
onClick: () => y(!1),
|
|
554
554
|
children: "Cancel"
|
|
555
555
|
}), /* @__PURE__ */ A("button", {
|
|
556
556
|
type: "button",
|
|
557
|
-
className:
|
|
557
|
+
className: F,
|
|
558
558
|
onClick: () => void _e(),
|
|
559
|
-
disabled:
|
|
560
|
-
children:
|
|
559
|
+
disabled: U,
|
|
560
|
+
children: U ? "Saving…" : p ? "Save" : "Create trigger"
|
|
561
561
|
})]
|
|
562
562
|
}),
|
|
563
|
-
children: [/* @__PURE__ */ A(
|
|
564
|
-
form:
|
|
563
|
+
children: [/* @__PURE__ */ A(H, {
|
|
564
|
+
form: b,
|
|
565
565
|
onChange: w
|
|
566
566
|
}), T && /* @__PURE__ */ A("p", {
|
|
567
567
|
role: "alert",
|
|
@@ -571,15 +571,15 @@ function U() {
|
|
|
571
571
|
}),
|
|
572
572
|
/* @__PURE__ */ A(i, {
|
|
573
573
|
open: L !== null,
|
|
574
|
-
onClose: () =>
|
|
574
|
+
onClose: () => R(null),
|
|
575
575
|
title: "Delete time trigger",
|
|
576
576
|
description: "This cannot be undone.",
|
|
577
577
|
footer: /* @__PURE__ */ j("div", {
|
|
578
578
|
className: "flex justify-end gap-2",
|
|
579
579
|
children: [/* @__PURE__ */ A("button", {
|
|
580
580
|
type: "button",
|
|
581
|
-
className:
|
|
582
|
-
onClick: () =>
|
|
581
|
+
className: I,
|
|
582
|
+
onClick: () => R(null),
|
|
583
583
|
children: "Cancel"
|
|
584
584
|
}), /* @__PURE__ */ j("button", {
|
|
585
585
|
type: "button",
|