Skip to content

Commit f8421ab

Browse files
committed
clean up
1 parent 6b31912 commit f8421ab

File tree

16 files changed

+75
-84
lines changed

16 files changed

+75
-84
lines changed

rubberduckvba.client/package-lock.json

Lines changed: 29 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rubberduckvba.client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@angular/platform-browser": "^20.1.4",
2222
"@angular/platform-browser-dynamic": "^20.1.4",
2323
"@angular/router": "^20.1.4",
24-
"@fortawesome/angular-fontawesome": "^0.14.1",
24+
"@fortawesome/angular-fontawesome": "^3.0.0",
2525
"@fortawesome/fontawesome-free": "^6.5.2",
2626
"@fortawesome/fontawesome-svg-core": "^6.5.2",
2727
"@fortawesome/free-brands-svg-icons": "^6.5.2",

rubberduckvba.client/src/app/components/feature-info/feature-info.component.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}
99
<div [ngClass]="(feature?.name != 'CodeInspections' && feature?.name != 'CommentAnnotations') && (!links || links.length == 0) ? 'col-12' : 'col-lg-8'">
1010
<h2>{{feature?.title}}</h2>
11-
@if (feature && user?.isAdmin) {
11+
@if (feature && user.isAdmin) {
1212
<div>
1313
<edit-feature [feature]="feature" [action]="editAction"></edit-feature>
1414
</div>
@@ -17,7 +17,7 @@ <h2>{{feature?.title}}</h2>
1717
</div>
1818
<div [ngClass]="(feature?.name != 'CodeInspections' && feature?.name != 'CommentAnnotations') && (!links || links.length == 0) ? 'col-12' : 'col-lg-4'">
1919
<!-- subfeatures -->
20-
@if (user && feature != null && subfeatures != null && (subfeatures.length ?? 0) > 0) {
20+
@if (user && feature != null && subfeatures != null && subfeatures.length > 0) {
2121
<div>
2222
@for (subFeature of subfeatures; track subFeature) {
2323
<div>
@@ -49,7 +49,7 @@ <h2>{{feature?.title}}</h2>
4949

5050
<loading-content [show]="!feature"></loading-content>
5151

52-
@if (subfeatures && (subfeatures.length ?? 0) > 0 || (inspectionItems.length ?? 0) > 0) {
52+
@if ((subfeatures && subfeatures.length > 0) || (inspectionItems && inspectionItems.length > 0)) {
5353
<section class="row text-center mb-3">
5454
<div class="col-12">
5555
<img class="ducky my-2 w-10 hover-enlarge" alt="Rubberduck logo" src="../../assets/vector-ducky-dark.svg" />
@@ -59,9 +59,9 @@ <h2>{{feature?.title}}</h2>
5959
@if (user && feature) {
6060
<section class="row">
6161
<!-- subfeatures -->
62-
@if (feature != null && subfeatures != null && (subfeatures.length ?? 0) > 0) {
62+
@if (feature != null && subfeatures != null && subfeatures.length > 0) {
6363
<div class="col-12">
64-
@if (!feature.featureId && user?.isAdmin) {
64+
@if (!feature.featureId && user.isAdmin) {
6565
<edit-feature [feature]="feature" [action]="createAction"></edit-feature>
6666
}
6767
@for (subFeature of subfeatures; track subFeature) {
@@ -83,21 +83,21 @@ <h2>{{feature?.title}}</h2>
8383
</div>
8484
}
8585
<!-- xmldoc items -->
86-
@if ((inspectionItems.length ?? 0) > 0 || (annotationItems.length ?? 0) > 0 || (quickfixItems.length ?? 0) > 0) {
86+
@if (inspectionItems.length > 0 || annotationItems.length > 0 || quickfixItems.length > 0) {
8787
<div class="col-12">
8888
<h3>Search &amp; Filter</h3>
89-
@if (feature?.name == 'Inspections' && filteredItems.length != inspectionItems.length) {
89+
@if (feature.name == 'Inspections' && filteredItems.length != inspectionItems.length) {
9090
<small class="small text-black-50">Showing {{filteredItems.length}} of {{inspectionItems.length}} items</small>
9191
}
92-
@if (feature?.name == 'Annotations' && filteredItems.length != annotationItems.length) {
92+
@if (feature.name == 'Annotations' && filteredItems.length != annotationItems.length) {
9393
<small class="small text-black-50">Showing {{filteredItems.length}} of {{annotationItems.length}} items</small>
9494
}
95-
@if (feature?.name == 'QuickFixes' && filteredItems.length != quickfixItems.length) {
95+
@if (feature.name == 'QuickFixes' && filteredItems.length != quickfixItems.length) {
9696
<small class="small text-black-50">Showing {{filteredItems.length}} of {{quickfixItems.length}} items</small>
9797
}
9898
<div class="row my-3">
9999
<div class="col-8">
100-
@if (feature?.name == 'Inspections') {
100+
@if (feature.name == 'Inspections') {
101101
<div class="text-start">
102102
<div class="row my-1">
103103
<div class="col">
@@ -132,7 +132,7 @@ <h6>Search</h6>
132132
</div>
133133
</div>
134134
</div>
135-
@if (feature?.name == 'Inspections') {
135+
@if (feature.name == 'Inspections') {
136136
<div class="row">
137137
<div class="card-columns">
138138
@for (item of filteredItems; track item) {
@@ -145,7 +145,7 @@ <h6>Search</h6>
145145
</div>
146146
</div>
147147
}
148-
@if (feature?.name == 'Annotations') {
148+
@if (feature.name == 'Annotations') {
149149
<div class="row">
150150
<div class="card-columns">
151151
@for (item of filteredItems; track item) {
@@ -158,7 +158,7 @@ <h6>Search</h6>
158158
</div>
159159
</div>
160160
}
161-
@if (feature?.name == 'QuickFixes') {
161+
@if (feature.name == 'QuickFixes') {
162162
<div class="row">
163163
<div class="card-columns">
164164
@for (item of filteredItems; track item) {

rubberduckvba.client/src/app/routes/annotation/annotation.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@if (info) {
22
<div>
3-
@if ((info?.featureId) && info?.featureId != 0) {
3+
@if (info.featureId && info.featureId != 0) {
44
<p><a href="/">Home</a><a href="/features">Features</a><a href="/features/commentannotations">CommentAnnotations</a><a href="/features/annotations">Annotations</a></p>
55
}
66
<h1>{{info.title}}</h1>

rubberduckvba.client/src/app/routes/annotation/annotation.component.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { Component, OnInit } from "@angular/core";
22
import { ActivatedRoute } from "@angular/router";
3-
import { FaIconLibrary } from "@fortawesome/angular-fontawesome";
4-
import { fas } from "@fortawesome/free-solid-svg-icons";
53
import { BehaviorSubject, switchMap } from "rxjs";
64
import { AnnotationViewModel } from "../../model/feature.model";
75
import { ApiClientService } from "../../services/api-client.service";
@@ -22,13 +20,12 @@ export class AnnotationComponent implements OnInit {
2220
return this._info.getValue();
2321
}
2422

25-
constructor(private api: ApiClientService, private fa: FaIconLibrary, private route: ActivatedRoute) {
26-
fa.addIconPacks(fas);
23+
constructor(private api: ApiClientService, private route: ActivatedRoute) {
2724
}
2825

2926
ngOnInit(): void {
3027
this.route.paramMap.pipe(
31-
switchMap(params => {
28+
switchMap((params :any) => {
3229
const name = params.get('name')!;
3330
return this.api.getAnnotation(name);
3431
})).subscribe(e => {

rubberduckvba.client/src/app/routes/audits/audit-item/audit-item.component.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { Component, OnInit } from "@angular/core";
22
import { ApiClientService } from "../../../services/api-client.service";
33
import { ActivatedRoute } from "@angular/router";
4-
import { FaIconLibrary } from "@fortawesome/angular-fontawesome";
5-
import { fas } from "@fortawesome/free-solid-svg-icons";
64
import { BehaviorSubject, switchMap } from "rxjs";
75
import { AuditRecordViewModel, FeatureEditViewModel, FeatureOperationViewModel, UserActivityType } from "../../../model/feature.model";
86

@@ -19,14 +17,13 @@ export class AuditItemComponent implements OnInit {
1917

2018
private _isEdit: boolean = false;
2119

22-
constructor(private fa: FaIconLibrary, private api: ApiClientService, private route: ActivatedRoute) {
23-
fa.addIconPacks(fas);
20+
constructor(private api: ApiClientService, private route: ActivatedRoute) {
2421
}
2522

2623
ngOnInit(): void {
2724
const route = this.route;
2825
route.paramMap.pipe(
29-
switchMap(params => {
26+
switchMap((params :any) => {
3027
const id = Number.parseInt(params.get('id')!);
3128
if (route.routeConfig?.path?.includes('/edit')) {
3229
return this.api.getAudit(id, UserActivityType.SubmitEdit);
@@ -36,7 +33,7 @@ export class AuditItemComponent implements OnInit {
3633
//}
3734
return this.api.getAudit(id, UserActivityType.SubmitCreate);
3835
})
39-
).subscribe(e => {
36+
).subscribe((e :any) => {
4037
if (e.edits.length > 0) {
4138
const edit = e.edits[0];
4239
this._item.next(edit);

rubberduckvba.client/src/app/routes/audits/audits.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { Component, OnInit } from "@angular/core";
22
import { ApiClientService } from "../../services/api-client.service";
3-
import { FeatureEditViewModel, FeatureOperation, FeatureOperationViewModel, PendingAuditsViewModel } from "../../model/feature.model";
4-
import { Change, diffWords } from "diff";
5-
import { encode } from "html-entities";
3+
import { FeatureOperation, PendingAuditsViewModel } from "../../model/feature.model";
64

75
@Component({
86
selector: 'app-audits',

rubberduckvba.client/src/app/routes/feature/feature.component.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import { Component, OnChanges, OnInit, SimpleChanges, inject } from '@angular/core';
1+
import { Component, OnInit } from '@angular/core';
22
import { ApiClientService } from "../../services/api-client.service";
3-
import { FaIconLibrary } from '@fortawesome/angular-fontawesome';
4-
import { fas } from '@fortawesome/free-solid-svg-icons';
53
import { BehaviorSubject, switchMap } from 'rxjs';
64
import { PendingAuditsViewModel, UserViewModel, XmlDocOrFeatureViewModel } from '../../model/feature.model';
75
import { ActivatedRoute } from '@angular/router';
8-
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
96
import { AuthService } from '../../services/auth.service';
107

118
@Component({
@@ -15,8 +12,6 @@ import { AuthService } from '../../services/auth.service';
1512
})
1613
export class FeatureComponent implements OnInit {
1714

18-
public modal = inject(NgbModal);
19-
2015
private readonly _feature: BehaviorSubject<XmlDocOrFeatureViewModel> = new BehaviorSubject<XmlDocOrFeatureViewModel>(null!);
2116
public get feature(): XmlDocOrFeatureViewModel {
2217
return this._feature.getValue();
@@ -32,16 +27,15 @@ export class FeatureComponent implements OnInit {
3227
return this._audits.getValue();
3328
}
3429

35-
constructor(private auth: AuthService, private api: ApiClientService, private fa: FaIconLibrary, private route: ActivatedRoute) {
36-
fa.addIconPacks(fas);
30+
constructor(private auth: AuthService, private api: ApiClientService, private route: ActivatedRoute) {
3731
}
3832

3933
ngOnInit(): void {
4034
this.route.paramMap.pipe(
41-
switchMap(params => {
35+
switchMap((params :any) => {
4236
const name = params.get('name')!;
4337
return this.api.getFeature(name);
44-
})).subscribe(e => {
38+
})).subscribe((e :any) => {
4539
this._feature.next(e);
4640
});
4741

rubberduckvba.client/src/app/routes/features/features.component.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { Component, OnInit } from '@angular/core';
22
import { ApiClientService } from "../../services/api-client.service";
3-
import { FaIconLibrary } from '@fortawesome/angular-fontawesome';
4-
import { fas } from '@fortawesome/free-solid-svg-icons';
53
import { BehaviorSubject } from 'rxjs';
6-
import { FeatureViewModel, PendingAuditsViewModel, QuickFixViewModel, UserViewModel } from '../../model/feature.model';
4+
import { FeatureViewModel, PendingAuditsViewModel, UserViewModel } from '../../model/feature.model';
75
import { AuthService } from '../../services/auth.service';
86

97
@Component({
@@ -36,8 +34,7 @@ export class FeaturesComponent implements OnInit {
3634
};
3735
}
3836

39-
constructor(private api: ApiClientService, private auth: AuthService, private fa: FaIconLibrary) {
40-
fa.addIconPacks(fas);
37+
constructor(private api: ApiClientService, private auth: AuthService) {
4138
}
4239

4340
ngOnInit(): void {

rubberduckvba.client/src/app/routes/home/home.component.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { Component, OnChanges, OnInit, SimpleChanges } from '@angular/core';
22
import { ApiClientService } from "../../services/api-client.service";
33
import { Tag } from '../../model/tags.model';
4-
import { FaIconLibrary } from '@fortawesome/angular-fontawesome';
5-
import { fas } from '@fortawesome/free-solid-svg-icons';
64
import { BehaviorSubject } from 'rxjs';
75
import { BlogLink, BlogLinkViewModelClass } from '../../model/feature.model';
86

@@ -38,8 +36,7 @@ export class HomeComponent implements OnInit, OnChanges {
3836
]
3937
}
4038

41-
constructor(private api: ApiClientService, private fa: FaIconLibrary) {
42-
fa.addIconPacks(fas);
39+
constructor(private api: ApiClientService) {
4340
}
4441

4542
ngOnChanges(changes: SimpleChanges): void {

0 commit comments

Comments
 (0)