diff --git a/tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/timeline/BUILD b/tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/timeline/BUILD index 9123b0529ae..c998b03958b 100644 --- a/tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/timeline/BUILD +++ b/tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/timeline/BUILD @@ -20,8 +20,8 @@ tf_ng_module( "//tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/store", "//tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/store:types", "//tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/execution_data", - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", "//tensorboard/webapp/angular:expect_angular_legacy_material_slider", + "//tensorboard/webapp/angular:expect_angular_material_button", "@npm//@angular/common", "@npm//@angular/core", "@npm//@ngrx/store", diff --git a/tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/timeline/timeline_module.ts b/tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/timeline/timeline_module.ts index e69fa2625b5..097d7b018dd 100644 --- a/tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/timeline/timeline_module.ts +++ b/tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/timeline/timeline_module.ts @@ -15,7 +15,7 @@ limitations under the License. import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; -import {MatLegacyButtonModule} from '@angular/material/legacy-button'; +import {MatButtonModule} from '@angular/material/button'; import {MatLegacySliderModule} from '@angular/material/legacy-slider'; import {ExecutionDataModule} from '../execution_data/execution_data_module'; import {TimelineComponent} from './timeline_component'; @@ -26,7 +26,7 @@ import {TimelineContainer} from './timeline_container'; imports: [ CommonModule, ExecutionDataModule, - MatLegacyButtonModule, + MatButtonModule, MatLegacySliderModule, ], // TODO(cais): The following two providers are meant to make the mat-slider diff --git a/tensorboard/webapp/alert/views/BUILD b/tensorboard/webapp/alert/views/BUILD index b8ec01fa2f3..78e359b7917 100644 --- a/tensorboard/webapp/alert/views/BUILD +++ b/tensorboard/webapp/alert/views/BUILD @@ -26,8 +26,8 @@ tf_ng_module( "//tensorboard/webapp/alert:types", "//tensorboard/webapp/alert/store", "//tensorboard/webapp/alert/store:types", - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", - "//tensorboard/webapp/angular:expect_angular_legacy_material_snackbar", + "//tensorboard/webapp/angular:expect_angular_material_button", + "//tensorboard/webapp/angular:expect_angular_material_snackbar", "//tensorboard/webapp/util:string", "@npm//@angular/common", "@npm//@angular/core", @@ -49,8 +49,8 @@ tf_ts_library( "//tensorboard/webapp/alert/store:testing", "//tensorboard/webapp/angular:expect_angular_cdk_overlay", "//tensorboard/webapp/angular:expect_angular_core_testing", - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", - "//tensorboard/webapp/angular:expect_angular_legacy_material_snackbar", + "//tensorboard/webapp/angular:expect_angular_material_button", + "//tensorboard/webapp/angular:expect_angular_material_snackbar", "//tensorboard/webapp/angular:expect_angular_platform_browser_animations", "//tensorboard/webapp/angular:expect_ngrx_store_testing", "@npm//@angular/core", diff --git a/tensorboard/webapp/alert/views/alert_display_snackbar_container.scss b/tensorboard/webapp/alert/views/alert_display_snackbar_container.scss index 4aed87692e5..af111929ce8 100644 --- a/tensorboard/webapp/alert/views/alert_display_snackbar_container.scss +++ b/tensorboard/webapp/alert/views/alert_display_snackbar_container.scss @@ -33,6 +33,7 @@ limitations under the License. margin-left: auto; } -button { +button.mat-mdc-button { + color: inherit; text-transform: uppercase; } diff --git a/tensorboard/webapp/alert/views/alert_display_snackbar_container.ts b/tensorboard/webapp/alert/views/alert_display_snackbar_container.ts index 139e064b788..ee209639316 100644 --- a/tensorboard/webapp/alert/views/alert_display_snackbar_container.ts +++ b/tensorboard/webapp/alert/views/alert_display_snackbar_container.ts @@ -13,10 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; -import { - MatLegacySnackBarRef, - MAT_LEGACY_SNACK_BAR_DATA, -} from '@angular/material/legacy-snack-bar'; +import {MatSnackBarRef, MAT_SNACK_BAR_DATA} from '@angular/material/snack-bar'; import {Store} from '@ngrx/store'; import {State} from '../../app_state'; import {splitByURL} from '../../util/string'; @@ -33,8 +30,8 @@ export class AlertDisplaySnackbarContainer { readonly splitByURL = splitByURL; constructor( - private readonly snackBarRef: MatLegacySnackBarRef, - @Inject(MAT_LEGACY_SNACK_BAR_DATA) readonly unknownData: unknown, + private readonly snackBarRef: MatSnackBarRef, + @Inject(MAT_SNACK_BAR_DATA) readonly unknownData: unknown, private readonly store: Store ) { this.alert = unknownData as AlertInfo; diff --git a/tensorboard/webapp/alert/views/alert_snackbar_container.ts b/tensorboard/webapp/alert/views/alert_snackbar_container.ts index 9b001c6f581..ebd8273586b 100644 --- a/tensorboard/webapp/alert/views/alert_snackbar_container.ts +++ b/tensorboard/webapp/alert/views/alert_snackbar_container.ts @@ -18,7 +18,7 @@ import { OnDestroy, OnInit, } from '@angular/core'; -import {MatLegacySnackBar} from '@angular/material/legacy-snack-bar'; +import {MatSnackBar} from '@angular/material/snack-bar'; import {Store} from '@ngrx/store'; import {Subject} from 'rxjs'; import {filter, takeUntil} from 'rxjs/operators'; @@ -40,7 +40,7 @@ export class AlertSnackbarContainer implements OnInit, OnDestroy { constructor( private readonly store: Store, - private readonly snackBar: MatLegacySnackBar + private readonly snackBar: MatSnackBar ) {} ngOnInit() { diff --git a/tensorboard/webapp/alert/views/alert_snackbar_module.ts b/tensorboard/webapp/alert/views/alert_snackbar_module.ts index ed88bdbf89b..5aa90179fb6 100644 --- a/tensorboard/webapp/alert/views/alert_snackbar_module.ts +++ b/tensorboard/webapp/alert/views/alert_snackbar_module.ts @@ -14,8 +14,8 @@ limitations under the License. ==============================================================================*/ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; -import {MatLegacyButtonModule} from '@angular/material/legacy-button'; -import {MatLegacySnackBarModule} from '@angular/material/legacy-snack-bar'; +import {MatButtonModule} from '@angular/material/button'; +import {MatSnackBarModule} from '@angular/material/snack-bar'; import {AlertDisplaySnackbarContainer} from './alert_display_snackbar_container'; import {AlertSnackbarContainer} from './alert_snackbar_container'; @@ -25,7 +25,7 @@ import {AlertSnackbarContainer} from './alert_snackbar_container'; @NgModule({ declarations: [AlertSnackbarContainer, AlertDisplaySnackbarContainer], exports: [AlertSnackbarContainer], - imports: [CommonModule, MatLegacyButtonModule, MatLegacySnackBarModule], + imports: [CommonModule, MatButtonModule, MatSnackBarModule], entryComponents: [ // Required for non-Ivy Angular apps. AlertDisplaySnackbarContainer, diff --git a/tensorboard/webapp/alert/views/alert_snackbar_test.ts b/tensorboard/webapp/alert/views/alert_snackbar_test.ts index 3d6d46de01d..2870ac2f3a0 100644 --- a/tensorboard/webapp/alert/views/alert_snackbar_test.ts +++ b/tensorboard/webapp/alert/views/alert_snackbar_test.ts @@ -14,11 +14,8 @@ limitations under the License. ==============================================================================*/ import {OverlayContainer} from '@angular/cdk/overlay'; import {TestBed} from '@angular/core/testing'; -import {MatLegacyButtonModule} from '@angular/material/legacy-button'; -import { - MatLegacySnackBar, - MatLegacySnackBarModule, -} from '@angular/material/legacy-snack-bar'; +import {MatButtonModule} from '@angular/material/button'; +import {MatSnackBar, MatSnackBarModule} from '@angular/material/snack-bar'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {Action, createAction, props, Store} from '@ngrx/store'; import {MockStore, provideMockStore} from '@ngrx/store/testing'; @@ -45,15 +42,11 @@ describe('alert snackbar', () => { let snackBarOpenSpy: jasmine.Spy; let recordedActions: Action[] = []; let overlayContainer: OverlayContainer; - let snackbar: MatLegacySnackBar; + let snackbar: MatSnackBar; beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ - NoopAnimationsModule, - MatLegacyButtonModule, - MatLegacySnackBarModule, - ], + imports: [NoopAnimationsModule, MatButtonModule, MatSnackBarModule], providers: [ provideMockStore({ initialState: buildStateFromAlertState(buildAlertState({})), @@ -67,7 +60,7 @@ describe('alert snackbar', () => { recordedActions.push(action); }); overlayContainer = TestBed.inject(OverlayContainer); - snackbar = TestBed.inject(MatLegacySnackBar); + snackbar = TestBed.inject(MatSnackBar); snackBarOpenSpy = spyOn(snackbar, 'openFromComponent').and.callThrough(); }); diff --git a/tensorboard/webapp/angular/BUILD b/tensorboard/webapp/angular/BUILD index a769eb7382b..5c710b161a7 100644 --- a/tensorboard/webapp/angular/BUILD +++ b/tensorboard/webapp/angular/BUILD @@ -71,7 +71,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/autocomplete dependency. tf_ts_library( - name = "expect_angular_legacy_material_autocomplete", + name = "expect_angular_material_autocomplete", srcs = [], deps = [ "@npm//@angular/material", @@ -87,15 +87,6 @@ tf_ts_library( ], ) -# This is a dummy rule used as a @angular/material/legacy_checkbox dependency. -tf_ts_library( - name = "expect_angular_legacy_material_checkbox", - srcs = [], - deps = [ - "@npm//@angular/material", - ], -) - # This is a dummy rule used as a @angular/material/checkbox/testing dependency. tf_ts_library( name = "expect_angular_material_checkbox_testing", @@ -107,7 +98,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/button dependency. tf_ts_library( - name = "expect_angular_legacy_material_button", + name = "expect_angular_material_button", srcs = [], deps = [ "@npm//@angular/material", @@ -125,7 +116,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/chips dependency. tf_ts_library( - name = "expect_angular_legacy_material_chips", + name = "expect_angular_material_chips", srcs = [], deps = [ "@npm//@angular/material", @@ -134,7 +125,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/dialog dependency. tf_ts_library( - name = "expect_angular_legacy_material_dialog", + name = "expect_angular_material_dialog", srcs = [], deps = [ "@npm//@angular/material", @@ -143,7 +134,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/dialog/testing dependency. tf_ts_library( - name = "expect_angular_legacy_material_dialog_testing", + name = "expect_angular_material_dialog_testing", srcs = [], deps = [ "@npm//@angular/material", @@ -152,7 +143,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/expansion dependency. tf_ts_library( - name = "expect_angular_legacy_material_expansion", + name = "expect_angular_material_expansion", srcs = [], deps = [ "@npm//@angular/material", @@ -161,7 +152,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/expansion dependency. tf_ts_library( - name = "expect_angular_legacy_material_form_field", + name = "expect_angular_material_form_field", srcs = [], deps = [ "@npm//@angular/material", @@ -188,7 +179,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/input dependency. tf_ts_library( - name = "expect_angular_legacy_material_input", + name = "expect_angular_material_input", srcs = [], deps = [ "@npm//@angular/material", @@ -197,7 +188,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/menu dependency. tf_ts_library( - name = "expect_angular_legacy_material_menu", + name = "expect_angular_material_menu", srcs = [], deps = [ "@npm//@angular/material", @@ -206,7 +197,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/menu/testing dependency. tf_ts_library( - name = "expect_angular_legacy_material_menu_testing", + name = "expect_angular_material_menu_testing", srcs = [], deps = [ "@npm//@angular/material", @@ -215,7 +206,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/paginator dependency. tf_ts_library( - name = "expect_angular_legacy_material_paginator", + name = "expect_angular_material_paginator", srcs = [], deps = [ "@npm//@angular/material", @@ -224,7 +215,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/progress_spinner dependency. tf_ts_library( - name = "expect_angular_legacy_material_progress_spinner", + name = "expect_angular_material_progress_spinner", srcs = [], deps = [ "@npm//@angular/material", @@ -233,7 +224,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/select dependency. tf_ts_library( - name = "expect_angular_legacy_material_select", + name = "expect_angular_material_select", srcs = [], deps = [ "@npm//@angular/material", @@ -242,7 +233,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/select/testing dependency. tf_ts_library( - name = "expect_angular_legacy_material_select_testing", + name = "expect_angular_material_select_testing", srcs = [], deps = [ "@npm//@angular/material", @@ -251,7 +242,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/slide_toggle dependency. tf_ts_library( - name = "expect_angular_legacy_material_slide_toggle", + name = "expect_angular_material_slide_toggle", srcs = [], deps = [ "@npm//@angular/material", @@ -269,7 +260,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/snackbar dependency. tf_ts_library( - name = "expect_angular_legacy_material_snackbar", + name = "expect_angular_material_snackbar", srcs = [], deps = [ "@npm//@angular/material", @@ -287,7 +278,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/table dependency. tf_ts_library( - name = "expect_angular_legacy_material_table", + name = "expect_angular_material_table", srcs = [], deps = [ "@npm//@angular/material", @@ -296,7 +287,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/tabs dependency. tf_ts_library( - name = "expect_angular_legacy_material_tabs", + name = "expect_angular_material_tabs", srcs = [], deps = [ "@npm//@angular/material", @@ -314,7 +305,7 @@ tf_ts_library( # This is a dummy rule used as a @angular/material/tooltip dependency. tf_ts_library( - name = "expect_angular_legacy_material_tooltip", + name = "expect_angular_material_tooltip", srcs = [], deps = [ "@npm//@angular/material", diff --git a/tensorboard/webapp/core/views/BUILD b/tensorboard/webapp/core/views/BUILD index 5230e45c8a7..511c16191bb 100644 --- a/tensorboard/webapp/core/views/BUILD +++ b/tensorboard/webapp/core/views/BUILD @@ -17,7 +17,7 @@ tf_ng_module( ], assets = [":layout_styles"], deps = [ - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", + "//tensorboard/webapp/angular:expect_angular_material_button", "//tensorboard/webapp/angular:expect_angular_material_icon", "//tensorboard/webapp/core:state", "//tensorboard/webapp/core:types", diff --git a/tensorboard/webapp/core/views/layout_module.ts b/tensorboard/webapp/core/views/layout_module.ts index 51ed3634a75..5a6fc1d7f44 100644 --- a/tensorboard/webapp/core/views/layout_module.ts +++ b/tensorboard/webapp/core/views/layout_module.ts @@ -14,7 +14,7 @@ limitations under the License. ==============================================================================*/ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; -import {MatLegacyButtonModule} from '@angular/material/legacy-button'; +import {MatButtonModule} from '@angular/material/button'; import {MatIconModule} from '@angular/material/icon'; import {LayoutContainer} from './layout_container'; @@ -24,6 +24,6 @@ import {LayoutContainer} from './layout_container'; @NgModule({ declarations: [LayoutContainer], exports: [LayoutContainer], - imports: [CommonModule, MatIconModule, MatLegacyButtonModule], + imports: [CommonModule, MatIconModule, MatButtonModule], }) export class LayoutModule {} diff --git a/tensorboard/webapp/feature_flag/views/BUILD b/tensorboard/webapp/feature_flag/views/BUILD index ea089c2fb18..d2c9a10f86a 100644 --- a/tensorboard/webapp/feature_flag/views/BUILD +++ b/tensorboard/webapp/feature_flag/views/BUILD @@ -24,7 +24,7 @@ tf_ng_module( ":feature_flag_dialog", "//tensorboard/webapp:app_state", "//tensorboard/webapp/angular:expect_angular_cdk_overlay", - "//tensorboard/webapp/angular:expect_angular_legacy_material_dialog", + "//tensorboard/webapp/angular:expect_angular_material_dialog", "//tensorboard/webapp/feature_flag/actions", "//tensorboard/webapp/feature_flag/store", "@npm//@angular/common", @@ -48,8 +48,8 @@ tf_ng_module( ], deps = [ "//tensorboard/webapp:app_state", - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", - "//tensorboard/webapp/angular:expect_angular_legacy_material_select", + "//tensorboard/webapp/angular:expect_angular_material_button", + "//tensorboard/webapp/angular:expect_angular_material_select", "//tensorboard/webapp/feature_flag:types", "//tensorboard/webapp/feature_flag/actions", "//tensorboard/webapp/feature_flag/store", @@ -76,8 +76,8 @@ tf_ng_module( "//tensorboard/webapp/angular:expect_angular_cdk_testing", "//tensorboard/webapp/angular:expect_angular_cdk_testing_testbed", "//tensorboard/webapp/angular:expect_angular_core_testing", - "//tensorboard/webapp/angular:expect_angular_legacy_material_dialog", - "//tensorboard/webapp/angular:expect_angular_legacy_material_dialog_testing", + "//tensorboard/webapp/angular:expect_angular_material_dialog", + "//tensorboard/webapp/angular:expect_angular_material_dialog_testing", "//tensorboard/webapp/angular:expect_angular_platform_browser_animations", "//tensorboard/webapp/angular:expect_ngrx_store_testing", "//tensorboard/webapp/feature_flag:types", diff --git a/tensorboard/webapp/feature_flag/views/feature_flag_dialog_module.ts b/tensorboard/webapp/feature_flag/views/feature_flag_dialog_module.ts index a415b320aae..1e384175335 100644 --- a/tensorboard/webapp/feature_flag/views/feature_flag_dialog_module.ts +++ b/tensorboard/webapp/feature_flag/views/feature_flag_dialog_module.ts @@ -14,8 +14,8 @@ limitations under the License. ==============================================================================*/ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; -import {MatLegacyButtonModule} from '@angular/material/legacy-button'; -import {MatLegacySelectModule} from '@angular/material/legacy-select'; +import {MatButtonModule} from '@angular/material/button'; +import {MatSelectModule} from '@angular/material/select'; import {FeatureFlagDialogComponent} from './feature_flag_dialog_component'; import {FeatureFlagDialogContainer} from './feature_flag_dialog_container'; @@ -24,7 +24,7 @@ import {FeatureFlagDialogContainer} from './feature_flag_dialog_container'; */ @NgModule({ declarations: [FeatureFlagDialogComponent, FeatureFlagDialogContainer], - imports: [CommonModule, MatLegacyButtonModule, MatLegacySelectModule], + imports: [CommonModule, MatButtonModule, MatSelectModule], exports: [FeatureFlagDialogContainer], entryComponents: [FeatureFlagDialogContainer], }) diff --git a/tensorboard/webapp/feature_flag/views/feature_flag_modal_trigger_container.ts b/tensorboard/webapp/feature_flag/views/feature_flag_modal_trigger_container.ts index a18f823f776..fba1f843ad6 100644 --- a/tensorboard/webapp/feature_flag/views/feature_flag_modal_trigger_container.ts +++ b/tensorboard/webapp/feature_flag/views/feature_flag_modal_trigger_container.ts @@ -14,10 +14,7 @@ limitations under the License. ==============================================================================*/ import {ComponentType} from '@angular/cdk/overlay'; import {Component, OnDestroy, OnInit} from '@angular/core'; -import { - MatLegacyDialog, - MatLegacyDialogRef, -} from '@angular/material/legacy-dialog'; +import {MatDialog, MatDialogRef} from '@angular/material/dialog'; import {Store} from '@ngrx/store'; import {Subject} from 'rxjs'; import {takeUntil} from 'rxjs/operators'; @@ -42,12 +39,12 @@ export class FeatureFlagModalTriggerContainer implements OnInit, OnDestroy { featureFlagDialogType: ComponentType = FeatureFlagDialogContainer; readonly showFeatureFlags$ = this.store.select(getShowFlagsEnabled); - private featureFlagsDialog?: MatLegacyDialogRef; + private featureFlagsDialog?: MatDialogRef; private ngUnsubscribe = new Subject(); constructor( private readonly store: Store, - private dialog: MatLegacyDialog + private dialog: MatDialog ) {} ngOnInit() { diff --git a/tensorboard/webapp/feature_flag/views/feature_flag_modal_trigger_container_test.ts b/tensorboard/webapp/feature_flag/views/feature_flag_modal_trigger_container_test.ts index 14368165658..5bb82fde767 100644 --- a/tensorboard/webapp/feature_flag/views/feature_flag_modal_trigger_container_test.ts +++ b/tensorboard/webapp/feature_flag/views/feature_flag_modal_trigger_container_test.ts @@ -16,8 +16,8 @@ import {HarnessLoader} from '@angular/cdk/testing'; import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed'; import {Component} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {MatLegacyDialogModule} from '@angular/material/legacy-dialog'; -import {MatLegacyDialogHarness} from '@angular/material/legacy-dialog/testing'; +import {MatDialogModule} from '@angular/material/dialog'; +import {MatDialogHarness} from '@angular/material/dialog/testing'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {Store} from '@ngrx/store'; import {MockStore} from '@ngrx/store/testing'; @@ -47,7 +47,7 @@ describe('feature_flag_modal_trigger_container', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [MatLegacyDialogModule, NoopAnimationsModule], + imports: [MatDialogModule, NoopAnimationsModule], providers: [provideMockTbStore()], }).compileComponents(); @@ -78,7 +78,7 @@ describe('feature_flag_modal_trigger_container', () => { store.overrideSelector(getOverriddenFeatureFlags, {}); store.overrideSelector(getShowFlagsEnabled, true); createComponent(); - const dialog = await rootLoader.getHarness(MatLegacyDialogHarness); + const dialog = await rootLoader.getHarness(MatDialogHarness); expect( (fixture.componentInstance as any).featureFlagsDialog ).not.toBeUndefined(); diff --git a/tensorboard/webapp/header/BUILD b/tensorboard/webapp/header/BUILD index 535a4b0fa89..5502ba956bf 100644 --- a/tensorboard/webapp/header/BUILD +++ b/tensorboard/webapp/header/BUILD @@ -37,11 +37,11 @@ tf_ng_module( ], deps = [ "//tensorboard/webapp:selectors", - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", - "//tensorboard/webapp/angular:expect_angular_legacy_material_menu", - "//tensorboard/webapp/angular:expect_angular_legacy_material_select", - "//tensorboard/webapp/angular:expect_angular_legacy_material_tabs", + "//tensorboard/webapp/angular:expect_angular_material_button", "//tensorboard/webapp/angular:expect_angular_material_icon", + "//tensorboard/webapp/angular:expect_angular_material_menu", + "//tensorboard/webapp/angular:expect_angular_material_select", + "//tensorboard/webapp/angular:expect_angular_material_tabs", "//tensorboard/webapp/angular:expect_angular_material_toolbar", "//tensorboard/webapp/core", "//tensorboard/webapp/core/actions", @@ -70,10 +70,10 @@ tf_ts_library( "//tensorboard/webapp:selectors", "//tensorboard/webapp/angular:expect_angular_cdk_overlay", "//tensorboard/webapp/angular:expect_angular_core_testing", - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", - "//tensorboard/webapp/angular:expect_angular_legacy_material_menu", - "//tensorboard/webapp/angular:expect_angular_legacy_material_select", - "//tensorboard/webapp/angular:expect_angular_legacy_material_tabs", + "//tensorboard/webapp/angular:expect_angular_material_button", + "//tensorboard/webapp/angular:expect_angular_material_menu", + "//tensorboard/webapp/angular:expect_angular_material_select", + "//tensorboard/webapp/angular:expect_angular_material_tabs", "//tensorboard/webapp/angular:expect_angular_material_toolbar", "//tensorboard/webapp/angular:expect_angular_platform_browser_animations", "//tensorboard/webapp/angular:expect_ngrx_store_testing", diff --git a/tensorboard/webapp/header/dark_mode_toggle_test.ts b/tensorboard/webapp/header/dark_mode_toggle_test.ts index e5cbfaa08ab..6cedfad7249 100644 --- a/tensorboard/webapp/header/dark_mode_toggle_test.ts +++ b/tensorboard/webapp/header/dark_mode_toggle_test.ts @@ -15,8 +15,8 @@ limitations under the License. import {OverlayContainer} from '@angular/cdk/overlay'; import {NO_ERRORS_SCHEMA} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {MatLegacyButtonModule} from '@angular/material/legacy-button'; -import {MatLegacyMenuModule} from '@angular/material/legacy-menu'; +import {MatButtonModule} from '@angular/material/button'; +import {MatMenuModule} from '@angular/material/menu'; import {By} from '@angular/platform-browser'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {Action, Store} from '@ngrx/store'; @@ -37,9 +37,9 @@ describe('dark mode toggle test', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [ - MatLegacyButtonModule, + MatButtonModule, MatIconTestingModule, - MatLegacyMenuModule, + MatMenuModule, NoopAnimationsModule, ], providers: [provideMockTbStore()], diff --git a/tensorboard/webapp/header/header_module.ts b/tensorboard/webapp/header/header_module.ts index b0872db4b5c..9adc6ce0034 100644 --- a/tensorboard/webapp/header/header_module.ts +++ b/tensorboard/webapp/header/header_module.ts @@ -15,11 +15,11 @@ limitations under the License. // Uses `async` pipe. import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; -import {MatLegacyButtonModule} from '@angular/material/legacy-button'; +import {MatButtonModule} from '@angular/material/button'; import {MatIconModule} from '@angular/material/icon'; -import {MatLegacyMenuModule} from '@angular/material/legacy-menu'; -import {MatLegacySelectModule} from '@angular/material/legacy-select'; -import {MatLegacyTabsModule} from '@angular/material/legacy-tabs'; +import {MatMenuModule} from '@angular/material/menu'; +import {MatSelectModule} from '@angular/material/select'; +import {MatTabsModule} from '@angular/material/tabs'; import {MatToolbarModule} from '@angular/material/toolbar'; import {CoreModule} from '../core/core_module'; import {SettingsModule} from '../settings/settings_module'; @@ -47,12 +47,12 @@ import {ReloadContainer} from './reload_container'; ], providers: [], imports: [ - MatLegacyButtonModule, + MatButtonModule, MatIconModule, - MatLegacyTabsModule, + MatTabsModule, MatToolbarModule, - MatLegacySelectModule, - MatLegacyMenuModule, + MatSelectModule, + MatMenuModule, CommonModule, CoreModule, SettingsModule, diff --git a/tensorboard/webapp/header/header_test.ts b/tensorboard/webapp/header/header_test.ts index 081651fbf56..dbebbfe29bc 100644 --- a/tensorboard/webapp/header/header_test.ts +++ b/tensorboard/webapp/header/header_test.ts @@ -14,9 +14,9 @@ limitations under the License. ==============================================================================*/ import {DebugElement, NO_ERRORS_SCHEMA} from '@angular/core'; import {TestBed} from '@angular/core/testing'; -import {MatLegacyButtonModule} from '@angular/material/legacy-button'; -import {MatLegacySelectModule} from '@angular/material/legacy-select'; -import {MatLegacyTabsModule} from '@angular/material/legacy-tabs'; +import {MatButtonModule} from '@angular/material/button'; +import {MatSelectModule} from '@angular/material/select'; +import {MatTabsModule} from '@angular/material/tabs'; import {MatToolbarModule} from '@angular/material/toolbar'; import {By} from '@angular/platform-browser'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; @@ -50,10 +50,10 @@ describe('header test', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [ - MatLegacyButtonModule, + MatButtonModule, MatIconTestingModule, - MatLegacySelectModule, - MatLegacyTabsModule, + MatSelectModule, + MatTabsModule, MatToolbarModule, NoopAnimationsModule, ], @@ -105,7 +105,7 @@ describe('header test', () => { const fixture = TestBed.createComponent(HeaderComponent); fixture.detectChanges(); - const els = fixture.debugElement.queryAll(By.css('.mat-tab-label')); + const els = fixture.debugElement.queryAll(By.css('.mat-mdc-tab')); expect(els.length).toBe(2); assertDebugElementText(els[0], 'FOO FIGHTER'); @@ -125,7 +125,7 @@ describe('header test', () => { fixture.detectChanges(); await fixture.whenStable(); - const els = fixture.debugElement.queryAll(By.css('.mat-tab-label')); + const els = fixture.debugElement.queryAll(By.css('.mat-mdc-tab')); expect(els.length).toBe(3); assertDebugElementText(els[0], 'MEOW'); assertDebugElementText(els[1], 'WOOF'); diff --git a/tensorboard/webapp/header/plugin_selector_component.ng.html b/tensorboard/webapp/header/plugin_selector_component.ng.html index 3e2c3ac54d4..8f61443f1a9 100644 --- a/tensorboard/webapp/header/plugin_selector_component.ng.html +++ b/tensorboard/webapp/header/plugin_selector_component.ng.html @@ -15,6 +15,7 @@ limitations under the License. --> - + Inactive { :first-child, - .mat-tab-label-container, + .mat-mdc-tab-label-container, :last-child { // [1]: Reason for customizing the mat-tab-header. // @@ -150,16 +162,16 @@ mat-option { } :first-child, - .mat-tab-label-container { + .mat-mdc-tab-label-container { left: 0; } :last-child, - .mat-tab-label-container { + .mat-mdc-tab-label-container { right: 0; } - .mat-tab-header-pagination { + .mat-mdc-tab-header-pagination { @include tb-theme-background-prop(background-color, app-bar); } } diff --git a/tensorboard/webapp/header/plugin_selector_component.ts b/tensorboard/webapp/header/plugin_selector_component.ts index fd01fe3ef59..c486424bac9 100644 --- a/tensorboard/webapp/header/plugin_selector_component.ts +++ b/tensorboard/webapp/header/plugin_selector_component.ts @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ import {Component, EventEmitter, Input, Output} from '@angular/core'; -import {MatLegacySelectChange} from '@angular/material/legacy-select'; +import {MatSelectChange} from '@angular/material/select'; import {PluginId} from '../types/api'; import {UiPluginMetadata} from './types'; @@ -44,7 +44,7 @@ export class PluginSelectorComponent { this.onPluginSelectionChanged.emit(pluginId); } - onDisabledPluginSelectionChanged(selectChangeEvent: MatLegacySelectChange) { + onDisabledPluginSelectionChanged(selectChangeEvent: MatSelectChange) { this.onPluginSelectionChanged.emit(selectChangeEvent.value); } } diff --git a/tensorboard/webapp/metrics/views/card_renderer/BUILD b/tensorboard/webapp/metrics/views/card_renderer/BUILD index 5d6cad6ff65..7076578ebcd 100644 --- a/tensorboard/webapp/metrics/views/card_renderer/BUILD +++ b/tensorboard/webapp/metrics/views/card_renderer/BUILD @@ -61,10 +61,10 @@ tf_ng_module( deps = [ "//tensorboard/webapp:app_state", "//tensorboard/webapp:selectors", - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", - "//tensorboard/webapp/angular:expect_angular_legacy_material_dialog", - "//tensorboard/webapp/angular:expect_angular_legacy_material_input", - "//tensorboard/webapp/angular:expect_angular_legacy_material_select", + "//tensorboard/webapp/angular:expect_angular_material_button", + "//tensorboard/webapp/angular:expect_angular_material_dialog", + "//tensorboard/webapp/angular:expect_angular_material_input", + "//tensorboard/webapp/angular:expect_angular_material_select", "//tensorboard/webapp/feature_flag/directives", "//tensorboard/webapp/metrics:types", "//tensorboard/webapp/metrics/data_source", @@ -106,9 +106,9 @@ tf_ng_module( ":vis_linked_time_selection_warning", "//tensorboard/webapp:app_state", "//tensorboard/webapp:selectors", - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", - "//tensorboard/webapp/angular:expect_angular_legacy_material_progress_spinner", + "//tensorboard/webapp/angular:expect_angular_material_button", "//tensorboard/webapp/angular:expect_angular_material_icon", + "//tensorboard/webapp/angular:expect_angular_material_progress_spinner", "//tensorboard/webapp/metrics:types", "//tensorboard/webapp/metrics/actions", "//tensorboard/webapp/metrics/data_source", @@ -155,10 +155,10 @@ tf_ng_module( ":utils", ":vis_linked_time_selection_warning", "//tensorboard/webapp:app_state", - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", - "//tensorboard/webapp/angular:expect_angular_legacy_material_progress_spinner", "//tensorboard/webapp/angular:expect_angular_legacy_material_slider", + "//tensorboard/webapp/angular:expect_angular_material_button", "//tensorboard/webapp/angular:expect_angular_material_icon", + "//tensorboard/webapp/angular:expect_angular_material_progress_spinner", "//tensorboard/webapp/feature_flag/directives", "//tensorboard/webapp/metrics:types", "//tensorboard/webapp/metrics/actions", @@ -332,11 +332,11 @@ tf_ng_module( "//tensorboard/webapp:app_state", "//tensorboard/webapp:selectors", "//tensorboard/webapp/angular:expect_angular_cdk_overlay", - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", - "//tensorboard/webapp/angular:expect_angular_legacy_material_dialog", - "//tensorboard/webapp/angular:expect_angular_legacy_material_menu", - "//tensorboard/webapp/angular:expect_angular_legacy_material_progress_spinner", + "//tensorboard/webapp/angular:expect_angular_material_button", + "//tensorboard/webapp/angular:expect_angular_material_dialog", "//tensorboard/webapp/angular:expect_angular_material_icon", + "//tensorboard/webapp/angular:expect_angular_material_menu", + "//tensorboard/webapp/angular:expect_angular_material_progress_spinner", "//tensorboard/webapp/experiments:types", "//tensorboard/webapp/feature_flag/store", "//tensorboard/webapp/metrics:types", @@ -449,13 +449,13 @@ tf_ts_library( "//tensorboard/webapp:selectors", "//tensorboard/webapp/angular:expect_angular_cdk_overlay", "//tensorboard/webapp/angular:expect_angular_core_testing", - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", - "//tensorboard/webapp/angular:expect_angular_legacy_material_dialog", - "//tensorboard/webapp/angular:expect_angular_legacy_material_input", - "//tensorboard/webapp/angular:expect_angular_legacy_material_menu", - "//tensorboard/webapp/angular:expect_angular_legacy_material_progress_spinner", - "//tensorboard/webapp/angular:expect_angular_legacy_material_select", "//tensorboard/webapp/angular:expect_angular_legacy_material_slider", + "//tensorboard/webapp/angular:expect_angular_material_button", + "//tensorboard/webapp/angular:expect_angular_material_dialog", + "//tensorboard/webapp/angular:expect_angular_material_input", + "//tensorboard/webapp/angular:expect_angular_material_menu", + "//tensorboard/webapp/angular:expect_angular_material_progress_spinner", + "//tensorboard/webapp/angular:expect_angular_material_select", "//tensorboard/webapp/angular:expect_angular_platform_browser_animations", "//tensorboard/webapp/angular:expect_ngrx_store_testing", "//tensorboard/webapp/experiments:types", diff --git a/tensorboard/webapp/metrics/views/card_renderer/data_download_dialog_container.ts b/tensorboard/webapp/metrics/views/card_renderer/data_download_dialog_container.ts index a9a13adebe6..b20f3e4f269 100644 --- a/tensorboard/webapp/metrics/views/card_renderer/data_download_dialog_container.ts +++ b/tensorboard/webapp/metrics/views/card_renderer/data_download_dialog_container.ts @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ import {ChangeDetectionStrategy, Component, Inject} from '@angular/core'; -import {MAT_LEGACY_DIALOG_DATA} from '@angular/material/legacy-dialog'; +import {MAT_DIALOG_DATA} from '@angular/material/dialog'; import {Store} from '@ngrx/store'; import {BehaviorSubject, combineLatest, Observable} from 'rxjs'; import {filter, map, startWith} from 'rxjs/operators'; @@ -54,7 +54,7 @@ export class DataDownloadDialogContainer { constructor( store: Store, dataSource: MetricsDataSource, - @Inject(MAT_LEGACY_DIALOG_DATA) data: DataDownloadDialogData + @Inject(MAT_DIALOG_DATA) data: DataDownloadDialogData ) { this.cardMetadata$ = store .select(getCardMetadata, data.cardId) diff --git a/tensorboard/webapp/metrics/views/card_renderer/data_download_dialog_test.ts b/tensorboard/webapp/metrics/views/card_renderer/data_download_dialog_test.ts index 2a45ff3cb19..0a74d72f36c 100644 --- a/tensorboard/webapp/metrics/views/card_renderer/data_download_dialog_test.ts +++ b/tensorboard/webapp/metrics/views/card_renderer/data_download_dialog_test.ts @@ -15,7 +15,7 @@ limitations under the License. import {NO_ERRORS_SCHEMA} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {FormsModule} from '@angular/forms'; -import {MAT_LEGACY_DIALOG_DATA} from '@angular/material/legacy-dialog'; +import {MAT_DIALOG_DATA} from '@angular/material/dialog'; import {By} from '@angular/platform-browser'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {Store} from '@ngrx/store'; @@ -55,7 +55,7 @@ describe('metrics/views/data_download_dialog', () => { declarations: [DataDownloadDialogContainer, DataDownloadDialogComponent], providers: [ provideMockStore({}), - {provide: MAT_LEGACY_DIALOG_DATA, useValue: dialogData}, + {provide: MAT_DIALOG_DATA, useValue: dialogData}, {provide: MetricsDataSource, useClass: TestingMetricsDataSource}, ], schemas: [NO_ERRORS_SCHEMA], diff --git a/tensorboard/webapp/metrics/views/card_renderer/data_download_module.ts b/tensorboard/webapp/metrics/views/card_renderer/data_download_module.ts index eb668a670e1..64396605725 100644 --- a/tensorboard/webapp/metrics/views/card_renderer/data_download_module.ts +++ b/tensorboard/webapp/metrics/views/card_renderer/data_download_module.ts @@ -15,10 +15,10 @@ limitations under the License. import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; -import {MatLegacyButtonModule} from '@angular/material/legacy-button'; -import {MatLegacyDialogModule} from '@angular/material/legacy-dialog'; -import {MatLegacyInputModule} from '@angular/material/legacy-input'; -import {MatLegacySelectModule} from '@angular/material/legacy-select'; +import {MatButtonModule} from '@angular/material/button'; +import {MatDialogModule} from '@angular/material/dialog'; +import {MatInputModule} from '@angular/material/input'; +import {MatSelectModule} from '@angular/material/select'; import {FeatureFlagDirectiveModule} from '../../../feature_flag/directives/feature_flag_directive_module'; import {MetricsDataSourceModule} from '../../data_source'; import {DataDownloadDialogComponent} from './data_download_dialog_component'; @@ -31,10 +31,10 @@ import {DataDownloadDialogContainer} from './data_download_dialog_container'; CommonModule, FeatureFlagDirectiveModule, FormsModule, - MatLegacyButtonModule, - MatLegacyDialogModule, - MatLegacyInputModule, - MatLegacySelectModule, + MatButtonModule, + MatDialogModule, + MatInputModule, + MatSelectModule, MetricsDataSourceModule, ], entryComponents: [DataDownloadDialogContainer], diff --git a/tensorboard/webapp/metrics/views/card_renderer/histogram_card_component.ng.html b/tensorboard/webapp/metrics/views/card_renderer/histogram_card_component.ng.html index 78e3e143ccf..e3dc2f57ed0 100644 --- a/tensorboard/webapp/metrics/views/card_renderer/histogram_card_component.ng.html +++ b/tensorboard/webapp/metrics/views/card_renderer/histogram_card_component.ng.html @@ -32,7 +32,6 @@ diff --git a/tensorboard/webapp/runs/views/runs_table/runs_group_menu_button_component.scss b/tensorboard/webapp/runs/views/runs_table/runs_group_menu_button_component.scss index 545a7a0fc3d..172eb5151b4 100644 --- a/tensorboard/webapp/runs/views/runs_table/runs_group_menu_button_component.scss +++ b/tensorboard/webapp/runs/views/runs_table/runs_group_menu_button_component.scss @@ -27,12 +27,6 @@ limitations under the License. pointer-events: none; } - button { - display: grid; - gap: 2px 10px; - grid-template-columns: $_icon-size auto; - } - mat-icon { height: $_icon-size; width: $_icon-size; diff --git a/tensorboard/webapp/runs/views/runs_table/runs_group_menu_button_component.ts b/tensorboard/webapp/runs/views/runs_table/runs_group_menu_button_component.ts index 9e37ea70d7b..c3fc7164379 100644 --- a/tensorboard/webapp/runs/views/runs_table/runs_group_menu_button_component.ts +++ b/tensorboard/webapp/runs/views/runs_table/runs_group_menu_button_component.ts @@ -19,7 +19,7 @@ import { Input, Output, } from '@angular/core'; -import {MatLegacyDialog} from '@angular/material/legacy-dialog'; +import {MatDialog} from '@angular/material/dialog'; import {GroupBy, GroupByKey} from '../../types'; import {RegexEditDialogContainer} from './regex_edit_dialog_container'; @@ -40,7 +40,7 @@ export class RunsGroupMenuButtonComponent { @Output() onGroupByChange = new EventEmitter(); - constructor(private readonly dialog: MatLegacyDialog) {} + constructor(private readonly dialog: MatDialog) {} onRegexStringEdit() { // data pass in the experiment id diff --git a/tensorboard/webapp/runs/views/runs_table/runs_table_component.ts b/tensorboard/webapp/runs/views/runs_table/runs_table_component.ts index 3a84927aa20..232d5f17fc7 100644 --- a/tensorboard/webapp/runs/views/runs_table/runs_table_component.ts +++ b/tensorboard/webapp/runs/views/runs_table/runs_table_component.ts @@ -23,12 +23,9 @@ import { Output, ViewChild, } from '@angular/core'; -import { - MatLegacyPaginator, - MatLegacyPaginatorIntl, -} from '@angular/material/legacy-paginator'; +import {MatPaginator, MatPaginatorIntl} from '@angular/material/paginator'; import {MatSort, Sort} from '@angular/material/sort'; -import {MatLegacyTableDataSource} from '@angular/material/legacy-table'; +import {MatTableDataSource} from '@angular/material/table'; import { DiscreteFilter, DiscreteHparamValue, @@ -44,7 +41,7 @@ import {HparamSpec, MetricSpec, RunsTableColumn, RunTableItem} from './types'; * Exported because Angular compiler requires decorated classes to be exported. */ @Injectable() -export class RunsPaginatorIntl extends MatLegacyPaginatorIntl { +export class RunsPaginatorIntl extends MatPaginatorIntl { override itemsPerPageLabel = 'Show runs:'; } @@ -76,10 +73,10 @@ export interface IntervalFilterChange { styleUrls: ['runs_table_component.css'], changeDetection: ChangeDetectionStrategy.OnPush, // Use Element Provider since this text is unique to this element hierarchy. - providers: [{provide: MatLegacyPaginatorIntl, useClass: RunsPaginatorIntl}], + providers: [{provide: MatPaginatorIntl, useClass: RunsPaginatorIntl}], }) export class RunsTableComponent implements OnChanges { - readonly dataSource = new MatLegacyTableDataSource(); + readonly dataSource = new MatTableDataSource(); readonly DomainType = DomainType; readonly RunsTableColumn = RunsTableColumn; readonly SortType = SortType; @@ -137,7 +134,7 @@ export class RunsTableComponent implements OnChanges { @ViewChild('filter', {static: true, read: ElementRef}) filter!: ElementRef; - @ViewChild(MatLegacyPaginator, {static: true}) paginator!: MatLegacyPaginator; + @ViewChild(MatPaginator, {static: true}) paginator!: MatPaginator; @ViewChild(MatSort, {static: true}) sort!: MatSort; ngOnChanges() { diff --git a/tensorboard/webapp/runs/views/runs_table/runs_table_module.ts b/tensorboard/webapp/runs/views/runs_table/runs_table_module.ts index 1f03baab1e0..2385048b978 100644 --- a/tensorboard/webapp/runs/views/runs_table/runs_table_module.ts +++ b/tensorboard/webapp/runs/views/runs_table/runs_table_module.ts @@ -18,17 +18,17 @@ limitations under the License. import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; -import {MatLegacyButtonModule} from '@angular/material/legacy-button'; -import {MatLegacyCheckboxModule} from '@angular/material/legacy-checkbox'; -import {MatLegacyDialogModule} from '@angular/material/legacy-dialog'; -import {MatLegacyFormFieldModule} from '@angular/material/legacy-form-field'; +import {MatButtonModule} from '@angular/material/button'; +import {MatCheckboxModule} from '@angular/material/checkbox'; +import {MatDialogModule} from '@angular/material/dialog'; +import {MatFormFieldModule} from '@angular/material/form-field'; import {MatIconModule} from '@angular/material/icon'; -import {MatLegacyInputModule} from '@angular/material/legacy-input'; -import {MatLegacyMenuModule} from '@angular/material/legacy-menu'; -import {MatLegacyPaginatorModule} from '@angular/material/legacy-paginator'; -import {MatLegacyProgressSpinnerModule} from '@angular/material/legacy-progress-spinner'; +import {MatInputModule} from '@angular/material/input'; +import {MatMenuModule} from '@angular/material/menu'; +import {MatPaginatorModule} from '@angular/material/paginator'; +import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; import {MatSortModule} from '@angular/material/sort'; -import {MatLegacyTableModule} from '@angular/material/legacy-table'; +import {MatTableModule} from '@angular/material/table'; import {ColorPickerModule} from 'ngx-color-picker'; import {AlertModule} from '../../../alert/alert_module'; import {DataTableModule} from '../../../widgets/data_table/data_table_module'; @@ -50,17 +50,17 @@ import {RunsTableContainer} from './runs_table_container'; DataTableModule, ExperimentAliasModule, FilterInputModule, - MatLegacyFormFieldModule, - MatLegacyButtonModule, - MatLegacyCheckboxModule, - MatLegacyDialogModule, - MatLegacyInputModule, + MatFormFieldModule, + MatButtonModule, + MatCheckboxModule, + MatDialogModule, + MatInputModule, MatIconModule, - MatLegacyMenuModule, - MatLegacyPaginatorModule, - MatLegacyProgressSpinnerModule, + MatMenuModule, + MatPaginatorModule, + MatProgressSpinnerModule, MatSortModule, - MatLegacyTableModule, + MatTableModule, RangeInputModule, AlertModule, ], diff --git a/tensorboard/webapp/runs/views/runs_table/runs_table_test.ts b/tensorboard/webapp/runs/views/runs_table/runs_table_test.ts index 8dca1ccc068..b467a5a0f31 100644 --- a/tensorboard/webapp/runs/views/runs_table/runs_table_test.ts +++ b/tensorboard/webapp/runs/views/runs_table/runs_table_test.ts @@ -27,13 +27,13 @@ import { flushMicrotasks, TestBed, } from '@angular/core/testing'; -import {MatLegacyCheckboxModule} from '@angular/material/legacy-checkbox'; -import {MatLegacyDialogModule} from '@angular/material/legacy-dialog'; -import {MatLegacyMenuModule} from '@angular/material/legacy-menu'; -import {MatLegacyPaginatorModule} from '@angular/material/legacy-paginator'; -import {MatLegacyProgressSpinnerModule} from '@angular/material/legacy-progress-spinner'; +import {MatCheckboxModule} from '@angular/material/checkbox'; +import {MatDialogModule} from '@angular/material/dialog'; +import {MatMenuModule} from '@angular/material/menu'; +import {MatPaginatorModule} from '@angular/material/paginator'; +import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; import {MatSortModule} from '@angular/material/sort'; -import {MatLegacyTableModule} from '@angular/material/legacy-table'; +import {MatTableModule} from '@angular/material/table'; import {By} from '@angular/platform-browser'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {Action, Store} from '@ngrx/store'; @@ -238,14 +238,14 @@ describe('runs_table', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [ - MatLegacyCheckboxModule, - MatLegacyDialogModule, + MatCheckboxModule, + MatDialogModule, MatIconTestingModule, - MatLegacyMenuModule, - MatLegacyPaginatorModule, - MatLegacyProgressSpinnerModule, + MatMenuModule, + MatPaginatorModule, + MatProgressSpinnerModule, MatSortModule, - MatLegacyTableModule, + MatTableModule, NoopAnimationsModule, FilterInputModule, RangeInputModule, @@ -638,7 +638,7 @@ describe('runs_table', () => { const items = getOverlayMenuItems(); expect( - items.map((element) => element.querySelector('label')!.textContent) + items.map((element) => element.querySelector('span')!.textContent) ).toEqual(['Experiment', 'Run', 'Regex', '(none set)']); }); @@ -655,9 +655,10 @@ describe('runs_table', () => { openColorGroupDialog(fixture); const items = getOverlayMenuItems(); + console.log('items', items); expect( - items.map((element) => element.querySelector('label')!.textContent) + items.map((element) => element.querySelector('span')!.textContent) ).toEqual(['Run', 'Regex', '(none set)']); }); @@ -1052,7 +1053,7 @@ describe('runs_table', () => { fixture.detectChanges(); const label = fixture.debugElement.query( - By.css('.mat-paginator-page-size-label') + By.css('.mat-mdc-paginator-page-size-label') ); expect(label.nativeElement.textContent).toContain('Show runs:'); }); @@ -1176,7 +1177,7 @@ describe('runs_table', () => { updateTableAndPaginator(fixture); const label = fixture.nativeElement.querySelector( - '.mat-paginator-range-label' + '.mat-mdc-paginator-range-label' ); // By default, mat-paginator take the lowest pageSizeOptions. expect(label.textContent).toContain('6 – 10 of 10'); @@ -1732,7 +1733,9 @@ describe('runs_table', () => { Selector.HEADER_CHECKBOX ); - expect(checkbox.classList.contains('mat-checkbox-checked')).toBe(true); + expect(checkbox.attributes.getNamedItem('ng-reflect-checked').value).toBe( + 'true' + ); }); it( @@ -1768,9 +1771,9 @@ describe('runs_table', () => { Selector.HEADER_CHECKBOX ); - expect(checkbox.classList.contains('mat-checkbox-indeterminate')).toBe( - true - ); + expect( + checkbox.attributes.getNamedItem('ng-reflect-indeterminate').value + ).toBe('true'); } ); diff --git a/tensorboard/webapp/settings/_views/BUILD b/tensorboard/webapp/settings/_views/BUILD index 7c23e752d5e..3e6f5f53243 100644 --- a/tensorboard/webapp/settings/_views/BUILD +++ b/tensorboard/webapp/settings/_views/BUILD @@ -18,11 +18,11 @@ tf_ng_module( ], deps = [ "//tensorboard/webapp:tb_polymer_interop_types", - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", - "//tensorboard/webapp/angular:expect_angular_legacy_material_checkbox", - "//tensorboard/webapp/angular:expect_angular_legacy_material_dialog", - "//tensorboard/webapp/angular:expect_angular_legacy_material_input", + "//tensorboard/webapp/angular:expect_angular_material_button", + "//tensorboard/webapp/angular:expect_angular_material_checkbox", + "//tensorboard/webapp/angular:expect_angular_material_dialog", "//tensorboard/webapp/angular:expect_angular_material_icon", + "//tensorboard/webapp/angular:expect_angular_material_input", "//tensorboard/webapp/settings/_redux", "//tensorboard/webapp/types", "@npm//@angular/common", @@ -44,11 +44,11 @@ tf_ts_library( ":_views", "//tensorboard/webapp/angular:expect_angular_cdk_overlay", "//tensorboard/webapp/angular:expect_angular_core_testing", - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", - "//tensorboard/webapp/angular:expect_angular_legacy_material_checkbox", - "//tensorboard/webapp/angular:expect_angular_legacy_material_dialog", - "//tensorboard/webapp/angular:expect_angular_legacy_material_input", + "//tensorboard/webapp/angular:expect_angular_material_button", + "//tensorboard/webapp/angular:expect_angular_material_checkbox", + "//tensorboard/webapp/angular:expect_angular_material_dialog", "//tensorboard/webapp/angular:expect_angular_material_icon", + "//tensorboard/webapp/angular:expect_angular_material_input", "//tensorboard/webapp/angular:expect_angular_platform_browser_animations", "//tensorboard/webapp/angular:expect_angular_platform_browser_dynamic_testing", "//tensorboard/webapp/angular:expect_ngrx_store_testing", diff --git a/tensorboard/webapp/settings/_views/settings_button_component.ts b/tensorboard/webapp/settings/_views/settings_button_component.ts index 2b6d9a61367..f403b2cc278 100644 --- a/tensorboard/webapp/settings/_views/settings_button_component.ts +++ b/tensorboard/webapp/settings/_views/settings_button_component.ts @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ import {Component, Input} from '@angular/core'; -import {MatLegacyDialog} from '@angular/material/legacy-dialog'; +import {MatDialog} from '@angular/material/dialog'; import {DataLoadState} from '../../types/data'; import {SettingsDialogContainer} from './settings_dialog_container'; @@ -32,7 +32,7 @@ import {SettingsDialogContainer} from './settings_dialog_container'; export class SettingsButtonComponent { @Input() settingsLoadState!: DataLoadState; - constructor(private dialog: MatLegacyDialog) {} + constructor(private dialog: MatDialog) {} isButtonDisabled() { // Button is disabled if we have not yet attempted to start diff --git a/tensorboard/webapp/settings/_views/settings_dialog_component.css b/tensorboard/webapp/settings/_views/settings_dialog_component.css index 4dd687235ce..53437e453d0 100644 --- a/tensorboard/webapp/settings/_views/settings_dialog_component.css +++ b/tensorboard/webapp/settings/_views/settings_dialog_component.css @@ -17,21 +17,14 @@ limitations under the License. } :host > div { - margin: 10px 0; -} - -:host > :first-child { - margin-top: 0; -} - -:host > :last-child { - margin-bottom: 0; + margin: 16px; } h3 { font-size: 20px; + margin: 16px; } .reload-toggle { - margin-bottom: 10px; + margin-bottom: 16px; } diff --git a/tensorboard/webapp/settings/_views/settings_dialog_component.ng.html b/tensorboard/webapp/settings/_views/settings_dialog_component.ng.html index 1984441d7a8..c738118073b 100644 --- a/tensorboard/webapp/settings/_views/settings_dialog_component.ng.html +++ b/tensorboard/webapp/settings/_views/settings_dialog_component.ng.html @@ -23,11 +23,11 @@

Settings

+ Reload Period (seconds) @@ -43,11 +43,11 @@

Settings

+ Pagination Limit diff --git a/tensorboard/webapp/settings/_views/settings_module.ts b/tensorboard/webapp/settings/_views/settings_module.ts index 21be7a1f51b..3f4119d57d3 100644 --- a/tensorboard/webapp/settings/_views/settings_module.ts +++ b/tensorboard/webapp/settings/_views/settings_module.ts @@ -15,11 +15,11 @@ limitations under the License. import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatLegacyButtonModule} from '@angular/material/legacy-button'; -import {MatLegacyCheckboxModule} from '@angular/material/legacy-checkbox'; -import {MatLegacyDialogModule} from '@angular/material/legacy-dialog'; +import {MatButtonModule} from '@angular/material/button'; +import {MatCheckboxModule} from '@angular/material/checkbox'; +import {MatDialogModule} from '@angular/material/dialog'; import {MatIconModule} from '@angular/material/icon'; -import {MatLegacyInputModule} from '@angular/material/legacy-input'; +import {MatInputModule} from '@angular/material/input'; import {SettingsPolymerInteropContainer} from './polymer_interop_container'; import {SettingsButtonComponent} from './settings_button_component'; import {SettingsButtonContainer} from './settings_button_container'; @@ -45,11 +45,11 @@ import {SettingsDialogContainer} from './settings_dialog_container'; CommonModule, FormsModule, ReactiveFormsModule, - MatLegacyButtonModule, - MatLegacyCheckboxModule, - MatLegacyDialogModule, + MatButtonModule, + MatCheckboxModule, + MatDialogModule, MatIconModule, - MatLegacyInputModule, + MatInputModule, ], }) export class SettingsModule {} diff --git a/tensorboard/webapp/settings/_views/settings_test.ts b/tensorboard/webapp/settings/_views/settings_test.ts index 5d0d362d900..c1c24f5e97b 100644 --- a/tensorboard/webapp/settings/_views/settings_test.ts +++ b/tensorboard/webapp/settings/_views/settings_test.ts @@ -15,10 +15,10 @@ limitations under the License. import {OverlayContainer} from '@angular/cdk/overlay'; import {fakeAsync, TestBed, tick} from '@angular/core/testing'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {MatLegacyButtonModule} from '@angular/material/legacy-button'; -import {MatLegacyCheckboxModule} from '@angular/material/legacy-checkbox'; -import {MatLegacyDialogModule} from '@angular/material/legacy-dialog'; -import {MatLegacyInputModule} from '@angular/material/legacy-input'; +import {MatButtonModule} from '@angular/material/button'; +import {MatCheckboxModule} from '@angular/material/checkbox'; +import {MatDialogModule} from '@angular/material/dialog'; +import {MatInputModule} from '@angular/material/input'; import {By} from '@angular/platform-browser'; import {BrowserDynamicTestingModule} from '@angular/platform-browser-dynamic/testing'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; @@ -46,11 +46,11 @@ describe('settings test', () => { await TestBed.configureTestingModule({ imports: [ FormsModule, - MatLegacyButtonModule, - MatLegacyCheckboxModule, - MatLegacyDialogModule, + MatButtonModule, + MatCheckboxModule, + MatDialogModule, MatIconTestingModule, - MatLegacyInputModule, + MatInputModule, NoopAnimationsModule, ReactiveFormsModule, ], diff --git a/tensorboard/webapp/testing/dom.ts b/tensorboard/webapp/testing/dom.ts index 3feb281e9ea..785283173ae 100644 --- a/tensorboard/webapp/testing/dom.ts +++ b/tensorboard/webapp/testing/dom.ts @@ -35,6 +35,7 @@ export interface SendKeySpecialArg { | 'Tab' | 'Enter' | 'ArrowLeft' + | 'ArrowUp' | 'ArrowRight' | 'Escape'; prevString: string; @@ -88,6 +89,12 @@ export function sendKey( keyCode = 0x25; emitKeyPressAndInput = false; break; + case 'ArrowUp': + nextString = prevString; + nextCursorIndex = startingCursorIndex - 1; + keyCode = 0x26; + emitKeyPressAndInput = false; + break; case 'ArrowRight': nextString = prevString; nextCursorIndex = startingCursorIndex + 1; diff --git a/tensorboard/webapp/theme/_tb_theme.template.scss b/tensorboard/webapp/theme/_tb_theme.template.scss index 24ed43be2f2..5f41a23c85a 100644 --- a/tensorboard/webapp/theme/_tb_theme.template.scss +++ b/tensorboard/webapp/theme/_tb_theme.template.scss @@ -268,6 +268,7 @@ $tb-dark-theme: map_merge( @include mat.all-legacy-component-typographies(); @include mat.all-component-typographies(); // Include all theme-styles for the components based on the current theme. + @include mat.all-component-themes($tb-theme); @include mat.all-legacy-component-themes($tb-theme); @include mat.all-component-themes($tb-theme); @@ -282,7 +283,7 @@ $tb-dark-theme: map_merge( contain: strict; } - a:not(.mat-button, .mat-icon-button) { + a:not(.mdc-button, .mdc-icon-button) { color: map-get($tb-foreground, link); &:visited { @@ -290,12 +291,45 @@ $tb-dark-theme: map_merge( } } + body, + body.dark-mode { + a, + button.mat-mdc-button-base { + --tb-icon-size: 24px; + --mdc-typography-button-letter-spacing: normal; + + &[mat-icon-button].mat-mdc-icon-button { + width: 40px; + height: 40px; + display: inline-flex; + justify-content: center; + align-items: center; + + .mat-mdc-button-touch-target { + height: 100%; + width: 100%; + } + } + + mat-icon.mat-icon { + flex-shrink: 0; + } + + mat-icon.mat-icon, + svg { + width: var(--tb-icon-size); + height: var(--tb-icon-size); + line-height: var(--tb-icon-size); + } + } + } + // Cannot use `tb-dark-theme` as :host-context in the global stylesheet is // meaningless. body.dark-mode { background-color: map-get($tb-dark-background, background); - a:not(.mat-button, .mat-icon-button) { + a:not(.mdc-button, .mdc-icon-button) { color: map-get($tb-dark-foreground, link); &:visited { diff --git a/tensorboard/webapp/widgets/data_table/BUILD b/tensorboard/webapp/widgets/data_table/BUILD index 035ace3794e..773be63f419 100644 --- a/tensorboard/webapp/widgets/data_table/BUILD +++ b/tensorboard/webapp/widgets/data_table/BUILD @@ -83,7 +83,7 @@ tf_ng_module( ":data_table_header", ":filter_dialog", ":types", - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", + "//tensorboard/webapp/angular:expect_angular_material_button", "//tensorboard/webapp/angular:expect_angular_material_icon", "//tensorboard/webapp/metrics/views/card_renderer:scalar_card_types", "//tensorboard/webapp/widgets/custom_modal", @@ -125,9 +125,9 @@ tf_ng_module( ], deps = [ ":types", - "//tensorboard/webapp/angular:expect_angular_legacy_material_button", - "//tensorboard/webapp/angular:expect_angular_legacy_material_input", + "//tensorboard/webapp/angular:expect_angular_material_button", "//tensorboard/webapp/angular:expect_angular_material_icon", + "//tensorboard/webapp/angular:expect_angular_material_input", "@npm//@angular/common", "@npm//@angular/core", "@npm//@angular/forms", diff --git a/tensorboard/webapp/widgets/data_table/column_selector_component.ng.html b/tensorboard/webapp/widgets/data_table/column_selector_component.ng.html index eea57cd30c3..b3ef95302e5 100644 --- a/tensorboard/webapp/widgets/data_table/column_selector_component.ng.html +++ b/tensorboard/webapp/widgets/data_table/column_selector_component.ng.html @@ -14,11 +14,11 @@
+ Search diff --git a/tensorboard/webapp/widgets/data_table/column_selector_component.scss b/tensorboard/webapp/widgets/data_table/column_selector_component.scss index fb850e29d0d..97bd7f0bac1 100644 --- a/tensorboard/webapp/widgets/data_table/column_selector_component.scss +++ b/tensorboard/webapp/widgets/data_table/column_selector_component.scss @@ -38,14 +38,6 @@ limitations under the License. .search-area { margin-bottom: 4px; - - mat-icon.search-icon { - font-size: 1em; - - ::ng-deep svg { - padding-top: 6px; - } - } } .column-list { @@ -58,7 +50,11 @@ limitations under the License. } .column-button { - text-align: left; + // Don't allow buttons to shrink when there are many of them. + flex-shrink: 0; + // Match height of button touch target to avoid unnecessary scrollbar. + height: 48px; + justify-content: left; width: 100%; &.selected { diff --git a/tensorboard/webapp/widgets/data_table/column_selector_module.ts b/tensorboard/webapp/widgets/data_table/column_selector_module.ts index adef9b315b7..75d27d0265d 100644 --- a/tensorboard/webapp/widgets/data_table/column_selector_module.ts +++ b/tensorboard/webapp/widgets/data_table/column_selector_module.ts @@ -16,8 +16,8 @@ limitations under the License. import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {MatIconModule} from '@angular/material/icon'; -import {MatLegacyInputModule} from '@angular/material/legacy-input'; -import {MatLegacyButtonModule} from '@angular/material/legacy-button'; +import {MatInputModule} from '@angular/material/input'; +import {MatButtonModule} from '@angular/material/button'; import {ColumnSelectorComponent} from './column_selector_component'; import {FormsModule} from '@angular/forms'; @@ -26,8 +26,8 @@ import {FormsModule} from '@angular/forms'; imports: [ CommonModule, MatIconModule, - MatLegacyInputModule, - MatLegacyButtonModule, + MatInputModule, + MatButtonModule, FormsModule, ], exports: [ColumnSelectorComponent], diff --git a/tensorboard/webapp/widgets/data_table/content_cell_component.scss b/tensorboard/webapp/widgets/data_table/content_cell_component.scss index 54a9dcfd8e5..dbdcf5ee6ce 100644 --- a/tensorboard/webapp/widgets/data_table/content_cell_component.scss +++ b/tensorboard/webapp/widgets/data_table/content_cell_component.scss @@ -15,8 +15,8 @@ limitations under the License. :host { display: table-cell; - padding: 4px; } + .cell { align-items: center; display: flex; diff --git a/tensorboard/webapp/widgets/data_table/data_table_component.ng.html b/tensorboard/webapp/widgets/data_table/data_table_component.ng.html index d41860fa716..e7872fdc162 100644 --- a/tensorboard/webapp/widgets/data_table/data_table_component.ng.html +++ b/tensorboard/webapp/widgets/data_table/data_table_component.ng.html @@ -26,22 +26,24 @@ Remove +