mirror of
https://github.com/reconurge/flowsint.git
synced 2026-04-27 18:01:58 -05:00
feat(app): feature flag
This commit is contained in:
@@ -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' }
|
||||
|
||||
@@ -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} />
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user