Skip to content

Commit

Permalink
feat: add new task submission card
Browse files Browse the repository at this point in the history
  • Loading branch information
jakerenzella committed Oct 3, 2022
1 parent ace8b73 commit 6d27690
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/app/doubtfire-angular.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ import { TaskStatusCardComponent } from './projects/states/dashboard/directives/
import { TaskDueCardComponent } from './projects/states/dashboard/directives/task-dashboard/directives/task-due-card/task-due-card.component';
import { FooterComponent } from './common/footer/footer.component';
import { TaskAssessmentCardComponent } from './projects/states/dashboard/directives/task-dashboard/directives/task-assessment-card/task-assessment-card.component';
import { TaskSubmissionCardComponent } from './projects/states/dashboard/directives/task-dashboard/directives/task-submission-card/task-submission-card.component';

@NgModule({
// Components we declare
Expand Down Expand Up @@ -247,6 +248,7 @@ import { TaskAssessmentCardComponent } from './projects/states/dashboard/directi
TaskDueCardComponent,
FooterComponent,
TaskAssessmentCardComponent,
TaskSubmissionCardComponent,
],
// Module Imports
imports: [
Expand Down
2 changes: 0 additions & 2 deletions src/app/doubtfire-angularjs.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ import 'build/src/app/projects/states/dashboard/directives/progress-dashboard/pr
import 'build/src/app/projects/states/dashboard/directives/student-task-list/student-task-list.js';
import 'build/src/app/projects/states/dashboard/directives/directives.js';
import 'build/src/app/projects/states/dashboard/directives/task-dashboard/directives/task-outcomes-card/task-outcomes-card.js';
import 'build/src/app/projects/states/dashboard/directives/task-dashboard/directives/task-submission-card/task-submission-card.js';
import 'build/src/app/projects/states/dashboard/directives/task-dashboard/directives/directives.js';
import 'build/src/app/projects/states/dashboard/directives/task-dashboard/directives/task-status-card/task-status-card.js';
import 'build/src/app/projects/states/dashboard/directives/task-dashboard/task-dashboard.js';
import 'build/src/app/projects/states/dashboard/dashboard.js';
import 'build/src/app/projects/states/outcomes/outcomes.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<mat-card [hidden]="!(submission.isUploaded || submission.isProcessing)">
<mat-card-title>Submission <span [hidden]="!submission.isProcessing">Processing</span></mat-card-title>
<mat-card-content>
<p [hidden]="!submission.isProcessing">
Your submission is being processed and will be avaliable to view soon. You will also be able to download your most
recently submitted files.
</p>
<p [hidden]="!submission.isUploaded">
You can choose to download your <em [hidden]="!submission.isProcessing">previous</em>
submission or the files you uploaded below.
</p>
<p [hidden]="!submission.isUploaded">
You uploaded this submission <strong>{{ task.submissionDate | humanizedDate }}</strong
>.
</p>
<p [hidden]="!canRegeneratePdf">
If you feel there has been an error in your submission, you can request Doubtfire to regenerate your submission
under the "Actions" dropdown menu.
</p>
<p [hidden]="!canReuploadEvidence">
If you would like to submit alternate evidence for use in your portfolio, you can upload alternate files under the
"Actions" dropdown menu.
</p></mat-card-content
>
<mat-card-actions [hidden]="!(submission.isUploaded || canReuploadEvidence || canRegeneratePdf)">
<button mat-stroked-button [hidden]="!submission.isUploaded" (click)="downloadSubmission()">
Download submission
</button>
<button
mat-icon-button
aria-label="More download options"
[matMenuTriggerFor]="menu"
[hidden]="!submission.isUploaded"
>
<mat-icon>more_vert</mat-icon>
</button>
<div fxFlex></div>
<mat-menu #menu="matMenu">
<button mat-menu-item (click)="downloadSubmissionFiles()">Download original files</button>
</mat-menu>

<button mat-stroked-button [matMenuTriggerFor]="menu2">
Actions <mat-icon aria-hidden="false" aria-label="dropdown icon" fontIcon="arrow_drop_down"></mat-icon>
</button>
<mat-menu #menu2="matMenu">
<button [hidden]="!canReuploadEvidence" mat-menu-item (click)="uploadAlternateFiles()">
Upload alternate files
</button>
<button [hidden]="!canRegeneratePdf" mat-menu-item (click)="regeneratePdf()">Regenerate PDFs</button>
</mat-menu>
</mat-card-actions>
</mat-card>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { TaskSubmissionCardComponent } from './task-submission-card.component';

describe('TaskSubmissionCardComponent', () => {
let component: TaskSubmissionCardComponent;
let fixture: ComponentFixture<TaskSubmissionCardComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ TaskSubmissionCardComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(TaskSubmissionCardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});

0 comments on commit 6d27690

Please sign in to comment.