diff --git a/src/app/common/footer/footer.component.html b/src/app/common/footer/footer.component.html index 019d4ae30..59b930968 100644 --- a/src/app/common/footer/footer.component.html +++ b/src/app/common/footer/footer.component.html @@ -22,9 +22,22 @@
- + + + + + + + diff --git a/src/app/common/footer/footer.component.ts b/src/app/common/footer/footer.component.ts index a3651cba7..46af3158a 100644 --- a/src/app/common/footer/footer.component.ts +++ b/src/app/common/footer/footer.component.ts @@ -23,8 +23,6 @@ export class FooterComponent implements OnInit { this.selectedTask$.subscribe((task) => { this.selectedTask = task; }); - - // this.selectedTask$.subscribe(this.selectedTaskService.selectedTask$); } downloadFiles() { @@ -40,4 +38,12 @@ export class FooterComponent implements OnInit { `${this.selectedTask.project.student.lastName}-${this.selectedTask.definition.name}.pdf` ); } + + viewTaskSheet() { + this.selectedTaskService.showTaskSheet(); + } + + viewSubmission() { + this.selectedTaskService.showSubmission(); + } } diff --git a/src/app/projects/states/dashboard/directives/task-dashboard/task-dashboard.component.html b/src/app/projects/states/dashboard/directives/task-dashboard/task-dashboard.component.html index ca11e3467..874096bbe 100644 --- a/src/app/projects/states/dashboard/directives/task-dashboard/task-dashboard.component.html +++ b/src/app/projects/states/dashboard/directives/task-dashboard/task-dashboard.component.html @@ -1,4 +1,4 @@ - + diff --git a/src/app/projects/states/dashboard/directives/task-dashboard/task-dashboard.component.ts b/src/app/projects/states/dashboard/directives/task-dashboard/task-dashboard.component.ts index 0c4a25016..9a5d49f77 100644 --- a/src/app/projects/states/dashboard/directives/task-dashboard/task-dashboard.component.ts +++ b/src/app/projects/states/dashboard/directives/task-dashboard/task-dashboard.component.ts @@ -21,6 +21,7 @@ enum dashboardViews { export class TaskDashboardComponent implements OnInit, OnChanges { @Input() task: Task; @Input() showSubmission: boolean; + @Input() pdfUrl: string; currentView: dashboardViews = dashboardViews.submission; taskStatusData: any; constructor( diff --git a/src/app/projects/states/dashboard/selected-task.service.ts b/src/app/projects/states/dashboard/selected-task.service.ts index aaadfccb6..abdfc18bf 100644 --- a/src/app/projects/states/dashboard/selected-task.service.ts +++ b/src/app/projects/states/dashboard/selected-task.service.ts @@ -10,6 +10,7 @@ export class SelectedTaskService { constructor(private taskService: TaskService) {} private task$ = new BehaviorSubject(null); + public currentPdfUrl$ = new BehaviorSubject(null); public setSelectedTask(task: number | Task) { if (typeof task === 'number') { @@ -17,7 +18,15 @@ export class SelectedTaskService { } else { this.task$.next(task); } - // this.task$.next(this.taskService.get(id)); + this.showSubmission(); + } + + public showTaskSheet() { + this.currentPdfUrl$.next(this.task$.value?.definition?.getTaskPDFUrl(false)); + } + + public showSubmission() { + this.currentPdfUrl$.next(this.task$.value.submissionUrl(false)); } public get selectedTask$(): Subject {