Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
chronark committed Dec 11, 2024
2 parents c556284 + b85e811 commit d5ea72a
Show file tree
Hide file tree
Showing 97 changed files with 314 additions and 298 deletions.
5 changes: 0 additions & 5 deletions apps/agent/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ require (
github.com/fvbommel/sortorder v1.1.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/gammazero/deque v0.2.1 // indirect
github.com/getkin/kin-openapi v0.124.0 // indirect
github.com/go-faster/city v1.0.1 // indirect
github.com/go-faster/errors v0.7.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
Expand Down Expand Up @@ -152,7 +151,6 @@ require (
github.com/in-toto/in-toto-golang v0.9.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/influxdata/tdigest v0.0.1 // indirect
github.com/invopop/yaml v0.2.0 // indirect
github.com/jonboulle/clockwork v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand Down Expand Up @@ -184,16 +182,13 @@ require (
github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/oapi-codegen/oapi-codegen/v2 v2.3.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/paulmach/orb v0.11.1 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/perimeterx/marshmallow v1.1.5 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
Expand Down
4 changes: 1 addition & 3 deletions apps/dashboard/app/(app)/[...not-found]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ export default function NotFound() {
</EmptyPlaceholder.Description>
<div className="flex flex-col items-center justify-center gap-2 md:flex-row">
<Link href="/">
<Button variant="secondary" className="items-center w-full gap-2 ">
Go Back
</Button>
<Button variant="default">Go Back</Button>
</Link>
</div>
</EmptyPlaceholder>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { cn } from "@/lib/utils";
import { Button } from "@unkey/ui";
import dagre from "dagre";
import { MoreVertical, Settings2 } from "lucide-react";
import Link from "next/link";
Expand Down Expand Up @@ -206,8 +207,8 @@ const KeyNode: React.FC<

<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon">
<MoreVertical className="w-4 h-4" />
<Button variant="ghost">
<MoreVertical />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent>
Expand Down Expand Up @@ -246,8 +247,8 @@ const RoleNode: React.FC<

<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon">
<MoreVertical className="w-4 h-4" />
<Button variant="ghost" shape="square">
<MoreVertical />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent>
Expand Down Expand Up @@ -283,7 +284,7 @@ const PermissionNode: React.FC<NodeProps<{ name: string; active: boolean; permis

<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="icon">
<Button variant="ghost" shape="square">
<MoreVertical className="w-4 h-4" />
</Button>
</DropdownMenuTrigger>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { clickhouse } from "@/lib/clickhouse";
import { and, db, eq, isNull, schema } from "@/lib/db";
import { formatNumber } from "@/lib/fmt";
import { cn } from "@/lib/utils";
import { Button, buttonVariants } from "@unkey/ui";
import { BarChart, Minus } from "lucide-react";
import ms from "ms";
import { notFound } from "next/navigation";
Expand Down Expand Up @@ -241,9 +242,9 @@ export default async function APIKeyDetailPage(props: {
</Link>
<Link
href={`/apis/${props.params.apiId}/keys/${props.params.keyAuthId}/${props.params.keyId}/settings`}
className={cn(buttonVariants({ variant: "outline" }), "gap-1")}
className={cn(buttonVariants({ variant: "default" }))}
>
<Settings2 className="w-4 h-4" />
<Settings2 />
Key settings
</Link>
</div>
Expand Down Expand Up @@ -339,12 +340,10 @@ export default async function APIKeyDetailPage(props: {
</div>
<div className="flex items-center gap-2">
<CreateNewRole
trigger={<Button variant="secondary">Create New Role</Button>}
trigger={<Button>Create New Role</Button>}
permissions={key.workspace.permissions}
/>
<CreateNewPermission
trigger={<Button variant="secondary">Create New Permission</Button>}
/>
<CreateNewPermission trigger={<Button>Create New Permission</Button>} />
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { revalidate } from "@/app/actions";
import { Button } from "@unkey/ui";
import { Card, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
import { toast } from "@/components/ui/toaster";
import { Button } from "@unkey/ui";
import type React from "react";
import { useState } from "react";

Expand Down Expand Up @@ -51,7 +52,7 @@ export const DeleteKey: React.FC<Props> = ({ apiKey, keyAuthId }) => {
</CardHeader>

<CardFooter className="z-10 justify-end">
<Button type="button" onClick={() => setOpen(!open)} variant="alert">
<Button type="button" onClick={() => setOpen(!open)} variant="destructive">
Delete Key
</Button>
</CardFooter>
Expand All @@ -73,12 +74,12 @@ export const DeleteKey: React.FC<Props> = ({ apiKey, keyAuthId }) => {
<input type="hidden" name="keyId" value={apiKey.id} />

<DialogFooter className="justify-end">
<Button type="button" onClick={() => setOpen(!open)} variant="secondary">
<Button type="button" onClick={() => setOpen(!open)}>
Cancel
</Button>
<Button
type="submit"
variant="alert"
variant="destructive"
disabled={deleteKey.isLoading}
onClick={() => deleteKey.mutate({ keyIds: [apiKey.id] })}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Switch } from "@/components/ui/switch";
import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { zodResolver } from "@hookform/resolvers/zod";
import { Button } from "@unkey/ui";
import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { z } from "zod";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { cn } from "@/lib/utils";
import { zodResolver } from "@hookform/resolvers/zod";
import { Button } from "@unkey/ui";
import { format } from "date-fns";

import { useRouter } from "next/navigation";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { Textarea } from "@/components/ui/textarea";
import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { zodResolver } from "@hookform/resolvers/zod";
import { Button } from "@unkey/ui";
import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { z } from "zod";
Expand Down Expand Up @@ -97,7 +98,6 @@ export const UpdateKeyMetadata: React.FC<Props> = ({ apiKey }) => {
</CardContent>
<CardFooter className="items-center justify-end gap-4">
<Button
variant="secondary"
type="button"
onClick={() => {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { cn } from "@/lib/utils";
import { zodResolver } from "@hookform/resolvers/zod";
import { Button } from "@unkey/ui";
import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { z } from "zod";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { cn } from "@/lib/utils";
import { zodResolver } from "@hookform/resolvers/zod";
import { Button } from "@unkey/ui";
import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { z } from "zod";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { cn } from "@/lib/utils";
import { zodResolver } from "@hookform/resolvers/zod";
import { Button } from "@unkey/ui";
import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { z } from "zod";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { cn } from "@/lib/utils";
import { zodResolver } from "@hookform/resolvers/zod";
import { Button } from "@unkey/ui";
import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { z } from "zod";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import BackButton from "@/components/ui/back-button";
import { Badge } from "@/components/ui/badge";
import { Button } from "@unkey/ui";
import { db } from "@/lib/db";
import { Button } from "@unkey/ui";
import { ChevronRight, Scan, User, VenetianMask } from "lucide-react";
import Link from "next/link";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Button } from "@unkey/ui";

import { Separator } from "@/components/ui/separator";
import { Switch } from "@/components/ui/switch";
Expand Down Expand Up @@ -198,10 +199,10 @@ export const CreateKey = ({ apiId, keyAuthId, defaultBytes, defaultPrefix }: Pro
</Code>
<div className="flex justify-end my-4 space-x-4">
<Link href={`/keys/${keyAuthId}`}>
<Button variant="secondary">Back</Button>
<Button>Back</Button>
</Link>
<Link href={`/apis/${apiId}/keys/${keyAuthId}/${key.data.keyId}`}>
<Button variant="secondary">View key details</Button>
<Button>View key details</Button>
</Link>
<Button
onClick={() => {
Expand Down Expand Up @@ -718,7 +719,6 @@ export const CreateKey = ({ apiId, keyAuthId, defaultBytes, defaultPrefix }: Pro
</FormDescription>
<FormMessage />
<Button
variant="secondary"
type="button"
onClick={(_e) => {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Input } from "@/components/ui/input";
import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { zodResolver } from "@hookform/resolvers/zod";
import { Button } from "@unkey/ui";
import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { z } from "zod";
Expand Down Expand Up @@ -93,9 +94,7 @@ export const DefaultBytes: React.FC<Props> = ({ keyAuth }) => {
</CardContent>
<CardFooter className="justify-end">
<Button
variant={
form.formState.isValid && !form.formState.isSubmitting ? "primary" : "disabled"
}
variant="primary"
disabled={!form.formState.isValid || form.formState.isSubmitting}
type="submit"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Input } from "@/components/ui/input";
import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { zodResolver } from "@hookform/resolvers/zod";
import { Button } from "@unkey/ui";
import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { z } from "zod";
Expand Down Expand Up @@ -80,13 +81,12 @@ export const DefaultPrefix: React.FC<Props> = ({ keyAuth }) => {
</CardContent>
<CardFooter className="justify-end">
<Button
variant={
form.formState.isValid && !form.formState.isSubmitting ? "primary" : "disabled"
}
variant="primary"
disabled={!form.formState.isValid || form.formState.isSubmitting}
type="submit"
loading={form.formState.isSubmitting}
>
{form.formState.isSubmitting ? <Loading /> : "Save"}
Save
</Button>
</CardFooter>
</Card>
Expand Down
16 changes: 6 additions & 10 deletions apps/dashboard/app/(app)/apis/[apiId]/settings/delete-api.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"use client";
import { Loading } from "@/components/dashboard/loading";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Button } from "@unkey/ui";
import { Card, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
Expand All @@ -24,6 +23,7 @@ import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { cn } from "@/lib/utils";
import { zodResolver } from "@hookform/resolvers/zod";
import { Button } from "@unkey/ui";
import { useRouter } from "next/navigation";
import type React from "react";
import { useState } from "react";
Expand Down Expand Up @@ -107,7 +107,7 @@ export const DeleteApi: React.FC<Props> = ({ api, keys }) => {
type="button"
disabled={!!api.deleteProtection}
onClick={() => setOpen(!open)}
variant="alert"
variant="destructive"
>
Delete API
</Button>
Expand Down Expand Up @@ -173,20 +173,16 @@ export const DeleteApi: React.FC<Props> = ({ api, keys }) => {
/>

<DialogFooter className="justify-end gap-4">
<Button
type="button"
disabled={deleteApi.isLoading}
onClick={() => setOpen(!open)}
variant="secondary"
>
<Button type="button" disabled={deleteApi.isLoading} onClick={() => setOpen(!open)}>
Cancel
</Button>
<Button
type="submit"
variant={isValid ? "alert" : "disabled"}
variant="destructive"
loading={deleteApi.isLoading}
disabled={!isValid || deleteApi.isLoading}
>
{deleteApi.isLoading ? <Loading /> : "Delete API"}
Delete API
</Button>
</DialogFooter>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const DeleteProtection: React.FC<Props> = ({ api }) => {
</CardHeader>

<CardFooter className="z-10 justify-end">
<Button type="button" onClick={() => setOpen(!open)} variant="alert">
<Button type="button" onClick={() => setOpen(!open)} variant="destructive">
Disable Delete Protection
</Button>
</CardFooter>
Expand Down Expand Up @@ -135,13 +135,12 @@ export const DeleteProtection: React.FC<Props> = ({ api }) => {
form.reset();
setOpen(!open);
}}
variant="secondary"
>
Cancel
</Button>
<Button
type="submit"
variant={isValid ? "alert" : "disabled"}
variant="destructive"
disabled={!isValid || updateDeleteProtection.isLoading}
>
{updateDeleteProtection.isLoading ? <Loading /> : "Disable"}
Expand Down Expand Up @@ -170,8 +169,9 @@ export const DeleteProtection: React.FC<Props> = ({ api }) => {
onClick={() => updateDeleteProtection.mutate({ apiId: api.id, enabled: true })}
variant="primary"
disabled={updateDeleteProtection.isLoading}
loading={updateDeleteProtection.isLoading}
>
{updateDeleteProtection.isLoading ? <Loading /> : "Enable"}
Enable
</Button>
</CardFooter>
</Card>
Expand Down
Loading

0 comments on commit d5ea72a

Please sign in to comment.