Skip to content

Commit

Permalink
Add stand alone pages
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu committed Sep 17, 2024
1 parent e40fbcf commit b33617d
Show file tree
Hide file tree
Showing 19 changed files with 142 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ApiRevisionOptionsComponent } from './api-revision-options.component';
import { ActivatedRoute, convertToParamMap } from '@angular/router';
import { ReviewPageModule } from 'src/app/_modules/review-page/review-page.module';
import { ReviewPageModule } from 'src/app/_modules/review-page.module';
import { SharedAppModule } from 'src/app/_modules/shared/shared-app.module';

describe('ApiRevisionOptionsComponent', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CommentsService } from 'src/app/_services/comments/comments.service';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ActivatedRoute, convertToParamMap } from '@angular/router';
import { SharedAppModule } from 'src/app/_modules/shared/shared-app.module';
import { ReviewPageModule } from 'src/app/_modules/review-page/review-page.module';
import { ReviewPageModule } from 'src/app/_modules/review-page.module';
import { MessageService } from 'primeng/api';

describe('CodePanelComponent', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<app-review-page-layout
[review]="review"
[sideMenu]="sideMenu">
<app-conversations
[apiRevisions]="apiRevisions"
[comments]="comments"
[userProfile]="userProfile"></app-conversations>
<div class="conversation-panel border rounded p-3">
<app-conversations
[apiRevisions]="apiRevisions"
[comments]="comments"
[userProfile]="userProfile">
</app-conversations>
</div>
</app-review-page-layout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:host ::ng-deep {
.conversation-panel{
height: calc(100vh - 130px);
background-color: var(--base-fg-color);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<h4>Conversations</h4>
<p-divider />
<p *ngIf="commentThreads.size === 0">This Review has no comments</p>
<p-timeline [value]="getAPIRevisionWithComments()">
<ng-template pTemplate="marker" let-apiRevision>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ConversationsComponent } from './conversations.component';
import { SharedAppModule } from 'src/app/_modules/shared/shared-app.module';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ReviewPageModule } from 'src/app/_modules/review-page/review-page.module';
import { ReviewPageModule } from 'src/app/_modules/review-page.module';
import { APIRevision } from 'src/app/_models/revision';
import { CommentItemModel } from 'src/app/_models/commentItemModel';
import { ActivatedRoute, convertToParamMap } from '@angular/router';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { HttpErrorInterceptorService } from 'src/app/_services/http-error-interc
import { PageOptionsSectionComponent } from '../shared/page-options-section/page-options-section.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { SharedAppModule } from 'src/app/_modules/shared/shared-app.module';
import { ReviewPageModule } from 'src/app/_modules/review-page/review-page.module';
import { ReviewPageModule } from 'src/app/_modules/review-page.module';
import { UserProfile } from 'src/app/_models/userProfile';

describe('ReviewPageOptionsComponent', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
[revisionSidePanel]="revisionSidePanel!"></app-revisions-list>
</p-sidebar>
<p-sidebar [(visible)]="conversationSidePanel!" position="right" [modal]="true" styleClass="conversation-sidebar">
<h4>Conversations</h4>
<p-divider />
<app-conversations
[apiRevisions]="apiRevisions"
[comments]="comments"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ReviewNavComponent } from '../review-nav/review-nav.component';
import { ReviewPageOptionsComponent } from '../review-page-options/review-page-options.component';
import { PageOptionsSectionComponent } from '../shared/page-options-section/page-options-section.component';
import { SharedAppModule } from 'src/app/_modules/shared/shared-app.module';
import { ReviewPageModule } from 'src/app/_modules/review-page/review-page.module';
import { ReviewPageModule } from 'src/app/_modules/review-page.module';
import { MessageService } from 'primeng/api';

describe('ReviewPageComponent', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CommentThreadComponent } from './comment-thread.component';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { SharedAppModule } from 'src/app/_modules/shared/shared-app.module';
import { ReviewPageModule } from 'src/app/_modules/review-page/review-page.module';
import { ReviewPageModule } from 'src/app/_modules/review-page.module';
import { CommentItemModel } from 'src/app/_models/commentItemModel';
import { CodePanelRowData } from 'src/app/_models/codePanelModels';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import { takeUntil } from "rxjs";
import { CodePanelRowData, CodePanelRowDatatype } from "../_models/codePanelModels";
import { ReviewsService } from "../_services/reviews/reviews.service";
import { Review } from "../_models/review";
import { Subject } from "@microsoft/signalr";

export const REVIEW_ID_ROUTE_PARAM = "reviewId";
export const ACTIVE_API_REVISION_ID_QUERY_PARAM = "activeApiRevisionId";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ConversationPageComponent } from 'src/app/_components/conversation-page/conversation-page.component';
import { ReviewPageLayoutModule } from './shared/review-page-layout.module';
import { SharedAppModule } from './shared/shared-app.module';
import { CommonModule } from '@angular/common';

const routes: Routes = [
{ path: '', component: ConversationPageComponent }
];

