Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions Client/src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { AuthGuard } from './core/security/auth.guard';
import { AdminGuard } from './core/security/admin.guard';
import { ModuleVersionViewComponent } from './pages/module-version-view/module-version-view.component';
import { SimilarModulesPage } from './pages/similar-modules/similar-modules.component';
import { ProposalAiReviewPageComponent } from './pages/proposal-ai-review/proposal-ai-review-page.component';
import { AccountLayoutComponent } from './pages/account-management/account-layout/account-layout.component';
import { AccountInformationComponent } from './pages/account-management/account-information/account-information.component';
import { AccountPasskeysComponent } from './pages/account-management/passkeys/account-passkeys.component';
Expand All @@ -19,6 +20,8 @@ import { DegreeProgramDetailsPageComponent } from './pages/admin/degree-programs
import { AllSpecializationsPageComponent } from './pages/admin/degree-program-specializations/all-specializations-page.component';
import { ExaminationBoardDetailPageComponent } from './pages/admin/examination-boards/examination-board-detail-page.component';
import { ExaminationBoardsPageComponent } from './pages/admin/examination-boards/examination-boards-page.component';
import { AiReviewGuidelinesPageComponent } from './pages/ai-review-guidelines/ai-review-guidelines-page.component';
import { AiReviewGuidelineManagerGuard } from './core/security/ai-review-guideline-manager.guard';
export const routes: Routes = [
{ path: '', component: IndexComponent },
{
Expand All @@ -30,7 +33,8 @@ export const routes: Routes = [
{ path: ':id', component: ProposalViewComponent },
{ path: ':id/version/:versionId', component: ModuleVersionViewComponent },
{ path: ':id/version/:versionId/edit', component: ModuleVersionEditComponent },
{ path: ':id/version/:versionId/overlap', component: SimilarModulesPage }
{ path: ':id/version/:versionId/overlap', component: SimilarModulesPage },
{ path: ':id/version/:versionId/ai-review', component: ProposalAiReviewPageComponent }
]
},
{
Expand All @@ -39,7 +43,8 @@ export const routes: Routes = [
children: [
{ path: '', component: ApprovalStaffHomePageComponent },
{ path: 'view/:id', component: FeedbackViewComponent },
{ path: 'view/:id/overlap/:versionId', component: SimilarModulesPage }
{ path: 'view/:id/overlap/:versionId', component: SimilarModulesPage },
{ path: 'view/:id/ai-review/:versionId', component: ProposalAiReviewPageComponent }
]
},
{
Expand All @@ -52,6 +57,11 @@ export const routes: Routes = [
{ path: '', redirectTo: 'information', pathMatch: 'full' }
]
},
{
path: 'ai-review-guidelines',
component: AiReviewGuidelinesPageComponent,
canActivate: [AuthGuard, AiReviewGuidelineManagerGuard]
},
{
path: 'admin',
canActivate: [AuthGuard, AdminGuard],
Expand Down
22 changes: 21 additions & 1 deletion Client/src/app/components/breadcrumb/breadcrumb.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ export class BreadcrumbComponent {

showBreadcrumb = computed(() => {
const u = this.url();
return u.startsWith('/proposals') || u.startsWith('/feedbacks') || u.startsWith('/admin');
return u.startsWith('/proposals') || u.startsWith('/feedbacks') || u.startsWith('/admin')
|| u.startsWith('/ai-review-guidelines');
});

private buildItems(url: string): MenuItem[] {
if (url.startsWith('/proposals')) return this.buildProposalItems(url);
if (url.startsWith('/feedbacks')) return this.buildFeedbackItems(url);
if (url.startsWith('/admin')) return this.buildAdminItems(url);
if (url.startsWith('/ai-review-guidelines')) return this.buildAiReviewGuidelinesItems();
return [];
}

Expand Down Expand Up @@ -132,6 +134,13 @@ export class BreadcrumbComponent {
});
return items;
}
if (segments[4] === 'ai-review') {
items.push({
label: 'AI Review',
routerLink: ['/proposals', proposalId, 'version', versionId, 'ai-review']
});
return items;
}
}

return items;
Expand Down Expand Up @@ -159,6 +168,17 @@ export class BreadcrumbComponent {
});
}

if (segments[3] === 'ai-review' && segments[4]) {
items.push({
label: 'AI Review',
routerLink: ['/feedbacks/view', segments[2], 'ai-review', segments[4]]
});
}

