diff options
4 files changed, 10 insertions, 9 deletions
diff --git a/client/src/app/+accounts/accounts.component.html b/client/src/app/+accounts/accounts.component.html index 144545250..8362e6b7e 100644 --- a/client/src/app/+accounts/accounts.component.html +++ b/client/src/app/+accounts/accounts.component.html | |||
@@ -83,5 +83,5 @@ | |||
83 | </div> | 83 | </div> |
84 | 84 | ||
85 | <ng-container *ngIf="prependModerationActions"> | 85 | <ng-container *ngIf="prependModerationActions"> |
86 | <my-account-report #accountReportModal [account]="account"></my-account-report> | 86 | <my-account-report #accountReportModal></my-account-report> |
87 | </ng-container> | 87 | </ng-container> |
diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts index 460f1dbf9..898325492 100644 --- a/client/src/app/+accounts/accounts.component.ts +++ b/client/src/app/+accounts/accounts.component.ts | |||
@@ -164,7 +164,7 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
164 | } | 164 | } |
165 | 165 | ||
166 | private showReportModal () { | 166 | private showReportModal () { |
167 | this.accountReportModal.show() | 167 | this.accountReportModal.show(this.account) |
168 | } | 168 | } |
169 | 169 | ||
170 | private loadUserIfNeeded (account: Account) { | 170 | private loadUserIfNeeded (account: Account) { |
diff --git a/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts b/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts index 4ec02f11a..78c9b3382 100644 --- a/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts +++ b/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { mapValues, pickBy } from 'lodash-es' | 1 | import { mapValues, pickBy } from 'lodash-es' |
2 | import { Component, Input, OnInit, ViewChild } from '@angular/core' | 2 | import { Component, OnInit, ViewChild } from '@angular/core' |
3 | import { Notifier } from '@app/core' | 3 | import { Notifier } from '@app/core' |
4 | import { ABUSE_REASON_VALIDATOR } from '@app/shared/form-validators/abuse-validators' | 4 | import { ABUSE_REASON_VALIDATOR } from '@app/shared/form-validators/abuse-validators' |
5 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' | 5 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' |
@@ -16,13 +16,12 @@ import { AbuseService } from '../abuse.service' | |||
16 | styleUrls: [ './report.component.scss' ] | 16 | styleUrls: [ './report.component.scss' ] |
17 | }) | 17 | }) |
18 | export class AccountReportComponent extends FormReactive implements OnInit { | 18 | export class AccountReportComponent extends FormReactive implements OnInit { |
19 | @Input() account: Account = null | ||
20 | |||
21 | @ViewChild('modal', { static: true }) modal: NgbModal | 19 | @ViewChild('modal', { static: true }) modal: NgbModal |
22 | 20 | ||
23 | error: string = null | 21 | error: string = null |
24 | predefinedReasons: { id: AbusePredefinedReasonsString, label: string, description?: string, help?: string }[] = [] | 22 | predefinedReasons: { id: AbusePredefinedReasonsString, label: string, description?: string, help?: string }[] = [] |
25 | modalTitle: string | 23 | modalTitle: string |
24 | account: Account = null | ||
26 | 25 | ||
27 | private openedModal: NgbModalRef | 26 | private openedModal: NgbModalRef |
28 | 27 | ||
@@ -48,8 +47,6 @@ export class AccountReportComponent extends FormReactive implements OnInit { | |||
48 | } | 47 | } |
49 | 48 | ||
50 | ngOnInit () { | 49 | ngOnInit () { |
51 | this.modalTitle = $localize`Report ${this.account.displayName}` | ||
52 | |||
53 | this.buildForm({ | 50 | this.buildForm({ |
54 | reason: ABUSE_REASON_VALIDATOR, | 51 | reason: ABUSE_REASON_VALIDATOR, |
55 | predefinedReasons: mapValues(abusePredefinedReasonsMap, r => null) | 52 | predefinedReasons: mapValues(abusePredefinedReasonsMap, r => null) |
@@ -58,7 +55,11 @@ export class AccountReportComponent extends FormReactive implements OnInit { | |||
58 | this.predefinedReasons = this.abuseService.getPrefefinedReasons('account') | 55 | this.predefinedReasons = this.abuseService.getPrefefinedReasons('account') |
59 | } | 56 | } |
60 | 57 | ||
61 | show () { | 58 | show (account: Account) { |
59 | this.account = account | ||
60 | |||
61 | this.modalTitle = $localize`Report ${this.account.displayName}` | ||
62 | |||
62 | this.openedModal = this.modalService.open(this.modal, { centered: true, keyboard: false, size: 'lg' }) | 63 | this.openedModal = this.modalService.open(this.modal, { centered: true, keyboard: false, size: 'lg' }) |
63 | } | 64 | } |
64 | 65 | ||
diff --git a/server/controllers/services.ts b/server/controllers/services.ts index 8a8a95486..9151e1b04 100644 --- a/server/controllers/services.ts +++ b/server/controllers/services.ts | |||
@@ -98,7 +98,7 @@ function buildOEmbed (options: { | |||
98 | thumbnailUrl = undefined | 98 | thumbnailUrl = undefined |
99 | } | 99 | } |
100 | 100 | ||
101 | const html = `<iframe width="${embedWidth}" height="${embedHeight}" sandbox="allow-same-origin allow-scripts" ` + | 101 | const html = `<iframe width="${embedWidth}" height="${embedHeight}" sandbox="allow-same-origin allow-scripts allow-popups" ` + |
102 | `title="${embedTitle}" src="${embedUrl}" frameborder="0" allowfullscreen></iframe>` | 102 | `title="${embedTitle}" src="${embedUrl}" frameborder="0" allowfullscreen></iframe>` |
103 | 103 | ||
104 | const json: any = { | 104 | const json: any = { |