Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable timeline view #327

Merged
merged 1 commit into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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