Skip to content

Commit

Permalink
FIX: Pass id is from inbox form rather than object
Browse files Browse the repository at this point in the history
  • Loading branch information
jakerenzella committed Sep 17, 2020
1 parent 66eb77f commit 656e3cb
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 97 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="scrollable">
<div div fxLayout="column" fxLayoutAlign=" none" style="height: 100%;">
<div class="omnisearch" [ngClass]="{ expanded: showSearchOptions }">
<div fxLayout="row">
<button mat-icon-button aria-label="Seach Icon" disabled>
Expand Down Expand Up @@ -80,7 +80,7 @@
>
<mat-option
*ngFor="let td of unit.task_definitions"
[value]="td"
[value]="td.id"
>
{{ td.abbreviation + " - " + td.name }}
</mat-option>
Expand All @@ -99,7 +99,7 @@
name="tutorial"
(selectionChange)="tutorialIdChanged()"
>
<mat-option *ngFor="let t of tutorials" [value]="t">
<mat-option *ngFor="let t of tutorials" [value]="t.id">
{{ t.inbox_description }}
</mat-option>
</mat-select>
Expand All @@ -115,104 +115,109 @@
</div>

<!--/search-options-->
<mat-list>
<mat-list-item
class="list-group-item list-group-item-task clearfix {{
task.statusClass()
}}"
id="{{ task.taskKeyToIdString() }}"
(click)="setSelectedTask(task)"
[ngClass]="{ selected: isSelectedTask(task) }"
*ngFor="let task of filteredTasks"
style="padding: 0;"
>
<div
class="inbox-entry"
fxLayout="row"
fxLayoutAlign="start center"
[ngClass]="{ hover: task.hover }"
(mouseover)="task.hover = true"
(mouseout)="task.hover = false"
<div class="scrollable">
<mat-list *ngIf="filteredTasks">
<mat-list-item
class="list-group-item list-group-item-task clearfix {{
task.statusClass()
}}"
id="{{ task.taskKeyToIdString() }}"
(click)="setSelectedTask(task)"
[ngClass]="{ selected: isSelectedTask(task) }"
*ngFor="let task of filteredTasks"
style="padding: 0;"
>
<user-icon
fxFlexAlign="center"
[user]="task.project()"
[email]="task.project().student_email"
[size]="45"
<div
class="inbox-entry"
fxLayout="row"
fxLayoutAlign="start center"
[ngClass]="{ hover: task.hover }"
(mouseover)="task.hover = true"
(mouseout)="task.hover = false"
>
</user-icon>
<div class="task-list-data">
<h4 class="mat-h4">{{ task.project().name }}</h4>
<p class="mat-small">
{{ task.definition.abbreviation }} - {{ task.definition.name }}
</p>
<div class="muted" [hidden]="!isSelectedTask(task)">
<p class="mat-small">
{{ task.project().shortTutorialDescription() }}
</p>
<user-icon
fxFlexAlign="center"
[user]="task.project()"
[email]="task.project().student_email"
[size]="45"
>
</user-icon>
<div class="task-list-data">
<h4 class="mat-h4">{{ task.project().name }}</h4>
<p class="mat-small">
Submitted {{ task.submission_date | humanizedDate }}
</p>
<p class="mat-small" [hidden]="!(task.times_assessed > 0)">
Assessed {{ task.times_assessed }} time{{
task.times_assessed == 1 ? "" : "s"
}}
{{ task.definition.abbreviation }} - {{ task.definition.name }}
</p>
<div class="muted" [hidden]="!isSelectedTask(task)">
<p class="mat-small">
{{ task.project().shortTutorialDescription() }}
</p>
<p class="mat-small">
Submitted {{ task.submission_date | humanizedDate }}
</p>
<p class="mat-small" [hidden]="!(task.times_assessed > 0)">
Assessed {{ task.times_assessed }} time{{
task.times_assessed == 1 ? "" : "s"
}}
</p>
</div>
</div>
</div>
<span fxFlex></span>
<!--/task-data-->
<div class="task-badges">
<status-icon [status]="task.status"></status-icon>
<div class="task-subscript-badges">
<span
class="task-subscript-badge grade-badge"
*ngIf="task.hasGrade()"
>
{{ task.gradeDesc() }}
<span fxFlex></span>
<!--/task-data-->
<div class="task-badges">
<status-icon [status]="task.status"></status-icon>
<span *ngIf="isSelectedTask(task)">
<span style="width: 20px; height: 20px;" *ngIf="task.hasGrade()">
{{ task.gradeDesc() }}
</span>
<span
style="width: 20px; height: 20px;"
*ngIf="task.hasQualityPoints()"
>
<sup>{{ task.quality_pts }}</sup
>&frasl;<sub>{{ task.definition.max_quality_pts }}</sub>
</span>
</span>
<span
class="task-subscript-badge quality-badge"
*ngIf="task.hasQualityPoints()"
</div>
<div class="overflow">
<button
[hidden]="task.hover"
mat-icon-button
aria-label="task-overflow"
>
<sup>{{ task.quality_pts }}</sup
>&frasl;<sub>{{ task.definition.max_quality_pts }}</sub>
</span>
<mat-icon class="warn-icon" *ngIf="task.plagiarismDetected()"
>remove_red_eye</mat-icon
>
<div
class="new_comments"
*ngIf="task.num_new_comments > 0 && !task.plagiarismDetected()"
>
{{ task.num_new_comments }}
</div>
</button>
<button
[hidden]="!task.hover"
mat-icon-button
aria-label="task-overflow"
>
<mat-icon>more_horiz</mat-icon>
</button>
</div>
</div>
<div class="overflow">
<button
[hidden]="task.hover"
mat-icon-button
aria-label="task-overflow"
>
<mat-icon class="warn-icon" *ngIf="task.plagiarismDetected()"
>remove_red_eye</mat-icon
>
<div class="new_comments" *ngIf="(task.num_new_comments > 0) && !task.plagiarismDetected()">
{{ task.num_new_comments }}
</div>
</button>
<button
[hidden]="!task.hover"
mat-icon-button
aria-label="task-overflow"
>
<mat-icon>more_horiz</mat-icon>
</button>
<!--/badges-->
</mat-list-item>
<!--/task-->
<mat-list-item
[hidden]="filteredTasks.length != 0"
class="list-group-item text-center text-muted"
>
<div id="empty-task-inbox">
<img
src="/assets/images/empty_task_inbox.svg"
alt="Empty task inbox"
/>
No tasks to display!
</div>
</div>
<!--/badges-->
</mat-list-item>
<!--/task-->
<mat-list-item
[hidden]="filteredTasks.length != 0"
class="list-group-item text-center text-muted"
>
<div id="empty-task-inbox">
<img src="/assets/images/empty_task_inbox.svg" alt="Empty task inbox" />
No tasks to display!
</div>
</mat-list-item>
</mat-list>
</mat-list-item>
</mat-list>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ $warn-color: #dd6666;
background-color: rgba(0, 0, 0, 0.04);
font-size: 15px;
min-height: 36px;
max-height: 220px;
padding-right: 16px;
text-align: left;

