import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core'
import { AuthService, ConfirmService, Notifier, ServerService, UserService } from '@app/core'
import { Account, DropdownAction } from '@app/shared/shared-main'
-import { BulkRemoveCommentsOfBody, ServerConfig, User, UserRight } from '@shared/models'
+import { BulkRemoveCommentsOfBody, User, UserRight } from '@shared/models'
import { BlocklistService } from './blocklist.service'
import { BulkService } from './bulk.service'
import { UserBanModalComponent } from './user-ban-modal.component'
@Input() prependActions: DropdownAction<{ user: User, account: Account }>[]
@Input() buttonSize: 'normal' | 'small' = 'normal'
+ @Input() buttonStyled = true
@Input() placement = 'right-top right-bottom auto'
@Input() label: string
@Input() container: 'body' | undefined = undefined
userActions: DropdownAction<{ user: User, account: Account }>[][] = []
- private serverConfig: ServerConfig
+ requiresEmailVerification = false
constructor (
private authService: AuthService,
private bulkService: BulkService
) { }
- get requiresEmailVerification () {
- return this.serverConfig.signup.requiresEmailVerification
- }
-
- ngOnInit (): void {
- this.serverConfig = this.serverService.getTmpConfig()
+ ngOnInit () {
this.serverService.getConfig()
- .subscribe(config => this.serverConfig = config)
+ .subscribe(config => this.requiresEmailVerification = config.signup.requiresEmailVerification)
}
ngOnChanges () {
this.userActions.push([
{
label: $localize`Mute this account`,
- description: $localize`Hide any content from that user for you.`,
+ description: $localize`Hide any content from that user from you.`,
isDisplayed: ({ account }) => account.mutedByUser === false,
handler: ({ account }) => this.blockAccountByUser(account)
},
},
{
label: $localize`Remove comments from your videos`,
- description: $localize`Remove comments of this account from your videos.`,
+ description: $localize`Remove comments made by this account on your videos.`,
handler: ({ account }) => this.bulkRemoveCommentsOf({ accountName: account.nameWithHost, scope: 'my-videos' })
}
])
instanceActions = instanceActions.concat([
{
label: $localize`Mute this account by your instance`,
- description: $localize`Hide any content from that user for you, your instance and its users.`,
+ description: $localize`Hide any content from that user from you, your instance and its users.`,
isDisplayed: ({ account }) => account.mutedByInstance === false,
handler: ({ account }) => this.blockAccountByInstance(account)
},
{
label: $localize`Unmute this account by your instance`,
- description: $localize`Show back content from that user for you, your instance and its users.`,
+ description: $localize`Show this user's content to the users of this instance again.`,
isDisplayed: ({ account }) => account.mutedByInstance === true,
handler: ({ account }) => this.unblockAccountByInstance(account)
}
instanceActions = instanceActions.concat([
{
label: $localize`Mute the instance by your instance`,
- description: $localize`Hide any content from that instance for you, your instance and its users.`,
+ description: $localize`Hide any content from that instance from you, your instance and its users.`,
isDisplayed: ({ account }) => !account.userId && account.mutedServerByInstance === false,
handler: ({ account }) => this.blockServerByInstance(account.host)
},
instanceActions = instanceActions.concat([
{
label: $localize`Remove comments from your instance`,
- description: $localize`Remove comments of this account from your instance.`,
+ description: $localize`Remove comments made by this account from your instance.`,
handler: ({ account }) => this.bulkRemoveCommentsOf({ accountName: account.nameWithHost, scope: 'instance' })
}
])