fix: fully remove maintenance flow references from TreeLibraryPage
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -47,14 +47,14 @@ export function TreeLibraryPage() {
|
|||||||
const [isLoading, setIsLoading] = useState(true)
|
const [isLoading, setIsLoading] = useState(true)
|
||||||
// Read type filter from URL query params (e.g. /trees?type=procedural)
|
// Read type filter from URL query params (e.g. /trees?type=procedural)
|
||||||
const urlType = searchParams.get('type')
|
const urlType = searchParams.get('type')
|
||||||
const [typeFilter, setTypeFilter] = useState<'all' | 'troubleshooting' | 'procedural' | 'maintenance'>(
|
const [typeFilter, setTypeFilter] = useState<'all' | 'troubleshooting' | 'procedural'>(
|
||||||
urlType === 'troubleshooting' || urlType === 'procedural' || urlType === 'maintenance' ? urlType : 'all'
|
urlType === 'troubleshooting' || urlType === 'procedural' ? urlType : 'all'
|
||||||
)
|
)
|
||||||
|
|
||||||
// Sync filters when URL changes (e.g. clicking sidebar categories/tags or nav sub-items)
|
// Sync filters when URL changes (e.g. clicking sidebar categories/tags or nav sub-items)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const t = searchParams.get('type')
|
const t = searchParams.get('type')
|
||||||
if (t === 'troubleshooting' || t === 'procedural' || t === 'maintenance') {
|
if (t === 'troubleshooting' || t === 'procedural') {
|
||||||
setTypeFilter(t)
|
setTypeFilter(t)
|
||||||
} else {
|
} else {
|
||||||
setTypeFilter('all')
|
setTypeFilter('all')
|
||||||
@@ -292,16 +292,14 @@ export function TreeLibraryPage() {
|
|||||||
<div className="mb-6 flex flex-col gap-4 sm:mb-8 sm:flex-row sm:items-start sm:justify-between">
|
<div className="mb-6 flex flex-col gap-4 sm:mb-8 sm:flex-row sm:items-start sm:justify-between">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-bold font-heading text-foreground sm:text-3xl">
|
<h1 className="text-2xl font-bold font-heading text-foreground sm:text-3xl">
|
||||||
{typeFilter === 'procedural' ? 'Projects' : typeFilter === 'troubleshooting' ? 'Troubleshooting Flows' : typeFilter === 'maintenance' ? 'Maintenance Flows' : 'Flow Library'}
|
{typeFilter === 'procedural' ? 'Projects' : typeFilter === 'troubleshooting' ? 'Troubleshooting Flows' : 'Flow Library'}
|
||||||
</h1>
|
</h1>
|
||||||
<p className="mt-2 text-muted-foreground">
|
<p className="mt-2 text-muted-foreground">
|
||||||
{typeFilter === 'procedural'
|
{typeFilter === 'procedural'
|
||||||
? 'Step-by-step projects and runbooks'
|
? 'Step-by-step projects and runbooks'
|
||||||
: typeFilter === 'troubleshooting'
|
: typeFilter === 'troubleshooting'
|
||||||
? 'Branching decision flows for troubleshooting'
|
? 'Branching decision flows for troubleshooting'
|
||||||
: typeFilter === 'maintenance'
|
: 'Browse and start troubleshooting flows and projects'}
|
||||||
? 'Scheduled maintenance procedures run across targets'
|
|
||||||
: 'Browse and start troubleshooting flows and projects'}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{canCreateTrees && (
|
{canCreateTrees && (
|
||||||
@@ -376,7 +374,7 @@ export function TreeLibraryPage() {
|
|||||||
: 'text-muted-foreground hover:text-foreground'
|
: 'text-muted-foreground hover:text-foreground'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{t === 'all' ? 'All' : t === 'troubleshooting' ? 'Troubleshooting' : t === 'procedural' ? 'Projects' : 'Maintenance'}
|
{t === 'all' ? 'All' : t === 'troubleshooting' ? 'Troubleshooting' : 'Projects'}
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user