From 943e56a7c7877beb1210ca92b2a17c9d512afc6e Mon Sep 17 00:00:00 2001 From: Yin Zhang Date: Tue, 19 Sep 2023 11:07:55 -0700 Subject: [PATCH] Migration to use the new MDC-based Angular Components. Components migrated: tooltip PiperOrigin-RevId: 566685736 --- frontend/app/common/angular/BUILD | 2 +- .../components/capture_profile/capture_profile_dialog/BUILD | 2 +- .../capture_profile_dialog/capture_profile_dialog_module.ts | 4 ++-- frontend/app/components/graph_viewer/graph_config/BUILD | 2 +- .../graph_viewer/graph_config/graph_config_module.ts | 4 ++-- .../components/memory_profile/memory_profile_summary/BUILD | 1 - .../memory_profile_summary/memory_profile_summary_module.ts | 2 -- .../app/components/memory_viewer/memory_viewer_main/BUILD | 1 - .../memory_viewer_main/memory_viewer_main_module.ts | 4 +--- frontend/app/components/op_profile/BUILD | 2 +- frontend/app/components/op_profile/op_profile_module.ts | 4 ++-- frontend/app/components/overview/performance_summary/BUILD | 2 +- .../performance_summary/performance_summary_module.ts | 4 ++-- frontend/styles.scss | 3 ++- 14 files changed, 16 insertions(+), 21 deletions(-) diff --git a/frontend/app/common/angular/BUILD b/frontend/app/common/angular/BUILD index 3385ea71..9173ddb7 100644 --- a/frontend/app/common/angular/BUILD +++ b/frontend/app/common/angular/BUILD @@ -155,7 +155,7 @@ ts_library( ) ts_library( - name = "angular_material_legacy_tooltip", + name = "angular_material_tooltip", srcs = [], deps = [ "@npm//@angular/material", diff --git a/frontend/app/components/capture_profile/capture_profile_dialog/BUILD b/frontend/app/components/capture_profile/capture_profile_dialog/BUILD index dae38d46..8d2061cc 100644 --- a/frontend/app/components/capture_profile/capture_profile_dialog/BUILD +++ b/frontend/app/components/capture_profile/capture_profile_dialog/BUILD @@ -23,9 +23,9 @@ xprof_ng_module( "@org_xprof//frontend/app/common/angular:angular_material_expansion", "@org_xprof//frontend/app/common/angular:angular_material_form_field", "@org_xprof//frontend/app/common/angular:angular_material_input", - "@org_xprof//frontend/app/common/angular:angular_material_legacy_tooltip", "@org_xprof//frontend/app/common/angular:angular_material_radio", "@org_xprof//frontend/app/common/angular:angular_material_select", + "@org_xprof//frontend/app/common/angular:angular_material_tooltip", "@org_xprof//frontend/app/common/interfaces", ], ) diff --git a/frontend/app/components/capture_profile/capture_profile_dialog/capture_profile_dialog_module.ts b/frontend/app/components/capture_profile/capture_profile_dialog/capture_profile_dialog_module.ts index b42e89f7..be2a35a9 100644 --- a/frontend/app/components/capture_profile/capture_profile_dialog/capture_profile_dialog_module.ts +++ b/frontend/app/components/capture_profile/capture_profile_dialog/capture_profile_dialog_module.ts @@ -8,7 +8,7 @@ import {MatFormFieldModule} from '@angular/material/form-field'; import {MatInputModule} from '@angular/material/input'; import {MatRadioModule} from '@angular/material/radio'; import {MatSelectModule} from '@angular/material/select'; -import {MatLegacyTooltipModule} from '@angular/material/legacy-tooltip'; +import {MatTooltipModule} from '@angular/material/tooltip'; import {BrowserModule} from '@angular/platform-browser'; import {CaptureProfileDialog} from './capture_profile_dialog'; @@ -27,7 +27,7 @@ import {CaptureProfileDialog} from './capture_profile_dialog'; MatInputModule, MatRadioModule, MatSelectModule, - MatLegacyTooltipModule, + MatTooltipModule, ], exports: [CaptureProfileDialog] }) diff --git a/frontend/app/components/graph_viewer/graph_config/BUILD b/frontend/app/components/graph_viewer/graph_config/BUILD index 26d9d555..beb495ac 100644 --- a/frontend/app/components/graph_viewer/graph_config/BUILD +++ b/frontend/app/components/graph_viewer/graph_config/BUILD @@ -24,9 +24,9 @@ xprof_ng_module( "@org_xprof//frontend/app/common/angular:angular_material_form_field", "@org_xprof//frontend/app/common/angular:angular_material_icon", "@org_xprof//frontend/app/common/angular:angular_material_input", - "@org_xprof//frontend/app/common/angular:angular_material_legacy_tooltip", "@org_xprof//frontend/app/common/angular:angular_material_select", "@org_xprof//frontend/app/common/angular:angular_material_sidenav", + "@org_xprof//frontend/app/common/angular:angular_material_tooltip", "@org_xprof//frontend/app/common/interfaces", ], ) diff --git a/frontend/app/components/graph_viewer/graph_config/graph_config_module.ts b/frontend/app/components/graph_viewer/graph_config/graph_config_module.ts index 66ee3767..a887d471 100644 --- a/frontend/app/components/graph_viewer/graph_config/graph_config_module.ts +++ b/frontend/app/components/graph_viewer/graph_config/graph_config_module.ts @@ -8,7 +8,7 @@ import {MatOptionModule} from '@angular/material/core'; import {MatFormFieldModule} from '@angular/material/form-field'; import {MatInputModule} from '@angular/material/input'; import {MatSelectModule} from '@angular/material/select'; -import {MatLegacyTooltipModule} from '@angular/material/legacy-tooltip'; +import {MatTooltipModule} from '@angular/material/tooltip'; import {MatSidenavModule} from '@angular/material/sidenav'; import {GraphConfig} from './graph_config'; @@ -25,7 +25,7 @@ import {GraphConfig} from './graph_config'; MatOptionModule, MatSelectModule, MatSidenavModule, - MatLegacyTooltipModule, + MatTooltipModule, ], declarations: [GraphConfig], exports: [GraphConfig] diff --git a/frontend/app/components/memory_profile/memory_profile_summary/BUILD b/frontend/app/components/memory_profile/memory_profile_summary/BUILD index 2f68bd07..c06a8adf 100644 --- a/frontend/app/components/memory_profile/memory_profile_summary/BUILD +++ b/frontend/app/components/memory_profile/memory_profile_summary/BUILD @@ -16,7 +16,6 @@ xprof_ng_module( deps = [ "@npm//@angular/core", "@org_xprof//frontend/app/common/angular:angular_material_card", - "@org_xprof//frontend/app/common/angular:angular_material_legacy_tooltip", "@org_xprof//frontend/app/common/interfaces", "@org_xprof//frontend/app/common/utils", ], diff --git a/frontend/app/components/memory_profile/memory_profile_summary/memory_profile_summary_module.ts b/frontend/app/components/memory_profile/memory_profile_summary/memory_profile_summary_module.ts index 54865bcb..d3c88bd8 100644 --- a/frontend/app/components/memory_profile/memory_profile_summary/memory_profile_summary_module.ts +++ b/frontend/app/components/memory_profile/memory_profile_summary/memory_profile_summary_module.ts @@ -1,7 +1,6 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {MatCardModule} from '@angular/material/card'; -import {MatLegacyTooltipModule} from '@angular/material/legacy-tooltip'; import {MemoryProfileSummary} from './memory_profile_summary'; @@ -10,7 +9,6 @@ import {MemoryProfileSummary} from './memory_profile_summary'; imports: [ CommonModule, MatCardModule, - MatLegacyTooltipModule, ], exports: [MemoryProfileSummary] }) diff --git a/frontend/app/components/memory_viewer/memory_viewer_main/BUILD b/frontend/app/components/memory_viewer/memory_viewer_main/BUILD index 1a97124b..b822981e 100644 --- a/frontend/app/components/memory_viewer/memory_viewer_main/BUILD +++ b/frontend/app/components/memory_viewer/memory_viewer_main/BUILD @@ -21,7 +21,6 @@ xprof_ng_module( "@org_xprof//frontend/app/common/angular:angular_material_checkbox", "@org_xprof//frontend/app/common/angular:angular_material_divider", "@org_xprof//frontend/app/common/angular:angular_material_icon", - "@org_xprof//frontend/app/common/angular:angular_material_legacy_tooltip", "@org_xprof//frontend/app/common/interfaces", "@org_xprof//frontend/app/common/utils", "@org_xprof//frontend/app/components/diagnostics_view", diff --git a/frontend/app/components/memory_viewer/memory_viewer_main/memory_viewer_main_module.ts b/frontend/app/components/memory_viewer/memory_viewer_main/memory_viewer_main_module.ts index f057b0fc..74a15a8f 100644 --- a/frontend/app/components/memory_viewer/memory_viewer_main/memory_viewer_main_module.ts +++ b/frontend/app/components/memory_viewer/memory_viewer_main/memory_viewer_main_module.ts @@ -1,9 +1,8 @@ import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; +import {MatCheckboxModule} from '@angular/material/checkbox'; import {MatDividerModule} from '@angular/material/divider'; import {MatIconModule} from '@angular/material/icon'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatLegacyTooltipModule} from '@angular/material/legacy-tooltip'; import {DiagnosticsViewModule} from 'org_xprof/frontend/app/components/diagnostics_view/diagnostics_view_module'; import {MaxHeapChartModule} from 'org_xprof/frontend/app/components/memory_viewer/max_heap_chart/max_heap_chart_module'; import {ProgramOrderChartModule} from 'org_xprof/frontend/app/components/memory_viewer/program_order_chart/program_order_chart_module'; @@ -20,7 +19,6 @@ import {MemoryViewerMain} from './memory_viewer_main'; MaxHeapChartModule, MatCheckboxModule, MatIconModule, - MatLegacyTooltipModule, ProgramOrderChartModule, ], exports: [MemoryViewerMain] diff --git a/frontend/app/components/op_profile/BUILD b/frontend/app/components/op_profile/BUILD index d9df6e69..7561295d 100644 --- a/frontend/app/components/op_profile/BUILD +++ b/frontend/app/components/op_profile/BUILD @@ -23,8 +23,8 @@ xprof_ng_module( "@org_xprof//frontend/app/common/angular:angular_material_form_field", "@org_xprof//frontend/app/common/angular:angular_material_icon", "@org_xprof//frontend/app/common/angular:angular_material_input", - "@org_xprof//frontend/app/common/angular:angular_material_legacy_tooltip", "@org_xprof//frontend/app/common/angular:angular_material_slide_toggle", + "@org_xprof//frontend/app/common/angular:angular_material_tooltip", "@org_xprof//frontend/app/common/interfaces", "@org_xprof//frontend/app/components/op_profile/op_table", "@org_xprof//frontend/app/services/data_service", diff --git a/frontend/app/components/op_profile/op_profile_module.ts b/frontend/app/components/op_profile/op_profile_module.ts index 9ae0080a..c73161f3 100644 --- a/frontend/app/components/op_profile/op_profile_module.ts +++ b/frontend/app/components/op_profile/op_profile_module.ts @@ -2,8 +2,8 @@ import {NgModule} from '@angular/core'; import {MatFormFieldModule} from '@angular/material/form-field'; import {MatIconModule} from '@angular/material/icon'; import {MatInputModule} from '@angular/material/input'; -import {MatLegacyTooltipModule} from '@angular/material/legacy-tooltip'; import {MatSlideToggleModule} from '@angular/material/slide-toggle'; +import {MatTooltipModule} from '@angular/material/tooltip'; import {OpProfile} from './op_profile'; import {OpTableModule} from './op_table/op_table_module'; @@ -17,7 +17,7 @@ import {OpTableModule} from './op_table/op_table_module'; MatSlideToggleModule, OpTableModule, MatIconModule, - MatLegacyTooltipModule, + MatTooltipModule, ], exports: [OpProfile] }) diff --git a/frontend/app/components/overview/performance_summary/BUILD b/frontend/app/components/overview/performance_summary/BUILD index 2a2bd19d..6be88476 100644 --- a/frontend/app/components/overview/performance_summary/BUILD +++ b/frontend/app/components/overview/performance_summary/BUILD @@ -18,7 +18,7 @@ xprof_ng_module( "@npm//@angular/core", "@org_xprof//frontend/app/common/angular:angular_material_card", "@org_xprof//frontend/app/common/angular:angular_material_icon", - "@org_xprof//frontend/app/common/angular:angular_material_legacy_tooltip", + "@org_xprof//frontend/app/common/angular:angular_material_tooltip", "@org_xprof//frontend/app/common/interfaces", ], ) diff --git a/frontend/app/components/overview/performance_summary/performance_summary_module.ts b/frontend/app/components/overview/performance_summary/performance_summary_module.ts index b7d2a782..882de447 100644 --- a/frontend/app/components/overview/performance_summary/performance_summary_module.ts +++ b/frontend/app/components/overview/performance_summary/performance_summary_module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {MatIconModule} from '@angular/material/icon'; import {MatCardModule} from '@angular/material/card'; -import {MatLegacyTooltipModule} from '@angular/material/legacy-tooltip'; +import {MatTooltipModule} from '@angular/material/tooltip'; import {PerformanceSummary} from './performance_summary'; @@ -12,7 +12,7 @@ import {PerformanceSummary} from './performance_summary'; CommonModule, MatCardModule, MatIconModule, - MatLegacyTooltipModule, + MatTooltipModule, ], exports: [PerformanceSummary] }) diff --git a/frontend/styles.scss b/frontend/styles.scss index 92239fe5..fda9f065 100644 --- a/frontend/styles.scss +++ b/frontend/styles.scss @@ -43,6 +43,7 @@ $theme: mat.define-light-theme( @include mat.radio-theme($theme); @include mat.snack-bar-theme($theme); @include mat.slider-theme($theme); +@include mat.tooltip-theme($theme); html, body { height: 100%; @@ -57,7 +58,7 @@ body { z-index: 10; } -.mat-tooltip { +.mat-mdc-tooltip { font-size: 12px; }