From 12c938fe2321d79b04811833ba649d6d770c3859 Mon Sep 17 00:00:00 2001 From: "jvanboxtel@wisc.edu" <jvanboxtel@wisc.edu> Date: Thu, 2 May 2019 10:44:46 -0500 Subject: [PATCH] ROENROLL-1698 remove print button --- src/app/core/header/header.component.html | 1 - src/app/core/header/header.component.ts | 4 --- .../degree-planner.component.html | 5 +--- .../degree-planner.component.ts | 18 ------------- .../sidenav-menu-item.component.html | 26 +++---------------- .../sidenav-menu-item.component.ts | 4 --- 6 files changed, 4 insertions(+), 54 deletions(-) diff --git a/src/app/core/header/header.component.html b/src/app/core/header/header.component.html index 7dbb7ca..3f42f79 100644 --- a/src/app/core/header/header.component.html +++ b/src/app/core/header/header.component.html @@ -110,7 +110,6 @@ </myuw-app-bar> <mat-menu #mobileActionMenu="matMenu"> - <button mat-menu-item (click)="printPlan()">Print degree plan</button> <a mat-menu-item target="_blank" href="/api/degreeplanpdf?roadmapId={{ activeRoadmapId$ | async }}">Download PDF</a> <button mat-menu-item (click)="addPlan()">Add degree plan</button> <button mat-menu-item (click)="addYear()">Add academic year</button> diff --git a/src/app/core/header/header.component.ts b/src/app/core/header/header.component.ts index 7f8e3f9..fed0387 100644 --- a/src/app/core/header/header.component.ts +++ b/src/app/core/header/header.component.ts @@ -63,10 +63,6 @@ export class HeaderComponent implements OnInit { this.store.dispatch(new CloseSidenav()); } - public printPlan() { - window.print(); - } - public addPlan() { this.dialog .open(PromptDialogComponent, { diff --git a/src/app/degree-planner/degree-planner.component.html b/src/app/degree-planner/degree-planner.component.html index 41d36ad..7a7d22b 100644 --- a/src/app/degree-planner/degree-planner.component.html +++ b/src/app/degree-planner/degree-planner.component.html @@ -77,10 +77,7 @@ [disabled]="degreePlan.primary"> Make primary </button> - <button mat-menu-item (click)="onPrintPlanClick()"> - Print plan - </button> - <a mat-menu-item target="_blank" href="/api/degreeplanpdf?roadmapId={{ degreePlan.roadmapId }}">Download PDF</a> + <a mat-menu-item target="_blank" href="/api/degreeplanpdf?roadmapId={{ degreePlan.roadmapId }}">Create PDF</a> <button mat-menu-item (click)="onDeletePlanClick(degreePlan)" diff --git a/src/app/degree-planner/degree-planner.component.ts b/src/app/degree-planner/degree-planner.component.ts index 55baa3a..e98ae34 100644 --- a/src/app/degree-planner/degree-planner.component.ts +++ b/src/app/degree-planner/degree-planner.component.ts @@ -224,24 +224,6 @@ export class DegreePlannerComponent implements OnInit { }); } - public onPrintPlanClick() { - const ua = navigator.userAgent.toLowerCase(); - const isAndroid = ua.indexOf('android') > -1; - // window.print() is not supported on android. - if (isAndroid) { - this.dialog.open(ConfirmDialogComponent, { - data: { - title: 'Print Dialog', - confirmText: 'Ok', - text: - 'Please try to print using your browsers print function or setup Google Cloud Print.', - }, - }); - } else { - window.print(); - } - } - public onSharePlanClick() { // TODO console.log('onSharePlanClick'); diff --git a/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.html b/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.html index 9a2597e..39875a7 100644 --- a/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.html +++ b/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.html @@ -66,29 +66,9 @@ </mat-panel-title> </mat-expansion-panel-header> <div> - <button mat-button aria-label="Print degree plan" class="sidenav-link-btn" (click)="print()"> - <i - aria-hidden="true" - class="material-icons" - alt="Print plan" - matTooltip="Print plan" - matTooltipPosition="left">print</i> - Print - </button> <a mat-button class="sidenav-link-btn" target="_blank" href="/api/degreeplanpdf?roadmapId={{ planId }}"> - <svg - aria-labelledby="downloadPDFtitle downloadPDFdesc" - role="img" - alt="Download PDF version of your degree plan" - matTooltip="Download PDF" - matTooltipPosition="left" - style="width:24px;height:24px;" - viewBox="0 0 24 24"> - <title id="downloadPDFtitle">Download PDF</title> - <desc id="downloadPDFdesc">Download PDF version of your degree plan</desc> - <path fill="#0479a8" d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z" /> - </svg> - Download PDF + <i aria-hidden="true" class="material-icons" alt="create pdf" matTooltip="Create a PDF" matTooltipPosition="left">picture_as_pdf</i> + Create PDF </a> <button mat-button aria-label="Add degree plan" class="sidenav-link-btn" (click)="onCreatePlanClick()"> <i @@ -115,7 +95,7 @@ fill="#0479a8" d="M19,19V7H5V19H19M16,1H18V3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1M11,9H13V12H16V14H13V17H11V14H8V12H11V9Z"/> </svg> - Add Academic Year + Add Academic Year </button> </div> </mat-expansion-panel> diff --git a/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.ts b/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.ts index 73c2d74..6f21ac0 100644 --- a/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.ts +++ b/src/app/degree-planner/sidenav-menu-item/sidenav-menu-item.component.ts @@ -49,10 +49,6 @@ export class SidenavMenuItemComponent implements OnDestroy { this.snackBar.open('New academic year has been created'); } - public print() { - window.print(); - } - public onCreatePlanClick() { this.dialog .open(PromptDialogComponent, { -- GitLab