Skip to content

Commit e1faca8

Browse files
committed
Don't show "Triggered" on the filter
1 parent f858b1a commit e1faca8

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type Variant = keyof typeof variants;
2121

2222
type AppliedFilterProps = {
2323
icon?: ReactNode;
24-
label: ReactNode;
24+
label?: ReactNode;
2525
value: ReactNode;
2626
removable?: boolean;
2727
onRemove?: () => void;
@@ -48,12 +48,12 @@ export function AppliedFilter({
4848
className
4949
)}
5050
>
51-
<div className="flex items-start gap-0.5 leading-4">
51+
<div className={cn("flex items-start leading-4", label === undefined ? "gap-1.5" : "gap-0.5")}>
5252
<div className="-mt-[0.5px] flex items-center gap-1">
5353
{icon}
54-
<div className="text-text-bright">
54+
{label !== undefined && <div className="text-text-bright">
5555
<span>{label}</span>:
56-
</div>
56+
</div>}
5757
</div>
5858
<div className="text-text-dimmed">
5959
<div>{value}</div>

apps/webapp/app/components/runs/v3/SharedFilters.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,34 @@
11
import * as Ariakit from "@ariakit/react";
22
import type { RuntimeEnvironment } from "@trigger.dev/database";
33
import {
4-
startOfDay,
54
endOfDay,
6-
startOfWeek,
5+
endOfMonth,
76
endOfWeek,
7+
isSaturday,
8+
isSunday,
9+
previousSaturday,
10+
startOfDay,
811
startOfMonth,
9-
endOfMonth,
12+
startOfWeek,
1013
startOfYear,
1114
subDays,
12-
subWeeks,
1315
subMonths,
14-
previousSaturday,
15-
isSaturday,
16-
isSunday,
16+
subWeeks,
1717
} from "date-fns";
1818
import parse from "parse-duration";
19-
import { startTransition, useCallback, useEffect, useRef, useState, type ReactNode } from "react";
19+
import { startTransition, useCallback, useEffect, useState, type ReactNode } from "react";
2020
import { AppliedFilter } from "~/components/primitives/AppliedFilter";
21-
import { DateTimePicker } from "~/components/primitives/DateTimePicker";
2221
import { DateTime } from "~/components/primitives/DateTime";
22+
import { DateTimePicker } from "~/components/primitives/DateTimePicker";
2323
import { Label } from "~/components/primitives/Label";
24+
import { Paragraph } from "~/components/primitives/Paragraph";
2425
import { RadioButtonCircle } from "~/components/primitives/RadioButton";
2526
import { ComboboxProvider, SelectPopover, SelectProvider } from "~/components/primitives/Select";
2627
import { useSearchParams } from "~/hooks/useSearchParam";
28+
import { type ShortcutDefinition } from "~/hooks/useShortcutKeys";
2729
import { cn } from "~/utils/cn";
2830
import { Button } from "../../primitives/Buttons";
2931
import { filterIcon } from "./RunFilters";
30-
import { Paragraph } from "~/components/primitives/Paragraph";
31-
import { ShortcutDefinition } from "~/hooks/useShortcutKeys";
32-
import { SpanPresenter } from "~/presenters/v3/SpanPresenter.server";
33-
import { useLocation } from "@remix-run/react";
3432

3533
export type DisplayableEnvironment = Pick<RuntimeEnvironment, "type" | "id"> & {
3634
userName?: string;
@@ -290,6 +288,7 @@ export interface TimeFilterProps {
290288
to?: string;
291289
/** Label name used in the filter display, defaults to "Created" */
292290
labelName?: string;
291+
hideLabel?: boolean;
293292
applyShortcut?: ShortcutDefinition | undefined;
294293
/** Callback when the user applies a time filter selection, receives the applied values */
295294
onValueChange?: (values: TimeFilterApplyValues) => void;
@@ -301,6 +300,7 @@ export function TimeFilter({
301300
from,
302301
to,
303302
labelName = "Created",
303+
hideLabel = false,
304304
applyShortcut,
305305
onValueChange,
306306
}: TimeFilterProps = {}) {
@@ -324,7 +324,7 @@ export function TimeFilter({
324324
trigger={
325325
<Ariakit.Select render={<div className="group cursor-pointer focus-custom" />}>
326326
<AppliedFilter
327-
label={constrained.label}
327+
label={hideLabel ? undefined : constrained.label}
328328
icon={filterIcon("period")}
329329
value={constrained.valueLabel}
330330
removable={false}

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query/route.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ const QueryEditorForm = forwardRef<
475475
<TimeFilter
476476
defaultPeriod={DEFAULT_PERIOD}
477477
labelName="Triggered"
478+
hideLabel
478479
period={period}
479480
from={from}
480481
to={to}

0 commit comments

Comments
 (0)