From dab35325fc7bd6bbae9ae16f093bad595b7d1467 Mon Sep 17 00:00:00 2001 From: Hoonji <736199+hoonji@users.noreply.github.com> Date: Tue, 26 Mar 2024 22:32:24 +0900 Subject: [PATCH] Removes enableScalarColumnContextMenus flag --- .../store/feature_flag_metadata.ts | 5 --- .../store/feature_flag_selectors.ts | 7 ---- tensorboard/webapp/feature_flag/types.ts | 2 -- .../scalar_card_component.ng.html | 1 - .../card_renderer/scalar_card_component.ts | 1 - .../card_renderer/scalar_card_container.ts | 5 --- .../scalar_card_data_table.ng.html | 1 - .../card_renderer/scalar_card_data_table.ts | 1 - .../views/card_renderer/scalar_card_test.ts | 33 +------------------ 9 files changed, 1 insertion(+), 55 deletions(-) diff --git a/tensorboard/webapp/feature_flag/store/feature_flag_metadata.ts b/tensorboard/webapp/feature_flag/store/feature_flag_metadata.ts index 01a13b30d1..c6185603da 100644 --- a/tensorboard/webapp/feature_flag/store/feature_flag_metadata.ts +++ b/tensorboard/webapp/feature_flag/store/feature_flag_metadata.ts @@ -110,11 +110,6 @@ export const FeatureFlagMetadataMap: FeatureFlagMetadataMapType = queryParamOverride: 'enableScalarColumnCustomization', parseValue: parseBoolean, }, - enableScalarColumnContextMenus: { - defaultValue: false, - queryParamOverride: 'enableScalarColumnContextMenus', - parseValue: parseBoolean, - }, enableSuggestedCards: { defaultValue: false, queryParamOverride: 'enableSuggestedCards', diff --git a/tensorboard/webapp/feature_flag/store/feature_flag_selectors.ts b/tensorboard/webapp/feature_flag/store/feature_flag_selectors.ts index c772d691ab..23b6726c59 100644 --- a/tensorboard/webapp/feature_flag/store/feature_flag_selectors.ts +++ b/tensorboard/webapp/feature_flag/store/feature_flag_selectors.ts @@ -146,10 +146,3 @@ export const getIsScalarColumnCustomizationEnabled = createSelector( return flags.enableScalarColumnCustomization; } ); - -export const getIsScalarColumnContextMenusEnabled = createSelector( - getFeatureFlags, - (flags: FeatureFlags): boolean => { - return flags.enableScalarColumnContextMenus; - } -); diff --git a/tensorboard/webapp/feature_flag/types.ts b/tensorboard/webapp/feature_flag/types.ts index 6304e2b988..4008554f32 100644 --- a/tensorboard/webapp/feature_flag/types.ts +++ b/tensorboard/webapp/feature_flag/types.ts @@ -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; diff --git a/tensorboard/webapp/metrics/views/card_renderer/scalar_card_component.ng.html b/tensorboard/webapp/metrics/views/card_renderer/scalar_card_component.ng.html index 79d4264b1e..31f822e36b 100644 --- a/tensorboard/webapp/metrics/views/card_renderer/scalar_card_component.ng.html +++ b/tensorboard/webapp/metrics/views/card_renderer/scalar_card_component.ng.html @@ -198,7 +198,6 @@ [columnHeaders]="columnHeaders" [sortingInfo]="sortingInfo" [columnCustomizationEnabled]="columnCustomizationEnabled" - [columnContextMenusEnabled]="columnContextMenusEnabled" [smoothingEnabled]="smoothingEnabled" [columnFilters]="columnFilters" [runToHparamMap]="runToHparamMap" diff --git a/tensorboard/webapp/metrics/views/card_renderer/scalar_card_component.ts b/tensorboard/webapp/metrics/views/card_renderer/scalar_card_component.ts index 989a76f616..098361e12b 100644 --- a/tensorboard/webapp/metrics/views/card_renderer/scalar_card_component.ts +++ b/tensorboard/webapp/metrics/views/card_renderer/scalar_card_component.ts @@ -105,7 +105,6 @@ export class ScalarCardComponent { @Input() useDarkMode!: boolean; @Input() forceSvg!: boolean; @Input() columnCustomizationEnabled!: boolean; - @Input() columnContextMenusEnabled!: boolean; @Input() linkedTimeSelection: TimeSelectionView | undefined; @Input() stepOrLinkedTimeSelection: TimeSelection | undefined; @Input() minMaxStep!: MinMaxStep; diff --git a/tensorboard/webapp/metrics/views/card_renderer/scalar_card_container.ts b/tensorboard/webapp/metrics/views/card_renderer/scalar_card_container.ts index 2a94e9fa31..9dab0ab27c 100644 --- a/tensorboard/webapp/metrics/views/card_renderer/scalar_card_container.ts +++ b/tensorboard/webapp/metrics/views/card_renderer/scalar_card_container.ts @@ -43,7 +43,6 @@ import { } from '../../../hparams'; import { getForceSvgFeatureFlag, - getIsScalarColumnContextMenusEnabled, getIsScalarColumnCustomizationEnabled, } from '../../../feature_flag/store/feature_flag_selectors'; import { @@ -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" @@ -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) { diff --git a/tensorboard/webapp/metrics/views/card_renderer/scalar_card_data_table.ng.html b/tensorboard/webapp/metrics/views/card_renderer/scalar_card_data_table.ng.html index 880ce02d9c..38cc246d02 100644 --- a/tensorboard/webapp/metrics/views/card_renderer/scalar_card_data_table.ng.html +++ b/tensorboard/webapp/metrics/views/card_renderer/scalar_card_data_table.ng.html @@ -35,7 +35,6 @@ *ngIf="header.enabled && (header.type !== ColumnHeaderType.SMOOTHED || smoothingEnabled)" [header]="header" [sortingInfo]="sortingInfo" - [disableContextMenu]="!columnContextMenusEnabled" > diff --git a/tensorboard/webapp/metrics/views/card_renderer/scalar_card_data_table.ts b/tensorboard/webapp/metrics/views/card_renderer/scalar_card_data_table.ts index f8d9b0a36b..f539e54f6b 100644 --- a/tensorboard/webapp/metrics/views/card_renderer/scalar_card_data_table.ts +++ b/tensorboard/webapp/metrics/views/card_renderer/scalar_card_data_table.ts @@ -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; @Input() selectableColumns!: ColumnHeader[]; diff --git a/tensorboard/webapp/metrics/views/card_renderer/scalar_card_test.ts b/tensorboard/webapp/metrics/views/card_renderer/scalar_card_test.ts index 3aa5062d41..e6c22e6640 100644 --- a/tensorboard/webapp/metrics/views/card_renderer/scalar_card_test.ts +++ b/tensorboard/webapp/metrics/views/card_renderer/scalar_card_test.ts @@ -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', @@ -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'), @@ -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: {