Skip to content

Commit 3c5cc9b

Browse files
committed
Refactor app module and actions component
1 parent b0738ae commit 3c5cc9b

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

src/app/app.module.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ import { ChartLineUsageDailyComponent } from './components/usage/actions/charts/
1515
import { HttpClientModule } from '@angular/common/http';
1616
import { ChartPieSkuComponent } from './components/usage/actions/charts/chart-pie-sku/chart-pie-sku.component';
1717
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
18-
import { ActionsUsageComponent } from './components/usage/actions/actions.component';
18+
import { ActionsComponent } from './components/usage/actions/actions.component';
1919
import { SharedStorageComponent } from './components/usage/shared-storage/shared-storage.component';
2020
import { TableSharedStorageComponent } from './components/usage/shared-storage/table-shared-storage/table-shared-storage.component';
2121
import { LineUsageTimeComponent } from './components/usage/shared-storage/charts/line-usage-time/line-usage-time.component';
2222
import { CopilotComponent } from './components/usage/copilot/copilot.component';
2323
import { DialogBillingNavigateComponent } from './components/usage/dialog-billing-navigate';
2424
import { TableCopilotUsageComponent } from './components/usage/copilot/table-workflow-usage/table-copilot-usage.component';
25+
import { AppRoutingModule } from './app-routing.module';
26+
import { RouterModule } from '@angular/router';
2527

2628
@NgModule({
2729
declarations: [
@@ -32,7 +34,7 @@ import { TableCopilotUsageComponent } from './components/usage/copilot/table-wor
3234
ChartBarTopTimeComponent,
3335
TableWorkflowUsageComponent,
3436
ChartPieSkuComponent,
35-
ActionsUsageComponent,
37+
ActionsComponent,
3638
SharedStorageComponent,
3739
FileUploadComponent,
3840
TableSharedStorageComponent,
@@ -48,7 +50,13 @@ import { TableCopilotUsageComponent } from './components/usage/copilot/table-wor
4850
HighchartsChartModule,
4951
HttpClientModule,
5052
FormsModule,
51-
ReactiveFormsModule
53+
ReactiveFormsModule,
54+
AppRoutingModule,
55+
RouterModule.forRoot([
56+
{ path: 'actions', component: ActionsComponent },
57+
{ path: 'copilot', component: CopilotComponent },
58+
{ path: 'shared-storage', component: SharedStorageComponent },
59+
])
5260
],
5361
providers: [],
5462
bootstrap: [AppComponent]

src/app/components/usage/actions/actions.component.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
22

3-
import { ActionsUsageComponent } from './actions.component';
3+
import { ActionsComponent } from './actions.component';
44

5-
describe('ActionsUsageComponent', () => {
6-
let component: ActionsUsageComponent;
7-
let fixture: ComponentFixture<ActionsUsageComponent>;
5+
describe('ActionsComponent', () => {
6+
let component: ActionsComponent;
7+
let fixture: ComponentFixture<ActionsComponent>;
88

99
beforeEach(async () => {
1010
await TestBed.configureTestingModule({
11-
imports: [ActionsUsageComponent]
11+
imports: [ActionsComponent]
1212
})
1313
.compileComponents();
1414

15-
fixture = TestBed.createComponent(ActionsUsageComponent);
15+
fixture = TestBed.createComponent(ActionsComponent);
1616
component = fixture.componentInstance;
1717
fixture.detectChanges();
1818
});

src/app/components/usage/actions/actions.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { CustomUsageReportLine, UsageReportService } from 'src/app/usage-report.
66
templateUrl: './actions.component.html',
77
styleUrl: './actions.component.scss'
88
})
9-
export class ActionsUsageComponent implements OnInit {
9+
export class ActionsComponent implements OnInit {
1010
@Input() data!: CustomUsageReportLine[];
1111
@Input() currency!: string;
1212
totalMinutes: number = 0;

0 commit comments

Comments
 (0)