mat-form-field {
margin-top: 0.5em;
margin-bottom: 0.5em;
}

&.expanded {
height: 100%;
}
}

.warn-icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class StaffTaskListComponent implements OnInit, OnChanges {
@Input() unit;
@Input() unitRole;
@Input() filters;
@Input() showSearchOptions;
@Input() showSearchOptions = false;

submissionsPdfsUrl: string;
submissionsUrl: string;
Expand Down Expand Up @@ -153,13 +153,16 @@ export class StaffTaskListComponent implements OnInit, OnChanges {
}

taskDefinitionIdChanged() {
let taskDef;
this.submissionsUrl = this.taskDef.getSubmissionsUrl(this.unit.id, this.filters.taskDefinitionIdSelected);
this.submissionsPdfsUrl = this.taskDef.getSubmissionsPdfsUrl(this.unit.id, this.filters.taskDefinitionIdSelected);
let taskDefId = this.filters.taskDefinitionIdSelected;
const taskDefId = this.filters.taskDefinitionIdSelected;
if (taskDefId) {
let taskDef = this.unit.taskDef(taskDefId.id);
this.filters.taskDefinition = taskDef;
taskDef = this.unit.taskDef(taskDefId);
} else {
taskDef = null;
}
this.filters.taskDefinition = taskDef;
if (this.isTaskDefMode) {
this.refreshData();
}
Expand Down

0 comments on commit 656e3cb

Please sign in to comment.