diff --git a/dashboard/components/account-details/OVHAccountDetails.tsx b/dashboard/components/account-details/OVHAccountDetails.tsx new file mode 100644 index 000000000..32bc546fc --- /dev/null +++ b/dashboard/components/account-details/OVHAccountDetails.tsx @@ -0,0 +1,84 @@ +import classNames from 'classnames'; +import { OVHCredentials } from '@utils/cloudAccountHelpers'; +import LabelledInput from '../onboarding-wizard/LabelledInput'; +import { CloudAccountPayload } from '../cloud-account/hooks/useCloudAccounts/useCloudAccount'; + +interface OVHAccountDetailsProps { + cloudAccountData?: CloudAccountPayload; + hasError?: boolean; +} + +function OVHAccountDetails({ + cloudAccountData, + hasError = false +}: OVHAccountDetailsProps) { + return ( +
+ + +
+ + + + +
+ {hasError && ( +
+ We couldn't connect to your OVH account. Please check if the + details are correct. +
+ )} +
+ ); +} + +export default OVHAccountDetails; diff --git a/dashboard/pages/onboarding/provider/ovh.tsx b/dashboard/pages/onboarding/provider/ovh.tsx new file mode 100644 index 000000000..c57f6d643 --- /dev/null +++ b/dashboard/pages/onboarding/provider/ovh.tsx @@ -0,0 +1,15 @@ +import OVHAccountDetails from '@components/account-details/OVHAccountDetails'; +import { allProviders } from '@utils/providerHelper'; +import ProviderContent from '@components/onboarding-wizard/ProviderContent'; + +export default function CivoCredentials() { + return ( + + + + ); +} diff --git a/dashboard/utils/cloudAccountHelpers.ts b/dashboard/utils/cloudAccountHelpers.ts index 3a3a9afe3..052e23ab7 100644 --- a/dashboard/utils/cloudAccountHelpers.ts +++ b/dashboard/utils/cloudAccountHelpers.ts @@ -26,6 +26,13 @@ export type CivoCredentials = Credentials & { token?: string; }; +export type OVHCredentials = Credentials & { + endpoint?: string; + consumerKey?: string; + applicationKey?: string; + applicationSecret?: string; +}; + export type DigitalOceanCredentials = Credentials & { source?: string; token?: string; @@ -171,6 +178,19 @@ export const getPayloadFromForm = (formData: FormData, provider: Provider) => { path: data.path } }; + case allProviders.OVH: + return { + name: data.name, + provider, + credentials: { + endpoint: data.endpoint, + consumerKey: data.consumerKey, + applicationKey: data.applicationKey, + applicationSecret: data.applicationSecret + } + }; + default: + return {}; } };