From 9c25f00db91c7893b266bfbf259045c2f0c9b38a Mon Sep 17 00:00:00 2001 From: James Date: Thu, 12 Oct 2023 08:50:53 -0700 Subject: [PATCH] MDC Migration: Merging feature branch with all new Angular Components Styled as desired. (#6631) Contributors: @rileyajones, @bmd3k, @JamesHollyer ## Motivation for features / changes Angular is deprecating the "Legacy" Material Components. We are migrating to the new MDC Components. This was done in a feature branch. This PR merges the feature branch into master with all components except for the mat-slider converted and styled properly. ## Technical description of changes This was all done in a feature branch for commit history please see that branch here: https://github.com/tensorflow/tensorboard/tree/MDCMigration ## Screenshots of UI changes (or N/A) Here is one basic screenshot of what a TensorBoard looks like now. For more detailed screenshots please see commit history with above link. ![Screenshot 2023-10-10 at 1 50 06 PM](https://github.com/tensorflow/tensorboard/assets/8672809/add132b1-5bfd-4ab9-9ac9-f135114df518) --------- Co-authored-by: Riley Jones <78179109+rileyajones@users.noreply.github.com> Co-authored-by: Brian Dubois --- .../views/timeline/BUILD | 2 +- .../views/timeline/timeline_module.ts | 4 +- tensorboard/webapp/alert/views/BUILD | 8 +- .../alert_display_snackbar_container.scss | 3 +- .../views/alert_display_snackbar_container.ts | 9 +- .../alert/views/alert_snackbar_container.ts | 4 +- .../alert/views/alert_snackbar_module.ts | 6 +- .../webapp/alert/views/alert_snackbar_test.ts | 17 +-- tensorboard/webapp/angular/BUILD | 47 +++---- tensorboard/webapp/core/views/BUILD | 2 +- .../webapp/core/views/layout_module.ts | 4 +- tensorboard/webapp/feature_flag/views/BUILD | 10 +- .../views/feature_flag_dialog_module.ts | 6 +- .../feature_flag_modal_trigger_container.ts | 9 +- ...ature_flag_modal_trigger_container_test.ts | 8 +- tensorboard/webapp/header/BUILD | 16 +-- .../webapp/header/dark_mode_toggle_test.ts | 8 +- tensorboard/webapp/header/header_module.ts | 16 +-- tensorboard/webapp/header/header_test.ts | 16 +-- .../header/plugin_selector_component.ng.html | 8 +- .../header/plugin_selector_component.scss | 116 ++++++++++-------- .../header/plugin_selector_component.ts | 4 +- .../webapp/metrics/views/card_renderer/BUILD | 36 +++--- .../data_download_dialog_container.ts | 4 +- .../data_download_dialog_test.ts | 4 +- .../card_renderer/data_download_module.ts | 16 +-- .../histogram_card_component.ng.html | 1 - .../histogram_card_component.scss | 4 - .../card_renderer/histogram_card_module.ts | 8 +- .../card_renderer/histogram_card_test.ts | 4 +- .../image_card_component.ng.html | 1 - .../card_renderer/image_card_component.scss | 4 - .../views/card_renderer/image_card_module.ts | 8 +- .../views/card_renderer/image_card_test.ts | 8 +- .../scalar_card_component.ng.html | 1 - .../card_renderer/scalar_card_component.scss | 4 - .../card_renderer/scalar_card_component.ts | 7 +- .../card_renderer/scalar_card_data_table.scss | 5 + .../views/card_renderer/scalar_card_module.ts | 12 +- .../views/card_renderer/scalar_card_test.ts | 17 ++- .../webapp/metrics/views/main_view/BUILD | 12 +- .../views/main_view/filter_input_test.ts | 8 +- .../views/main_view/main_view_module.ts | 16 +-- .../webapp/metrics/views/right_pane/BUILD | 10 +- .../views/right_pane/right_pane_module.ts | 12 +- .../views/right_pane/right_pane_test.ts | 36 +++--- .../right_pane/scalar_column_editor/BUILD | 7 +- .../scalar_column_editor_component.ng.html | 30 +++-- .../scalar_column_editor_component.scss | 7 +- .../scalar_column_editor_component.ts | 4 +- .../scalar_column_editor_module.ts | 12 +- .../scalar_column_editor_test.ts | 28 +++-- .../right_pane/settings_view_component.scss | 26 ++-- .../webapp/notification_center/_views/BUILD | 10 +- .../_views/notification_center_test.ts | 8 +- .../_views/views_module.ts | 8 +- .../webapp/runs/views/runs_table/BUILD | 32 ++--- .../runs_table/regex_edit_dialog.ng.html | 1 + .../regex_edit_dialog_component.scss | 19 ++- .../runs_table/regex_edit_dialog_component.ts | 4 +- .../runs_table/regex_edit_dialog_container.ts | 9 +- .../runs_table/regex_edit_dialog_test.ts | 24 ++-- .../views/runs_table/runs_data_table.scss | 8 +- .../views/runs_table/runs_data_table_test.ts | 4 +- .../runs_group_menu_button_component.ng.html | 44 +++---- .../runs_group_menu_button_component.scss | 6 - .../runs_group_menu_button_component.ts | 4 +- .../views/runs_table/runs_table_component.ts | 15 +-- .../views/runs_table/runs_table_module.ts | 36 +++--- .../runs/views/runs_table/runs_table_test.ts | 43 ++++--- tensorboard/webapp/settings/_views/BUILD | 16 +-- .../_views/settings_button_component.ts | 4 +- .../_views/settings_dialog_component.css | 13 +- .../_views/settings_dialog_component.ng.html | 4 +- .../webapp/settings/_views/settings_module.ts | 16 +-- .../webapp/settings/_views/settings_test.ts | 16 +-- tensorboard/webapp/testing/dom.ts | 7 ++ .../webapp/theme/_tb_theme.template.scss | 38 +++++- tensorboard/webapp/widgets/data_table/BUILD | 6 +- .../column_selector_component.ng.html | 2 +- .../data_table/column_selector_component.scss | 14 +-- .../data_table/column_selector_module.ts | 8 +- .../data_table/content_cell_component.scss | 2 +- .../data_table/data_table_component.ng.html | 26 ++-- .../data_table/data_table_component.scss | 3 +- .../widgets/data_table/data_table_module.ts | 4 +- .../data_table/header_cell_component.scss | 24 ++-- tensorboard/webapp/widgets/dropdown/BUILD | 6 +- .../widgets/dropdown/dropdown_component.scss | 28 +++-- .../widgets/dropdown/dropdown_component.ts | 1 + .../widgets/dropdown/dropdown_module.ts | 4 +- .../webapp/widgets/dropdown/dropdown_test.ts | 10 +- tensorboard/webapp/widgets/filter_input/BUILD | 4 +- .../filter_input/filter_input_component.ts | 6 +- .../filter_input/filter_input_module.ts | 4 +- .../widgets/filter_input/filter_input_test.ts | 11 +- .../widgets/line_chart_v2/sub_view/BUILD | 14 +-- .../sub_view/line_chart_axis_view.ng.html | 2 +- .../sub_view/line_chart_axis_view.scss | 29 ++--- .../sub_view/line_chart_axis_view_test.ts | 16 +-- .../line_chart_v2/sub_view/sub_view_module.ts | 12 +- .../widgets/range_input/range_input_test.ts | 4 +- 102 files changed, 661 insertions(+), 643 deletions(-) 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 9123b0529a..c998b03958 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 e69fa2625b..097d7b018d 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 b8ec01fa2f..78e359b791 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 4aed87692e..af111929ce 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 139e064b78..ee20963931 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 9b001c6f58..ebd8273586 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 ed88bdbf89..5aa90179fb 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 3d6d46de01..2870ac2f3a 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 a769eb7382..5c710b161a 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 5230e45c8a..511c16191b 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 51ed3634a7..5a6fc1d7f4 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 ea089c2fb1..d2c9a10f86 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 a415b320aa..1e38417533 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 a18f823f77..fba1f843ad 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 1436816565..5bb82fde76 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 535a4b0fa8..5502ba956b 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 e5cbfaa08a..6cedfad724 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 b0872db4b5..9adc6ce003 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 081651fbf5..dbebbfe29b 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 3e2c3ac54d..8f61443f1a 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 fd01fe3ef5..c486424bac 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 5d6cad6ff6..7076578ebc 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 a9a13adebe..b20f3e4f26 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 2a45ff3cb1..0a74d72f36 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 eb668a670e..6439660572 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 78e3e143cc..e3dc2f57ed 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 545a7a0fc3..172eb5151b 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 9e37ea70d7..c3fc716437 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 3a84927aa2..232d5f17fc 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 1f03baab1e..2385048b97 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 8dca1ccc06..b467a5a0f3 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 7c23e752d5..3e6f5f5324 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 2b6d9a6136..f403b2cc27 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 4dd687235c..53437e453d 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 1984441d7a..c738118073 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 21be7a1f51..3f4119d57d 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 5d0d362d90..c1c24f5e97 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 3feb281e9e..785283173a 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 24ed43be2f..5f41a23c85 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 035ace3794..773be63f41 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 eea57cd30c..b3ef95302e 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 fb850e29d0..97bd7f0bac 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 adef9b315b..75d27d0265 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 54a9dcfd8e..dbdcf5ee6c 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 d41860fa71..e7872fdc16 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 +