Skip to content

Commit 0e919f5

Browse files
ericallamsamejrmatt-aitken
authored
Alerts v1 (#1065)
* Alerts v1 * Encrypt alert webhook secrets and allow them to be generated by the server * Alert v1 UI * Remove unnecessary emails * Move to using `@react-email/components` * WIP slack alerts * More slack alerts WIP * Update pnpm lock after rebase * Finish implementing Slack alerts * Use a more error like emoji * New secondary variant for the segmented control * Added a simple checkbox style variant to storybook * Style tweak to the segmented control * UI improvements to the alert modal * Use searchable Select for alerts. Changed default variant for SegmentedControl * Secondary button now using secondary colour * segmented control style tweak * Improved the channel column in the alerts table * Updated logo-mono.png * Updated email styles * Email templates updated to new styles * Don’t log the decrypted secret * await enqueing the deployment alert when an index fails * await enqueing the timeout alert --------- Co-authored-by: James Ritchie <[email protected]> Co-authored-by: Matt Aitken <[email protected]>
1 parent f90960f commit 0e919f5

File tree

70 files changed

+5002
-655
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+5002
-655
lines changed

.changeset/nice-bulldogs-turn.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"trigger.dev": patch
3+
"@trigger.dev/core": patch
4+
---
5+
6+
Better handle uncaught exceptions

apps/webapp/app/components/billing/PricingTiers.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ export function TierPro({
290290
options={concurrencyTiers.map((c) => ({ label: `Up to ${c.upto}`, value: c.code }))}
291291
fullWidth
292292
value={concurrentBracketCode}
293+
variant="primary"
293294
onChange={(v) => setConcurrentBracketCode(v)}
294295
/>
295296
<div className="py-6">

apps/webapp/app/components/navigation/SideMenu.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
ArrowRightIcon,
44
ArrowRightOnRectangleIcon,
55
BeakerIcon,
6+
BellAlertIcon,
67
ChartBarIcon,
78
ClockIcon,
89
CursorArrowRaysIcon,
@@ -45,6 +46,7 @@ import {
4546
v3ApiKeysPath,
4647
v3DeploymentsPath,
4748
v3EnvironmentVariablesPath,
49+
v3ProjectAlertsPath,
4850
v3ProjectPath,
4951
v3ProjectSettingsPath,
5052
v3RunsPath,
@@ -601,6 +603,13 @@ function V3ProjectSideMenu({
601603
to={v3DeploymentsPath(organization, project)}
602604
data-action="deployments"
603605
/>
606+
<SideMenuItem
607+
name="Alerts"
608+
icon={BellAlertIcon}
609+
iconColor="text-red-500"
610+
to={v3ProjectAlertsPath(organization, project)}
611+
data-action="alerts"
612+
/>
604613
<SideMenuItem
605614
name="Project settings"
606615
icon="settings"

apps/webapp/app/components/primitives/Buttons.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ const theme = {
4848
"border-black/40 text-charcoal-900 group-hover:border-black/60 group-hover:text-charcoal-900",
4949
},
5050
secondary: {
51-
textColor: "text-primary group-hover:text-apple-200 transition group-disabled:text-primary",
51+
textColor: "text-secondary group-hover:text-secondary transition group-disabled:text-secondary",
5252
button:
53-
"bg-transparent border border-primary group-hover:border-apple-200 group-hover:bg-apple-950 group-disabled:opacity-30 group-disabled:border-primary group-disabled:bg-transparent group-disabled:pointer-events-none",
53+
"bg-transparent border border-secondary group-hover:border-secondary group-hover:bg-secondary/10 group-disabled:opacity-30 group-disabled:border-secondary group-disabled:bg-transparent group-disabled:pointer-events-none",
5454
shortcut:
55-
"border-primary/30 text-apple-200 group-hover:text-text-bright/80 group-hover:border-dimmed/60",
55+
"border-secondary/30 text-secondary group-hover:text-text-bright/80 group-hover:border-dimmed/60",
5656
},
5757
tertiary: {
5858
textColor: "text-text-bright transition group-disabled:text-text-dimmed/80",

apps/webapp/app/components/primitives/DetailCell.tsx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,33 +49,22 @@ export function DetailCell({
4949
const variation = variations[variant];
5050

5151
return (
52-
<div
53-
className={cn(
54-
"group flex h-11 w-full items-center gap-3 rounded-md p-1 pr-3 transition hover:bg-charcoal-900",
55-
className
56-
)}
57-
>
52+
<div className={cn("group flex h-11 w-full items-center gap-3 rounded-md p-1 pr-3", className)}>
5853
<IconInBox
5954
icon={leadingIcon}
6055
className={cn("flex-none transition group-hover:border-charcoal-750", leadingIconClassName)}
6156
/>
6257
<div className="flex flex-1 flex-col">
6358
<Paragraph
6459
variant={variation.label.variant}
65-
className={cn(
66-
"flex-1 text-left transition group-hover:text-text-bright",
67-
variation.label.className
68-
)}
60+
className={cn("flex-1 text-left", variation.label.className)}
6961
>
7062
{label}
7163
</Paragraph>
7264
{description && (
7365
<Paragraph
7466
variant={variation.description.variant}
75-
className={cn(
76-
"flex-1 text-left text-text-dimmed transition group-hover:text-text-bright",
77-
variation.description.className
78-
)}
67+
className={cn("flex-1 text-left text-text-dimmed", variation.description.className)}
7968
>
8069
{description}
8170
</Paragraph>

apps/webapp/app/components/primitives/SegmentedControl.tsx

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@ import { RadioGroup } from "@headlessui/react";
22
import { motion } from "framer-motion";
33
import { cn } from "~/utils/cn";
44

5+
const variants = {
6+
primary: {
7+
base: "bg-charcoal-700",
8+
active: "text-text-bright hover:bg-charcoal-750/50",
9+
},
10+
secondary: {
11+
base: "bg-charcoal-700/50",
12+
active: "text-text-bright bg-charcoal-700 rounded-[2px] border border-charcoal-600/50",
13+
},
14+
};
15+
16+
type Variants = keyof typeof variants;
17+
518
type Options = {
619
label: string;
720
value: string;
@@ -12,6 +25,7 @@ type SegmentedControlProps = {
1225
value?: string;
1326
defaultValue?: string;
1427
options: Options[];
28+
variant?: Variants;
1529
fullWidth?: boolean;
1630
onChange?: (value: string) => void;
1731
};
@@ -21,11 +35,18 @@ export default function SegmentedControl({
2135
value,
2236
defaultValue,
2337
options,
38+
variant = "secondary",
2439
fullWidth,
2540
onChange,
2641
}: SegmentedControlProps) {
2742
return (
28-
<div className={cn("flex h-10 rounded bg-charcoal-700", fullWidth ? "w-full" : "w-fit")}>
43+
<div
44+
className={cn(
45+
"flex h-10 rounded text-text-bright",
46+
variants[variant].base,
47+
fullWidth ? "w-full" : "w-fit"
48+
)}
49+
>
2950
<RadioGroup
3051
value={value}
3152
defaultValue={defaultValue ?? options[0].value}
@@ -46,11 +67,11 @@ export default function SegmentedControl({
4667
cn(
4768
"relative flex h-full grow cursor-pointer text-center font-normal focus:outline-none",
4869
active
49-
? "ring-offset-2 focus-visible:ring focus-visible:ring-primary focus-visible:ring-opacity-60"
70+
? "ring-offset-2 focus-visible:ring focus-visible:ring-secondary focus-visible:ring-opacity-60"
5071
: "",
5172
checked
52-
? "text-text-bright"
53-
: "rounded-[2px] text-text-dimmed transition hover:bg-charcoal-750/50 hover:text-text-bright"
73+
? variants[variant].active
74+
: "text-text-dimmed transition hover:text-text-bright"
5475
)
5576
}
5677
>
@@ -60,12 +81,12 @@ export default function SegmentedControl({
6081
<div className="z-10 flex h-full w-full items-center justify-center text-sm">
6182
<RadioGroup.Label as="p">{option.label}</RadioGroup.Label>
6283
</div>
63-
{checked && (
84+
{checked && variant === "primary" && (
6485
<motion.div
6586
layoutId={`segmented-control-${name}`}
6687
transition={{ duration: 0.4, type: "spring" }}
6788
className="absolute inset-0 rounded-[2px] shadow-md outline outline-3 outline-primary"
68-
></motion.div>
89+
/>
6990
)}
7091
</div>
7192
</>

apps/webapp/app/env.server.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ const EnvironmentSchema = z.object({
153153
INTERNAL_OTEL_TRACE_SAMPLING_RATE: z.string().default("20"),
154154
INTERNAL_OTEL_TRACE_INSTRUMENT_PRISMA_ENABLED: z.string().default("0"),
155155
INTERNAL_OTEL_TRACE_DISABLED: z.string().default("0"),
156+
157+
ORG_SLACK_INTEGRATION_CLIENT_ID: z.string().optional(),
158+
ORG_SLACK_INTEGRATION_CLIENT_SECRET: z.string().optional(),
156159
});
157160

158161
export type Environment = z.infer<typeof EnvironmentSchema>;

0 commit comments

Comments
 (0)