From e4d2448d1acdec4e955bb76573b5f6a372e7a924 Mon Sep 17 00:00:00 2001 From: unrenamed Date: Mon, 7 Oct 2024 18:37:43 +0300 Subject: [PATCH 1/7] fix(dashboard): resolve button descendant warnings --- .../permissions/[permissionId]/delete-permission.tsx | 2 +- .../authorization/permissions/[permissionId]/page.tsx | 8 ++++---- .../authorization/permissions/create-new-permission.tsx | 2 +- .../(app)/authorization/roles/[roleId]/delete-role.tsx | 2 +- .../(app)/authorization/roles/[roleId]/update-role.tsx | 2 +- .../app/(app)/authorization/roles/create-new-role.tsx | 2 +- .../dashboard/app/(app)/settings/billing/plans/button.tsx | 2 +- apps/dashboard/app/(app)/team-switcher.tsx | 2 +- apps/dashboard/app/(app)/user-button.tsx | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/delete-permission.tsx b/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/delete-permission.tsx index 691c130acd..1b1de8c149 100644 --- a/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/delete-permission.tsx +++ b/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/delete-permission.tsx @@ -67,7 +67,7 @@ export const DeletePermission: React.FC = ({ trigger, permission }) => { return ( setOpen(o)}> - {trigger} + {trigger} Delete Permission diff --git a/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/page.tsx b/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/page.tsx index 10de75c985..d3807ba832 100644 --- a/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/page.tsx +++ b/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/page.tsx @@ -84,10 +84,10 @@ export default async function RolesPage(props: Props) { className="w-40 font-mono font-medium ph-no-capture" > - - {permission.name} -
- + +
+ {permission.name} +
{shouldShowTooltip && ( diff --git a/apps/dashboard/app/(app)/authorization/permissions/create-new-permission.tsx b/apps/dashboard/app/(app)/authorization/permissions/create-new-permission.tsx index 95865b7f51..6a66b45eef 100644 --- a/apps/dashboard/app/(app)/authorization/permissions/create-new-permission.tsx +++ b/apps/dashboard/app/(app)/authorization/permissions/create-new-permission.tsx @@ -75,7 +75,7 @@ export const CreateNewPermission: React.FC = ({ trigger }) => { return ( - {trigger} + {trigger} Create a new permission diff --git a/apps/dashboard/app/(app)/authorization/roles/[roleId]/delete-role.tsx b/apps/dashboard/app/(app)/authorization/roles/[roleId]/delete-role.tsx index a82b265810..a61741a3c4 100644 --- a/apps/dashboard/app/(app)/authorization/roles/[roleId]/delete-role.tsx +++ b/apps/dashboard/app/(app)/authorization/roles/[roleId]/delete-role.tsx @@ -68,7 +68,7 @@ export const DeleteRole: React.FC = ({ trigger, role }) => { return ( setOpen(o)}> - {trigger} + {trigger} Delete Role diff --git a/apps/dashboard/app/(app)/authorization/roles/[roleId]/update-role.tsx b/apps/dashboard/app/(app)/authorization/roles/[roleId]/update-role.tsx index 2ea3a2a6bf..d7c3363023 100644 --- a/apps/dashboard/app/(app)/authorization/roles/[roleId]/update-role.tsx +++ b/apps/dashboard/app/(app)/authorization/roles/[roleId]/update-role.tsx @@ -74,7 +74,7 @@ export const UpdateRole: React.FC = ({ trigger, role }) => { return ( - {trigger} + {trigger} Update Role diff --git a/apps/dashboard/app/(app)/authorization/roles/create-new-role.tsx b/apps/dashboard/app/(app)/authorization/roles/create-new-role.tsx index c9840ee2db..b65f6e8e80 100644 --- a/apps/dashboard/app/(app)/authorization/roles/create-new-role.tsx +++ b/apps/dashboard/app/(app)/authorization/roles/create-new-role.tsx @@ -95,7 +95,7 @@ export const CreateNewRole: React.FC = ({ trigger, permissions }) => { return ( - {trigger} + {trigger} Create a new role diff --git a/apps/dashboard/app/(app)/settings/billing/plans/button.tsx b/apps/dashboard/app/(app)/settings/billing/plans/button.tsx index 8b10427ec1..e173ed1562 100644 --- a/apps/dashboard/app/(app)/settings/billing/plans/button.tsx +++ b/apps/dashboard/app/(app)/settings/billing/plans/button.tsx @@ -60,7 +60,7 @@ export const ChangePlanButton: React.FC = ({ workspace, newPlan, label }) const isSamePlan = workspace.plan === newPlan; return ( - +
diff --git a/apps/dashboard/app/(app)/semantic-cache/[gatewayId]/analytics/page.tsx b/apps/dashboard/app/(app)/semantic-cache/[gatewayId]/analytics/page.tsx index 4c3983a10b..c078d5c31a 100644 --- a/apps/dashboard/app/(app)/semantic-cache/[gatewayId]/analytics/page.tsx +++ b/apps/dashboard/app/(app)/semantic-cache/[gatewayId]/analytics/page.tsx @@ -6,11 +6,7 @@ import { Code } from "@/components/ui/code"; import { Separator } from "@/components/ui/separator"; import { getTenantId } from "@/lib/auth"; import { db } from "@/lib/db"; -import { - getAllSemanticCacheLogs, - getSemanticCachesDaily, - getSemanticCachesHourly, -} from "@/lib/tinybird"; +import { getSemanticCachesDaily, getSemanticCachesHourly } from "@/lib/tinybird"; import { BarChart } from "lucide-react"; import ms from "ms"; import { redirect } from "next/navigation"; @@ -220,11 +216,11 @@ export default async function SemanticCacheAnalyticsPage(props: { No usage Use the snippet below to start using the semantic cache. - - {snippet} - - + + {snippet} + + )} diff --git a/apps/dashboard/app/(app)/settings/billing/stripe/success/page.tsx b/apps/dashboard/app/(app)/settings/billing/stripe/success/page.tsx index c36fa7b35c..c6ff70571c 100644 --- a/apps/dashboard/app/(app)/settings/billing/stripe/success/page.tsx +++ b/apps/dashboard/app/(app)/settings/billing/stripe/success/page.tsx @@ -54,10 +54,16 @@ export default async function StripeSuccess(props: Props) { if (!session) { return ( - Stripe session not found + + Stripe session not found + - The Stripe session {session_id} you are trying to access does not exist. - Please contact support@unkey.dev. + The Stripe session + + {session_id} + + you are trying to access does not exist. Please contact + support@unkey.dev. ); @@ -66,10 +72,16 @@ export default async function StripeSuccess(props: Props) { if (!customer) { return ( - Stripe session not found + + Stripe session not found + + + The Stripe customer + + {session.customer as string} - The Stripe customer {session.customer as string} you are trying to access - does not exist. Please contact support@unkey.dev. + you are trying to access does not exist. Please contact + support@unkey.dev. ); diff --git a/apps/dashboard/app/(app)/settings/vercel/page.tsx b/apps/dashboard/app/(app)/settings/vercel/page.tsx index 93480d0826..a392afd247 100644 --- a/apps/dashboard/app/(app)/settings/vercel/page.tsx +++ b/apps/dashboard/app/(app)/settings/vercel/page.tsx @@ -66,8 +66,8 @@ export default async function Page(props: Props) { Error We couldn't load your projects from Vercel. Please try again or contact support. - {JSON.stringify(err, null, 2)} + {JSON.stringify(err, null, 2)} ); } From f2fcbd6a0f8f2fe4dbda81ab7695d03448a6c6bb Mon Sep 17 00:00:00 2001 From: unrenamed Date: Mon, 7 Oct 2024 18:51:51 +0300 Subject: [PATCH 3/7] fix(dashboard): adjust EmptyPlaceholder.Description margins --- apps/dashboard/components/dashboard/empty-placeholder.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/components/dashboard/empty-placeholder.tsx b/apps/dashboard/components/dashboard/empty-placeholder.tsx index 968d4593f5..adc4bad964 100644 --- a/apps/dashboard/components/dashboard/empty-placeholder.tsx +++ b/apps/dashboard/components/dashboard/empty-placeholder.tsx @@ -48,7 +48,7 @@ EmptyPlaceholder.Description = function EmptyPlaceholderDescription({ return (

Date: Mon, 7 Oct 2024 18:53:05 +0300 Subject: [PATCH 4/7] fix(dashboard): fix async/await is not yet supported in client components error --- apps/dashboard/app/(app)/ratelimits/sparkline.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/app/(app)/ratelimits/sparkline.tsx b/apps/dashboard/app/(app)/ratelimits/sparkline.tsx index 6d9b156c4b..16cd8ed067 100644 --- a/apps/dashboard/app/(app)/ratelimits/sparkline.tsx +++ b/apps/dashboard/app/(app)/ratelimits/sparkline.tsx @@ -12,7 +12,7 @@ type Props = { }[]; }; -export const Sparkline: React.FC = async ({ data }) => { +export const Sparkline: React.FC = ({ data }) => { const data2 = data.map((d) => ({ date: new Date(d.time), values: d.values, From 7d2e18ef69bcc9d9bfedd00f5e0680fdf960a10b Mon Sep 17 00:00:00 2001 From: unrenamed Date: Mon, 7 Oct 2024 18:53:56 +0300 Subject: [PATCH 5/7] fix(dashboard): each child in an array should have a unique "key" prop --- .../[keyId]/permissions/permission-manager-card.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/dashboard/app/(app)/settings/root-keys/[keyId]/permissions/permission-manager-card.tsx b/apps/dashboard/app/(app)/settings/root-keys/[keyId]/permissions/permission-manager-card.tsx index 1c708ac347..458ac06116 100644 --- a/apps/dashboard/app/(app)/settings/root-keys/[keyId]/permissions/permission-manager-card.tsx +++ b/apps/dashboard/app/(app)/settings/root-keys/[keyId]/permissions/permission-manager-card.tsx @@ -12,7 +12,7 @@ import { import { Label } from "@/components/ui/label"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; import type { Permission } from "@unkey/db"; -import { Check, Pencil } from "lucide-react"; +import { Check } from "lucide-react"; import { PermissionToggle } from "./permission_toggle"; import type { UnkeyPermissions } from "./permissions"; @@ -62,7 +62,7 @@ export function PermissionManagerCard(props: PermissionManagerCardProps) {

{Object.entries(props.permissionsStructure).map(([category, allPermissions]) => ( -
+
{category}{" "}
{Object.entries(allPermissions).map( @@ -96,7 +96,7 @@ export function PermissionManagerCard(props: PermissionManagerCardProps) {

)} {activePermissions.map(([category, allPermissions]) => ( -
+
{category}{" "}
{Object.entries(allPermissions) @@ -105,7 +105,7 @@ export function PermissionManagerCard(props: PermissionManagerCardProps) { }) .map(([action, { description, permission }]) => { return ( -
+
From 5d9995d10a11dbcb7da969f00bef0fdaab94e896 Mon Sep 17 00:00:00 2001 From: unrenamed Date: Mon, 7 Oct 2024 19:41:02 +0300 Subject: [PATCH 6/7] refactor(dashboard): rename "session" to "customer" on /stripe/success page --- .../app/(app)/settings/billing/stripe/success/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/app/(app)/settings/billing/stripe/success/page.tsx b/apps/dashboard/app/(app)/settings/billing/stripe/success/page.tsx index c6ff70571c..f0c7165eb0 100644 --- a/apps/dashboard/app/(app)/settings/billing/stripe/success/page.tsx +++ b/apps/dashboard/app/(app)/settings/billing/stripe/success/page.tsx @@ -73,7 +73,7 @@ export default async function StripeSuccess(props: Props) { return ( - Stripe session not found + Stripe customer not found The Stripe customer From 8f9305c51ff1a5d3795b891ffaeb896bcaf44323 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:31:29 +0000 Subject: [PATCH 7/7] [autofix.ci] apply automated fixes --- .../permissions/[permissionId]/page.tsx | 4 +++- .../settings/billing/stripe/success/page.tsx | 22 +++++-------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/page.tsx b/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/page.tsx index d3807ba832..8c9a2eb8ae 100644 --- a/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/page.tsx +++ b/apps/dashboard/app/(app)/authorization/permissions/[permissionId]/page.tsx @@ -87,7 +87,9 @@ export default async function RolesPage(props: Props) {
{permission.name} -
+
+ +
{shouldShowTooltip && ( diff --git a/apps/dashboard/app/(app)/settings/billing/stripe/success/page.tsx b/apps/dashboard/app/(app)/settings/billing/stripe/success/page.tsx index f0c7165eb0..56ea43356a 100644 --- a/apps/dashboard/app/(app)/settings/billing/stripe/success/page.tsx +++ b/apps/dashboard/app/(app)/settings/billing/stripe/success/page.tsx @@ -54,16 +54,11 @@ export default async function StripeSuccess(props: Props) { if (!session) { return ( - - Stripe session not found - - - The Stripe session - + Stripe session not found + The Stripe session {session_id} - you are trying to access does not exist. Please contact - support@unkey.dev. + you are trying to access does not exist. Please contact support@unkey.dev. ); @@ -72,16 +67,11 @@ export default async function StripeSuccess(props: Props) { if (!customer) { return ( - - Stripe customer not found - - - The Stripe customer - + Stripe customer not found + The Stripe customer {session.customer as string} - you are trying to access does not exist. Please contact - support@unkey.dev. + you are trying to access does not exist. Please contact support@unkey.dev. );