Skip to content

Commit 5b1d246

Browse files
committed
refactor: migrate all components to standalone
1 parent 3ca5e9e commit 5b1d246

52 files changed

Lines changed: 409 additions & 216 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/app/app.component.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import { TitleService } from './service/title.service';
1212

1313
class MockThemeService {
1414
initTheme() {}
15+
getTheme() {
16+
return 'light';
17+
}
18+
setTheme(theme: string) {}
1519
}
1620

1721
class MockTitleService {
@@ -27,13 +31,13 @@ describe('AppComponent', () => {
2731

2832
beforeEach(async () => {
2933
await TestBed.configureTestingModule({
30-
declarations: [AppComponent],
3134
imports: [
3235
RouterTestingModule,
3336
MatToolbarModule,
3437
MatIconModule,
3538
MatSidenavModule,
3639
BrowserAnimationsModule,
40+
AppComponent,
3741
],
3842
providers: [
3943
{ provide: ThemeService, useClass: MockThemeService },

src/app/app.component.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,31 @@ import { Component, OnInit, OnDestroy } from '@angular/core';
22
import { Subject, takeUntil } from 'rxjs';
33
import { ThemeService } from './service/theme.service';
44
import { TitleService } from './service/title.service';
5+
import { SidenavButtonsComponent } from './component/sidenav-buttons/sidenav-buttons.component';
6+
import { MatSidenavModule } from '@angular/material/sidenav';
7+
import { NgIf } from '@angular/common';
8+
import { LogoComponent } from './component/logo/logo.component';
9+
import { RouterLink, RouterOutlet } from '@angular/router';
10+
import { MatIconModule } from '@angular/material/icon';
11+
import { MatButtonModule } from '@angular/material/button';
12+
import { MatToolbarModule } from '@angular/material/toolbar';
513

614
@Component({
715
selector: 'app-root',
816
templateUrl: './app.component.html',
917
styleUrls: ['./app.component.css'],
18+
standalone: true,
19+
imports: [
20+
MatToolbarModule,
21+
MatButtonModule,
22+
MatIconModule,
23+
RouterLink,
24+
LogoComponent,
25+
NgIf,
26+
MatSidenavModule,
27+
SidenavButtonsComponent,
28+
RouterOutlet,
29+
],
1030
})
1131
export class AppComponent implements OnInit, OnDestroy {
1232
title = '';

src/app/app.module.ts

Lines changed: 0 additions & 97 deletions
This file was deleted.

src/app/component/activity-description/activity-description.component.spec.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { MockLoaderService } from 'src/app/service/loader/mock-data-loader.servi
1111
import { MarkdownText } from 'src/app/model/markdown-text';
1212
import { Data } from 'src/app/model/activity-store';
1313
import { isEmptyObj } from 'src/app/util/util';
14-
import { MaterialModule } from 'src/app/material/material.module';
14+
1515
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
1616
import { DataStore } from 'src/app/model/data-store';
1717

@@ -48,6 +48,8 @@ let mockData = {
4848
@Component({
4949
selector: 'app-dependency-graph',
5050
template: '',
51+
standalone: true,
52+
imports: [RouterTestingModule],
5153
})
5254
class DependencyGraphStubComponent {
5355
@Input() activityName: string = '';
@@ -69,8 +71,13 @@ describe('ActivityDescriptionComponent', () => {
6971
{ provide: ActivatedRoute, useValue: mockActivatedRoute },
7072
{ provide: LoaderService, useValue: mockLoaderService },
7173
],
72-
imports: [RouterTestingModule, MaterialModule, NoopAnimationsModule],
73-
declarations: [ActivityDescriptionComponent, DependencyGraphStubComponent],
74+
imports: [
75+
RouterTestingModule,
76+
77+
NoopAnimationsModule,
78+
ActivityDescriptionComponent,
79+
DependencyGraphStubComponent,
80+
],
7481
}).compileComponents();
7582
});
7683

src/app/component/activity-description/activity-description.component.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,30 @@ import {
1010
OnInit,
1111
HostListener,
1212
} from '@angular/core';
13-
import { MatAccordion } from '@angular/material/expansion';
13+
import { MatAccordion, MatExpansionModule } from '@angular/material/expansion';
1414
import { Activity } from '../../model/activity-store';
1515
import { LoaderService } from '../../service/loader/data-loader.service';
1616
import { TeamName, ProgressTitle } from '../../model/types';
17+
import { EvidencePanelComponent } from '../evidence-panel/evidence-panel.component';
18+
import { DependencyGraphComponent } from '../dependency-graph/dependency-graph.component';
19+
import { MatButtonModule } from '@angular/material/button';
20+
import { MatIconModule } from '@angular/material/icon';
21+
import { NgIf, NgFor } from '@angular/common';
1722

1823
@Component({
1924
selector: 'app-activity-description',
2025
templateUrl: './activity-description.component.html',
2126
styleUrls: ['./activity-description.component.css'],
27+
standalone: true,
28+
imports: [
29+
NgIf,
30+
MatIconModule,
31+
MatButtonModule,
32+
MatExpansionModule,
33+
DependencyGraphComponent,
34+
NgFor,
35+
EvidencePanelComponent,
36+
],
2237
})
2338
export class ActivityDescriptionComponent implements OnInit, OnChanges {
2439
@Input() activity: Activity | null = null;

src/app/component/add-evidence-modal/add-evidence-modal.component.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
import { Component, Inject } from '@angular/core';
2-
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
2+
import { MAT_DIALOG_DATA, MatDialogRef, MatDialogModule } from '@angular/material/dialog';
33
import { EvidenceEntry, EvidenceStore } from '../../model/evidence-store';
44
import { TeamGroups } from '../../model/types';
5+
import { MatIconModule } from '@angular/material/icon';
6+
import { MatTooltipModule } from '@angular/material/tooltip';
7+
import { MatButtonModule } from '@angular/material/button';
8+
import { MatOptionModule } from '@angular/material/core';
9+
import { MatSelectModule } from '@angular/material/select';
10+
import { FormsModule } from '@angular/forms';
11+
import { MatInputModule } from '@angular/material/input';
12+
import { MatDividerModule } from '@angular/material/divider';
13+
import { MatFormFieldModule } from '@angular/material/form-field';
14+
import { NgIf, NgFor } from '@angular/common';
15+
import { TeamSelectorComponent } from '../team-selector/team-selector.component';
516

617
export interface AddEvidenceModalData {
718
activityUuid: string;
@@ -13,6 +24,22 @@ export interface AddEvidenceModalData {
1324
selector: 'app-add-evidence-modal',
1425
templateUrl: './add-evidence-modal.component.html',
1526
styleUrls: ['./add-evidence-modal.component.css'],
27+
standalone: true,
28+
imports: [
29+
MatDialogModule,
30+
TeamSelectorComponent,
31+
NgIf,
32+
MatFormFieldModule,
33+
MatDividerModule,
34+
MatInputModule,
35+
FormsModule,
36+
NgFor,
37+
MatSelectModule,
38+
MatOptionModule,
39+
MatButtonModule,
40+
MatTooltipModule,
41+
MatIconModule,
42+
],
1643
})
1744
export class AddEvidenceModalComponent {
1845
activityUuid: string;

src/app/component/dependency-graph/dependency-graph.component.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ describe('DependencyGraphComponent', () => {
99

1010
beforeEach(async () => {
1111
await TestBed.configureTestingModule({
12-
declarations: [DependencyGraphComponent],
13-
imports: [MatDialogModule],
12+
imports: [MatDialogModule, DependencyGraphComponent],
1413
providers: [HttpClient, HttpHandler],
1514
}).compileComponents();
1615
});

src/app/component/dependency-graph/dependency-graph.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ interface ThemeColors {
3737
selector: 'app-dependency-graph',
3838
templateUrl: './dependency-graph.component.html',
3939
styleUrls: ['./dependency-graph.component.css'],
40+
standalone: true,
4041
})
4142
export class DependencyGraphComponent implements OnInit, OnChanges {
4243
css: CSSStyleDeclaration = getComputedStyle(document.body);

src/app/component/evidence-panel/evidence-panel.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
22
import { EvidenceEntry } from '../../model/evidence-store';
33
import { LoaderService } from '../../service/loader/data-loader.service';
4+
import { MatIconModule } from '@angular/material/icon';
5+
import { MatExpansionModule } from '@angular/material/expansion';
6+
import { NgIf, NgFor, DatePipe } from '@angular/common';
47

58
@Component({
69
selector: 'app-evidence-panel',
710
templateUrl: './evidence-panel.component.html',
811
styleUrls: ['./evidence-panel.component.css'],
12+
standalone: true,
13+
imports: [NgIf, MatExpansionModule, NgFor, MatIconModule, DatePipe],
914
})
1015
export class EvidencePanelComponent implements OnChanges {
1116
@Input() activityUuid: string = '';

src/app/component/kpi/kpi.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Component, Input } from '@angular/core';
44
selector: 'app-kpi',
55
templateUrl: './kpi.component.html',
66
styleUrls: ['./kpi.component.css'],
7+
standalone: true,
78
})
89
export class KpiComponent {
910
@Input() title: string = '';

0 commit comments

Comments
 (0)