Skip to content

Commit f2a30b0

Browse files
committed
add audits admin routing
1 parent 941ec30 commit f2a30b0

File tree

6 files changed

+36
-3
lines changed

6 files changed

+36
-3
lines changed

rubberduckvba.Server/ContentSynchronization/Pipeline/Sections/Context/SyncContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public static void ThrowIfNotNull<T>(params T?[] values)
203203
{
204204
if (values.Any(e => e != null))
205205
{
206-
throw new ContextAlreadyInitializedException();
206+
//throw new ContextAlreadyInitializedException();
207207
}
208208
}
209209
}

rubberduckvba.client/src/app/app.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import { IndenterComponent } from './routes/indenter/indenter.component';
4040
import { DefaultUrlSerializer, UrlTree } from '@angular/router';
4141
import { AuthComponent } from './routes/auth/auth.component';
4242
import { AuthMenuComponent } from './components/auth-menu/auth-menu.component';
43+
import { AuditsAdminComponent } from './routes/audits/audits.component';
4344

4445
/**
4546
* https://stackoverflow.com/a/39560520
@@ -61,6 +62,7 @@ export class LowerCaseUrlSerializer extends DefaultUrlSerializer {
6162
HomeComponent,
6263
AuthComponent,
6364
AuthMenuComponent,
65+
AuditsAdminComponent,
6466
IndenterComponent,
6567
FeaturesComponent,
6668
FeatureComponent,
@@ -93,6 +95,7 @@ export class LowerCaseUrlSerializer extends DefaultUrlSerializer {
9395
{ path: 'inspections/details/:name', redirectTo: 'inspections/:name' },
9496
// actual routes:
9597
{ path: 'auth/github', component: AuthComponent },
98+
{ path: 'audits', component: AuditsAdminComponent },
9699
{ path: 'features', component: FeaturesComponent },
97100
{ path: 'features/:name', component: FeatureComponent },
98101
{ path: 'inspections/:name', component: InspectionComponent },

rubberduckvba.client/src/app/components/auth-menu/auth-menu.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class AuthMenuComponent implements OnInit {
7070

7171
public auditsCountIconClass(): string {
7272
if (this.pendingAudits == 0) {
73-
return 'text-success disabled';
73+
return 'text-success';
7474
}
7575
else {
7676
return 'text-danger';

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ <h6>Edit {{action == 'edit' ? 'description' : 'summary'}}</h6>
4141
<div class="row">
4242
<span *ngIf="action == 'edit'" class="text-small text-muted text-end">{{feature.description.length}}</span>
4343
<span *ngIf="action == 'summary'" class="text-small text-muted text-end">{{feature.shortDescription.length}}</span>
44-
</div>x
44+
</div>
4545
<div *ngIf="action == 'edit'">
4646
<hr />
4747
<button type="button" class="btn btn-outline-secondary mb-2" (click)="onPreviewDescription()">
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<div class="row">
2+
<h2>Audits</h2>
3+
<p>
4+
Use this page to review pending additions, deletions, and edits to features described on this site; approved/rejected records are not shown.
5+
</p>
6+
</div>
7+
<div class="row">
8+
<h3>TODO</h3>
9+
</div>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Component, OnInit } from "@angular/core";
2+
import { ApiClientService } from "../../services/api-client.service";
3+
import { PendingAuditsViewModel } from "../../model/feature.model";
4+
5+
@Component({
6+
selector: 'app-audits',
7+
templateUrl: './audits.component.html'
8+
})
9+
export class AuditsAdminComponent implements OnInit {
10+
11+
constructor(private api: ApiClientService) {
12+
13+
}
14+
15+
public pendingAudits: PendingAuditsViewModel = { edits: [], other: [] };
16+
17+
ngOnInit(): void {
18+
this.api.getPendingAudits().subscribe(e => this.pendingAudits = e);
19+
}
20+
21+
}

0 commit comments

Comments
 (0)