-
Notifications
You must be signed in to change notification settings - Fork 559
feat: bypass feature flag #2707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
669547f
a3fcd86
410699d
20e47e7
c39ebae
c55257a
ccc2d6d
307c0a6
c4860fc
134ba3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,6 +3,7 @@ | |||||
import { getTenantId } from "@/lib/auth"; | ||||||
import { clickhouse } from "@/lib/clickhouse"; | ||||||
import { db } from "@/lib/db"; | ||||||
import { getFlag } from "@/lib/utils"; | ||||||
import { notFound } from "next/navigation"; | ||||||
import { createSearchParamsCache } from "nuqs/server"; | ||||||
import { DEFAULT_LOGS_FETCH_COUNT } from "./constants"; | ||||||
|
@@ -28,7 +29,7 @@ export default async function Page({ | |||||
return <div>Workspace with tenantId: {tenantId} not found</div>; | ||||||
} | ||||||
|
||||||
if (!workspace.betaFeatures.logsPage) { | ||||||
if (getFlag(workspace, "logsPage", { devFallback: false, prodFallback: true })) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return notFound(); | ||||||
} | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ import { | |
ShieldCheck, | ||
TableProperties, | ||
} from "lucide-react"; | ||
import { cn } from "../../lib/utils"; | ||
import { cn, getFlag } from "../../lib/utils"; | ||
|
||
type NavItem = { | ||
disabled?: boolean; | ||
|
@@ -44,7 +44,7 @@ const DiscordIcon = () => ( | |
</svg> | ||
); | ||
|
||
const Tag: React.FC<{ label: string; className?: string }> = ({ label, className }) => ( | ||
const Tag = ({ label, className }: { label: string; className?: string }) => ( | ||
<div | ||
className={cn( | ||
"bg-background border text-content-subtle rounded text-xs px-1 py-0.5 font-mono ", | ||
|
@@ -56,8 +56,7 @@ const Tag: React.FC<{ label: string; className?: string }> = ({ label, className | |
); | ||
|
||
export const createWorkspaceNavigation = ( | ||
workspace: Pick<Workspace, "features"> & | ||
Pick<Workspace, "betaFeatures"> & { llmGateways: { id: string }[] }, | ||
workspace: Workspace & { llmGateways: { id: string }[] }, | ||
segments: string[], | ||
) => { | ||
return [ | ||
|
@@ -91,22 +90,31 @@ export const createWorkspaceNavigation = ( | |
href: "/monitors/verifications", | ||
label: "Monitors", | ||
active: segments.at(0) === "verifications", | ||
hidden: !workspace.features.webhooks, | ||
hidden: getFlag(workspace, "webhooks", { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's reversed too |
||
devFallback: false, | ||
prodFallback: true, | ||
}), | ||
ogzhanolguncu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
{ | ||
icon: TableProperties, | ||
href: "/logs", | ||
label: "Logs", | ||
active: segments.at(0) === "logs", | ||
hidden: !workspace.betaFeatures.logsPage, | ||
hidden: getFlag(workspace, "logsPage", { | ||
devFallback: false, | ||
prodFallback: true, | ||
}), | ||
}, | ||
{ | ||
icon: Crown, | ||
href: "/success", | ||
label: "Success", | ||
active: segments.at(0) === "success", | ||
tag: <Tag label="internal" />, | ||
hidden: !workspace.features.successPage, | ||
hidden: getFlag(workspace, "successPage", { | ||
devFallback: false, | ||
prodFallback: true, | ||
}), | ||
}, | ||
{ | ||
icon: DatabaseZap, | ||
|
@@ -120,7 +128,10 @@ export const createWorkspaceNavigation = ( | |
href: "/identities", | ||
label: "Identities", | ||
active: segments.at(0) === "identities", | ||
hidden: !workspace.betaFeatures.identities, | ||
hidden: getFlag(workspace, "identities", { | ||
devFallback: false, | ||
prodFallback: true, | ||
}), | ||
}, | ||
{ | ||
icon: Settings2, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const DEFAULT_RATELIMIT_OVERRIDES = 5; | ||
export const DEFAULT_FREE_AUDIT_LOG_RETENTION_DAYS = 30; | ||
export const DEFAULT_PAID_AUDIT_LOG_RETENTION_DAYS = 90; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you flipped it around, so when they had it set to true in our database, we would actually deny them access