diff --git a/js_modules/dagster-ui/packages/ui-core/src/pipelines/SidebarRoot.tsx b/js_modules/dagster-ui/packages/ui-core/src/pipelines/SidebarRoot.tsx index 9370d5670c3df..1d378733c5730 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/pipelines/SidebarRoot.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/pipelines/SidebarRoot.tsx @@ -1,10 +1,11 @@ import {Box, ErrorBoundary, Tabs} from '@dagster-io/ui-components'; -import * as React from 'react'; +import {useJobSidebarAlertsTabConfig} from 'shared/pipelines/useJobSidebarAlertsTabConfig.oss'; import {RightInfoPanelContent} from './GraphExplorer'; import {ExplorerPath} from './PipelinePathUtils'; import {SidebarContainerOverview} from './SidebarContainerOverview'; import {SidebarOp} from './SidebarOp'; +import {TabDefinition, TabKey} from './types'; import {SidebarRootContainerFragment} from './types/SidebarContainerOverview.types'; import {OpNameOrPath} from '../ops/OpNameOrPath'; import {TypeExplorerContainer} from '../typeexplorer/TypeExplorerContainer'; @@ -12,14 +13,6 @@ import {TypeListContainer} from '../typeexplorer/TypeListContainer'; import {TabLink} from '../ui/TabLink'; import {RepoAddress} from '../workspace/types'; -type TabKey = 'types' | 'info'; - -interface TabDefinition { - name: string; - key: TabKey; - content: () => React.ReactNode; -} - interface SidebarRootProps { tab?: TabKey; typeName?: string; @@ -49,10 +42,10 @@ export const SidebarRoot = (props: SidebarRootProps) => { const activeTab = tab || 'info'; - const TabDefinitions: Array = [ + const tabDefinitions: TabDefinition[] = [ { name: 'Info', - key: 'info', + key: 'info' as const, content: () => opHandleID ? ( { }, { name: 'Types', - key: 'types', + key: 'types' as const, content: () => typeName ? ( { ), }, - ]; + useJobSidebarAlertsTabConfig({repoAddress, jobName: container.name}), + ].filter((tab) => tab !== null); return ( <> - {TabDefinitions.map(({name, key}) => ( + {tabDefinitions.map(({name, key}) => ( ))} - {TabDefinitions.find((t) => t.key === activeTab)?.content()} + {tabDefinitions.find((t) => t.key === activeTab)?.content()} diff --git a/js_modules/dagster-ui/packages/ui-core/src/pipelines/types.tsx b/js_modules/dagster-ui/packages/ui-core/src/pipelines/types.tsx new file mode 100644 index 0000000000000..831e3c4c4e2fe --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/pipelines/types.tsx @@ -0,0 +1,9 @@ +import {ReactNode} from 'react'; + +export type TabKey = 'types' | 'info' | 'alerts'; + +export interface TabDefinition { + name: string; + key: TabKey; + content: () => ReactNode; +} diff --git a/js_modules/dagster-ui/packages/ui-core/src/pipelines/useJobSidebarAlertsTabConfig.oss.tsx b/js_modules/dagster-ui/packages/ui-core/src/pipelines/useJobSidebarAlertsTabConfig.oss.tsx new file mode 100644 index 0000000000000..c6ae10950c65b --- /dev/null +++ b/js_modules/dagster-ui/packages/ui-core/src/pipelines/useJobSidebarAlertsTabConfig.oss.tsx @@ -0,0 +1,8 @@ +import {RepoAddress} from '../workspace/types'; + +export interface Config { + repoAddress?: RepoAddress; + jobName: string; +} + +export const useJobSidebarAlertsTabConfig = (_: Config) => null;