Skip to content

Commit a76cecf

Browse files
committed
feat: display submitted grade in portfolio view
1 parent ceb8bbc commit a76cecf

7 files changed

Lines changed: 47 additions & 2 deletions

File tree

src/app/projects/states/dashboard/directives/progress-dashboard/progress-dashboard.component.html

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ <h4 class="py-3.5 font-semibold text-gray-800">
99
</div>
1010
<div class="grid grid-cols-1 items-stretch gap-3.5 p-3.5 xl:grid-cols-2">
1111
<!-- Task Planner Card -->
12-
<div class="size-full xl:col-span-1">
12+
<div
13+
class="size-full"
14+
[ngClass]="
15+
showSubmittedGrade
16+
? 'xl:col-span-2 xl:mx-auto xl:w-[calc((100%-0.875rem)/2)]'
17+
: 'xl:col-span-1'
18+
"
19+
>
1320
<f-task-planner-card class="block size-full" [project]="project"></f-task-planner-card>
1421
</div>
1522

@@ -50,6 +57,35 @@ <h4 class="py-3.5 font-semibold text-gray-800">
5057
</mat-card>
5158
</div>
5259

60+
@if (showSubmittedGrade) {
61+
<!-- Submitted Grade Card -->
62+
<div class="h-full xl:col-span-1">
63+
<mat-card appearance="outlined" class="flex h-full flex-col">
64+
<mat-card-header>
65+
<mat-card-title>Submitted Grade</mat-card-title>
66+
<mat-card-subtitle class="mb-2.5">
67+
<p>The grade you are submitting your portfolio for.</p>
68+
</mat-card-subtitle>
69+
</mat-card-header>
70+
71+
<mat-card-content class="flex flex-1 items-center">
72+
<div class="w-full">
73+
<mat-form-field appearance="fill" class="w-full">
74+
<mat-label>Select Submitted Grade</mat-label>
75+
<mat-select disabled [value]="project.submittedGrade">
76+
@for (grade of grades.values; track grade) {
77+
<mat-option [value]="grade">
78+
{{ grades.names[grade] }}
79+
</mat-option>
80+
}
81+
</mat-select>
82+
</mat-form-field>
83+
</div>
84+
</mat-card-content>
85+
</mat-card>
86+
</div>
87+
}
88+
5389
<!-- Unit learning outcomes -->
5490
<div class="xl:col-span-2">
5591
<f-task-ilos-card [iloContextType]="'Unit'" [unit]="project.unit"></f-task-ilos-card>

src/app/projects/states/dashboard/directives/progress-dashboard/progress-dashboard.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {GradeService} from 'src/app/common/services/grade.service';
2121
})
2222
export class ProgressDashboardComponent implements OnInit {
2323
@Input() project: Project;
24+
@Input() showSubmittedGrade?: boolean = false;
2425
@Output() doUpdateTargetGrade: EventEmitter<void> = new EventEmitter();
2526

2627
grades: {names: Record<number, string>; values: number[]} = {

src/app/projects/states/dashboard/project-dashboard/project-dashboard.component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@
133133
</div>
134134
} @else {
135135
<div class="min-h-0 flex-1 overflow-y-auto p-1">
136-
<f-progress-dashboard class="w-full" [project]="project"></f-progress-dashboard>
136+
<f-progress-dashboard
137+
class="w-full"
138+
[project]="project"
139+
[showSubmittedGrade]="showSubmittedGrade"
140+
></f-progress-dashboard>
137141
</div>
138142
}
139143
</div>

src/app/projects/states/dashboard/project-dashboard/project-dashboard.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export class ProjectDashboardComponent implements OnInit, OnDestroy {
2121
@Input() public project$: Observable<Project>;
2222
@Input() public defaultTaskListCollapsed = false;
2323
@Input() public taskSelectionUrlBase: unknown[] | null = null;
24+
@Input() public showSubmittedGrade?: boolean = false;
2425

2526
/**
2627
* The currently selected task definition - selected in the unit task list.

src/app/units/states/portfolios/directives/portfolios-project-progress/portfolios-project-progress.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ <h2>Review progress of {{ project.student.name }}</h2>
5656
class="block min-h-fit min-w-0"
5757
[defaultTaskListCollapsed]="true"
5858
[project$]="project$"
59+
[showSubmittedGrade]="showSubmittedGrade"
5960
[taskSelectionUrlBase]="taskSelectionUrlBase"
6061
></f-project-dashboard>
6162

src/app/units/states/portfolios/directives/portfolios-project-progress/portfolios-project-progress.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export class PortfoliosProjectProgressComponent implements OnChanges {
2525
@Input() project: Project;
2626
@Input() unit: Unit;
2727
@Input() taskSelectionUrlBase: unknown[] | null = null;
28+
@Input() showSubmittedGrade?: boolean = false;
2829

2930
@Input()
3031
public project$: BehaviorSubject<Project> = new BehaviorSubject(null);

src/app/units/states/portfolios/portfolios.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<f-portfolios-project-progress
2828
[project]="selectedProject"
2929
[project$]="selectedProject$"
30+
[showSubmittedGrade]="true"
3031
[taskSelectionUrlBase]="progressTaskSelectionUrlBase"
3132
[unit]="unit"
3233
></f-portfolios-project-progress>

0 commit comments

Comments
 (0)