Skip to content

Commit

Permalink
Removes enableScalarColumnContextMenus flag
Browse files Browse the repository at this point in the history
  • Loading branch information
hoonji committed Mar 26, 2024
1 parent c01e0bc commit dab3532
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ export const FeatureFlagMetadataMap: FeatureFlagMetadataMapType<FeatureFlags> =
queryParamOverride: 'enableScalarColumnCustomization',
parseValue: parseBoolean,
},
enableScalarColumnContextMenus: {
defaultValue: false,
queryParamOverride: 'enableScalarColumnContextMenus',
parseValue: parseBoolean,
},
enableSuggestedCards: {
defaultValue: false,
queryParamOverride: 'enableSuggestedCards',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,3 @@ export const getIsScalarColumnCustomizationEnabled = createSelector(
return flags.enableScalarColumnCustomization;
}
);

export const getIsScalarColumnContextMenusEnabled = createSelector(
getFeatureFlags,
(flags: FeatureFlags): boolean => {
return flags.enableScalarColumnContextMenus;
}
);
2 changes: 0 additions & 2 deletions tensorboard/webapp/feature_flag/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export interface FeatureFlags {
// Adds affordance for users to select and reorder the columns in the Scalar
// Card Data Table
enableScalarColumnCustomization: boolean;
// Allows users to manipulate Scalar Card Table columns using context menus.
enableScalarColumnContextMenus: boolean;
// Adds a new section at the top of the time series metrics view
// containing suggested cards based on the users previous interactions.
enableSuggestedCards: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@
[columnHeaders]="columnHeaders"
[sortingInfo]="sortingInfo"
[columnCustomizationEnabled]="columnCustomizationEnabled"
[columnContextMenusEnabled]="columnContextMenusEnabled"
[smoothingEnabled]="smoothingEnabled"
[columnFilters]="columnFilters"
[runToHparamMap]="runToHparamMap"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ export class ScalarCardComponent<Downloader> {
@Input() useDarkMode!: boolean;
@Input() forceSvg!: boolean;
@Input() columnCustomizationEnabled!: boolean;
@Input() columnContextMenusEnabled!: boolean;
@Input() linkedTimeSelection: TimeSelectionView | undefined;
@Input() stepOrLinkedTimeSelection: TimeSelection | undefined;
@Input() minMaxStep!: MinMaxStep;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import {
} from '../../../hparams';
import {
getForceSvgFeatureFlag,
getIsScalarColumnContextMenusEnabled,
getIsScalarColumnCustomizationEnabled,
} from '../../../feature_flag/store/feature_flag_selectors';
import {
Expand Down Expand Up @@ -187,7 +186,6 @@ function areSeriesEqual(
[stepOrLinkedTimeSelection]="stepOrLinkedTimeSelection$ | async"
[forceSvg]="forceSvg$ | async"
[columnCustomizationEnabled]="columnCustomizationEnabled$ | async"
[columnContextMenusEnabled]="columnContextMenusEnabled$ | async"
[minMaxStep]="minMaxSteps$ | async"
[userViewBox]="userViewBox$ | async"
[columnHeaders]="columnHeaders$ | async"
Expand Down Expand Up @@ -273,9 +271,6 @@ export class ScalarCardContainer implements CardRenderer, OnInit, OnDestroy {
readonly columnCustomizationEnabled$ = this.store.select(
getIsScalarColumnCustomizationEnabled
);
readonly columnContextMenusEnabled$ = this.store.select(
getIsScalarColumnContextMenusEnabled
);
readonly xScaleType$ = this.store.select(getMetricsXAxisType).pipe(
map((xAxisType) => {
switch (xAxisType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
*ngIf="header.enabled && (header.type !== ColumnHeaderType.SMOOTHED || smoothingEnabled)"
[header]="header"
[sortingInfo]="sortingInfo"
[disableContextMenu]="!columnContextMenusEnabled"
></tb-data-table-header-cell> </ng-container
></ng-container>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export class ScalarCardDataTable {
@Input() columnHeaders!: ColumnHeader[];
@Input() sortingInfo!: SortingInfo;
@Input() columnCustomizationEnabled!: boolean;
@Input() columnContextMenusEnabled!: boolean;
@Input() smoothingEnabled!: boolean;
@Input() columnFilters!: Map<string, DiscreteFilter | IntervalFilter>;
@Input() selectableColumns!: ColumnHeader[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ import {HparamFilter} from '../../../hparams/_redux/types';
import * as hparamsSelectors from '../../../hparams/_redux/hparams_selectors';
import * as hparamsActions from '../../../hparams/_redux/hparams_actions';
import * as runsSelectors from '../../../runs/store/runs_selectors';
import {getIsScalarColumnContextMenusEnabled} from '../../../selectors';

@Component({
selector: 'line-chart',
Expand Down Expand Up @@ -394,10 +393,6 @@ describe('scalar card', () => {
selectors.getIsScalarColumnCustomizationEnabled,
false
);
store.overrideSelector(
selectors.getIsScalarColumnContextMenusEnabled,
false
);
store.overrideSelector(selectors.getMetricsStepSelectorEnabled, false);
store.overrideSelector(
selectors.getMetricsCardRangeSelectionEnabled('card1'),
Expand Down Expand Up @@ -4648,33 +4643,7 @@ describe('scalar card', () => {
expect(dataTableComponent).toBeFalsy();
}));

it('disables context menus if columnContextMenusEnabled is not set', fakeAsync(() => {
store.overrideSelector(getIsScalarColumnContextMenusEnabled, false);
store.overrideSelector(getCardStateMap, {
card1: {
dataMinMax: {
minStep: 0,
maxStep: 100,
},
},
});
store.overrideSelector(getMetricsCardTimeSelection, {
start: {step: 0},
end: {step: 100},
});
store.overrideSelector(selectors.getMetricsStepSelectorEnabled, true);
const fixture = createComponent('card1');
fixture.detectChanges();

const headerCellComponentInstance = fixture.debugElement.query(
By.directive(HeaderCellComponent)
).componentInstance;

expect(headerCellComponentInstance.disableContextMenu).toBeTrue();
}));

it('enables context menus if columnContextMenusEnabled is set', fakeAsync(() => {
store.overrideSelector(getIsScalarColumnContextMenusEnabled, true);
it('shows context menus', fakeAsync(() => {
store.overrideSelector(getCardStateMap, {
card1: {
dataMinMax: {
Expand Down

0 comments on commit dab3532

Please sign in to comment.