Skip to content

Commit

Permalink
Migration to use the new MDC-based Angular Components. Components mig…
Browse files Browse the repository at this point in the history
…rated: snack-bar

PiperOrigin-RevId: 565194998
  • Loading branch information
zzzaries authored and copybara-github committed Sep 18, 2023
1 parent c745837 commit 0815e0b
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 231 deletions.
4 changes: 2 additions & 2 deletions frontend/app/common/angular/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ ts_library(
)

ts_library(
name = "angular_material_legacy_snack_bar",
name = "angular_material_snack_bar",
srcs = [],
deps = [
"@npm//@angular/material",
Expand All @@ -147,7 +147,7 @@ ts_library(
)

ts_library(
name = "angular_material_legacy_slider",
name = "angular_material_slider",
srcs = [],
deps = [
"@npm//@angular/material",
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/components/capture_profile/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ xprof_ng_module(
"@npm//rxjs",
"@org_xprof//frontend/app/common/angular:angular_material_button",
"@org_xprof//frontend/app/common/angular:angular_material_dialog",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_snack_bar",
"@org_xprof//frontend/app/common/angular:angular_material_progress_spinner",
"@org_xprof//frontend/app/common/angular:angular_material_snack_bar",
"@org_xprof//frontend/app/common/interfaces",
"@org_xprof//frontend/app/components/capture_profile/capture_profile_dialog",
"@org_xprof//frontend/app/services/data_service",
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/components/capture_profile/capture_profile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component, OnDestroy} from '@angular/core';
import {MatDialog} from '@angular/material/dialog';
import {MatLegacySnackBar} from '@angular/material/legacy-snack-bar';
import {MatSnackBar} from '@angular/material/snack-bar';
import {Store} from '@ngrx/store';
import {CaptureProfileOptions, CaptureProfileResponse} from 'org_xprof/frontend/app/common/interfaces/capture_profile';
import {DataService} from 'org_xprof/frontend/app/services/data_service/data_service';
Expand Down Expand Up @@ -28,7 +28,7 @@ export class CaptureProfile implements OnDestroy {

constructor(
private readonly dialog: MatDialog,
private readonly snackBar: MatLegacySnackBar,
private readonly snackBar: MatSnackBar,
private readonly dataService: DataService,
private readonly store: Store<{}>) {
this.capturingProfile = this.store.select(getCapturingProfileState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {NgModule} from '@angular/core';
import {MatButtonModule} from '@angular/material/button';
import {MatDialogModule} from '@angular/material/dialog';
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
import {MatLegacySnackBarModule} from '@angular/material/legacy-snack-bar';
import {MatSnackBarModule} from '@angular/material/snack-bar';

import {CaptureProfile} from './capture_profile';
import {CaptureProfileDialog} from './capture_profile_dialog/capture_profile_dialog';
Expand All @@ -18,7 +18,7 @@ import {CaptureProfileDialogModule} from './capture_profile_dialog/capture_profi
MatDialogModule,
MatProgressSpinnerModule,
CaptureProfileDialogModule,
MatLegacySnackBarModule,
MatSnackBarModule,
],
exports: [CaptureProfile],
entryComponents: [CaptureProfileDialog],
Expand Down
1 change: 0 additions & 1 deletion frontend/app/components/op_profile/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ 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_slider",
"@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/interfaces",
Expand Down
6 changes: 2 additions & 4 deletions frontend/app/components/op_profile/op_profile_module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {NgModule} from '@angular/core';
import {MatIconModule} from '@angular/material/icon';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatIconModule} from '@angular/material/icon';
import {MatInputModule} from '@angular/material/input';
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import {MatLegacySliderModule} from '@angular/material/legacy-slider';
import {MatLegacyTooltipModule} from '@angular/material/legacy-tooltip';
import {MatSlideToggleModule} from '@angular/material/slide-toggle';

import {OpProfile} from './op_profile';
import {OpTableModule} from './op_table/op_table_module';
Expand All @@ -15,7 +14,6 @@ import {OpTableModule} from './op_table/op_table_module';
imports: [
MatFormFieldModule,
MatInputModule,
MatLegacySliderModule,
MatSlideToggleModule,
OpTableModule,
MatIconModule,
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/components/pod_viewer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ xprof_ng_module(
"@npm//@ngrx/store",
"@npm//rxjs",
"@org_xprof//frontend/app/common/angular:angular_material_divider",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_slider",
"@org_xprof//frontend/app/common/angular:angular_material_slider",
"@org_xprof//frontend/app/common/constants",
"@org_xprof//frontend/app/common/interfaces",
"@org_xprof//frontend/app/common/utils",
Expand Down
3 changes: 1 addition & 2 deletions frontend/app/components/pod_viewer/pod_viewer.ng.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
<mat-slider
[min]="minStep"
[max]="maxStep"
[step]="1"
(change)="updateSelectedStep($event.value)">
[step]="1" #ngSlider><input matSliderThumb (change)="updateSelectedStep({source: ngSliderThumb, parent: ngSlider, value: ngSliderThumb.value}.value)" #ngSliderThumb="matSliderThumb" />
</mat-slider>
</div>
<div *ngIf="topology">
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/components/pod_viewer/pod_viewer_module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {MatDividerModule} from '@angular/material/divider';
import {MatLegacySliderModule} from '@angular/material/legacy-slider';
import {MatSliderModule} from '@angular/material/slider';
import {DiagnosticsViewModule} from 'org_xprof/frontend/app/components/diagnostics_view/diagnostics_view_module';

import {PodViewer} from './pod_viewer';
Expand All @@ -15,7 +15,7 @@ import {TopologyGraphModule} from './topology_graph/topology_graph_module';
CommonModule,
DiagnosticsViewModule,
MatDividerModule,
MatLegacySliderModule,
MatSliderModule,
StackBarChartModule,
TopologyGraphModule,
],
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/components/pod_viewer/topology_graph/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,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_slider",
"@org_xprof//frontend/app/common/angular:angular_material_menu",
"@org_xprof//frontend/app/common/angular:angular_material_slider",
"@org_xprof//frontend/app/common/constants",
"@org_xprof//frontend/app/common/interfaces",
"@org_xprof//frontend/app/common/utils",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
<mat-slider
[min]="0"
[max]="channelCount"
[step]="1"
[value]="selectedChannelIndex"
(change)="updateChannelIndex($event.value)">
[step]="1" #ngSlider><input matSliderThumb [value]="selectedChannelIndex" (change)="updateChannelIndex({source: ngSliderThumb, parent: ngSlider, value: ngSliderThumb.value}.value)" #ngSliderThumb="matSliderThumb" />
</mat-slider>
<mat-form-field class="channel-input" appearance="outline">
<mat-label>Channel id</mat-label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {MatButtonModule} from '@angular/material/button';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatInputModule} from '@angular/material/input';
import {MatMenuModule} from '@angular/material/menu';
import {MatLegacySliderModule} from '@angular/material/legacy-slider';
import {MatSliderModule} from '@angular/material/slider';

import {TopologyGraph} from './topology_graph';

Expand All @@ -19,7 +19,7 @@ import {TopologyGraph} from './topology_graph';
MatIconModule,
MatInputModule,
MatMenuModule,
MatLegacySliderModule,
MatSliderModule,
],
exports: [TopologyGraph]
})
Expand Down
29 changes: 0 additions & 29 deletions frontend/app/components/range_slider/BUILD

This file was deleted.

16 changes: 0 additions & 16 deletions frontend/app/components/range_slider/README.md

This file was deleted.

17 changes: 0 additions & 17 deletions frontend/app/components/range_slider/range_slider.ng.html

This file was deleted.

43 changes: 0 additions & 43 deletions frontend/app/components/range_slider/range_slider.scss

This file was deleted.

90 changes: 0 additions & 90 deletions frontend/app/components/range_slider/range_slider.ts

This file was deleted.

13 changes: 0 additions & 13 deletions frontend/app/components/range_slider/range_slider_module.ts

This file was deleted.

2 changes: 2 additions & 0 deletions frontend/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ $theme: mat.define-light-theme(
@include mat.progress-bar-theme($theme);
@include mat.slide-toggle-theme(map-merge($theme, (density: -5)));
@include mat.radio-theme($theme);
@include mat.snack-bar-theme($theme);
@include mat.slider-theme($theme);

html, body {
height: 100%;
Expand Down

0 comments on commit 0815e0b

Please sign in to comment.