Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes enableScalarColumnContextMenus flag #6809

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preferred way to do this would have been to set defaultValue: true.

That way rolling it back is very slightly more straightforward - greater chance of avoiding merge conflicts and having a clean rollback commit.

And then delete the code, say, one or two weeks later?

But I leave that up to you to decide which way to go.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops sorry I see now that your request in the email was just to set the defaultValue.

I'll send another PR for the defaultValue update and we can just apply this PR later when everything looks good.

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
Loading