diff --git a/wowup-electron/src/app/components/common/confirm-dialog/confirm-dialog.component.html b/wowup-electron/src/app/components/common/confirm-dialog/confirm-dialog.component.html index 3305dbdf..4c06d689 100644 --- a/wowup-electron/src/app/components/common/confirm-dialog/confirm-dialog.component.html +++ b/wowup-electron/src/app/components/common/confirm-dialog/confirm-dialog.component.html @@ -1,5 +1,5 @@

{{ data.title }}

-
+

 
diff --git a/wowup-electron/src/app/components/common/confirm-dialog/confirm-dialog.component.ts b/wowup-electron/src/app/components/common/confirm-dialog/confirm-dialog.component.ts index b1e98e4b..fd20d118 100644 --- a/wowup-electron/src/app/components/common/confirm-dialog/confirm-dialog.component.ts +++ b/wowup-electron/src/app/components/common/confirm-dialog/confirm-dialog.component.ts @@ -1,5 +1,7 @@ -import { Component, Inject } from "@angular/core"; +import { Component, ElementRef, Inject, ViewChild } from "@angular/core"; import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog"; +import { LinkService } from "../../../services/links/link.service"; +import { formatDynamicLinks } from "../../../utils/dom.utils"; export interface DialogData { title: string; @@ -14,14 +16,28 @@ export interface DialogData { styleUrls: ["./confirm-dialog.component.scss"], }) export class ConfirmDialogComponent { + @ViewChild("dialogContent", { read: ElementRef }) public dialogContent!: ElementRef; + public positiveKey: string; public negativeKey: string; public constructor( public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: DialogData + @Inject(MAT_DIALOG_DATA) public data: DialogData, + private _linkService: LinkService ) { this.positiveKey = data.positiveKey ?? "DIALOGS.CONFIRM.POSITIVE_BUTTON"; this.negativeKey = data.negativeKey ?? "DIALOGS.CONFIRM.NEGATIVE_BUTTON"; } + + public ngAfterViewChecked(): void { + const descriptionContainer: HTMLDivElement = this.dialogContent?.nativeElement; + formatDynamicLinks(descriptionContainer, this.onOpenLink); + } + + private onOpenLink = (element: HTMLAnchorElement): boolean => { + this._linkService.confirmLinkNavigation(element.href).subscribe(); + + return false; + }; }