bc0d1ff59a
Summary - Implemented metrics dashboards with a built-in dashboard and custom dashboards - Added a "Big number” display type What changed - New data format for metric layouts and saving/editing layouts (editing, saving, cancel revert) - QueryWidget usable on Query page and Metrics dashboards - Time filtering, auto-reloading and timeBucket() auto-bin support - Filters added to metrics; widget popover/improved history and blank states - Side menu: - Metrics/Insights section with icons, colors, padding, collapsible behavior and reordering of custom dashboards - Move action logic into service for reuse and API querying; refactor reordering for reuse <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/triggerdotdev/trigger.dev/pull/3019" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end --> --------- Co-authored-by: James Ritchie <james@trigger.dev>
36 lines
832 B
TypeScript
36 lines
832 B
TypeScript
import { cn } from "~/utils/cn";
|
|
|
|
export function FormButtons({
|
|
cancelButton,
|
|
confirmButton,
|
|
defaultAction,
|
|
className,
|
|
}: {
|
|
cancelButton?: React.ReactNode;
|
|
confirmButton?: React.ReactNode;
|
|
defaultAction?: { name: string; value: string; disabled?: boolean };
|
|
className?: string;
|
|
}) {
|
|
return (
|
|
<div
|
|
className={cn(
|
|
"flex w-full items-center justify-between border-t border-grid-bright pt-4",
|
|
className
|
|
)}
|
|
>
|
|
{defaultAction && (
|
|
<button
|
|
type="submit"
|
|
name={defaultAction.name}
|
|
value={defaultAction.value}
|
|
disabled={defaultAction.disabled}
|
|
className="hidden"
|
|
tabIndex={-1}
|
|
aria-hidden="true"
|
|
/>
|
|
)}
|
|
{cancelButton ? cancelButton : <div />} {confirmButton ?? null}
|
|
</div>
|
|
);
|
|
}
|