Skip to content

Commit

Permalink
chore: remove page component and other unused code (#3138)
Browse files Browse the repository at this point in the history
Fixes #2490
  • Loading branch information
wesbillman authored Oct 16, 2024
1 parent 0175b61 commit 6546b1e
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 248 deletions.
13 changes: 0 additions & 13 deletions frontend/console/src/features/console/BottomPanel.tsx

This file was deleted.

28 changes: 15 additions & 13 deletions frontend/console/src/features/console/ConsolePage.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useState } from 'react'
import { type NavigateFunction, useNavigate } from 'react-router-dom'
import { useModules } from '../../api/modules/use-modules'
import { Loader } from '../../components/Loader'
import { ResizablePanels } from '../../components/ResizablePanels'
import { Page } from '../../layout'
import { Config, Module, Secret, Verb } from '../../protos/xyz/block/ftl/v1/console/console_pb'
import { type FTLNode, GraphPane } from '../graph/GraphPane'
import BottomPanel from './BottomPanel'
import { Timeline } from '../timeline/Timeline'
import type { ExpandablePanelProps } from './ExpandablePanel'
import { configPanels } from './right-panel/ConfigPanels'
import { modulePanels } from './right-panel/ModulePanels'
Expand All @@ -19,20 +19,22 @@ export const ConsolePage = () => {
const [selectedNode, setSelectedNode] = useState<FTLNode | null>(null)

if (!modules.isSuccess) {
return <Page>Loading...</Page>
return (
<div className='flex justify-center items-center h-full'>
<Loader />
</div>
)
}

return (
<Page>
<Page.Body className='flex h-full'>
<ResizablePanels
mainContent={<GraphPane onTapped={setSelectedNode} />}
rightPanelHeader={headerForNode(selectedNode)}
rightPanelPanels={panelsForNode(modules.data.modules, selectedNode, navigate)}
bottomPanelContent={<BottomPanel />}
/>
</Page.Body>
</Page>
<div className='flex h-full'>
<ResizablePanels
mainContent={<GraphPane onTapped={setSelectedNode} />}
rightPanelHeader={headerForNode(selectedNode)}
rightPanelPanels={panelsForNode(modules.data.modules, selectedNode, navigate)}
bottomPanelContent={<Timeline timeSettings={{ isTailing: true, isPaused: false }} filters={[]} />}
/>
</div>
)
}

Expand Down
69 changes: 0 additions & 69 deletions frontend/console/src/features/deployments/DeploymentPage.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions frontend/console/src/features/deployments/DeploymentsPage.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions frontend/console/src/features/logs/LogLevelBadge.tsx

This file was deleted.

Empty file.
69 changes: 0 additions & 69 deletions frontend/console/src/features/modules/decls/VerbPanel.tsx

This file was deleted.

21 changes: 9 additions & 12 deletions frontend/console/src/features/timeline/TimelinePage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useEffect, useState } from 'react'
import { useSearchParams } from 'react-router-dom'
import { Page } from '../../layout'
import type { EventsQuery_Filter } from '../../protos/xyz/block/ftl/v1/console/console_pb'
import { SidePanelProvider } from '../../providers/side-panel-provider'
import { Timeline } from './Timeline'
Expand Down Expand Up @@ -33,17 +32,15 @@ export const TimelinePage = () => {

return (
<SidePanelProvider>
<Page>
<Page.Body className='flex'>
<div className='sticky top-0 flex-none overflow-y-auto'>
<TimelineTimeControls selectedTimeRange={selectedTimeRange} isTimelinePaused={isTimelinePaused} onTimeSettingsChange={handleTimeSettingsChanged} />
<TimelineFilterPanel onFiltersChanged={handleFiltersChanged} />
</div>
<div className='flex-grow overflow-y-scroll'>
<Timeline timeSettings={timeSettings} filters={filters} />
</div>
</Page.Body>
</Page>
<div className='flex h-full'>
<div className='flex-none overflow-y-auto'>
<TimelineTimeControls selectedTimeRange={selectedTimeRange} isTimelinePaused={isTimelinePaused} onTimeSettingsChange={handleTimeSettingsChanged} />
<TimelineFilterPanel onFiltersChanged={handleFiltersChanged} />
</div>
<div className='flex-grow overflow-y-scroll'>
<Timeline timeSettings={timeSettings} filters={filters} />
</div>
</div>
</SidePanelProvider>
)
}
11 changes: 10 additions & 1 deletion frontend/console/src/features/traces/TraceRequestList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import type { Event } from '../../protos/xyz/block/ftl/v1/console/console_pb'
import { SidePanelContext } from '../../providers/side-panel-provider'
import TimelineEventList from '../timeline/TimelineEventList'
import { TimelineCallDetails } from '../timeline/details/TimelineCallDetails'
import { TimelineDetailsHeader } from '../timeline/details/TimelineDetailsHeader'
import { TimelineIngressDetails } from '../timeline/details/TimelineIngressDetails'
import { groupEventsByRequestKey } from './traces.utils'

export const TraceRequestList = ({ module, verb }: { module: string; verb?: string }) => {
Expand All @@ -22,7 +24,14 @@ export const TraceRequestList = ({ module, verb }: { module: string; verb?: stri
return
}
setSelectedEventId(event.id)
openPanel(<TimelineCallDetails event={event} />)
switch (event.entry?.case) {
case 'call':
openPanel(<TimelineCallDetails event={event} />, <TimelineDetailsHeader event={event} />)
break
case 'ingress':
openPanel(<TimelineIngressDetails event={event} />, <TimelineDetailsHeader event={event} />)
break
}
}

const events = Object.entries(traceEvents).map(([_, events]) => events[0])
Expand Down
9 changes: 4 additions & 5 deletions frontend/console/src/features/verbs/VerbPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useNavigate } from 'react-router-dom'
import { useModules } from '../../api/modules/use-modules'
import { Loader } from '../../components/Loader'
import { ResizablePanels } from '../../components/ResizablePanels'
import { Page } from '../../layout'
import type { Module, Verb } from '../../protos/xyz/block/ftl/v1/console/console_pb'
import { NotificationType, NotificationsContext } from '../../providers/notifications-provider'
import { SidePanelProvider } from '../../providers/side-panel-provider'
Expand Down Expand Up @@ -55,16 +54,16 @@ export const VerbPage = ({ moduleName, declName }: { moduleName: string; declNam

return (
<SidePanelProvider>
<Page>
<Page.Body className='flex h-full'>
<div className='flex flex-col h-full'>
<div className='flex h-full'>
<ResizablePanels
mainContent={<VerbRequestForm module={module} verb={verb} />}
rightPanelHeader={header}
rightPanelPanels={verbPanels(verb)}
bottomPanelContent={<TraceRequestList module={module.name} verb={verb.verb?.name} />}
/>
</Page.Body>
</Page>
</div>
</div>
</SidePanelProvider>
)
}
30 changes: 0 additions & 30 deletions frontend/console/src/layout/Page.tsx

This file was deleted.

1 change: 0 additions & 1 deletion frontend/console/src/layout/index.ts

This file was deleted.

0 comments on commit 6546b1e

Please sign in to comment.