feat: last run struct

pull/21369/head
Joel 1 year ago
parent 079d0f786d
commit cd675651d8

@ -106,7 +106,7 @@ const BasePanel: FC<BasePanelProps> = ({
}, [handleNodeDataUpdateWithSyncDraft, id, saveStateToHistory]) }, [handleNodeDataUpdateWithSyncDraft, id, saveStateToHistory])
const [tabType, setTabType] = useState<TabType>(TabType.settings) const [tabType, setTabType] = useState<TabType>(TabType.settings)
const hasLastRunData = true // TODO: add disabled logic
return ( return (
<div className={cn( <div className={cn(
'relative mr-2 h-full', 'relative mr-2 h-full',
@ -176,6 +176,7 @@ const BasePanel: FC<BasePanelProps> = ({
<Tab <Tab
value={tabType} value={tabType}
onChange={setTabType} onChange={setTabType}
canSwitchToLastRun={hasLastRunData}
/> />
</div> </div>
<Split /> <Split />

@ -1,4 +1,5 @@
'use client' 'use client'
import ResultPanel from '@/app/components/workflow/run/result-panel'
import type { FC } from 'react' import type { FC } from 'react'
import React from 'react' import React from 'react'
@ -12,6 +13,9 @@ const LastRun: FC<Props> = ({
return ( return (
<div> <div>
last run: {appId} last run: {appId}
<ResultPanel
status='success'
/>
</div> </div>
) )
} }

@ -12,18 +12,20 @@ export enum TabType {
type Props = { type Props = {
value: TabType, value: TabType,
onChange: (value: TabType) => void onChange: (value: TabType) => void
canSwitchToLastRun: boolean
} }
const Tab: FC<Props> = ({ const Tab: FC<Props> = ({
value, value,
onChange, onChange,
canSwitchToLastRun,
}) => { }) => {
const { t } = useTranslation() const { t } = useTranslation()
return ( return (
<TabHeader <TabHeader
items={[ items={[
{ id: TabType.settings, name: t('workflow.debug.settingsTab').toLocaleUpperCase() }, { id: TabType.settings, name: t('workflow.debug.settingsTab').toLocaleUpperCase() },
{ id: TabType.lastRun, name: t('workflow.debug.lastRunTab').toLocaleUpperCase(), disabled: true }, // TODO: add disabled logic { id: TabType.lastRun, name: t('workflow.debug.lastRunTab').toLocaleUpperCase(), disabled: !canSwitchToLastRun },
]} ]}
itemClassName='ml-0' itemClassName='ml-0'
value={value} value={value}

Loading…
Cancel
Save