Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[33078] Don't assign src from method

Oliver Günther0c5a6d62a8d4
diff --git a/frontend/src/app/modules/boards/board/board-video-teaser-modal/board-video-teaser-modal.component.ts b/frontend/src/app/modules/boards/board/board-video-teaser-modal/board-video-teaser-modal.component.ts
index 62a0ae70cf9..3901fb8c702 100644
--- a/frontend/src/app/modules/boards/board/board-video-teaser-modal/board-video-teaser-modal.component.ts
+++ b/frontend/src/app/modules/boards/board/board-video-teaser-modal/board-video-teaser-modal.component.ts
@@ -25,7 +25,7 @@ import {DomSanitizer} from "@angular/platform-browser";
<h3 [textContent]="text.title"></h3>
- <iframe [src]="teaserVideoUrl()"
+ <iframe [src]="teaserVideoUrl"
width="800"
height="500"
class="boards--teaser-video"
@@ -38,7 +38,7 @@ import {DomSanitizer} from "@angular/platform-browser";
`
})
-export class BoardVideoTeaserModalComponent extends OpModalComponent implements OnInit, OnDestroy {
+export class BoardVideoTeaserModalComponent extends OpModalComponent implements OnInit, OnDestroy {
/* Close on escape? */
public closeOnEscape = false;
@@ -50,6 +50,8 @@ export class BoardVideoTeaserModalComponent extends OpModalComponent implements
title: this.I18n.t('js.label_board_plural')
};
+ public teaserVideoUrl = this.domSanitizer.bypassSecurityTrustResourceUrl(boardTeaserVideoURL);
+
constructor(readonly elementRef:ElementRef,
@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
readonly cdRef:ChangeDetectorRef,
@@ -58,8 +60,4 @@ export class BoardVideoTeaserModalComponent extends OpModalComponent implements
super(locals, cdRef, elementRef);
}
-
- public teaserVideoUrl() {
- return this.domSanitizer.bypassSecurityTrustResourceUrl(boardTeaserVideoURL);
- }
}
diff --git a/frontend/src/app/modules/boards/index-page/boards-index-page.component.html b/frontend/src/app/modules/boards/index-page/boards-index-page.component.html
index 6415064ae03..bbb9a7c9a37 100644
--- a/frontend/src/app/modules/boards/index-page/boards-index-page.component.html
+++ b/frontend/src/app/modules/boards/index-page/boards-index-page.component.html
@@ -122,7 +122,7 @@
</a>
<div class="boards--teaser-video-container">
- <iframe [src]="teaserVideoURL()"
+ <iframe [src]="teaserVideoURL"
class="boards--teaser-video"
frameborder="0"
allow="autoplay; fullscreen"
diff --git a/frontend/src/app/modules/boards/index-page/boards-index-page.component.ts b/frontend/src/app/modules/boards/index-page/boards-index-page.component.ts
index 3458282e521..520540a7dcd 100644
--- a/frontend/src/app/modules/boards/index-page/boards-index-page.component.ts
+++ b/frontend/src/app/modules/boards/index-page/boards-index-page.component.ts
@@ -46,6 +46,8 @@ export class BoardsIndexPageComponent extends UntilDestroyedMixin implements OnI
public boards$:Observable<Board[]> = this.boardCache.observeAll();
+ teaserVideoURL = this.domSanitizer.bypassSecurityTrustResourceUrl(boardTeaserVideoURL);
+
constructor(private readonly boardService:BoardService,
private readonly boardCache:BoardCacheService,
private readonly I18n:I18nService,
@@ -101,8 +103,4 @@ export class BoardsIndexPageComponent extends UntilDestroyedMixin implements OnI
public demoLink() {
return enterpriseDemoUrl;
}
-
- public teaserVideoURL() {
- return this.domSanitizer.bypassSecurityTrustResourceUrl(boardTeaserVideoURL);
- }
}