@NgModule({
declarations: [
ConversationPageComponent
],
imports: [
CommonModule,
ReviewPageLayoutModule,
RouterModule.forChild(routes),
]
})
export class ConversationPageModule { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { ReviewPageComponent } from 'src/app/_components/review-page/review-page.component';
import { ReviewNavComponent } from 'src/app/_components/review-nav/review-nav.component';
import { CodePanelComponent } from 'src/app/_components/code-panel/code-panel.component';
import { DialogModule } from 'primeng/dialog';
import { TreeSelectModule } from 'primeng/treeselect';
import { ButtonModule } from 'primeng/button';
import { UiScrollModule } from 'ngx-ui-scroll' ;
import { PageOptionsSectionComponent } from 'src/app/_components/shared/page-options-section/page-options-section.component';
import { ReviewPageOptionsComponent } from 'src/app/_components/review-page-options/review-page-options.component';
import { InputSwitchModule } from 'primeng/inputswitch';
import { SharedAppModule } from './shared/shared-app.module';
import { ReviewPageLayoutModule } from './shared/review-page-layout.module';

const routes: Routes = [
{ path: '', component: ReviewPageComponent }
];

@NgModule({
declarations: [
ReviewPageComponent,
ReviewNavComponent,
CodePanelComponent,
PageOptionsSectionComponent,
ReviewPageOptionsComponent,
],
imports: [
CommonModule,
DialogModule,
TreeSelectModule,
ButtonModule,
InputSwitchModule,
UiScrollModule,
ReviewPageLayoutModule,
RouterModule.forChild(routes),
]
})
export class ReviewPageModule { }

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { NgModule } from '@angular/core';
import { ReviewInfoComponent } from 'src/app/_components/shared/review-info/review-info.component';
import { ConversationsComponent } from 'src/app/_components/conversations/conversations.component';
import { CommentThreadComponent } from 'src/app/_components/shared/comment-thread/comment-thread.component';
import { ReviewPageLayoutComponent } from 'src/app/_components/shared/review-page-layout/review-page-layout.component';
import { MarkdownToHtmlPipe } from 'src/app/_pipes/markdown-to-html.pipe';
import { EditorComponent } from 'src/app/_components/shared/editor/editor.component';
import { EditorModule } from 'primeng/editor';
import { PanelModule } from 'primeng/panel';
import { MenuModule } from 'primeng/menu';
import { TimelineModule } from 'primeng/timeline';
import { DividerModule } from 'primeng/divider';
import { ApiRevisionOptionsComponent } from 'src/app/_components/api-revision-options/api-revision-options.component';
import { SharedAppModule } from './shared-app.module';
import { CommonModule } from '@angular/common';


@NgModule({
declarations: [
ReviewInfoComponent,
CommentThreadComponent,
ConversationsComponent,
ReviewPageLayoutComponent,
ApiRevisionOptionsComponent,
MarkdownToHtmlPipe,
EditorComponent,
],
exports: [
ReviewInfoComponent,
CommentThreadComponent,
ConversationsComponent,
ReviewPageLayoutComponent,
ApiRevisionOptionsComponent,
MarkdownToHtmlPipe,
EditorComponent,
SharedAppModule,
EditorModule,
PanelModule,
MenuModule,
TimelineModule,
DividerModule
],
imports: [
CommonModule,
SharedAppModule,
EditorModule,
PanelModule,
MenuModule,
TimelineModule,
DividerModule
]
})
export class ReviewPageLayoutModule { }
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { FileUploadModule } from 'primeng/fileupload';
import { InputTextModule } from 'primeng/inputtext';
import { MessagesModule } from 'primeng/messages';
import { BadgeModule } from 'primeng/badge';
import { MenuModule } from 'primeng/menu';


@NgModule({
Expand Down Expand Up @@ -58,8 +57,8 @@ import { MenuModule } from 'primeng/menu';
InputTextModule,
],
imports: [
BadgeModule,
CommonModule,
BadgeModule,
ContextMenuModule,
TableModule,
ChipModule,
Expand Down
3 changes: 2 additions & 1 deletion src/dotnet/APIView/ClientSPA/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const routes: Routes = [
runGuardsAndResolvers: 'always',
canActivate: [AuthGuard],
children: [
{ path: '*/:reviewId', loadChildren: () => import('./_modules/review-page/review-page.module').then(m => m.ReviewPageModule) }, // Lazy load review page module
{ path: 'review/:reviewId', loadChildren: () => import('./_modules/review-page.module').then(m => m.ReviewPageModule) }, // Lazy load review page module
{ path: 'conversation/:reviewId', loadChildren: () => import('./_modules/conversation-page.module').then(m => m.ConversationPageModule) }
]
},
{ path: '**', component: IndexPageComponent, pathMatch: 'full' }
Expand Down
2 changes: 2 additions & 0 deletions src/dotnet/APIView/ClientSPA/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { CookieService } from 'ngx-cookie-service';
import { SharedAppModule } from './_modules/shared/shared-app.module';
import { HttpErrorInterceptorService } from './_services/http-error-interceptor/http-error-interceptor.service';
import { MessageService } from 'primeng/api';
import { CommonModule } from '@angular/common';

export function initializeApp(configService: ConfigService) {
return (): Observable<any> => {
Expand All @@ -32,6 +33,7 @@ export function initializeApp(configService: ConfigService) {
],
imports: [
SharedAppModule,
CommonModule,
AppRoutingModule,
BadgeModule,
BrowserModule,
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet/APIView/ClientSPA/src/ng-prime-overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ p-contextmenusub {
}

.p-multiselect-panel .p-multiselect-items .p-multiselect-item:not(.p-highlight):not(.p-disabled).p-focus {
background: var(--base-fg-color);;
background: var(--base-fg-color);
}

.p-datatable .p-sortable-column.p-highlight, .p-datatable .p-sortable-column.p-highlight:hover {
Expand Down

0 comments on commit b33617d

Please sign in to comment.