1/**
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16// Angular modules.
17import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
18import { BrowserModule } from '@angular/platform-browser';
19import { FormsModule } from '@angular/forms';
20import { HttpClientModule } from '@angular/common/http';
21import { NgModule } from '@angular/core';
22import { RouterModule, Routes } from '@angular/router';
23
24// Angular Material modules
25import { MatButtonModule } from '@angular/material/button';
26import { MatCardModule } from '@angular/material/card';
27import { MatChipsModule } from '@angular/material/chips';
28import { MatExpansionModule } from '@angular/material/expansion';
29import { MatFormFieldModule } from '@angular/material/form-field';
30import { MatIconModule } from '@angular/material';
31import { MatInputModule } from '@angular/material/input';
32import { MatListModule } from '@angular/material/list';
33import { MatPaginatorModule } from '@angular/material/paginator';
34import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
35import { MatSnackBarModule } from '@angular/material/snack-bar';
36import { MatSelectModule } from '@angular/material/select';
37import { MatSidenavModule } from '@angular/material/sidenav';
38import { MatSortModule } from '@angular/material/sort';
39import { MatTableModule } from '@angular/material/table';
40import { MatTabsModule } from '@angular/material/tabs';
41
42// User components.
43import { AppComponent } from './app.component';
44import { BuildComponent } from './menu/build/build.component';
45import { DashboardComponent } from './menu/dashboard/dashboard.component';
46import { DeviceComponent } from './menu/device/device.component';
47import { FilterComponent } from './shared/filter/filter.component';
48import { JobComponent } from './menu/job/job.component';
49import { LabComponent } from './menu/lab/lab.component';
50import { ScheduleComponent } from './menu/schedule/schedule.component';
51
52// User modules.
53import { NavModule } from './shared/navbar/navbar';
54
55// Other dependencies.
56import { FlexLayoutModule } from '@angular/flex-layout';
57
58// User directives for CDK (Component Development Kit).
59import { CdkDetailRowDirective } from './menu/cdk-detail-row.directive';
60
61
62const appRoutes: Routes = [
63  { path: 'device', component: DeviceComponent },
64  { path: 'build', component: BuildComponent },
65  { path: 'job', component: JobComponent },
66  { path: 'lab', component: LabComponent },
67  { path: 'schedule', component: ScheduleComponent },
68  { path: '', component: DashboardComponent },
69  { path: '**', redirectTo: '/', pathMatch: 'full' }
70];
71
72
73@NgModule({
74  imports: [
75    MatButtonModule,
76    MatCardModule,
77    MatChipsModule,
78    MatExpansionModule,
79    MatFormFieldModule,
80    MatIconModule,
81    MatInputModule,
82    MatListModule,
83    MatPaginatorModule,
84    MatProgressSpinnerModule,
85    MatSnackBarModule,
86    MatSelectModule,
87    MatSidenavModule,
88    MatSortModule,
89    MatTableModule,
90    MatTabsModule,
91  ],
92  exports: [
93    MatButtonModule,
94    MatCardModule,
95    MatChipsModule,
96    MatExpansionModule,
97    MatFormFieldModule,
98    MatIconModule,
99    MatInputModule,
100    MatListModule,
101    MatPaginatorModule,
102    MatProgressSpinnerModule,
103    MatSnackBarModule,
104    MatSelectModule,
105    MatSidenavModule,
106    MatSortModule,
107    MatTableModule,
108    MatTabsModule,
109  ]
110})
111export class MaterialModule {}
112
113
114@NgModule({
115  declarations: [
116    AppComponent,
117    BuildComponent,
118    CdkDetailRowDirective,
119    DashboardComponent,
120    DeviceComponent,
121    FilterComponent,
122    JobComponent,
123    LabComponent,
124    ScheduleComponent,
125  ],
126  imports: [
127    BrowserAnimationsModule,
128    BrowserModule,
129    FlexLayoutModule,
130    FormsModule,
131    HttpClientModule,
132    MaterialModule,
133    NavModule,
134    RouterModule.forRoot(
135      appRoutes
136    ),
137  ],
138  providers: [],
139  bootstrap: [AppComponent]
140})
141export class AppModule { }
142