diff --git a/modules/ui/src/app/components/download-report-zip/download-report-zip.component.ts b/modules/ui/src/app/components/download-report-zip/download-report-zip.component.ts index 2dbae7d9a..f773d87d9 100644 --- a/modules/ui/src/app/components/download-report-zip/download-report-zip.component.ts +++ b/modules/ui/src/app/components/download-report-zip/download-report-zip.component.ts @@ -16,6 +16,7 @@ import { ChangeDetectionStrategy, Component, + HostBinding, HostListener, Input, OnDestroy, @@ -44,6 +45,8 @@ export class DownloadReportZipComponent implements OnDestroy { @Input() url: string | null | undefined = null; @HostListener('click', ['$event.target']) + @HostListener('keydown.enter', ['$event']) + @HostListener('keydown.space', ['$event']) onClick() { const dialogRef = this.dialog.open(DownloadZipModalComponent, { ariaLabel: 'Download zip', @@ -77,6 +80,9 @@ export class DownloadReportZipComponent implements OnDestroy { }); } + @HostBinding('tabIndex') + readonly tabIndex = 0; + ngOnDestroy() { this.destroy$.next(true); this.destroy$.unsubscribe(); diff --git a/modules/ui/src/app/components/download-zip-modal/download-zip-modal.component.html b/modules/ui/src/app/components/download-zip-modal/download-zip-modal.component.html index 8f76133d6..abbbee77b 100644 --- a/modules/ui/src/app/components/download-zip-modal/download-zip-modal.component.html +++ b/modules/ui/src/app/components/download-zip-modal/download-zip-modal.component.html @@ -54,6 +54,7 @@ class="download-button" color="primary" mat-flat-button + aria-label="Download" type="button"> Download @@ -69,7 +70,7 @@ color="primary" mat-button type="button" - m + aria-label="Download ZIP file without Risk Assessment" class="download-button"> Download Anyway diff --git a/modules/ui/src/app/pages/reports/reports.component.html b/modules/ui/src/app/pages/reports/reports.component.html index c649478a5..e35728c6b 100644 --- a/modules/ui/src/app/pages/reports/reports.component.html +++ b/modules/ui/src/app/pages/reports/reports.component.html @@ -155,11 +155,13 @@

Reports

[url]="data.report" [hasProfiles]="vm.hasProfiles" [profiles]="vm.profiles"> - - archive - + + + archive + + {{ DownloadOption.PDF }} - - + + archive {{ DownloadOption.ZIP }} - - + + diff --git a/modules/ui/src/app/pages/testrun/components/download-options/download-options.component.ts b/modules/ui/src/app/pages/testrun/components/download-options/download-options.component.ts index 76cd8d66f..943616d5b 100644 --- a/modules/ui/src/app/pages/testrun/components/download-options/download-options.component.ts +++ b/modules/ui/src/app/pages/testrun/components/download-options/download-options.component.ts @@ -13,7 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + ElementRef, + Input, + ViewChild, +} from '@angular/core'; import { FormsModule } from '@angular/forms'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatSelectModule } from '@angular/material/select'; @@ -48,6 +54,7 @@ export enum DownloadOption { changeDetection: ChangeDetectionStrategy.OnPush, }) export class DownloadOptionsComponent { + @ViewChild('downloadReportZip') downloadReportZip!: ElementRef; @Input() hasProfiles: boolean = false; @Input() profiles: Profile[] = []; @Input() data!: TestrunStatus; @@ -65,6 +72,15 @@ export class DownloadOptionsComponent { } } + onZipSelected(event: MatOptionSelectionChange) { + if (event.isUserInput) { + const uploadCertificatesButton = document.querySelector( + '#downloadReportZip' + ) as HTMLElement; + uploadCertificatesButton.dispatchEvent(new MouseEvent('click')); + } + } + createLink(data: TestrunStatus, type: string) { if (!data.report) { return;