@burdenoff/microfe-planmagnet 2026.930.20 → 2026.930.21

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.
Files changed (26) hide show
  1. package/dist/planmagnet/automation/AutomationExecutionsPanel.d.ts.map +1 -1
  2. package/dist/planmagnet/automation/AutomationExecutionsPanel.js +43 -39
  3. package/dist/planmagnet/automation/AutomationExecutionsPanel.js.map +1 -1
  4. package/dist/planmagnet/automation/AutomationRuleFields.d.ts +23 -4
  5. package/dist/planmagnet/automation/AutomationRuleFields.d.ts.map +1 -1
  6. package/dist/planmagnet/automation/AutomationRuleFields.js +255 -108
  7. package/dist/planmagnet/automation/AutomationRuleFields.js.map +1 -1
  8. package/dist/planmagnet/automation/automationRuleTypes.d.ts +138 -15
  9. package/dist/planmagnet/automation/automationRuleTypes.d.ts.map +1 -1
  10. package/dist/planmagnet/automation/automationRuleTypes.js +162 -22
  11. package/dist/planmagnet/automation/automationRuleTypes.js.map +1 -1
  12. package/dist/planmagnet/controls/AutomationRuleControls.d.ts.map +1 -1
  13. package/dist/planmagnet/controls/AutomationRuleControls.js +76 -71
  14. package/dist/planmagnet/controls/AutomationRuleControls.js.map +1 -1
  15. package/dist/planmagnet/pages/AutomationAutomationRuleDetailPagePage.d.ts.map +1 -1
  16. package/dist/planmagnet/pages/AutomationAutomationRuleDetailPagePage.js +85 -76
  17. package/dist/planmagnet/pages/AutomationAutomationRuleDetailPagePage.js.map +1 -1
  18. package/dist/planmagnet/pages/AutomationAutomationRulesPagePage.js +12 -12
  19. package/dist/planmagnet/pages/AutomationAutomationRulesPagePage.js.map +1 -1
  20. package/dist/planmagnet/pages/AutomationCreateAutomationRulePagePage.d.ts.map +1 -1
  21. package/dist/planmagnet/pages/AutomationCreateAutomationRulePagePage.js +48 -44
  22. package/dist/planmagnet/pages/AutomationCreateAutomationRulePagePage.js.map +1 -1
  23. package/dist/planmagnet/people/People.d.ts.map +1 -1
  24. package/dist/planmagnet/people/People.js +30 -17
  25. package/dist/planmagnet/people/People.js.map +1 -1
  26. package/package.json +1 -1
@@ -1,169 +1,253 @@
1
1
  import { AssigneeSelect as e, WORK_ITEM_PRIORITIES as t, WORK_ITEM_STATUSES as n, enumLabel as r } from "../controls/WorkItemControls.js";
2
2
  import { ProjectSelect as i } from "../controls/Pickers.js";
3
- import { ACTION_TYPES as a, ACTION_TYPE_LABEL as o, AUTOMATIC_TRIGGER_TYPES as s, CONDITION_FIELDS as c, CONDITION_OPERATORS as l, CONDITION_OPERATOR_LABEL as u, TRIGGER_TYPES as d, TRIGGER_TYPE_LABEL as f } from "./automationRuleTypes.js";
4
- import { Plus as p, X as m } from "lucide-react";
5
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
6
- import { Button as _, Input as v } from "@burdenoff/fe-libs/ui";
3
+ import { ACTION_TYPES as a, ACTION_TYPE_LABEL as o, AUTOMATION_TEMPLATE_MAX_LENGTH as s, CHANNEL_POSTING_BLOCKED_MESSAGE as c, CHANNEL_POSTING_OPTION_REASON as l, CONDITION_FIELDS as u, CONDITION_OPERATORS as d, CONDITION_OPERATOR_LABEL as f, NO_WORK_ITEM_TRIGGER_TYPES as p, POST_COMMENT_MAX_RENDERED_LENGTH as m, TEMPLATE_PLACEHOLDER_INFO as h, TRIGGER_TYPES as g, TRIGGER_TYPE_LABEL as _, WORK_ITEM_ACTION_TYPES as v, parseScheduleDays as y, renderTemplatePreview as b, templatePlaceholdersForTrigger as x, templateSampleValues as S, triggerHint as C, triggerOptionSuffix as w } from "./automationRuleTypes.js";
4
+ import { Plus as T, X as E } from "lucide-react";
5
+ import { jsx as D, jsxs as O } from "react/jsx-runtime";
6
+ import { Button as k, Checkbox as A, Input as j, Textarea as M } from "@burdenoff/fe-libs/ui";
7
7
  //#region src/planmagnet/automation/AutomationRuleFields.tsx
