Skip to content

Commit ef74aff

Browse files
linked time: add feature flag for prospective fob (#5983)
We want to show a prospective fob on user hovering the axis. This PR creates a feature flag to hide it until it's ready. Co-authored-by: Riley Jones <[email protected]>
1 parent a3ba7ab commit ef74aff

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

tensorboard/webapp/feature_flag/store/feature_flag_metadata.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ export const FeatureFlagMetadataMap: FeatureFlagMetadataMapType<FeatureFlags> =
116116
queryParamOverride: 'allowRangeSelection',
117117
parseValue: parseBoolean,
118118
},
119+
enabledProspectiveFob: {
120+
defaultValue: false,
121+
queryParamOverride: 'enableProspectiveFob',
122+
parseValue: parseBoolean,
123+
},
119124
};
120125

121126
/**

tensorboard/webapp/feature_flag/store/feature_flag_selectors.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,10 @@ export const getAllowRangeSelection = createSelector(
163163
return flags.allowRangeSelection;
164164
}
165165
);
166+
167+
export const getIsLinkedTimeProspectiveFobEnabled = createSelector(
168+
getFeatureFlags,
169+
(flags: FeatureFlags): boolean => {
170+
return flags.enabledProspectiveFob;
171+
}
172+
);

tensorboard/webapp/feature_flag/store/feature_flag_selectors_test.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,4 +415,33 @@ describe('feature_flag_selectors', () => {
415415
expect(selectors.getIsDataTableEnabled(state)).toEqual(true);
416416
});
417417
});
418+
419+
describe('#getIsLinkedTimeProspectiveFobEnabled', () => {
420+
it('returns the proper value', () => {
421+
let state = buildState(
422+
buildFeatureFlagState({
423+
defaultFlags: buildFeatureFlag({
424+
enabledProspectiveFob: false,
425+
}),
426+
})
427+
);
428+
expect(selectors.getIsLinkedTimeProspectiveFobEnabled(state)).toEqual(
429+
false
430+
);
431+
432+
state = buildState(
433+
buildFeatureFlagState({
434+
defaultFlags: buildFeatureFlag({
435+
enabledProspectiveFob: false,
436+
}),
437+
flagOverrides: {
438+
enabledProspectiveFob: true,
439+
},
440+
})
441+
);
442+
expect(selectors.getIsLinkedTimeProspectiveFobEnabled(state)).toEqual(
443+
true
444+
);
445+
});
446+
});
418447
});

tensorboard/webapp/feature_flag/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,6 @@ export interface FeatureFlags {
4848
enableShowFlags: boolean;
4949
// Adds check box in settings which allows users to enter step selection range.
5050
allowRangeSelection: boolean;
51+
// In Linked Time, if enabled, show a prospective fob user to turn on the feature or select a step.
52+
enabledProspectiveFob: boolean;
5153
}

0 commit comments

Comments
 (0)