diff --git a/src/react/ISV/modules/index.tsx b/src/react/ISV/modules/index.tsx index c61369695..e22149741 100644 --- a/src/react/ISV/modules/index.tsx +++ b/src/react/ISV/modules/index.tsx @@ -3,6 +3,7 @@ import { ISVPlatformConfig } from '../types'; import styled from 'styled-components'; import Joi from '@hapi/joi'; import { Commvault } from './commvault'; +import { VeeamVBO } from './veeam-vbo'; export const ListItem = styled.li` padding: 0.5rem; @@ -21,6 +22,6 @@ export const checkDecimals = (value: number, helpers: Joi.CustomHelpers) => { return value; }; -export const isvModules: ISVPlatformConfig[] = [Veeam, Commvault]; +export const isvModules: ISVPlatformConfig[] = [Veeam, Commvault, VeeamVBO]; export type { ISVPlatformConfig }; diff --git a/src/react/ISV/modules/veeam-vbo/index.tsx b/src/react/ISV/modules/veeam-vbo/index.tsx new file mode 100644 index 000000000..21dce531c --- /dev/null +++ b/src/react/ISV/modules/veeam-vbo/index.tsx @@ -0,0 +1,162 @@ +import { ISVPlatformConfig } from '../../types'; +import { VeeamLogo } from '../../../ui-elements/Veeam/VeeamLogo'; +import Joi from '@hapi/joi'; +import { Text } from '@scality/core-ui'; +import { checkDecimals, ListItem } from '../index'; +import { accountNameValidationSchema } from '../../../account/AccountCreate'; +import { bucketNameValidationSchema } from '../../../databrowser/buckets/BucketCreate'; +import { VEEAM_BACKUP_REPLICATION_XML_VALUE } from '../../../ui-elements/Veeam/VeeamConstants'; + +const AccountTooltip = () => { + return ( + + ); +}; + +const ApplicationTooltip = () => { + return ( + + ); +}; + +const BucketNameTooltip = () => { + return ( + + ); +}; + +const CapacityTooltip = () => { + return ( + + ); +}; + +const EnableImmutableBackupTooltip = () => { + return ( + + ); +}; + +export const VeeamVBO: ISVPlatformConfig = { + id: 'veeam-vbo', + name: 'Veeam', + logo: , + description: 'Prepare ARTESCA for ', + bucketTag: 'veeam-backup', + skipModalContent: ( + + To start Veeam assistant configuration again, you can go to the{' '} + Accounts page. If the platform doesn't have any accounts, it will + also prompt you on your next login. + + ), + fieldOverrides: [ + { + name: 'accountName', + label: 'Account', + placeholder: 'Enter account name', + tooltip: , + }, + { + name: 'application', + label: 'Veeam application', + placeholder: 'Select Veeam application', + tooltip: , + }, + { + name: 'bucketName', + label: 'Bucket name', + placeholder: 'Enter bucket name', + tooltip: , + }, + { + name: 'capacity', + label: 'Repository Capacity', + placeholder: 'Enter capacity', + tooltip: , + }, + { + name: 'enableImmutableBackup', + label: 'Immutable Backup', + tooltip: , + }, + ], + validator: Joi.object({ + accountName: accountNameValidationSchema, + accountNameType: Joi.string().required(), + IAMUserName: accountNameValidationSchema, + IAMUserNameType: Joi.string().required(), + generateKey: Joi.boolean().required(), + application: Joi.string().required(), + enableImmutableBackup: Joi.boolean().required(), + buckets: Joi.array().items( + Joi.object({ + name: bucketNameValidationSchema, + tag: Joi.string(), + capacity: Joi.when('application', { + is: Joi.equal(VEEAM_BACKUP_REPLICATION_XML_VALUE), + then: Joi.number() + .required() + .min(1) + .max(1024) + .custom((value, helpers) => checkDecimals(value, helpers)), + otherwise: Joi.valid(), + }), + capacityUnit: Joi.when('application', { + is: Joi.equal(VEEAM_BACKUP_REPLICATION_XML_VALUE), + then: Joi.string().required(), + otherwise: Joi.valid(), + }), + capacityBytes: Joi.number().required(), + }), + ), + }), +}; diff --git a/src/react/ISV/types/index.ts b/src/react/ISV/types/index.ts index 47f46393b..eee190d58 100644 --- a/src/react/ISV/types/index.ts +++ b/src/react/ISV/types/index.ts @@ -1,6 +1,6 @@ import Joi from '@hapi/joi'; -export type ISVPlatform = 'veeam' | 'commvault'; +export type ISVPlatform = 'veeam' | 'commvault' | 'veeam-vbo'; export type ISVConfig = { accountName: string; diff --git a/src/react/ui-elements/PartnerApp/ISVList.tsx b/src/react/ui-elements/PartnerApp/ISVList.tsx index d42ca14ea..7ed5e5f19 100644 --- a/src/react/ui-elements/PartnerApp/ISVList.tsx +++ b/src/react/ui-elements/PartnerApp/ISVList.tsx @@ -14,16 +14,16 @@ import React from 'react'; export const ISVList = [ { id: 'veeam', - name: 'Veeam', logo: , type: VEEAM_BACKUP_REPLICATION, }, - // { - // name: 'Veeam VBO', - // logo: , - // type: 'Veeam Backup for Microsoft 365', - // }, + { + id: 'veeam-vbo', + name: 'Veeam VBO', + logo: , + type: 'Veeam Backup for Microsoft 365', + }, { id: 'commvault', name: 'Commvault', logo: }, ];