Skip to content

Commit

Permalink
add feature gate
Browse files Browse the repository at this point in the history
  • Loading branch information
salazarm committed Mar 6, 2024
1 parent 30e3741 commit 21e5373
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
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 @@ -13,6 +13,7 @@ export const FeatureFlag = {
flagDisableAutoLoadDefaults: 'flagDisableAutoLoadDefaults' as const,
flagUseNewAutomationPage: 'flagUseNewAutomationPage' as const,
flagUseNewOverviewPage: 'flagUseNewOverviewPage' as const,
flagExperimentalBranchDiff: 'flagExperimentalBranchDiff' as const,
};
export type FeatureFlagType = keyof typeof FeatureFlag;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from '@dagster-io/ui-components';
import styled from 'styled-components';

import {FeatureFlag, featureEnabled} from '../app/Flags';
import {displayNameForAssetKey} from '../asset-graph/Utils';
import {AssetKeyInput, ChangeReason} from '../graphql/types';
import {numberFormatter} from '../ui/formatters';
Expand All @@ -21,7 +22,8 @@ export const ChangedReasonsTag = ({
changedReasons?: ChangeReason[];
assetKey: AssetKeyInput;
}) => {
if (!changedReasons?.length) {
const flagExperimentalBranchDiff = featureEnabled(FeatureFlag.flagExperimentalBranchDiff);
if (!changedReasons?.length || !flagExperimentalBranchDiff) {
return null;
}
return (
Expand All @@ -45,6 +47,10 @@ export const ChangedReasonsPopover = ({
assetKey: AssetKeyInput;
children: React.ReactNode;
}) => {
const flagExperimentalBranchDiff = featureEnabled(FeatureFlag.flagExperimentalBranchDiff);
if (!flagExperimentalBranchDiff) {
return null;
}
const modifiedChanges = changedReasons.filter((reason) => reason !== ChangeReason.NEW);
function getDescription(change: ChangeReason) {
switch (change) {
Expand Down Expand Up @@ -100,6 +106,10 @@ export const MinimalNodeChangedDot = ({
changedReasons: ChangeReason[];
assetKey: AssetKeyInput;
}) => {
const flagExperimentalBranchDiff = featureEnabled(FeatureFlag.flagExperimentalBranchDiff);
if (!flagExperimentalBranchDiff) {
return null;
}
return (
<ChangedReasonsPopover changedReasons={changedReasons} assetKey={assetKey}>
<MinimalNodeChangedDotContainer />
Expand Down

0 comments on commit 21e5373

Please sign in to comment.