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: core, autocomplete, form-field, input, select

PiperOrigin-RevId: 565544760
  • Loading branch information
zzzaries authored and copybara-github committed Sep 15, 2023
1 parent 8c0a84d commit 2bcffaa
Show file tree
Hide file tree
Showing 53 changed files with 160 additions and 152 deletions.
8 changes: 4 additions & 4 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 @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 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_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_input",
"@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_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 @@ -4,10 +4,10 @@ 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 {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 @@ -19,11 +19,11 @@ import {GraphConfig} from './graph_config';
FormsModule,
MatButtonModule,
MatLegacyCheckboxModule,
MatLegacyFormFieldModule,
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
14 changes: 7 additions & 7 deletions frontend/app/components/graph_viewer/graph_viewer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
padding: 20px 20px 0;
}

.row {
display: flex;
}

mat-sidenav {
@include border-right-gray;
background: transparent;
width: 340px;
width: 25%;
min-width: 350px;
}

mat-sidenav-content {
width: 75%;
}

mat-sidenav-container {
Expand All @@ -25,7 +25,7 @@ iframe {
top: 0;
width: 100%;
height: 100%;
box-sizing: border-box;
border: none;
}

mat-progress-bar {
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/components/graph_viewer/graph_viewer_module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {MatLegacyOptionModule} from '@angular/material/legacy-core';
import {MatOptionModule} from '@angular/material/core';
import {MatLegacyProgressBarModule} from '@angular/material/legacy-progress-bar';
import {MatSidenavModule} from '@angular/material/sidenav';
import {DiagnosticsViewModule} from 'org_xprof/frontend/app/components/diagnostics_view/diagnostics_view_module';
Expand All @@ -13,7 +13,7 @@ import {GraphViewer} from './graph_viewer';
imports: [
CommonModule,
DiagnosticsViewModule,
MatLegacyOptionModule,
MatOptionModule,
MatLegacyProgressBarModule,
MatSidenavModule,
PipesModule,
Expand Down
Loading

0 comments on commit 2bcffaa

Please sign in to comment.