Skip to content

Commit 3b4d8c5

Browse files
Copilotmaciejkrol18
andcommitted
feat: comment out attribute_changed email trigger (not yet implemented on backend)
Co-authored-by: maciejkrol18 <63610278+maciejkrol18@users.noreply.github.com>
1 parent b335128 commit 3b4d8c5

5 files changed

Lines changed: 154 additions & 134 deletions

File tree

src/app/dashboard/events/[id]/emails/(steps)/message-content.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ function getTitlePlaceholder(trigger: string) {
5353
case "form_filled": {
5454
return "Dziękujemy za wypełnienie formularza!";
5555
}
56-
case "attribute_changed": {
57-
return "Otrzymaliśmy Twoją wpłatę";
58-
}
56+
// NOTE: Commented out because this trigger is not yet implemented on the backend.
57+
// Uncomment when the backend supports this feature.
58+
// case "attribute_changed": {
59+
// return "Otrzymaliśmy Twoją wpłatę";
60+
// }
5961
default: {
6062
return "Nowa wiadomość od organizatorów";
6163
}

src/app/dashboard/events/[id]/emails/(steps)/trigger-type.tsx

Lines changed: 62 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ import {
1717
FormLabel,
1818
FormMessage,
1919
} from "@/components/ui/form";
20-
import { Input } from "@/components/ui/input";
20+
// NOTE: Input import is commented out because it's used by the attribute_changed trigger
21+
// which is not yet implemented on the backend. Uncomment when the backend supports this feature.
22+
// import { Input } from "@/components/ui/input";
2123
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
2224
import {
2325
Select,
@@ -44,12 +46,14 @@ const EventEmailTemplateTriggerTypeSchema = z
4446
if (data.trigger === "form_filled") {
4547
return data.triggerValue !== undefined && data.triggerValue !== "";
4648
}
47-
if (data.trigger === "attribute_changed") {
48-
return (
49-
(data.triggerValue !== undefined && data.triggerValue !== "") ||
50-
(data.triggerValue2 !== undefined && data.triggerValue2 !== "")
51-
);
52-
}
49+
// NOTE: Commented out because this trigger is not yet implemented on the backend.
50+
// Uncomment when the backend supports this feature.
51+
// if (data.trigger === "attribute_changed") {
52+
// return (
53+
// (data.triggerValue !== undefined && data.triggerValue !== "") ||
54+
// (data.triggerValue2 !== undefined && data.triggerValue2 !== "")
55+
// );
56+
// }
5357
return true;
5458
},
5559
{
@@ -75,7 +79,9 @@ function TriggerTypeExplanation({ trigger }: { trigger: string }) {
7579
}
7680

7781
function TriggerConfigurationInputs({
78-
eventAttributes,
82+
// NOTE: eventAttributes is prefixed with underscore because the attribute_changed trigger
83+
// which uses it is not yet implemented on the backend. Rename back when the backend supports this feature.
84+
eventAttributes: _eventAttributes,
7985
eventForms,
8086
trigger,
8187
form,
@@ -136,52 +142,54 @@ function TriggerConfigurationInputs({
136142
</div>
137143
);
138144
}
139-
case "attribute_changed": {
140-
return (
141-
<div className="flex flex-col gap-2">
142-
<FormField
143-
control={form.control}
144-
name="triggerValue"
145-
render={({ field }) => (
146-
<FormItem className="space-y-3">
147-
<FormLabel>Atrybut</FormLabel>
148-
<Select onValueChange={field.onChange}>
149-
<FormControl>
150-
<SelectTrigger>
151-
<SelectValue placeholder="Wybierz atrybut" />
152-
</SelectTrigger>
153-
</FormControl>
154-
<SelectContent>
155-
{eventAttributes.map((attribute) => (
156-
<SelectItem
157-
key={attribute.id}
158-
value={String(attribute.id)}
159-
>
160-
{attribute.name}
161-
</SelectItem>
162-
))}
163-
</SelectContent>
164-
</Select>
165-
<FormMessage />
166-
</FormItem>
167-
)}
168-
/>
169-
<FormField
170-
control={form.control}
171-
name="triggerValue2"
172-
render={({ field }) => (
173-
<FormItem className="space-y-3">
174-
<FormLabel>Wyzwalająca wartość atrybutu</FormLabel>
175-
<FormControl>
176-
<Input type="text" placeholder="tak" {...field} />
177-
</FormControl>
178-
<FormMessage />
179-
</FormItem>
180-
)}
181-
/>
182-
</div>
183-
);
184-
}
145+
// NOTE: Commented out because this trigger is not yet implemented on the backend.
146+
// Uncomment when the backend supports this feature.
147+
// case "attribute_changed": {
148+
// return (
149+
// <div className="flex flex-col gap-2">
150+
// <FormField
151+
// control={form.control}
152+
// name="triggerValue"
153+
// render={({ field }) => (
154+
// <FormItem className="space-y-3">
155+
// <FormLabel>Atrybut</FormLabel>
156+
// <Select onValueChange={field.onChange}>
157+
// <FormControl>
158+
// <SelectTrigger>
159+
// <SelectValue placeholder="Wybierz atrybut" />
160+
// </SelectTrigger>
161+
// </FormControl>
162+
// <SelectContent>
163+
// {eventAttributes.map((attribute) => (
164+
// <SelectItem
165+
// key={attribute.id}
166+
// value={String(attribute.id)}
167+
// >
168+
// {attribute.name}
169+
// </SelectItem>
170+
// ))}
171+
// </SelectContent>
172+
// </Select>
173+
// <FormMessage />
174+
// </FormItem>
175+
// )}
176+
// />
177+
// <FormField
178+
// control={form.control}
179+
// name="triggerValue2"
180+
// render={({ field }) => (
181+
// <FormItem className="space-y-3">
182+
// <FormLabel>Wyzwalająca wartość atrybutu</FormLabel>
183+
// <FormControl>
184+
// <Input type="text" placeholder="tak" {...field} />
185+
// </FormControl>
186+
// <FormMessage />
187+
// </FormItem>
188+
// )}
189+
// />
190+
// </div>
191+
// );
192+
// }
185193
}
186194
}
187195

src/app/dashboard/events/[id]/emails/[emailId]/edit-form.tsx

Lines changed: 62 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,14 @@ const EventEmailEditFormSchema = z
5656
if (data.trigger === "form_filled") {
5757
return data.triggerValue !== undefined && data.triggerValue !== "";
5858
}
59-
if (data.trigger === "attribute_changed") {
60-
return (
61-
(data.triggerValue !== undefined && data.triggerValue !== "") ||
62-
(data.triggerValue2 !== undefined && data.triggerValue2 !== "")
63-
);
64-
}
59+
// NOTE: Commented out because this trigger is not yet implemented on the backend.
60+
// Uncomment when the backend supports this feature.
61+
// if (data.trigger === "attribute_changed") {
62+
// return (
63+
// (data.triggerValue !== undefined && data.triggerValue !== "") ||
64+
// (data.triggerValue2 !== undefined && data.triggerValue2 !== "")
65+
// );
66+
// }
6567
return true;
6668
},
6769
{
@@ -87,7 +89,9 @@ function TriggerTypeExplanation({ trigger }: { trigger: string }) {
8789
}
8890

8991
function TriggerConfigurationInputs({
90-
eventAttributes,
92+
// NOTE: eventAttributes is prefixed with underscore because the attribute_changed trigger
93+
// which uses it is not yet implemented on the backend. Rename back when the backend supports this feature.
94+
eventAttributes: _eventAttributes,
9195
eventForms,
9296
trigger,
9397
form,
@@ -149,55 +153,57 @@ function TriggerConfigurationInputs({
149153
</div>
150154
);
151155
}
152-
case "attribute_changed": {
153-
return (
154-
<div className="flex flex-col gap-2">
155-
<FormField
156-
control={form.control}
157-
name="triggerValue"
158-
render={({ field }) => (
159-
<FormItem className="space-y-3">
160-
<FormLabel>Atrybut</FormLabel>
161-
<Select
162-
onValueChange={field.onChange}
163-
defaultValue={field.value}
164-
>
165-
<FormControl>
166-
<SelectTrigger>
167-
<SelectValue placeholder="Wybierz atrybut" />
168-
</SelectTrigger>
169-
</FormControl>
170-
<SelectContent>
171-
{eventAttributes.map((attribute) => (
172-
<SelectItem
173-
key={attribute.id}
174-
value={String(attribute.id)}
175-
>
176-
{attribute.name}
177-
</SelectItem>
178-
))}
179-
</SelectContent>
180-
</Select>
181-
<FormMessage />
182-
</FormItem>
183-
)}
184-
/>
185-
<FormField
186-
control={form.control}
187-
name="triggerValue2"
188-
render={({ field }) => (
189-
<FormItem className="space-y-3">
190-
<FormLabel>Wyzwalająca wartość atrybutu</FormLabel>
191-
<FormControl>
192-
<Input type="text" placeholder="tak" {...field} />
193-
</FormControl>
194-
<FormMessage />
195-
</FormItem>
196-
)}
197-
/>
198-
</div>
199-
);
200-
}
156+
// NOTE: Commented out because this trigger is not yet implemented on the backend.
157+
// Uncomment when the backend supports this feature.
158+
// case "attribute_changed": {
159+
// return (
160+
// <div className="flex flex-col gap-2">
161+
// <FormField
162+
// control={form.control}
163+
// name="triggerValue"
164+
// render={({ field }) => (
165+
// <FormItem className="space-y-3">
166+
// <FormLabel>Atrybut</FormLabel>
167+
// <Select
168+
// onValueChange={field.onChange}
169+
// defaultValue={field.value}
170+
// >
171+
// <FormControl>
172+
// <SelectTrigger>
173+
// <SelectValue placeholder="Wybierz atrybut" />
174+
// </SelectTrigger>
175+
// </FormControl>
176+
// <SelectContent>
177+
// {eventAttributes.map((attribute) => (
178+
// <SelectItem
179+
// key={attribute.id}
180+
// value={String(attribute.id)}
181+
// >
182+
// {attribute.name}
183+
// </SelectItem>
184+
// ))}
185+
// </SelectContent>
186+
// </Select>
187+
// <FormMessage />
188+
// </FormItem>
189+
// )}
190+
// />
191+
// <FormField
192+
// control={form.control}
193+
// name="triggerValue2"
194+
// render={({ field }) => (
195+
// <FormItem className="space-y-3">
196+
// <FormLabel>Wyzwalająca wartość atrybutu</FormLabel>
197+
// <FormControl>
198+
// <Input type="text" placeholder="tak" {...field} />
199+
// </FormControl>
200+
// <FormMessage />
201+
// </FormItem>
202+
// )}
203+
// />
204+
// </div>
205+
// );
206+
// }
201207
}
202208
}
203209

src/app/dashboard/events/[id]/participants/table/tests/mocks/test-cases-data.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,23 @@ export const textCaseData: TestCaseData = {
9292
},
9393
},
9494

95-
{
96-
id: 1002,
97-
eventId: 250,
98-
name: "VIP Upgrade Notification",
99-
trigger: "attribute_changed",
100-
triggerValue: "ticket_type", // AI generated slop - idk if it makes any sense
101-
triggerValue2: "VIP", // AI generated slop - idk if it makes any sense
102-
createdAt: "2024-11-08T16:45:30.000Z",
103-
updatedAt: "2025-02-01T11:18:42.000Z",
104-
meta: {
105-
failedCount: "1",
106-
pendingCount: "0",
107-
sentCount: "23",
108-
},
109-
},
95+
// NOTE: Commented out because the attribute_changed trigger is not yet implemented on the backend.
96+
// Uncomment when the backend supports this feature.
97+
// {
98+
// id: 1002,
99+
// eventId: 250,
100+
// name: "VIP Upgrade Notification",
101+
// trigger: "attribute_changed",
102+
// triggerValue: "ticket_type", // AI generated slop - idk if it makes any sense
103+
// triggerValue2: "VIP", // AI generated slop - idk if it makes any sense
104+
// createdAt: "2024-11-08T16:45:30.000Z",
105+
// updatedAt: "2025-02-01T11:18:42.000Z",
106+
// meta: {
107+
// failedCount: "1",
108+
// pendingCount: "0",
109+
// sentCount: "23",
110+
// },
111+
// },
110112
],
111113
};
112114

src/lib/emails.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ export const EMAIL_TRIGGERS = [
1717
"Ten szablon zostanie automatycznie wysłany do uczestnika po wypełnieniu określonego formularza.",
1818
value: "form_filled",
1919
},
20-
{
21-
name: "Zmiana atrybutu",
22-
description:
23-
"Ten szablon zostanie automatycznie wysłany do uczestnika, gdy wartość określonego atrybutu ulegnie zmianie na daną wartość.",
24-
value: "attribute_changed",
25-
},
20+
// NOTE: Commented out because this trigger is not yet implemented on the backend.
21+
// Uncomment when the backend supports this feature.
22+
// {
23+
// name: "Zmiana atrybutu",
24+
// description:
25+
// "Ten szablon zostanie automatycznie wysłany do uczestnika, gdy wartość określonego atrybutu ulegnie zmianie na daną wartość.",
26+
// value: "attribute_changed",
27+
// },
2628
{
2729
name: "Manualny",
2830
description:

0 commit comments

Comments
 (0)