return items;
}

private buildAiReviewGuidelinesItems(): MenuItem[] {
return [{ label: 'AI Review Guidelines', routerLink: ['/ai-review-guidelines'] }];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ <h1 class="text-2xl mb-4">{{ moduleVersionDto()?.titleEng ? 'Edit Proposal for '
</div>
</p-message>

@if (moduleVersionId && moduleVersionDto()?.proposalId; as proposalId) {
<div class="flex flex-wrap gap-2 mb-4">
<p-button
label="AI Review"
icon="pi pi-sparkles"
severity="contrast"
outlined
[routerLink]="['/proposals', proposalId, 'version', moduleVersionId, 'ai-review']"
/>
<p-button
label="Check Overlaps"
severity="contrast"
outlined
[routerLink]="['/proposals', proposalId, 'version', moduleVersionId, 'overlap']"
/>
</div>
}

<form [formGroup]="proposalForm" (ngSubmit)="onSubmit()" class="space-y-6">
@if (currentStepIndex() === 0) {
<div class="space-y-6">
Expand Down
10 changes: 10 additions & 0 deletions Client/src/app/components/side-bar/side-bar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@
styleClass="sidebar-btn justify-start"
/>
}
@if (isAiReviewGuidelineManager()) {
<p-button
label="AI review guidelines"
icon="pi pi-sparkles"
[routerLink]="['/ai-review-guidelines']"
[severity]="isActive('/ai-review-guidelines') ? 'contrast' : 'secondary'"
[style]="{ width: '100%' }"
styleClass="sidebar-btn justify-start"
/>
}
@if (isReviewer()) {
<p-button
label="Pending Feedbacks"
Expand Down
3 changes: 2 additions & 1 deletion Client/src/app/components/side-bar/side-bar.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, inject } from '@angular/core';
import { Router, RouterModule } from '@angular/router';
import { ButtonModule } from 'primeng/button';
import { isAdminRole, isProfessorRole, isReviewerRole } from '../../core/shared/user-role.utils';
import { isAdminRole, isAiReviewGuidelineManagerRole, isProfessorRole, isReviewerRole } from '../../core/shared/user-role.utils';
import { SecurityStore } from '../../core/security/security-store.service';
import { SidebarService } from './sidebar.service';

Expand All @@ -28,6 +28,7 @@ export class SideBarComponent {
isAdmin = (): boolean => isAdminRole(this.user()?.roles);
isProfessor = (): boolean => isProfessorRole(this.user()?.roles);
isReviewer = (): boolean => isReviewerRole(this.user()?.roles);
isAiReviewGuidelineManager = (): boolean => isAiReviewGuidelineManagerRole(this.user()?.roles);

isActive(path: string): boolean {
return this.router.url.startsWith(path);
Expand Down
7 changes: 7 additions & 0 deletions Client/src/app/core/modules/openapi/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ README.md
api.module.ts
api/admin-user-controller.service.ts
api/admin-user-controller.serviceInterface.ts
api/ai-review-guideline-controller.service.ts
api/ai-review-guideline-controller.serviceInterface.ts
api/api.ts
api/degree-program-specializations-controller.service.ts
api/degree-program-specializations-controller.serviceInterface.ts
Expand All @@ -24,8 +26,10 @@ encoder.ts
git_push.sh
index.ts
model/add-specializations-to-degree-program-dto.ts
model/ai-review-guideline-dto.ts
model/completion-service-request-dto.ts
model/completion-service-response-dto.ts
model/create-ai-review-guideline-dto.ts
model/create-degree-program-dto.ts
model/create-degree-program-specialization-dto.ts
model/create-examination-board-dto.ts
Expand All @@ -45,11 +49,14 @@ model/module-version-update-request-dto.ts
model/module-version-view-dto.ts
model/module-version-view-feedback-dto.ts
model/page-response-dto-user-dto.ts
model/proposal-ai-review-dto.ts
model/proposal-ai-review-section-dto.ts
model/proposal-request-dto.ts
model/proposal-view-dto.ts
model/proposals-compact-dto.ts
model/responsible-user-dto.ts
model/similar-module-dto.ts
model/update-ai-review-guideline-dto.ts
model/update-degree-program-dto.ts
model/update-degree-program-specialization-dto.ts
model/update-examination-board-dto.ts
Expand Down
Loading
Loading