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: checkbox

PiperOrigin-RevId: 565192999
  • Loading branch information
zzzaries authored and Copybara-Service committed Sep 14, 2023
1 parent fdb11fa commit 996e873
Show file tree
Hide file tree
Showing 67 changed files with 202 additions and 191 deletions.
12 changes: 6 additions & 6 deletions frontend/app/common/angular/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ts_library(
)

ts_library(
name = "angular_material_legacy_form_field",
name = "angular_material_form_field",
srcs = [],
deps = [
"@npm//@angular/material",
Expand All @@ -51,7 +51,7 @@ ts_library(
)

ts_library(
name = "angular_material_legacy_input",
name = "angular_material_input",
srcs = [],
deps = [
"@npm//@angular/material",
Expand Down Expand Up @@ -91,7 +91,7 @@ ts_library(
)

ts_library(
name = "angular_material_legacy_checkbox",
name = "angular_material_checkbox",
srcs = [],
deps = [
"@npm//@angular/material",
Expand Down Expand Up @@ -131,7 +131,7 @@ ts_library(
)

ts_library(
name = "angular_material_legacy_card",
name = "angular_material_card",
srcs = [],
deps = [
"@npm//@angular/material",
Expand Down Expand Up @@ -163,15 +163,15 @@ ts_library(
)

ts_library(
name = "angular_material_legacy_core",
name = "angular_material_core",
srcs = [],
deps = [
"@npm//@angular/material",
],
)

ts_library(
name = "angular_material_legacy_select",
name = "angular_material_select",
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
@@ -1,5 +1,5 @@
load("//defs:defs.bzl", "xprof_ng_module")
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
load("//defs:defs.bzl", "xprof_ng_module")

package(default_visibility = ["//frontend:internal"])

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("//defs:defs.bzl", "xprof_ng_module")
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
load("//defs:defs.bzl", "xprof_ng_module")

package(default_visibility = ["//frontend:internal"])

Expand All @@ -20,12 +20,12 @@ xprof_ng_module(
"@npm//@angular/platform-browser",
"@org_xprof//frontend/app/common/angular:angular_material_button",
"@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_dialog",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_form_field",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_input",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_radio",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_select",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_tooltip",
"@org_xprof//frontend/app/common/angular:angular_material_select",
"@org_xprof//frontend/app/common/interfaces",
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</div>

<div>
<mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Host Trace (TraceMe) Level</mat-label>
<mat-select
matTooltip="{{ hostTracerTooltip }}"
Expand All @@ -55,7 +55,7 @@
</div>

<div>
<mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Device Trace Level</mat-label>
<mat-select [(ngModel)]="deviceTracerLevel">
<mat-option value="0">disable</mat-option>
Expand All @@ -65,7 +65,7 @@
</div>

<div>
<mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Python Trace Level</mat-label>
<mat-select [(ngModel)]="pythonTracerLevel">
<mat-option value="0">disable</mat-option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import {FormsModule} from '@angular/forms';
import {MatExpansionModule} from '@angular/material/expansion';
import {MatButtonModule} from '@angular/material/button';
import {MatLegacyDialogModule} from '@angular/material/legacy-dialog';
import {MatLegacyFormFieldModule} from '@angular/material/legacy-form-field';
import {MatLegacyInputModule} from '@angular/material/legacy-input';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatInputModule} from '@angular/material/input';
import {MatLegacyRadioModule} from '@angular/material/legacy-radio';
import {MatLegacySelectModule} from '@angular/material/legacy-select';
import {MatSelectModule} from '@angular/material/select';
import {MatLegacyTooltipModule} from '@angular/material/legacy-tooltip';
import {BrowserModule} from '@angular/platform-browser';

Expand All @@ -23,10 +23,10 @@ import {CaptureProfileDialog} from './capture_profile_dialog';
MatButtonModule,
MatLegacyDialogModule,
MatExpansionModule,
MatLegacyFormFieldModule,
MatLegacyInputModule,
MatFormFieldModule,
MatInputModule,
MatLegacyRadioModule,
MatLegacySelectModule,
MatSelectModule,
MatLegacyTooltipModule,
],
exports: [CaptureProfileDialog]
Expand Down
6 changes: 3 additions & 3 deletions frontend/app/components/chart/table/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ xprof_ng_module(
deps = [
"@npm//@angular/core",
"@npm//@types/google.visualization",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_core",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_form_field",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_select",
"@org_xprof//frontend/app/common/angular:angular_material_core",
"@org_xprof//frontend/app/common/angular:angular_material_form_field",
"@org_xprof//frontend/app/common/angular:angular_material_select",
],
)

Expand Down
2 changes: 1 addition & 1 deletion frontend/app/components/chart/table/table.ng.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div [style.height]="height">
<mat-form-field *ngIf="displayPageSizeSelector()">
<mat-form-field *ngIf="displayPageSizeSelector()" appearance="outline">
<mat-label>Rows per Page: </mat-label>
<mat-select (selectionChange)="drawTable()" [(value)]="pageSize">
<mat-option *ngFor="let option of pageSizeOptions" [value]="option">{{option}}</mat-option>
Expand Down
12 changes: 6 additions & 6 deletions frontend/app/components/chart/table/table_module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {MatLegacyOptionModule} from '@angular/material/legacy-core';
import {MatLegacyFormFieldModule} from '@angular/material/legacy-form-field';
import {MatLegacySelectModule} from '@angular/material/legacy-select';
import {MatOptionModule} from '@angular/material/core';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatSelectModule} from '@angular/material/select';

import {Table} from './table';

Expand All @@ -11,9 +11,9 @@ import {Table} from './table';
declarations: [Table],
imports: [
CommonModule,
MatLegacyOptionModule,
MatLegacySelectModule,
MatLegacyFormFieldModule,
MatOptionModule,
MatSelectModule,
MatFormFieldModule,
],
exports: [Table],
})
Expand Down
6 changes: 3 additions & 3 deletions frontend/app/components/controls/category_filter/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ xprof_ng_module(
"@npm//@angular/common",
"@npm//@angular/core",
"@npm//@types/google.visualization",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_core",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_form_field",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_select",
"@org_xprof//frontend/app/common/angular:angular_material_core",
"@org_xprof//frontend/app/common/angular:angular_material_form_field",
"@org_xprof//frontend/app/common/angular:angular_material_select",
],
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<mat-form-field class="control" *ngIf="columnLabel">
<mat-form-field class="control" *ngIf="columnLabel" appearance="outline">
<mat-label>{{columnLabel}}</mat-label>
<mat-select (selectionChange)="updateFilter()" [(value)]="value">
<mat-option *ngFor="let option of options" [value]="option">{{option}}</mat-option>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {MatLegacyOptionModule} from '@angular/material/legacy-core';
import {MatLegacyFormFieldModule} from '@angular/material/legacy-form-field';
import {MatLegacySelectModule} from '@angular/material/legacy-select';
import {MatOptionModule} from '@angular/material/core';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatSelectModule} from '@angular/material/select';

import {CategoryFilter} from './category_filter';

Expand All @@ -11,9 +11,9 @@ import {CategoryFilter} from './category_filter';
declarations: [CategoryFilter],
imports: [
CommonModule,
MatLegacyOptionModule,
MatLegacyFormFieldModule,
MatLegacySelectModule,
MatOptionModule,
MatFormFieldModule,
MatSelectModule,
],
exports: [CategoryFilter],
})
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/components/controls/string_filter/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ xprof_ng_module(
"@npm//@angular/common",
"@npm//@angular/core",
"@npm//@types/google.visualization",
"@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_legacy_form_field",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_input",
"@org_xprof//frontend/app/common/angular:angular_material_input",
],
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<mat-form-field class="input-control" *ngIf="columnLabel">
<mat-form-field class="control" *ngIf="columnLabel" style="margin-right:8px;">
<mat-label>{{columnLabel}}</mat-label>
<input
matInput
[placeholder]="columnLabel"
[value]="value"
(input)="value = $event.target.value; updateFilter()"
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
/** CSS for a stats table component. */
/** CSS for string filter component. */

@import 'frontend/app/styles/common';

mat-icon {
color: $button-focus-color;
vertical-align: bottom;
}

// This control class never works for unknown reason
// added inline style instead
.control {
width: 240px;
margin-right: 8px;
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {MatIconModule} from '@angular/material/icon';
import {MatLegacyFormFieldModule} from '@angular/material/legacy-form-field';
import {MatLegacyInputModule} from '@angular/material/legacy-input';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatInputModule} from '@angular/material/input';

import {StringFilter} from './string_filter';

Expand All @@ -11,9 +11,9 @@ import {StringFilter} from './string_filter';
declarations: [StringFilter],
imports: [
CommonModule,
MatLegacyFormFieldModule,
MatFormFieldModule,
MatIconModule,
MatLegacyInputModule,
MatInputModule,
],
exports: [StringFilter],
})
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/components/graph_viewer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ xprof_ng_module(
"@npm//@angular/router",
"@npm//@ngrx/store",
"@npm//rxjs",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_core",
"@org_xprof//frontend/app/common/angular:angular_material_core",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_progress_bar",
"@org_xprof//frontend/app/common/angular:angular_material_sidenav",
"@org_xprof//frontend/app/common/constants",
Expand Down
10 changes: 5 additions & 5 deletions frontend/app/components/graph_viewer/graph_config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ xprof_ng_module(
"@npm//@angular/forms",
"@npm//rxjs",
"@org_xprof//frontend/app/common/angular:angular_material_button",
"@org_xprof//frontend/app/common/angular:angular_material_checkbox",
"@org_xprof//frontend/app/common/angular:angular_material_core",
"@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_legacy_checkbox",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_core",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_form_field",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_input",
"@org_xprof//frontend/app/common/angular:angular_material_legacy_select",
"@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/interfaces",
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div class="item-container">
<div class="form-container">
<form (ngSubmit)="onSubmit()">
<div class="row" *ngIf="!isHloOssTool" id="xla-module-list-header">
<div [ngClass]="{ 'mat-subheading-2': true }">
XLA Modules ({{ moduleList.length }})
</div>
</div>
<mat-form-field class="full-width" *ngIf="!isHloOssTool" id="xla-module-list-selector">
<mat-form-field class="full-width" *ngIf="!isHloOssTool" id="xla-module-list-selector" appearance="outline">
<mat-select
name="selectedModule"
panelClass="panel-override"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

@import 'frontend/app/styles/common';

.item-container {
padding: 20px 20px 0;
}

.mat-subheading-2 {
margin-bottom: 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {MatIconModule} from '@angular/material/icon';
import {MatButtonModule} from '@angular/material/button';
import {MatLegacyCheckboxModule} from '@angular/material/legacy-checkbox';
import {MatLegacyOptionModule} from '@angular/material/legacy-core';
import {MatLegacyFormFieldModule} from '@angular/material/legacy-form-field';
import {MatLegacyInputModule} from '@angular/material/legacy-input';
import {MatLegacySelectModule} from '@angular/material/legacy-select';
import {MatCheckboxModule} from '@angular/material/checkbox';
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 {MatSidenavModule} from '@angular/material/sidenav';

Expand All @@ -18,12 +18,12 @@ import {GraphConfig} from './graph_config';
CommonModule,
FormsModule,
MatButtonModule,
MatLegacyCheckboxModule,
MatLegacyFormFieldModule,
MatCheckboxModule,
MatFormFieldModule,
MatIconModule,
MatLegacyInputModule,
MatLegacyOptionModule,
MatLegacySelectModule,
MatInputModule,
MatOptionModule,
MatSelectModule,
MatSidenavModule,
MatLegacyTooltipModule,
],
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/components/graph_viewer/graph_viewer.ng.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<mat-sidenav-container>
<mat-sidenav mode="side" opened>
<div class="row">
<div class="item-container">
<graph-config [initialInputs]="initialParams" [moduleList]="moduleList" [isHloOssTool]="true" (plot)="onPlot()" (update)="onUpdateParam($event)"></graph-config>
</div>
</mat-sidenav>
Expand Down
Loading

0 comments on commit 996e873

Please sign in to comment.