8
- var y = "rounded-md border border-input bg-background px-3 py-2 text-sm disabled:opacity-60", b = `mt-1 w-full ${y}`, x = "text-foreground";
9
- function S({ action: i, onChange: a }) {
8
+ var N = "rounded-md border border-input bg-background px-3 py-2 text-sm disabled:opacity-60", P = `mt-1 w-full ${N}`, F = "text-foreground";
9
+ function I({ value: e, triggerType: t, onChange: n }) {
10
+ let r = x(t), i = b(e, S(t), m), a = (t) => n(`${e}{{${t}}}`);
11
+ return /* @__PURE__ */ O("div", {
12
+ className: "space-y-2",
13
+ children: [
14
+ /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D(M, {
15
+ "aria-label": "Comment template",
16
+ "data-testid": "automation-template",
17
+ className: `min-h-[72px] w-full ${F}`,
18
+ maxLength: s,
19
+ placeholder: "e.g. Automatically moved to {{toStatus}} by {{actor}}",
20
+ value: e,
21
+ onChange: (e) => n(e.target.value)
22
+ }), /* @__PURE__ */ O("p", {
23
+ className: "mt-1 text-xs text-muted-foreground",
24
+ children: [
25
+ e.length,
26
+ " / ",
27
+ s,
28
+ " characters"
29
+ ]
30
+ })] }),
31
+ /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
32
+ className: "text-xs font-medium text-muted-foreground",
33
+ children: "Insert a placeholder"
34
+ }), /* @__PURE__ */ D("div", {
35
+ "data-testid": "automation-placeholders",
36
+ className: "mt-1 flex flex-wrap gap-1.5",
37
+ children: r.map((e) => /* @__PURE__ */ D("button", {
38
+ type: "button",
39
+ onClick: () => a(e),
40
+ title: `Insert {{${e}}} — ${h[e]?.label ?? e}`,
41
+ className: "rounded-full border border-input px-2 py-0.5 text-xs text-muted-foreground hover:bg-muted",
42
+ children: `{{${e}}}`
43
+ }, e))
44
+ })] }),
45
+ /* @__PURE__ */ O("div", {
46
+ "data-testid": "automation-template-preview",
47
+ className: "rounded-md border border-dashed border-input p-2 text-xs",
48
+ children: [/* @__PURE__ */ D("p", {
49
+ className: "font-medium text-foreground",
50
+ children: "Preview"
51
+ }), /* @__PURE__ */ D("p", {
52
+ className: "mt-0.5 whitespace-pre-wrap text-muted-foreground",
53
+ children: i || /* @__PURE__ */ D("span", {
54
+ className: "italic",
55
+ children: "Nothing to show yet — write a template above."
56
+ })
57
+ })]
58
+ })
59
+ ]
60
+ });
61
+ }
62
+ function L({ action: i, triggerType: a, onChange: o }) {
10
63
  switch (i.type) {
11
- case "ASSIGN_TO_USER": return /* @__PURE__ */ h(e, {
64
+ case "ASSIGN_TO_USER": return /* @__PURE__ */ D(e, {
12
65
  value: i.value,
13
- onChange: a
66
+ onChange: o
14
67
  });
15
- case "SET_STATUS": return /* @__PURE__ */ g("select", {
16
- className: `${y} w-full`,
68
+ case "SET_STATUS": return /* @__PURE__ */ O("select", {
69
+ className: `${N} w-full`,
17
70
  value: i.value,
18
- onChange: (e) => a(e.target.value),
19
- children: [/* @__PURE__ */ h("option", {
71
+ onChange: (e) => o(e.target.value),
72
+ children: [/* @__PURE__ */ D("option", {
20
73
  value: "",
21
74
  children: "Choose a status"
22
- }), n.map((e) => /* @__PURE__ */ h("option", {
75
+ }), n.map((e) => /* @__PURE__ */ D("option", {
23
76
  value: e,
24
77
  children: r(e)
25
78
  }, e))]
26
79
  });
27
- case "SET_PRIORITY": return /* @__PURE__ */ g("select", {
28
- className: `${y} w-full`,
80
+ case "SET_PRIORITY": return /* @__PURE__ */ O("select", {
81
+ className: `${N} w-full`,
29
82
  value: i.value,
30
- onChange: (e) => a(e.target.value),
31
- children: [/* @__PURE__ */ h("option", {
83
+ onChange: (e) => o(e.target.value),
84
+ children: [/* @__PURE__ */ D("option", {
32
85
  value: "",
33
86
  children: "Choose a priority"
34
- }), t.map((e) => /* @__PURE__ */ h("option", {
87
+ }), t.map((e) => /* @__PURE__ */ D("option", {
35
88
  value: e,
36
89
  children: r(e)
37
90
  }, e))]
38
91
  });
39
- default: return /* @__PURE__ */ h(v, {
92
+ case "POST_COMMENT": return /* @__PURE__ */ D(I, {
93
+ value: i.value,
94
+ triggerType: a,
95
+ onChange: o
96
+ });
97
+ case "POST_TO_CHANNEL": return /* @__PURE__ */ O("div", {
98
+ className: "space-y-1",
99
+ children: [/* @__PURE__ */ D(j, {
100
+ "aria-label": "Channel message template (read-only — not available yet)",
101
+ className: F,
102
+ value: i.value,
103
+ disabled: !0,
104
+ readOnly: !0
105
+ }), /* @__PURE__ */ D("p", {
106
+ className: "text-xs text-destructive",
107
+ children: c
108
+ })]
109
+ });
110
+ default: return /* @__PURE__ */ D(j, {
40
111
  "aria-label": "Label",
41
- className: x,
112
+ className: F,
42
113
  placeholder: "e.g. needs-review",
43
114
  value: i.value,
44
- onChange: (e) => a(e.target.value)
115
+ onChange: (e) => o(e.target.value)
45
116
  });
46
117
  }
47
118
  }
48
- function C({ actions: e, onChange: t }) {
49
- let n = (n, r) => t(e.map((e, t) => t === n ? {
119
+ function R({ actions: e, triggerType: t, onChange: n }) {
120
+ let r = p.has(t), i = (t, r) => n(e.map((e, n) => n === t ? {
50
121
  ...e,
51
122
  ...r
52
- } : e)), r = (n) => t(e.filter((e, t) => t !== n));
53
- return /* @__PURE__ */ g("div", {
123
+ } : e)), s = (t) => n(e.filter((e, n) => n !== t));
124
+ return /* @__PURE__ */ O("div", {
54
125
  className: "space-y-2",
55
126
  children: [
56
- e.map((e, t) => {
57
- let i = a.includes(e.type), s = i ? a : [e.type, ...a];
58
- return /* @__PURE__ */ g("div", {
127
+ r && /* @__PURE__ */ D("p", {
128
+ className: "text-xs text-muted-foreground",
129
+ children: "This trigger has no target work item, so none of the actions below can run for it. Remove any left over from before this restriction existed, or switch to a different trigger."
130
+ }),
131
+ e.map((e, n) => {
132
+ let c = a.includes(e.type), u = c ? a : [e.type, ...a], d = r && v.has(e.type);
133
+ return /* @__PURE__ */ O("div", {
59
134
  className: "space-y-1",
60
- children: [/* @__PURE__ */ g("div", {
135
+ children: [/* @__PURE__ */ O("div", {
61
136
  className: "flex items-start gap-2",
62
137
  children: [
63
- /* @__PURE__ */ h("select", {
138
+ /* @__PURE__ */ D("select", {
64
139
  "aria-label": "Action type",
65
- className: `${y} w-40 shrink-0`,
140
+ "data-testid": "automation-action-type",
141
+ className: `${N} w-40 shrink-0`,
66
142
  value: e.type,
67
- onChange: (r) => n(t, {
68
- type: r.target.value,
69
- value: r.target.value === e.type ? e.value : ""
143
+ disabled: d,
144
+ onChange: (t) => i(n, {
145
+ type: t.target.value,
146
+ value: t.target.value === e.type ? e.value : ""
70
147
  }),
71
- children: s.map((t) => /* @__PURE__ */ h("option", {
72
- value: t,
73
- children: i || t !== e.type ? o[t] ?? t : t
74
- }, t))
148
+ children: u.map((t) => {
149
+ let n = t === "POST_TO_CHANNEL" && !0, r = c || t !== e.type ? o[t] ?? t : t;
150
+ return /* @__PURE__ */ D("option", {
151
+ value: t,
152
+ disabled: n,
153
+ children: n ? `${r} — ${l}` : r
154
+ }, t);
155
+ })
75
156
  }),
76
- /* @__PURE__ */ h("div", {
157
+ /* @__PURE__ */ D("div", {
77
158
  className: "min-w-0 flex-1",
78
- children: /* @__PURE__ */ h(S, {
159
+ children: /* @__PURE__ */ D(L, {
79
160
  action: e,
80
- onChange: (e) => n(t, { value: e })
161
+ triggerType: t,
162
+ onChange: (e) => i(n, { value: e })
81
163
  })
82
164
  }),
83
- /* @__PURE__ */ h(_, {
165
+ /* @__PURE__ */ D(k, {
84
166
  type: "button",
85
167
  size: "sm",
86
168
  variant: "ghost",
87
169
  "aria-label": "Remove action",
88
- onClick: () => r(t),
89
- children: /* @__PURE__ */ h(m, { className: "h-4 w-4" })
170
+ onClick: () => s(n),
171
+ children: /* @__PURE__ */ D(E, { className: "h-4 w-4" })
90
172
  })
91
173
  ]
92
- }), !i && /* @__PURE__ */ h("p", {
174
+ }), !c && /* @__PURE__ */ D("p", {
93
175
  className: "text-xs text-muted-foreground",
94
176
  children: "This action type is not run by the engine yet; the rule keeps it but never dispatches it."
95
177
  })]
96
- }, t);
178
+ }, n);
97
179
  }),
98
- /* @__PURE__ */ g(_, {
180
+ /* @__PURE__ */ O(k, {
99
181
  type: "button",
100
182
  size: "sm",
101
183
  variant: "outline",
102
- onClick: () => t([...e, {
184
+ onClick: () => n([...e, {
103
185
  type: "ASSIGN_TO_USER",
104
186
  value: ""
105
187
  }]),
188
+ disabled: r,
189
+ title: r ? "This trigger has no target work item — no action can be added." : void 0,
106
190
  "data-testid": "automation-add-action",
107
- children: [/* @__PURE__ */ h(p, { className: "mr-1 h-4 w-4" }), "Add action"]
191
+ children: [/* @__PURE__ */ D(T, { className: "mr-1 h-4 w-4" }), "Add action"]
108
192
  }),
109
- e.length === 0 && /* @__PURE__ */ h("p", {
193
+ e.length === 0 && !r && /* @__PURE__ */ D("p", {
110
194
  className: "text-xs text-muted-foreground",
111
195
  children: "A rule with no actions still records that it ran, but changes nothing."
112
196
  })
113
197
  ]
114
198
  });
115
199
  }
116
- function w({ conditions: e, onChange: t }) {
200
+ function z({ conditions: e, onChange: t }) {
117
201
  let n = (n, r) => t(e.map((e, t) => t === n ? {
118
202
  ...e,
119
203
  ...r
120
204
  } : e)), r = (n) => t(e.filter((e, t) => t !== n));
121
- return /* @__PURE__ */ g("div", {
205
+ return /* @__PURE__ */ O("div", {
122
206
  className: "space-y-2",
123
207
  children: [
124
- e.map((e, t) => /* @__PURE__ */ g("div", {
208
+ e.map((e, t) => /* @__PURE__ */ O("div", {
125
209
  className: "flex items-start gap-2",
126
210
  children: [
127
- /* @__PURE__ */ h(v, {
211
+ /* @__PURE__ */ D(j, {
128
212
  "aria-label": "Condition field",
129
213
  list: "automation-condition-fields",
130
- className: `w-36 shrink-0 ${x}`,
214
+ className: `w-36 shrink-0 ${F}`,
131
215
  placeholder: "field",
132
216
  value: e.field,
133
217
  onChange: (e) => n(t, { field: e.target.value })
134
218
  }),
135
- /* @__PURE__ */ h("select", {
219
+ /* @__PURE__ */ D("select", {
136
220
  "aria-label": "Condition operator",
137
- className: `${y} w-32 shrink-0`,
221
+ className: `${N} w-32 shrink-0`,
138
222
  value: e.operator,
139
223
  onChange: (e) => n(t, { operator: e.target.value }),
140
- children: l.map((e) => /* @__PURE__ */ h("option", {
224
+ children: d.map((e) => /* @__PURE__ */ D("option", {
141
225
  value: e,
142
- children: u[e]
226
+ children: f[e]
143
227
  }, e))
144
228
  }),
145
- e.operator !== "exists" && /* @__PURE__ */ h(v, {
229
+ e.operator !== "exists" && /* @__PURE__ */ D(j, {
146
230
  "aria-label": "Condition value",
147
- className: `min-w-0 flex-1 ${x}`,
231
+ className: `min-w-0 flex-1 ${F}`,
148
232
  placeholder: e.operator === "in" || e.operator === "notIn" ? "comma, separated, values" : "value",
149
233
  value: e.value,
150
234
  onChange: (e) => n(t, { value: e.target.value })
151
235
  }),
152
- /* @__PURE__ */ h(_, {
236
+ /* @__PURE__ */ D(k, {
153
237
  type: "button",
154
238
  size: "sm",
155
239
  variant: "ghost",
156
240
  "aria-label": "Remove condition",
157
241
  onClick: () => r(t),
158
- children: /* @__PURE__ */ h(m, { className: "h-4 w-4" })
242
+ children: /* @__PURE__ */ D(E, { className: "h-4 w-4" })
159
243
  })
160
244
  ]
161
245
  }, t)),
162
- /* @__PURE__ */ h("datalist", {
246
+ /* @__PURE__ */ D("datalist", {
163
247
  id: "automation-condition-fields",
164
- children: c.map((e) => /* @__PURE__ */ h("option", { value: e }, e))
248
+ children: u.map((e) => /* @__PURE__ */ D("option", { value: e }, e))
165
249
  }),
166
- /* @__PURE__ */ g(_, {
250
+ /* @__PURE__ */ O(k, {
167
251
  type: "button",
168
252
  size: "sm",
169
253
  variant: "outline",
@@ -173,26 +257,84 @@ function w({ conditions: e, onChange: t }) {
173
257
  value: ""
174
258
  }]),
175
259
  "data-testid": "automation-add-condition",
176
- children: [/* @__PURE__ */ h(p, { className: "mr-1 h-4 w-4" }), "Add condition"]
260
+ children: [/* @__PURE__ */ D(T, { className: "mr-1 h-4 w-4" }), "Add condition"]
177
261
  }),
178
- e.length === 0 && /* @__PURE__ */ h("p", {
262
+ e.length === 0 && /* @__PURE__ */ D("p", {
179
263
  className: "text-xs text-muted-foreground",
180
264
  children: "No conditions: the rule matches every event."
181
265
  })
182
266
  ]
183
267
  });
184
268
  }
185
- function T({ form: e, onChange: t, projectLocked: n = !1 }) {
186
- return /* @__PURE__ */ g("div", {
269
+ function B({ statuses: e, days: t, onStatusesChange: i, onDaysChange: a }) {
270
+ let o = (t) => i(e.includes(t) ? e.filter((e) => e !== t) : [...e, t]), s = y(t);
271
+ return /* @__PURE__ */ O("div", {
272
+ className: "space-y-3",
273
+ children: [
274
+ /* @__PURE__ */ O("div", { children: [
275
+ /* @__PURE__ */ D("p", {
276
+ className: "text-sm font-medium",
277
+ children: "Statuses"
278
+ }),
279
+ /* @__PURE__ */ D("div", {
280
+ "data-testid": "automation-schedule-statuses",
281
+ role: "group",
282
+ "aria-label": "Statuses to watch",
283
+ className: "mt-1 flex flex-wrap gap-2",
284
+ children: n.map((t) => /* @__PURE__ */ O("label", {
285
+ className: "flex items-center gap-1.5 rounded-md border border-input px-2 py-1 text-sm",
286
+ children: [/* @__PURE__ */ D(A, {
287
+ checked: e.includes(t),
288
+ onCheckedChange: () => o(t),
289
+ "aria-label": r(t)
290
+ }), r(t)]
291
+ }, t))
292
+ }),
293
+ e.length === 0 && /* @__PURE__ */ D("p", {
294
+ className: "mt-1 text-xs text-destructive",
295
+ children: "Choose at least one status."
296
+ })
297
+ ] }),
298
+ /* @__PURE__ */ O("div", { children: [
299
+ /* @__PURE__ */ D("label", {
300
+ htmlFor: "automation-schedule-days",
301
+ className: "text-sm font-medium",
302
+ children: "Not updated for (days)"
303
+ }),
304
+ /* @__PURE__ */ D(j, {
305
+ id: "automation-schedule-days",
306
+ "data-testid": "automation-schedule-days",
307
+ inputMode: "numeric",
308
+ pattern: "[0-9]*",
309
+ className: `mt-1 w-28 ${F}`,
310
+ value: t,
311
+ onChange: (e) => a(e.target.value),
312
+ placeholder: "e.g. 7"
313
+ }),
314
+ t !== "" && s === null && /* @__PURE__ */ D("p", {
315
+ className: "mt-1 text-xs text-destructive",
316
+ children: "Enter a whole number of days, 1 or more."
317
+ })
318
+ ] }),
319
+ /* @__PURE__ */ D("p", {
320
+ className: "text-xs text-muted-foreground",
321
+ children: "Runs once a day against every work item matching these statuses and staleness window, and acts on each matching item at most once per day."
322
+ })
323
+ ]
324
+ });
325
+ }
326
+ function V({ form: e, onChange: t, projectLocked: n = !1 }) {
327
+ let r = C(e.triggerType), a = e.triggerType === "SCHEDULE";
328
+ return /* @__PURE__ */ O("div", {
187
329
  className: "space-y-4",
188
330
  children: [
189
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
331
+ /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("label", {
190
332
  htmlFor: "automation-name",
191
333
  className: "text-sm font-medium",
192
334
  children: "Name"
193
- }), /* @__PURE__ */ h(v, {
335
+ }), /* @__PURE__ */ D(j, {
194
336
  id: "automation-name",
195
- className: `mt-1 ${x}`,
337
+ className: `mt-1 ${F}`,
196
338
  value: e.name,
197
339
  onChange: (n) => t({
198
340
  ...e,
@@ -200,11 +342,11 @@ function T({ form: e, onChange: t, projectLocked: n = !1 }) {
200
342
  }),
201
343
  placeholder: "e.g. Assign new bugs to triage"
202
344
  })] }),
203
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
345
+ /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("label", {
204
346
  htmlFor: "automation-description",
205
347
  className: "text-sm font-medium",
206
348
  children: "Description"
207
- }), /* @__PURE__ */ h("textarea", {
349
+ }), /* @__PURE__ */ D("textarea", {
208
350
  id: "automation-description",
209
351
  className: "mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm min-h-[72px]",
210
352
  value: e.description,
@@ -214,18 +356,18 @@ function T({ form: e, onChange: t, projectLocked: n = !1 }) {
214
356
  }),
215
357
  placeholder: "What this rule is for"
216
358
  })] }),
217
- /* @__PURE__ */ g("div", {
359
+ /* @__PURE__ */ O("div", {
218
360
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
219
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
361
+ children: [/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("label", {
220
362
  htmlFor: "automation-project",
221
363
  className: "text-sm font-medium",
222
364
  children: "Project"
223
- }), n ? /* @__PURE__ */ h("p", {
365
+ }), n ? /* @__PURE__ */ D("p", {
224
366
  className: "mt-1 text-sm text-muted-foreground",
225
367
  children: "A rule's project cannot be changed after it is created."
226
- }) : /* @__PURE__ */ h("div", {
368
+ }) : /* @__PURE__ */ D("div", {
227
369
  className: "mt-1",
228
- children: /* @__PURE__ */ h(i, {
370
+ children: /* @__PURE__ */ D(i, {
229
371
  id: "automation-project",
230
372
  value: e.projectId,
231
373
  onChange: (n) => t({
@@ -233,49 +375,53 @@ function T({ form: e, onChange: t, projectLocked: n = !1 }) {
233
375
  projectId: n
234
376
  })
235
377
  })
236
- })] }), /* @__PURE__ */ g("div", { children: [
237
- /* @__PURE__ */ h("label", {
378
+ })] }), /* @__PURE__ */ O("div", { children: [
379
+ /* @__PURE__ */ D("label", {
238
380
  htmlFor: "automation-trigger",
239
381
  className: "text-sm font-medium",
240
382
  children: "Trigger"
241
383
  }),
242
- /* @__PURE__ */ h("select", {
384
+ /* @__PURE__ */ D("select", {
243
385
  id: "automation-trigger",
244
- className: b,
386
+ className: P,
245
387
  value: e.triggerType,
246
388
  onChange: (n) => t({
247
389
  ...e,
248
390
  triggerType: n.target.value
249
391
  }),
250
- children: d.map((e) => /* @__PURE__ */ g("option", {
392
+ children: g.map((e) => /* @__PURE__ */ O("option", {
251
393
  value: e,
252
- children: [f[e], s.has(e) ? "" : " (not yet automatic)"]
394
+ children: [_[e], w(e)]
253
395
  }, e))
254
396
  }),
255
- !s.has(e.triggerType) && /* @__PURE__ */ g("p", {
256
- className: "mt-1 text-xs text-muted-foreground",
257
- children: [
258
- "This trigger is saved but does not fire on its own yet — use",
259
- " ",
260
- /* @__PURE__ */ h("span", {
261
- className: "font-medium",
262
- children: "Run now"
263
- }),
264
- " to run it against a work item."
265
- ]
397
+ r && /* @__PURE__ */ D("p", {
398
+ "data-testid": "automation-trigger-hint",
399
+ className: `mt-1 text-xs ${p.has(e.triggerType) ? "text-destructive" : "text-muted-foreground"}`,
400
+ children: r
266
401
  })
267
402
  ] })]
268
403
  }),
269
- /* @__PURE__ */ g("div", { children: [
270
- /* @__PURE__ */ h("p", {
404
+ /* @__PURE__ */ O("div", { children: [
405
+ /* @__PURE__ */ D("p", {
271
406
  className: "text-sm font-medium",
272
- children: "Conditions"
407
+ children: a ? "Schedule conditions" : "Conditions"
273
408
  }),
274
- /* @__PURE__ */ h("p", {
409
+ /* @__PURE__ */ D("p", {
275
410
  className: "mb-2 text-xs text-muted-foreground",
276
- children: "All conditions must match. Leave empty to match every event."
411
+ children: a ? "Which work items this schedule watches." : "All conditions must match. Leave empty to match every event."
277
412
  }),
278
- /* @__PURE__ */ h(w, {
413
+ a ? /* @__PURE__ */ D(B, {
414
+ statuses: e.scheduleStatuses,
415
+ days: e.scheduleNotUpdatedForDays,
416
+ onStatusesChange: (n) => t({
417
+ ...e,
418
+ scheduleStatuses: n
419
+ }),
420
+ onDaysChange: (n) => t({
421
+ ...e,
422
+ scheduleNotUpdatedForDays: n
423
+ })
424
+ }) : /* @__PURE__ */ D(z, {
279
425
  conditions: e.conditions,
280
426
  onChange: (n) => t({
281
427
  ...e,
@@ -283,17 +429,18 @@ function T({ form: e, onChange: t, projectLocked: n = !1 }) {
283
429
  })
284
430
  })
285
431
  ] }),
286
- /* @__PURE__ */ g("div", { children: [
287
- /* @__PURE__ */ h("p", {
432
+ /* @__PURE__ */ O("div", { children: [
433
+ /* @__PURE__ */ D("p", {
288
434
  className: "text-sm font-medium",
289
435
  children: "Actions"
290
436
  }),
291
- /* @__PURE__ */ h("p", {
437
+ /* @__PURE__ */ D("p", {
292
438
  className: "mb-2 text-xs text-muted-foreground",
293
439
  children: "Run in order when the conditions match."
294
440
  }),
295
- /* @__PURE__ */ h(C, {
441
+ /* @__PURE__ */ D(R, {
296
442
  actions: e.actions,
443
+ triggerType: e.triggerType,
297
444
  onChange: (n) => t({
298
445
  ...e,
299
446
  actions: n
@@ -304,6 +451,6 @@ function T({ form: e, onChange: t, projectLocked: n = !1 }) {
304
451
  });
305
452
  }
306
453
  //#endregion
307
- export { T as AutomationRuleFields };
454
+ export { V as AutomationRuleFields };
308
455
 
309
456
  //# sourceMappingURL=AutomationRuleFields.js.map