feat(app): feature flag

This commit is contained in:
dextmorgn
2026-02-12 23:43:57 +01:00
parent 599fc8353d
commit ae070c14c7
3 changed files with 21 additions and 8 deletions

View File

@@ -18,7 +18,7 @@ export const Sidebar = memo(() => {
const navItems: NavItem[] = [
{ icon: Home, label: 'Dashboard', href: '/dashboard/' },
{ icon: Puzzle, label: 'Enrichers', href: '/dashboard/enrichers' },
// { icon: Puzzle, label: 'Enrichers', href: '/dashboard/enrichers' },
{ icon: Workflow, label: 'Flows', href: '/dashboard/flows' },
{ icon: Shapes, label: 'Custom types', href: '/dashboard/custom-types' },
{ icon: Lock, label: 'Vault', href: '/dashboard/vault' }

View File

@@ -1,9 +1,18 @@
import { createFileRoute } from '@tanstack/react-router'
import { createFileRoute, redirect } from '@tanstack/react-router'
import Loader from '@/components/loader'
import { templateService } from '@/api/template-service'
import { TemplateEditor } from '@/components/templates/template-editor'
const FEATURE_FLAG = true
export const Route = createFileRoute('/_auth/dashboard/enrichers/$enricherId')({
beforeLoad: async () => {
if (FEATURE_FLAG) {
throw redirect({
to: '/'
})
}
},
loader: async ({ params: { enricherId } }) => {
const template = await templateService.getById(enricherId)
return { template }
@@ -30,10 +39,6 @@ export const Route = createFileRoute('/_auth/dashboard/enrichers/$enricherId')({
function TemplatePage() {
const { template } = Route.useLoaderData()
return (
<TemplateEditor
key={template.id}
templateId={template.id}
initialContent={template.content}
/>
<TemplateEditor key={template.id} templateId={template.id} initialContent={template.content} />
)
}

View File

@@ -1,4 +1,4 @@
import { createFileRoute } from '@tanstack/react-router'
import { createFileRoute, redirect } from '@tanstack/react-router'
import { useQuery } from '@tanstack/react-query'
import { useRef, useState } from 'react'
import { Button } from '@/components/ui/button'
@@ -13,8 +13,16 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
import ErrorState from '@/components/shared/error-state'
import { PageLayout } from '@/components/layout/page-layout'
import { templateService, type Template } from '@/api/template-service'
const FEATURE_FLAG = true
export const Route = createFileRoute('/_auth/dashboard/enrichers/')({
beforeLoad: async () => {
if (FEATURE_FLAG) {
throw redirect({
to: '/'
})
}
},
component: TemplatesPage
})