Skip to content

Commit

Permalink
feature gate
Browse files Browse the repository at this point in the history
  • Loading branch information
salazarm committed Jan 10, 2024
1 parent ce75e38 commit 9389f57
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 108 deletions.
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 @@ -11,6 +11,7 @@ export const FeatureFlag = {
flagDisableWebsockets: 'flagDisableWebsockets' as const,
flagSidebarResources: 'flagSidebarResources' as const,
flagDisableAutoLoadDefaults: 'flagDisableAutoLoadDefaults' as const,
flagUseOldAutomationPage: 'flagUseOldAutomationPage' as const,
};
export type FeatureFlagType = keyof typeof FeatureFlag;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ export const getVisibleFeatureFlagRows = () => [
key: 'Debug console logging',
flagType: FeatureFlag.flagDebugConsoleLogging,
},
{
key: 'Use old asset auto-materialize history page',
flagType: FeatureFlag.flagUseOldAutomationPage,
},
];
12 changes: 12 additions & 0 deletions js_modules/dagster-ui/packages/ui-core/src/assets/AssetView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {Alert, Box, NonIdealState, Spinner, Tag, ErrorBoundary} from '@dagster-i
import * as React from 'react';
import {Link, useLocation} from 'react-router-dom';

import {useFeatureFlags} from '../app/Flags';
import {Timestamp} from '../app/time/Timestamp';
import {AssetLiveDataRefresh, useAssetLiveData} from '../asset-data/AssetLiveDataProvider';
import {
Expand Down Expand Up @@ -31,6 +32,7 @@ import {AssetPartitions} from './AssetPartitions';
import {AssetPlots} from './AssetPlots';
import {AssetTabs} from './AssetTabs';
import {AssetAutomaterializePolicyPage} from './AutoMaterializePolicyPage/AssetAutomaterializePolicyPage';
import {AssetAutomaterializePolicyPageOld} from './AutoMaterializePolicyPageOld/AssetAutomaterializePolicyPage';
import {AutomaterializeDaemonStatusTag} from './AutomaterializeDaemonStatusTag';
import {useAutomationPolicySensorFlag} from './AutomationPolicySensorFlag';
import {LaunchAssetExecutionButton} from './LaunchAssetExecutionButton';
Expand Down Expand Up @@ -182,10 +184,20 @@ export const AssetView = ({assetKey, trace}: Props) => {
);
};

const {flagUseOldAutomationPage} = useFeatureFlags();

const renderAutomaterializeHistoryTab = () => {
if (definitionQueryResult.loading && !definitionQueryResult.previousData) {
return <AssetLoadingDefinitionState />;
}
if (flagUseOldAutomationPage) {
return (
<AssetAutomaterializePolicyPageOld
assetKey={assetKey}
assetHasDefinedPartitions={!!definition?.partitionDefinition}
/>
);
}
return <AssetAutomaterializePolicyPage assetKey={assetKey} definition={definition} />;
};

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {AutomaterializeMiddlePanel} from './AutomaterializeMiddlePanel';
import {AutomaterializeRightPanel} from './AutomaterializeRightPanel';
import {useEvaluationsQueryResult} from './useEvaluationsQueryResult';

export const AssetAutomaterializePolicyPage = ({
export const AssetAutomaterializePolicyPageOld = ({
assetKey,
assetHasDefinedPartitions,
}: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,28 @@ export const ParentUpdatedPartitionLink = ({updatedAssetKeys, willUpdateAssetKey
const count = partitionNames.length;
const filteredPartitionNames = useFilterPartitionNames(partitionNames, queryString);

console.log({filteredPartitionNames});

const visiblePartitions = React.useMemo(() => {
return Object.fromEntries(
filteredPartitionNames.map((partitionName) => {
return [
partitionName,
[
...(updatedAssetKeys[partitionName] || []).sort(sortAssetKeys).map((assetKey) => ({
assetKey,
detailType: AssetDetailType.Updated,
})),
...(willUpdateAssetKeys[partitionName] || []).sort(sortAssetKeys).map((assetKey) => ({
assetKey,
detailType: AssetDetailType.WillUpdate,
})),
...(updatedAssetKeys[partitionName] || [])
.slice()
.sort(sortAssetKeys)
.map((assetKey) => ({
assetKey,
detailType: AssetDetailType.Updated,
})),
...(willUpdateAssetKeys[partitionName] || [])
.slice()
.sort(sortAssetKeys)
.map((assetKey) => ({
assetKey,
detailType: AssetDetailType.WillUpdate,
})),
],
];
}),
Expand Down

0 comments on commit 9389f57

Please sign in to comment.