Skip to content

Commit

Permalink
feat: enable timeline view
Browse files Browse the repository at this point in the history
  • Loading branch information
anrusina committed Mar 15, 2022
1 parent ae63316 commit 07cff21
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
6 changes: 2 additions & 4 deletions src/basics/FeatureFlags/defaultConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ export enum FeatureFlag {
TestFlagTrue = 'test-flag-true',

// Production flags
LaunchPlan = 'launch-plan',
TimelineView = 'timeline-view'
LaunchPlan = 'launch-plan'
}

export type FeatureFlagConfig = { [k: string]: boolean };
Expand All @@ -20,6 +19,5 @@ export const defaultFlagConfig: FeatureFlagConfig = {

// Production - new code should be turned off by default
// If you need to turn it on locally -> update runtimeConfig in ./index.tsx file
'launch-plan': false,
'timeline-view': false
'launch-plan': false
};
5 changes: 1 addition & 4 deletions src/basics/LocalCache/defaultConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ export enum LocalCacheItem {
TestObject = 'test-object',

// Production flags
ShowWorkflowVersions = 'flyte.show-workflow-versions',

// Feature flags - for prod testing
ffTimelineView = 'ff.timeline-view'
ShowWorkflowVersions = 'flyte.show-workflow-versions'
}

type LocalCacheConfig = { [k: string]: string };
Expand Down
12 changes: 2 additions & 10 deletions src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,10 @@ export const ExecutionNodeViews: React.FC<ExecutionNodeViewsProps> = ({ executio
const filterState = useNodeExecutionFiltersState();
const tabState = useTabState(tabs, defaultTab);

const timelineFlag = useFeatureFlag(FeatureFlag.TimelineView);
const [useTimelineFromCache] = useLocalCache(LocalCacheItem.ffTimelineView);
const isTimelineEnabled = useTimelineFromCache || timelineFlag;

const {
closure: { abortMetadata }
} = execution;

if (!isTimelineEnabled && tabState.value === tabs.timeline.id) {
tabState.onChange(noop, defaultTab);
}

/* We want to maintain the filter selection when switching away from the Nodes
tab and back, but do not want to filter the nodes when viewing the graph. So,
we will only pass filters to the execution state when on the nodes tab. */
Expand All @@ -86,7 +78,7 @@ export const ExecutionNodeViews: React.FC<ExecutionNodeViewsProps> = ({ executio
<Tabs className={styles.tabs} {...tabState}>
<Tab value={tabs.nodes.id} label={tabs.nodes.label} />
<Tab value={tabs.graph.id} label={tabs.graph.label} />
{isTimelineEnabled && <Tab value={tabs.timeline.id} label={tabs.timeline.label} />}
<Tab value={tabs.timeline.id} label={tabs.timeline.label} />
</Tabs>
<NodeExecutionDetailsContextProvider workflowId={execution.closure.workflowId}>
<div className={styles.nodesContainer}>
Expand All @@ -105,7 +97,7 @@ export const ExecutionNodeViews: React.FC<ExecutionNodeViewsProps> = ({ executio
{renderExecutionLoader}
</WaitForQuery>
)}
{isTimelineEnabled && tabState.value === tabs.timeline.id && (
{tabState.value === tabs.timeline.id && (
<WaitForQuery errorComponent={DataError} query={nodeExecutionsQuery}>
{renderExecutionsTimeline}
</WaitForQuery>
Expand Down

0 comments on commit 07cff21

Please sign in to comment.