21925: Add resources to fake store for progress bar unit tests
[arvados.git] / services / workbench2 / src / validators / validators.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { fieldRequire } from './require';
6 import { maxLength } from './max-length';
7 import { isRsaKey } from './is-rsa-key';
8 import { isRemoteHost } from "./is-remote-host";
9 import { validFilePath, validName, validNameAllowSlash } from "./valid-name";
10
11 export const TAG_KEY_VALIDATION = [maxLength(255)];
12 export const TAG_VALUE_VALIDATION = [maxLength(255)];
13
14 export const PROJECT_NAME_VALIDATION = [fieldRequire, validName, maxLength(255)];
15 export const PROJECT_NAME_VALIDATION_ALLOW_SLASH = [fieldRequire, validNameAllowSlash, maxLength(255)];
16
17 export const COLLECTION_NAME_VALIDATION = [fieldRequire, validName, maxLength(255)];
18 export const COLLECTION_NAME_VALIDATION_ALLOW_SLASH = [fieldRequire, validNameAllowSlash, maxLength(255)];
19 export const COLLECTION_DESCRIPTION_VALIDATION = [maxLength(255)];
20 export const COLLECTION_PROJECT_VALIDATION = [fieldRequire];
21
22 export const COPY_NAME_VALIDATION = [fieldRequire, maxLength(255)];
23 export const COPY_FILE_VALIDATION = [fieldRequire];
24 export const RENAME_FILE_VALIDATION = [fieldRequire, validFilePath];
25
26 export const MOVE_TO_VALIDATION = [fieldRequire];
27
28 export const PROCESS_NAME_VALIDATION = [fieldRequire, maxLength(255)];
29 export const PROCESS_DESCRIPTION_VALIDATION = [maxLength(255)];
30
31 export const REPOSITORY_NAME_VALIDATION = [fieldRequire, maxLength(255)];
32
33 export const USER_EMAIL_VALIDATION = [fieldRequire, maxLength(255)];
34 export const PROFILE_EMAIL_VALIDATION = [maxLength(255)];
35 export const PROFILE_URL_VALIDATION = [maxLength(255)];
36 export const USER_LENGTH_VALIDATION = [maxLength(255)];
37
38 export const SSH_KEY_PUBLIC_VALIDATION = [fieldRequire, isRsaKey, maxLength(1024)];
39 export const SSH_KEY_NAME_VALIDATION = [fieldRequire, maxLength(255)];
40
41 export const SITE_MANAGER_REMOTE_HOST_VALIDATION = [fieldRequire, isRemoteHost, maxLength(255)];
42
43 export const MY_ACCOUNT_VALIDATION = [fieldRequire];
44
45 export const CHOOSE_VM_VALIDATION = [fieldRequire];