Skip to content
Snippets Groups Projects
Commit 5db7c880 authored by pnogal's avatar pnogal
Browse files

Add downloadPdf() to all Download PDF buttons

parent 6b8f7296
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ import { AddAcademicYearRequest } from '@app/degree-planner/store/actions/addAca
styleUrls: ['./header.component.scss'],
})
export class HeaderComponent {
public planId: number;
constructor(
private store: Store<DegreePlannerState>,
private dialog: MatDialog,
......@@ -23,8 +24,7 @@ export class HeaderComponent {
}
public downloadPdf() {
// FIXME and open in new window
this.snackBar.open('Not supported yet');
window.open('/api/degreeplanpdf?roadmapId=' + this.planId, '_blank');
}
public addPlan() {
......
......@@ -112,7 +112,7 @@
<button mat-menu-item (click)="onPrintPlanClick()">
Print plan
</button>
<button mat-menu-item>
<button mat-menu-item (click)="downloadPdf()">
Download PDF
</button>
<button
......
......@@ -53,6 +53,7 @@ export class DegreePlannerComponent implements OnInit, OnDestroy {
public isLoadingPlan$: Observable<boolean>;
public activeTermSubscription: Subscription;
public firstActiveTerm: TermCode;
public planId: number;
constructor(
private store: Store<GlobalState>,
......@@ -99,6 +100,10 @@ export class DegreePlannerComponent implements OnInit, OnDestroy {
this.activeTermSubscription.unsubscribe();
}
public downloadPdf() {
window.open('/api/degreeplanpdf?roadmapId=' + this.planId, '_blank');
}
public handleAcademicYearToggle(year: Year): void {
// this.store.dispatch(
// new ToggleAcademicYear({ year: year.twoDigitYearCode.toString() }),
......
......@@ -54,9 +54,7 @@ export class SidenavMenuItemComponent implements OnDestroy {
}
public downloadPdf() {
// FIXME
// window.open('/api/degreeplanpdf?roadmapId=' + this.planId);
this.snackBar.open('Not supported yet');
window.open('/api/degreeplanpdf?roadmapId=' + this.planId, '_blank');
}
public onCreatePlanClick() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment