Merge branch 'release/4.0.0' into develop
This commit is contained in:
commit
d9f9804d86
|
@ -83,5 +83,5 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-container *ngIf="prependModerationActions">
|
<ng-container *ngIf="prependModerationActions">
|
||||||
<my-account-report #accountReportModal [account]="account"></my-account-report>
|
<my-account-report #accountReportModal></my-account-report>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
|
@ -164,7 +164,7 @@ export class AccountsComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
private showReportModal () {
|
private showReportModal () {
|
||||||
this.accountReportModal.show()
|
this.accountReportModal.show(this.account)
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadUserIfNeeded (account: Account) {
|
private loadUserIfNeeded (account: Account) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { mapValues, pickBy } from 'lodash-es'
|
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 { Notifier } from '@app/core'
|
||||||
import { ABUSE_REASON_VALIDATOR } from '@app/shared/form-validators/abuse-validators'
|
import { ABUSE_REASON_VALIDATOR } from '@app/shared/form-validators/abuse-validators'
|
||||||
import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
|
import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
|
||||||
|
@ -16,13 +16,12 @@ import { AbuseService } from '../abuse.service'
|
||||||
styleUrls: [ './report.component.scss' ]
|
styleUrls: [ './report.component.scss' ]
|
||||||
})
|
})
|
||||||
export class AccountReportComponent extends FormReactive implements OnInit {
|
export class AccountReportComponent extends FormReactive implements OnInit {
|
||||||
@Input() account: Account = null
|
|
||||||
|
|
||||||
@ViewChild('modal', { static: true }) modal: NgbModal
|
@ViewChild('modal', { static: true }) modal: NgbModal
|
||||||
|
|
||||||
error: string = null
|
error: string = null
|
||||||
predefinedReasons: { id: AbusePredefinedReasonsString, label: string, description?: string, help?: string }[] = []
|
predefinedReasons: { id: AbusePredefinedReasonsString, label: string, description?: string, help?: string }[] = []
|
||||||
modalTitle: string
|
modalTitle: string
|
||||||
|
account: Account = null
|
||||||
|
|
||||||
private openedModal: NgbModalRef
|
private openedModal: NgbModalRef
|
||||||
|
|
||||||
|
@ -48,8 +47,6 @@ export class AccountReportComponent extends FormReactive implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
this.modalTitle = $localize`Report ${this.account.displayName}`
|
|
||||||
|
|
||||||
this.buildForm({
|
this.buildForm({
|
||||||
reason: ABUSE_REASON_VALIDATOR,
|
reason: ABUSE_REASON_VALIDATOR,
|
||||||
predefinedReasons: mapValues(abusePredefinedReasonsMap, r => null)
|
predefinedReasons: mapValues(abusePredefinedReasonsMap, r => null)
|
||||||
|
@ -58,7 +55,11 @@ export class AccountReportComponent extends FormReactive implements OnInit {
|
||||||
this.predefinedReasons = this.abuseService.getPrefefinedReasons('account')
|
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' })
|
this.openedModal = this.modalService.open(this.modal, { centered: true, keyboard: false, size: 'lg' })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ function buildOEmbed (options: {
|
||||||
thumbnailUrl = undefined
|
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>`
|
`title="${embedTitle}" src="${embedUrl}" frameborder="0" allowfullscreen></iframe>`
|
||||||
|
|
||||||
const json: any = {
|
const json: any = {
|
||||||
|
|
Loading…
Reference in New Issue