Skip to content

Commit

Permalink
client side feature flag instead
Browse files Browse the repository at this point in the history
  • Loading branch information
salazarm committed Oct 9, 2023
1 parent cc70012 commit 1ceb3ac
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.

This file was deleted.

1 change: 1 addition & 0 deletions js_modules/dagster-ui/packages/ui-core/src/app/Flags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const FeatureFlag = {
flagDisableAutoLoadDefaults: 'flagDisableAutoLoadDefaults' as const,
flagDAGSidebar: 'flagDAGSidebar' as const,
flagDisableDAGCache: 'flagDisableDAGCache' as const,
flagEnableAMPTimeline: 'flagEnableAMPTimeline' as const,
};
export type FeatureFlagType = keyof typeof FeatureFlag;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,8 @@ export const getVisibleFeatureFlagRows = () => [
key: 'Disable Asset Graph caching',
flagType: FeatureFlag.flagDisableDAGCache,
},
{
key: 'Experimental Auto-materialize policy timeline page',
flagType: FeatureFlag.flagEnableAMPTimeline,
},
];
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import {Redirect, Route, Switch} from 'react-router-dom';

import {useCloudFeatureFlag} from '../app/CloudFeatureFlag';
import {useFeatureFlags} from '../app/Flags';
import {AutomaterializationRoot} from '../assets/auto-materialization/AutomaterializationRoot';
import {InstanceBackfills} from '../instance/InstanceBackfills';
import {BackfillPage} from '../instance/backfill/BackfillPage';
Expand All @@ -13,7 +13,7 @@ import {OverviewSchedulesRoot} from './OverviewSchedulesRoot';
import {OverviewSensorsRoot} from './OverviewSensorsRoot';

export const OverviewRoot = () => {
const {enableAMPTimeline} = useCloudFeatureFlag();
const {flagEnableAMPTimeline} = useFeatureFlags();
return (
<Switch>
<Route path="/overview/activity">
Expand All @@ -28,7 +28,7 @@ export const OverviewRoot = () => {
<Route path="/overview/sensors">
<OverviewSensorsRoot />
</Route>
{enableAMPTimeline ? (
{flagEnableAMPTimeline ? (
<Route path="/overview/amp">
<AutomaterializationRoot />
</Route>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {QueryResult} from '@apollo/client';
import {Box, Colors, Spinner, Tabs} from '@dagster-io/ui-components';
import * as React from 'react';

import {useCloudFeatureFlag} from '../app/CloudFeatureFlag';
import {useFeatureFlags} from '../app/Flags';
import {QueryRefreshCountdown, QueryRefreshState} from '../app/QueryRefresh';
import {useAutomaterializeDaemonStatus} from '../assets/AutomaterializeDaemonStatusTag';
import {TabLink} from '../ui/TabLink';
Expand All @@ -17,7 +17,7 @@ export const OverviewTabs = <TData extends Record<string, any>>(props: Props<TDa
const {refreshState, tab} = props;

const automaterialize = useAutomaterializeDaemonStatus();
const {enableAMPTimeline} = useCloudFeatureFlag();
const {flagEnableAMPTimeline} = useFeatureFlags();

return (
<Box flex={{direction: 'row', justifyContent: 'space-between', alignItems: 'flex-end'}}>
Expand All @@ -26,7 +26,7 @@ export const OverviewTabs = <TData extends Record<string, any>>(props: Props<TDa
<TabLink id="jobs" title="Jobs" to="/overview/jobs" />
<TabLink id="schedules" title="Schedules" to="/overview/schedules" />
<TabLink id="sensors" title="Sensors" to="/overview/sensors" />
{enableAMPTimeline ? (
{flagEnableAMPTimeline ? (
<TabLink
id="amp"
title={
Expand Down

0 comments on commit 1ceb3ac

Please sign in to comment.