Skip to content

Commit

Permalink
[UI v2] feat: Adds Day or dialog info
Browse files Browse the repository at this point in the history
  • Loading branch information
devinvillarosa committed Feb 13, 2025
1 parent cd03e6f commit 56f1bcf
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import {
import type { DeploymentSchedule } from "@/api/deployments";
import { Button } from "@/components/ui/button";
import { CronInput } from "@/components/ui/cron-input";
import { DialogFooter, DialogTrigger } from "@/components/ui/dialog";
import {
Dialog,
DialogContent,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import {
Form,
FormControl,
Expand All @@ -14,8 +21,10 @@ import {
FormLabel,
FormMessage,
} from "@/components/ui/form";
import { Icon } from "@/components/ui/icons";
import { Switch } from "@/components/ui/switch";
import { TimezoneSelect } from "@/components/ui/timezone-select";
import { Typography } from "@/components/ui/typography";
import { useToast } from "@/hooks/use-toast";
import { zodResolver } from "@hookform/resolvers/zod";
import cronParser from "cron-parser";
Expand Down Expand Up @@ -194,7 +203,9 @@ export const CronScheduleForm = ({
name="schedule.day_or"
render={({ field }) => (
<FormItem>
<FormLabel>Day Or</FormLabel>
<FormLabel>
Day or <DayOrDialog />
</FormLabel>
<FormControl>
<Switch
className="block"
Expand Down Expand Up @@ -237,3 +248,25 @@ export const CronScheduleForm = ({
</Form>
);
};

const DayOrDialog = () => {
return (
<Dialog>
<DialogTrigger asChild>
<button>
<Icon id="Info" className="h-4 w-4 inline" />
</button>
</DialogTrigger>
<DialogContent aria-describedby={undefined}>
<DialogHeader>
<DialogTitle>Day Or</DialogTitle>
</DialogHeader>
<Typography>
When the "Day Or" value is off, this schedule will connect day of the

Check failure on line 265 in ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/cron-schedule-form.tsx

View workflow job for this annotation

GitHub Actions / Build ui

`"` can be escaped with `&quot;`, `&ldquo;`, `&#34;`, `&rdquo;`

Check failure on line 265 in ui-v2/src/components/deployments/deployment-schedules/deployment-schedule-dialog/cron-schedule-form.tsx

View workflow job for this annotation

GitHub Actions / Build ui

`"` can be escaped with `&quot;`, `&ldquo;`, `&#34;`, `&rdquo;`
month and day of the week entries using OR logic; when on it will
connect them using AND logic.
</Typography>
</DialogContent>
</Dialog>
);
};
2 changes: 2 additions & 0 deletions ui-v2/src/components/ui/icons/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
EllipsisVertical,
ExternalLink,
Image,
Info,
LayoutGrid,
Loader2,
Moon,
Expand Down Expand Up @@ -61,6 +62,7 @@ export const ICONS = {
EllipsisVertical,
ExternalLink,
Image,
Info,
LayoutGrid,
Loader2,
Moon,
Expand Down

0 comments on commit 56f1bcf

Please sign in to comment.