-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
358bbfb
commit 6cdfbfb
Showing
18 changed files
with
200 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../APIView/ClientSPA/src/app/_components/conversation-page/conversation-page.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
src/dotnet/APIView/ClientSPA/src/app/_components/conversations/conversations.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
src/dotnet/APIView/ClientSPA/src/app/_components/revision-page/revision-page.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
|
||
<app-review-page-layout | ||
[review]="review" | ||
[sideMenu]="sideMenu"> | ||
<div class="revisions-panel overflow-auto border rounded"> | ||
<app-revisions-list | ||
[review]="review" | ||
(apiRevisionsEmitter)="handleApiRevisionsEmitter($event)"> | ||
</app-revisions-list> | ||
</div> | ||
</app-review-page-layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
:host ::ng-deep { | ||
.revision-panel{ | ||
height: calc(100vh - 130px); | ||
background-color: var(--base-fg-color); | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
src/dotnet/APIView/ClientSPA/src/app/_components/revision-page/revision-page.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,64 @@ | ||
import { Component } from '@angular/core'; | ||
import { ActivatedRoute, Router } from '@angular/router'; | ||
import { MenuItem } from 'primeng/api'; | ||
import { Subject, takeUntil } from 'rxjs'; | ||
import { REVIEW_ID_ROUTE_PARAM } from 'src/app/_helpers/common-helpers'; | ||
import { Review } from 'src/app/_models/review'; | ||
import { APIRevision } from 'src/app/_models/revision'; | ||
import { ReviewsService } from 'src/app/_services/reviews/reviews.service'; | ||
import { RevisionsService } from 'src/app/_services/revisions/revisions.service'; | ||
|
||
@Component({ | ||
selector: 'app-revision-page', | ||
templateUrl: './revision-page.component.html', | ||
styleUrls: ['./revision-page.component.scss'] | ||
}) | ||
export class RevisionPageComponent { | ||
reviewId : string | null = null; | ||
review : Review | undefined = undefined; | ||
sideMenu: MenuItem[] | undefined; | ||
apiRevisions: APIRevision[] = []; | ||
|
||
private destroy$ = new Subject<void>(); | ||
|
||
constructor(private route: ActivatedRoute, private reviewsService: ReviewsService, private apiRevisionsService: RevisionsService, private router: Router) {} | ||
|
||
ngOnInit() { | ||
this.reviewId = this.route.snapshot.paramMap.get(REVIEW_ID_ROUTE_PARAM); | ||
this.createSideMenu(); | ||
this.loadReview(this.reviewId!); | ||
} | ||
|
||
createSideMenu() { | ||
this.sideMenu = [ | ||
{ | ||
icon: 'bi bi-braces', | ||
tooltip: 'API', | ||
command: () => this.openLatestAPIReivisonForReview() | ||
}, | ||
{ | ||
icon: 'bi bi-chat-left-dots', | ||
tooltip: 'Conversations', | ||
command: () => this.router.navigate([`/conversation/${this.reviewId}`]) | ||
} | ||
]; | ||
} | ||
|
||
loadReview(reviewId: string) { | ||
this.reviewsService.getReview(reviewId) | ||
.pipe(takeUntil(this.destroy$)).subscribe({ | ||
next: (review: Review) => { | ||
this.review = review; | ||
} | ||
}); | ||
} | ||
|
||
openLatestAPIReivisonForReview() { | ||
const apiRevision = this.apiRevisions.find(x => x.apiRevisionType === "Automatic") ?? this.apiRevisions[0]; | ||
this.apiRevisionsService.openAPIRevisionPage(apiRevision, this.router.url); | ||
} | ||
|
||
handleApiRevisionsEmitter(apiRevisions: APIRevision[]) { | ||
this.apiRevisions = apiRevisions as APIRevision[]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/dotnet/APIView/ClientSPA/src/app/_helpers/router-helpers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.