diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts index 6f340884f..1e137e63e 100644 --- a/client/src/app/+admin/admin.component.ts +++ b/client/src/app/+admin/admin.component.ts @@ -91,7 +91,7 @@ export class AdminComponent implements OnInit { } hasVideoAbusesRight () { - return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES) + return this.auth.getUser().hasRight(UserRight.MANAGE_ABUSES) } hasVideoBlocklistRight () { diff --git a/client/src/app/+admin/admin.module.ts b/client/src/app/+admin/admin.module.ts index 728227a84..c59bd2927 100644 --- a/client/src/app/+admin/admin.module.ts +++ b/client/src/app/+admin/admin.module.ts @@ -14,10 +14,10 @@ import { FollowersListComponent, FollowsComponent, VideoRedundanciesListComponen import { FollowingListComponent } from './follows/following-list/following-list.component' import { RedundancyCheckboxComponent } from './follows/shared/redundancy-checkbox.component' import { VideoRedundancyInformationComponent } from './follows/video-redundancies-list/video-redundancy-information.component' -import { ModerationCommentModalComponent, VideoAbuseListComponent, VideoBlockListComponent } from './moderation' +import { ModerationCommentModalComponent, AbuseListComponent, VideoBlockListComponent } from './moderation' import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from './moderation/instance-blocklist' import { ModerationComponent } from './moderation/moderation.component' -import { VideoAbuseDetailsComponent } from './moderation/video-abuse-list/video-abuse-details.component' +import { AbuseDetailsComponent } from './moderation/abuse-list/abuse-details.component' import { PluginListInstalledComponent } from './plugins/plugin-list-installed/plugin-list-installed.component' import { PluginSearchComponent } from './plugins/plugin-search/plugin-search.component' import { PluginShowInstalledComponent } from './plugins/plugin-show-installed/plugin-show-installed.component' @@ -60,8 +60,10 @@ import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersCom ModerationComponent, VideoBlockListComponent, - VideoAbuseListComponent, - VideoAbuseDetailsComponent, + + AbuseListComponent, + AbuseDetailsComponent, + ModerationCommentModalComponent, InstanceServerBlocklistComponent, InstanceAccountBlocklistComponent, diff --git a/client/src/app/+admin/moderation/abuse-list/abuse-details.component.html b/client/src/app/+admin/moderation/abuse-list/abuse-details.component.html new file mode 100644 index 000000000..d031ea8ed --- /dev/null +++ b/client/src/app/+admin/moderation/abuse-list/abuse-details.component.html @@ -0,0 +1,93 @@ +
diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts b/client/src/app/+admin/moderation/abuse-list/abuse-details.component.ts similarity index 59% rename from client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts rename to client/src/app/+admin/moderation/abuse-list/abuse-details.component.ts index 5db2887fa..8f87630b8 100644 --- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts +++ b/client/src/app/+admin/moderation/abuse-list/abuse-details.component.ts @@ -1,19 +1,19 @@ import { Component, Input } from '@angular/core' import { Actor } from '@app/shared/shared-main' import { I18n } from '@ngx-translate/i18n-polyfill' -import { VideoAbusePredefinedReasonsString } from '../../../../../../shared/models/videos/abuse/video-abuse-reason.model' -import { ProcessedVideoAbuse } from './video-abuse-list.component' +import { AbusePredefinedReasonsString } from '@shared/models' +import { ProcessedAbuse } from './abuse-list.component' import { durationToString } from '@app/helpers' @Component({ - selector: 'my-video-abuse-details', - templateUrl: './video-abuse-details.component.html', + selector: 'my-abuse-details', + templateUrl: './abuse-details.component.html', styleUrls: [ '../moderation.component.scss' ] }) -export class VideoAbuseDetailsComponent { - @Input() videoAbuse: ProcessedVideoAbuse +export class AbuseDetailsComponent { + @Input() abuse: ProcessedAbuse - private predefinedReasonsTranslations: { [key in VideoAbusePredefinedReasonsString]: string } + private predefinedReasonsTranslations: { [key in AbusePredefinedReasonsString]: string } constructor ( private i18n: I18n @@ -31,16 +31,16 @@ export class VideoAbuseDetailsComponent { } get startAt () { - return durationToString(this.videoAbuse.startAt) + return durationToString(this.abuse.startAt) } get endAt () { - return durationToString(this.videoAbuse.endAt) + return durationToString(this.abuse.endAt) } getPredefinedReasons () { - if (!this.videoAbuse.predefinedReasons) return [] - return this.videoAbuse.predefinedReasons.map(r => ({ + if (!this.abuse.predefinedReasons) return [] + return this.abuse.predefinedReasons.map(r => ({ id: r, label: this.predefinedReasonsTranslations[r] })) diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html b/client/src/app/+admin/moderation/abuse-list/abuse-list.component.html similarity index 52% rename from client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html rename to client/src/app/+admin/moderation/abuse-list/abuse-list.component.html index 64641b28a..167f32fe6 100644 --- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html +++ b/client/src/app/+admin/moderation/abuse-list/abuse-list.component.html @@ -1,5 +1,5 @@