]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Merge branch 'release/4.0.0' into develop
authorChocobozzz <me@florianbigard.com>
Tue, 7 Dec 2021 10:06:57 +0000 (11:06 +0100)
committerChocobozzz <me@florianbigard.com>
Tue, 7 Dec 2021 10:06:57 +0000 (11:06 +0100)
client/src/app/+accounts/accounts.component.html
client/src/app/+accounts/accounts.component.ts
client/src/app/shared/shared-moderation/report-modals/account-report.component.ts
server/controllers/services.ts

index 1445452507e43cc4aec0445fadc75760767ce41b..8362e6b7e50bfa5f30bdd6882c16ce8b165e3dc3 100644 (file)
@@ -83,5 +83,5 @@
 </div>
 
 <ng-container *ngIf="prependModerationActions">
-  <my-account-report #accountReportModal [account]="account"></my-account-report>
+  <my-account-report #accountReportModal></my-account-report>
 </ng-container>
index 460f1dbf90f77d4fb676887dcbf5b8316a402ffe..8983254928339990c8f76a43073809501580f636 100644 (file)
@@ -164,7 +164,7 @@ export class AccountsComponent implements OnInit, OnDestroy {
   }
 
   private showReportModal () {
-    this.accountReportModal.show()
+    this.accountReportModal.show(this.account)
   }
 
   private loadUserIfNeeded (account: Account) {
index 4ec02f11aeba65ce4b0aba2d6e1beb196fe30fe9..78c9b338292f6c0d20e18f541e0d0b1ae5adce8c 100644 (file)
@@ -1,5 +1,5 @@
 import { mapValues, pickBy } from 'lodash-es'
-import { Component, Input, OnInit, ViewChild } from '@angular/core'
+import { Component, OnInit, ViewChild } from '@angular/core'
 import { Notifier } from '@app/core'
 import { ABUSE_REASON_VALIDATOR } from '@app/shared/form-validators/abuse-validators'
 import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
@@ -16,13 +16,12 @@ import { AbuseService } from '../abuse.service'
   styleUrls: [ './report.component.scss' ]
 })
 export class AccountReportComponent extends FormReactive implements OnInit {
-  @Input() account: Account = null
-
   @ViewChild('modal', { static: true }) modal: NgbModal
 
   error: string = null
   predefinedReasons: { id: AbusePredefinedReasonsString, label: string, description?: string, help?: string }[] = []
   modalTitle: string
+  account: Account = null
 
   private openedModal: NgbModalRef
 
@@ -48,8 +47,6 @@ export class AccountReportComponent extends FormReactive implements OnInit {
   }
 
   ngOnInit () {
-    this.modalTitle = $localize`Report ${this.account.displayName}`
-
     this.buildForm({
       reason: ABUSE_REASON_VALIDATOR,
       predefinedReasons: mapValues(abusePredefinedReasonsMap, r => null)
@@ -58,7 +55,11 @@ export class AccountReportComponent extends FormReactive implements OnInit {
     this.predefinedReasons = this.abuseService.getPrefefinedReasons('account')
   }
 
-  show () {
+  show (account: Account) {
+    this.account = account
+
+    this.modalTitle = $localize`Report ${this.account.displayName}`
+
     this.openedModal = this.modalService.open(this.modal, { centered: true, keyboard: false, size: 'lg' })
   }
 
index 8a8a95486071b0b12ef5397e6ac8225da8b70d82..9151e1b04e73b64a9e0e2e10cc43729cb4c1e277 100644 (file)
@@ -98,7 +98,7 @@ function buildOEmbed (options: {
     thumbnailUrl = undefined
   }
 
-  const html = `<iframe width="${embedWidth}" height="${embedHeight}" sandbox="allow-same-origin allow-scripts" ` +
+  const html = `<iframe width="${embedWidth}" height="${embedHeight}" sandbox="allow-same-origin allow-scripts allow-popups" ` +
     `title="${embedTitle}" src="${embedUrl}" frameborder="0" allowfullscreen></iframe>`
 
   const json: any = {