Reorganize client shared modules
[oweals/peertube.git] / client / src / app / shared / forms / form-validators / video-change-ownership-validators.service.ts
diff --git a/client/src/app/shared/forms/form-validators/video-change-ownership-validators.service.ts b/client/src/app/shared/forms/form-validators/video-change-ownership-validators.service.ts
deleted file mode 100644 (file)
index c6fbb75..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-import { I18n } from '@ngx-translate/i18n-polyfill'
-import { AbstractControl, ValidationErrors, Validators } from '@angular/forms'
-import { Injectable } from '@angular/core'
-import { BuildFormValidator } from '@app/shared'
-
-@Injectable()
-export class VideoChangeOwnershipValidatorsService {
-  readonly USERNAME: BuildFormValidator
-
-  constructor (private i18n: I18n) {
-    this.USERNAME = {
-      VALIDATORS: [ Validators.required, this.localAccountValidator ],
-      MESSAGES: {
-        'required': this.i18n('The username is required.'),
-        'localAccountOnly': this.i18n('You can only transfer ownership to a local account')
-      }
-    }
-  }
-
-  localAccountValidator (control: AbstractControl): ValidationErrors {
-    if (control.value.includes('@')) {
-      return { 'localAccountOnly': true }
-    }
-
-    return null
-  }
-}