diff --git a/diworker/diworker/importers/gcp.py b/diworker/diworker/importers/gcp.py index 1f5ea9aea..9e4b36c8d 100644 --- a/diworker/diworker/importers/gcp.py +++ b/diworker/diworker/importers/gcp.py @@ -27,7 +27,7 @@ def detect_period_start(self): if last_exp_date: self.period_start = last_exp_date.replace( hour=0, minute=0, second=0, microsecond=0) - timedelta( - days=1) + days=3) if not self.period_start: super().detect_period_start() diff --git a/ngui/server/api/restapi/client.ts b/ngui/server/api/restapi/client.ts index 906959239..c5397e53f 100644 --- a/ngui/server/api/restapi/client.ts +++ b/ngui/server/api/restapi/client.ts @@ -67,6 +67,7 @@ class RestApiClient extends BaseClient { ...params.azureSubscriptionConfig, ...params.azureTenantConfig, ...params.gcpConfig, + ...params.gcpTenantConfig, ...params.alibabaConfig, ...params.nebiusConfig, ...params.databricksConfig, @@ -95,6 +96,7 @@ class RestApiClient extends BaseClient { ...params.azureSubscriptionConfig, ...params.azureTenantConfig, ...params.gcpConfig, + ...params.gcpTenantConfig, ...params.alibabaConfig, ...params.nebiusConfig, ...params.databricksConfig, diff --git a/ngui/server/graphql/resolvers/restapi.generated.ts b/ngui/server/graphql/resolvers/restapi.generated.ts index ee8e569f9..6874e9944 100644 --- a/ngui/server/graphql/resolvers/restapi.generated.ts +++ b/ngui/server/graphql/resolvers/restapi.generated.ts @@ -160,6 +160,7 @@ export type CreateDataSourceInput = { azureTenantConfig?: InputMaybe; databricksConfig?: InputMaybe; gcpConfig?: InputMaybe; + gcpTenantConfig?: InputMaybe; k8sConfig?: InputMaybe; name?: InputMaybe; nebiusConfig?: InputMaybe; @@ -190,18 +191,18 @@ export type DataSourceDiscoveryInfos = { }; export type DataSourceInterface = { - account_id: Scalars['String']['output']; + account_id?: Maybe; details?: Maybe; - id: Scalars['String']['output']; - last_getting_metric_attempt_at: Scalars['Int']['output']; + id?: Maybe; + last_getting_metric_attempt_at?: Maybe; last_getting_metric_attempt_error?: Maybe; - last_getting_metrics_at: Scalars['Int']['output']; - last_import_at: Scalars['Int']['output']; - last_import_attempt_at: Scalars['Int']['output']; + last_getting_metrics_at?: Maybe; + last_import_at?: Maybe; + last_import_attempt_at?: Maybe; last_import_attempt_error?: Maybe; - name: Scalars['String']['output']; + name?: Maybe; parent_id?: Maybe; - type: DataSourceType; + type?: Maybe; }; export type DataSourceRequestParams = { @@ -216,6 +217,7 @@ export enum DataSourceType { Databricks = 'databricks', Environment = 'environment', GcpCnr = 'gcp_cnr', + GcpTenant = 'gcp_tenant', KubernetesCnr = 'kubernetes_cnr', Nebius = 'nebius' } @@ -320,6 +322,40 @@ export type GcpDataSource = DataSourceInterface & { type: DataSourceType; }; +export type GcpTenantBillingDataConfig = { + __typename?: 'GcpTenantBillingDataConfig'; + dataset_name?: Maybe; + project_id?: Maybe; + table_name?: Maybe; +}; + +export type GcpTenantConfig = { + __typename?: 'GcpTenantConfig'; + billing_data?: Maybe; +}; + +export type GcpTenantConfigInput = { + billing_data: GcpBillingDataConfigInput; + credentials: Scalars['JSONObject']['input']; +}; + +export type GcpTenantDataSource = DataSourceInterface & { + __typename?: 'GcpTenantDataSource'; + account_id?: Maybe; + config?: Maybe; + details?: Maybe; + id: Scalars['String']['output']; + last_getting_metric_attempt_at: Scalars['Int']['output']; + last_getting_metric_attempt_error?: Maybe; + last_getting_metrics_at: Scalars['Int']['output']; + last_import_at: Scalars['Int']['output']; + last_import_attempt_at: Scalars['Int']['output']; + last_import_attempt_error?: Maybe; + name: Scalars['String']['output']; + parent_id?: Maybe; + type: DataSourceType; +}; + export type Invitation = { __typename?: 'Invitation'; id: Scalars['String']['output']; @@ -334,6 +370,7 @@ export type InvitationAssignment = { id: Scalars['String']['output']; purpose: Scalars['String']['output']; scope_id: Scalars['String']['output']; + scope_name: Scalars['String']['output']; scope_type: Scalars['String']['output']; }; @@ -577,6 +614,7 @@ export type UpdateDataSourceInput = { azureTenantConfig?: InputMaybe; databricksConfig?: InputMaybe; gcpConfig?: InputMaybe; + gcpTenantConfig?: InputMaybe; k8sConfig?: InputMaybe; lastImportAt?: InputMaybe; lastImportModifiedAt?: InputMaybe; @@ -674,7 +712,7 @@ export type DirectiveResolverFn> = { - DataSourceInterface: ( AlibabaDataSource ) | ( AwsDataSource ) | ( AzureSubscriptionDataSource ) | ( AzureTenantDataSource ) | ( DatabricksDataSource ) | ( EnvironmentDataSource ) | ( GcpDataSource ) | ( K8sDataSource ) | ( NebiusDataSource ); + DataSourceInterface: ( AlibabaDataSource ) | ( AwsDataSource ) | ( AzureSubscriptionDataSource ) | ( AzureTenantDataSource ) | ( DatabricksDataSource ) | ( EnvironmentDataSource ) | ( GcpDataSource ) | ( GcpTenantDataSource ) | ( K8sDataSource ) | ( NebiusDataSource ); }; /** Mapping between all available schema types and the resolvers types */ @@ -711,6 +749,10 @@ export type ResolversTypes = { GcpConfig: ResolverTypeWrapper; GcpConfigInput: GcpConfigInput; GcpDataSource: ResolverTypeWrapper; + GcpTenantBillingDataConfig: ResolverTypeWrapper; + GcpTenantConfig: ResolverTypeWrapper; + GcpTenantConfigInput: GcpTenantConfigInput; + GcpTenantDataSource: ResolverTypeWrapper; ID: ResolverTypeWrapper; Int: ResolverTypeWrapper; Invitation: ResolverTypeWrapper; @@ -769,6 +811,10 @@ export type ResolversParentTypes = { GcpConfig: GcpConfig; GcpConfigInput: GcpConfigInput; GcpDataSource: GcpDataSource; + GcpTenantBillingDataConfig: GcpTenantBillingDataConfig; + GcpTenantConfig: GcpTenantConfig; + GcpTenantConfigInput: GcpTenantConfigInput; + GcpTenantDataSource: GcpTenantDataSource; ID: Scalars['ID']['output']; Int: Scalars['Int']['output']; Invitation: Invitation; @@ -917,19 +963,19 @@ export type DataSourceDiscoveryInfosResolvers = { - __resolveType: TypeResolveFn<'AlibabaDataSource' | 'AwsDataSource' | 'AzureSubscriptionDataSource' | 'AzureTenantDataSource' | 'DatabricksDataSource' | 'EnvironmentDataSource' | 'GcpDataSource' | 'K8sDataSource' | 'NebiusDataSource', ParentType, ContextType>; - account_id?: Resolver; + __resolveType: TypeResolveFn<'AlibabaDataSource' | 'AwsDataSource' | 'AzureSubscriptionDataSource' | 'AzureTenantDataSource' | 'DatabricksDataSource' | 'EnvironmentDataSource' | 'GcpDataSource' | 'GcpTenantDataSource' | 'K8sDataSource' | 'NebiusDataSource', ParentType, ContextType>; + account_id?: Resolver, ParentType, ContextType>; details?: Resolver, ParentType, ContextType>; - id?: Resolver; - last_getting_metric_attempt_at?: Resolver; + id?: Resolver, ParentType, ContextType>; + last_getting_metric_attempt_at?: Resolver, ParentType, ContextType>; last_getting_metric_attempt_error?: Resolver, ParentType, ContextType>; - last_getting_metrics_at?: Resolver; - last_import_at?: Resolver; - last_import_attempt_at?: Resolver; + last_getting_metrics_at?: Resolver, ParentType, ContextType>; + last_import_at?: Resolver, ParentType, ContextType>; + last_import_attempt_at?: Resolver, ParentType, ContextType>; last_import_attempt_error?: Resolver, ParentType, ContextType>; - name?: Resolver; + name?: Resolver, ParentType, ContextType>; parent_id?: Resolver, ParentType, ContextType>; - type?: Resolver; + type?: Resolver, ParentType, ContextType>; }; export type DatabricksConfigResolvers = { @@ -1016,6 +1062,35 @@ export type GcpDataSourceResolvers; }; +export type GcpTenantBillingDataConfigResolvers = { + dataset_name?: Resolver, ParentType, ContextType>; + project_id?: Resolver, ParentType, ContextType>; + table_name?: Resolver, ParentType, ContextType>; + __isTypeOf?: IsTypeOfResolverFn; +}; + +export type GcpTenantConfigResolvers = { + billing_data?: Resolver, ParentType, ContextType>; + __isTypeOf?: IsTypeOfResolverFn; +}; + +export type GcpTenantDataSourceResolvers = { + account_id?: Resolver, ParentType, ContextType>; + config?: Resolver, ParentType, ContextType>; + details?: Resolver, ParentType, ContextType>; + id?: Resolver; + last_getting_metric_attempt_at?: Resolver; + last_getting_metric_attempt_error?: Resolver, ParentType, ContextType>; + last_getting_metrics_at?: Resolver; + last_import_at?: Resolver; + last_import_attempt_at?: Resolver; + last_import_attempt_error?: Resolver, ParentType, ContextType>; + name?: Resolver; + parent_id?: Resolver, ParentType, ContextType>; + type?: Resolver; + __isTypeOf?: IsTypeOfResolverFn; +}; + export type InvitationResolvers = { id?: Resolver; invite_assignments?: Resolver>, ParentType, ContextType>; @@ -1029,6 +1104,7 @@ export type InvitationAssignmentResolvers; purpose?: Resolver; scope_id?: Resolver; + scope_name?: Resolver; scope_type?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; @@ -1156,6 +1232,9 @@ export type Resolvers = { GcpBillingDataConfig?: GcpBillingDataConfigResolvers; GcpConfig?: GcpConfigResolvers; GcpDataSource?: GcpDataSourceResolvers; + GcpTenantBillingDataConfig?: GcpTenantBillingDataConfigResolvers; + GcpTenantConfig?: GcpTenantConfigResolvers; + GcpTenantDataSource?: GcpTenantDataSourceResolvers; Invitation?: InvitationResolvers; InvitationAssignment?: InvitationAssignmentResolvers; JSONObject?: GraphQLScalarType; diff --git a/ngui/server/graphql/resolvers/restapi.ts b/ngui/server/graphql/resolvers/restapi.ts index 198555381..0e0423a13 100644 --- a/ngui/server/graphql/resolvers/restapi.ts +++ b/ngui/server/graphql/resolvers/restapi.ts @@ -19,6 +19,9 @@ const resolvers: Resolvers = { case "gcp_cnr": { return "GcpDataSource"; } + case "gcp_tenant": { + return "GcpTenantDataSource"; + } case "alibaba_cnr": { return "AlibabaDataSource"; } diff --git a/ngui/server/graphql/schemas/restapi.graphql b/ngui/server/graphql/schemas/restapi.graphql index c5f73f934..37cbe6585 100644 --- a/ngui/server/graphql/schemas/restapi.graphql +++ b/ngui/server/graphql/schemas/restapi.graphql @@ -6,6 +6,7 @@ enum DataSourceType { azure_tenant azure_cnr gcp_cnr + gcp_tenant alibaba_cnr nebius databricks @@ -35,16 +36,16 @@ type DataSourceDetails { } interface DataSourceInterface { - id: String! - name: String! - type: DataSourceType! + id: String + name: String + type: DataSourceType parent_id: String - account_id: String! - last_import_at: Int! - last_import_attempt_at: Int! + account_id: String + last_import_at: Int + last_import_attempt_at: Int last_import_attempt_error: String - last_getting_metrics_at: Int! - last_getting_metric_attempt_at: Int! + last_getting_metrics_at: Int + last_getting_metric_attempt_at: Int last_getting_metric_attempt_error: String details: DataSourceDetails } @@ -151,6 +152,33 @@ type GcpDataSource implements DataSourceInterface { config: GcpConfig } +# GCP tenant data source +type GcpTenantBillingDataConfig { + dataset_name: String + table_name: String + project_id: String +} + +type GcpTenantConfig { + billing_data: GcpTenantBillingDataConfig +} + +type GcpTenantDataSource implements DataSourceInterface { + id: String! + name: String! + type: DataSourceType! + parent_id: String + account_id: String + last_import_at: Int! + last_import_attempt_at: Int! + last_import_attempt_error: String + last_getting_metrics_at: Int! + last_getting_metric_attempt_at: Int! + last_getting_metric_attempt_error: String + details: DataSourceDetails + config: GcpTenantConfig +} + # Alibaba data source type AlibabaConfig { access_key_id: String @@ -309,6 +337,11 @@ input GcpConfigInput { credentials: JSONObject! } +input GcpTenantConfigInput { + billing_data: GcpBillingDataConfigInput! + credentials: JSONObject! +} + input AlibabaConfigInput { access_key_id: String! secret_access_key: String! @@ -344,6 +377,7 @@ input CreateDataSourceInput { azureSubscriptionConfig: AzureSubscriptionConfigInput azureTenantConfig: AzureTenantConfigInput gcpConfig: GcpConfigInput + gcpTenantConfig: GcpTenantConfigInput alibabaConfig: AlibabaConfigInput nebiusConfig: NebiusConfigInput databricksConfig: DatabricksConfigInput @@ -359,6 +393,7 @@ input UpdateDataSourceInput { azureSubscriptionConfig: AzureSubscriptionConfigInput azureTenantConfig: AzureTenantConfigInput gcpConfig: GcpConfigInput + gcpTenantConfig: GcpTenantConfigInput alibabaConfig: AlibabaConfigInput nebiusConfig: NebiusConfigInput databricksConfig: DatabricksConfigInput @@ -405,6 +440,7 @@ type Employee { type InvitationAssignment { id: String! scope_id: String! + scope_name: String! scope_type: String! purpose: String! } diff --git a/ngui/ui/src/components/DataSourceCredentialFields/GcpTenantCredentials/GcpTenantCredentials.tsx b/ngui/ui/src/components/DataSourceCredentialFields/GcpTenantCredentials/GcpTenantCredentials.tsx new file mode 100644 index 000000000..03a4b0231 --- /dev/null +++ b/ngui/ui/src/components/DataSourceCredentialFields/GcpTenantCredentials/GcpTenantCredentials.tsx @@ -0,0 +1,64 @@ +import { FormControl } from "@mui/material"; +import { FormattedMessage } from "react-intl"; +import { DropzoneArea } from "components/Dropzone"; +import { TextInput } from "components/forms/common/fields"; +import QuestionMark from "components/QuestionMark"; +import { ObjectValues } from "utils/types"; + +export const FIELD_NAMES = Object.freeze({ + CREDENTIALS: "credentials", + BILLING_DATA_DATASET: "billingDataDatasetName", + BILLING_DATA_TABLE: "billingDataTableName" +}); + +type FIELD_NAME = ObjectValues; + +type GcpTenantCredentialsProps = { + hidden?: FIELD_NAME[]; +}; + +const GcpTenantCredentials = ({ hidden = [] }: GcpTenantCredentialsProps) => { + const isHidden = (fieldName: FIELD_NAME) => hidden.includes(fieldName); + + return ( + <> + + + + {!isHidden(FIELD_NAMES.BILLING_DATA_DATASET) && ( + {chunks} + }} + dataTestId="qmark_billing_data_dataset_name" + /> + ) + }} + label={} + autoComplete="off" + /> + )} + {!isHidden(FIELD_NAMES.BILLING_DATA_DATASET) && ( + + }} + label={} + autoComplete="off" + /> + )} + + ); +}; + +export default GcpTenantCredentials; diff --git a/ngui/ui/src/components/DataSourceCredentialFields/GcpTenantCredentials/index.ts b/ngui/ui/src/components/DataSourceCredentialFields/GcpTenantCredentials/index.ts new file mode 100644 index 000000000..70cbe42b3 --- /dev/null +++ b/ngui/ui/src/components/DataSourceCredentialFields/GcpTenantCredentials/index.ts @@ -0,0 +1,4 @@ +import GcpTenantCredentials, { FIELD_NAMES } from "./GcpTenantCredentials"; + +export { FIELD_NAMES }; +export default GcpTenantCredentials; diff --git a/ngui/ui/src/components/DataSourceCredentialFields/index.ts b/ngui/ui/src/components/DataSourceCredentialFields/index.ts index b73e8796e..068463188 100644 --- a/ngui/ui/src/components/DataSourceCredentialFields/index.ts +++ b/ngui/ui/src/components/DataSourceCredentialFields/index.ts @@ -10,6 +10,7 @@ import AzureSubscriptionCredentials, { import AzureTenantCredentials, { FIELD_NAMES as AZURE_TENANT_CREDENTIALS_FIELD_NAMES } from "./AzureTenantCredentials"; import DatabricksCredentials, { FIELD_NAMES as DATABRICKS_CREDENTIALS_FIELD_NAMES } from "./DatabricksCredentials"; import GcpCredentials, { FIELD_NAMES as GCP_CREDENTIALS_FIELD_NAMES } from "./GcpCredentials"; +import GcpTenantCredentials, { FIELD_NAMES as GCP_TENANT_CREDENTIALS_FIELD_NAMES } from "./GcpTenantCredentials"; import KubernetesCredentials, { FIELD_NAMES as KUBERNETES_CREDENTIALS_FIELD_NAMES } from "./KubernetesCredentials"; import NebiusCredentials from "./NebiusCredentials"; @@ -32,6 +33,8 @@ export { KUBERNETES_CREDENTIALS_FIELD_NAMES, GcpCredentials, GCP_CREDENTIALS_FIELD_NAMES, + GcpTenantCredentials, + GCP_TENANT_CREDENTIALS_FIELD_NAMES, AlibabaCredentials, ALIBABA_CREDENTIALS_FIELD_NAMES, NebiusCredentials, diff --git a/ngui/ui/src/components/DataSourceDetails/DataSourceDetails.tsx b/ngui/ui/src/components/DataSourceDetails/DataSourceDetails.tsx index e4de0837e..04beeb2fb 100644 --- a/ngui/ui/src/components/DataSourceDetails/DataSourceDetails.tsx +++ b/ngui/ui/src/components/DataSourceDetails/DataSourceDetails.tsx @@ -1,7 +1,17 @@ import { Stack } from "@mui/material"; import { FormattedMessage } from "react-intl"; import SummaryList from "components/SummaryList"; -import { ALIBABA_CNR, AWS_CNR, AZURE_CNR, AZURE_TENANT, GCP_CNR, KUBERNETES_CNR, NEBIUS, DATABRICKS } from "utils/constants"; +import { + ALIBABA_CNR, + AWS_CNR, + AZURE_CNR, + AZURE_TENANT, + GCP_CNR, + KUBERNETES_CNR, + NEBIUS, + DATABRICKS, + GCP_TENANT +} from "utils/constants"; import { SPACING_2 } from "utils/layouts"; import { ChildrenList } from "./ChildrenList"; import { K8sHelp } from "./Help"; @@ -21,6 +31,7 @@ const DataSourceDetails = ({ id, accountId, parentId, type, config = {} }) => { [AZURE_CNR]: AzureProperties, [AZURE_TENANT]: AzureProperties, [GCP_CNR]: GcpProperties, + [GCP_TENANT]: GcpProperties, [ALIBABA_CNR]: AlibabaProperties, [KUBERNETES_CNR]: K8sProperties, [NEBIUS]: NebiusProperties, @@ -32,7 +43,8 @@ const DataSourceDetails = ({ id, accountId, parentId, type, config = {} }) => { }[type]; const childrenList = { - [AZURE_TENANT]: ChildrenList + [AZURE_TENANT]: ChildrenList, + [GCP_TENANT]: ChildrenList }[type]; return ( diff --git a/ngui/ui/src/components/forms/ConnectCloudAccountForm/ConnectCloudAccountForm.tsx b/ngui/ui/src/components/forms/ConnectCloudAccountForm/ConnectCloudAccountForm.tsx index a361ee85d..8935697f3 100644 --- a/ngui/ui/src/components/forms/ConnectCloudAccountForm/ConnectCloudAccountForm.tsx +++ b/ngui/ui/src/components/forms/ConnectCloudAccountForm/ConnectCloudAccountForm.tsx @@ -13,6 +13,7 @@ import { AZURE_TENANT_CREDENTIALS_FIELD_NAMES, AZURE_SUBSCRIPTION_CREDENTIALS_FIELD_NAMES, GCP_CREDENTIALS_FIELD_NAMES, + GCP_TENANT_CREDENTIALS_FIELD_NAMES, KUBERNETES_CREDENTIALS_FIELD_NAMES, DATABRICKS_CREDENTIALS_FIELD_NAMES, AWS_ROOT_CREDENTIALS_FIELD_NAMES, @@ -65,7 +66,9 @@ import { NEBIUS, DATABRICKS, DATABRICKS_ACCOUNT, - OPTSCALE_MODE + OPTSCALE_MODE, + GCP_TENANT_ACCOUNT, + GCP_TENANT } from "utils/constants"; import { readFileAsText } from "utils/files"; import { SPACING_2 } from "utils/layouts"; @@ -85,6 +88,7 @@ const getCloudType = (connectionType) => [AZURE_TENANT_ACCOUNT]: AZURE_TENANT, [ALIBABA_ACCOUNT]: ALIBABA_CNR, [GCP_ACCOUNT]: GCP_CNR, + [GCP_TENANT_ACCOUNT]: GCP_TENANT, [NEBIUS_ACCOUNT]: NEBIUS, [DATABRICKS_ACCOUNT]: DATABRICKS, [KUBERNETES]: KUBERNETES_CNR @@ -189,6 +193,22 @@ const getGoogleParameters = async (formData) => { }; }; +const getGoogleTenantParameters = async (formData) => { + const credentials = await readFileAsText(formData[GCP_TENANT_CREDENTIALS_FIELD_NAMES.CREDENTIALS]); + + return { + name: formData[DATA_SOURCE_NAME_FIELD_NAME], + type: GCP_TENANT, + config: { + credentials: JSON.parse(credentials), + billing_data: { + dataset_name: formData[GCP_TENANT_CREDENTIALS_FIELD_NAMES.BILLING_DATA_DATASET], + table_name: formData[GCP_TENANT_CREDENTIALS_FIELD_NAMES.BILLING_DATA_TABLE] + } + } + }; +}; + const getNebiusParameters = (formData) => ({ name: formData[DATA_SOURCE_NAME_FIELD_NAME], type: NEBIUS, @@ -227,7 +247,7 @@ const renderConnectionTypeDescription = (settings) => )); -const renderConnectionTypeInfoMessage = ({ connectionType }) => +const renderConnectionTypeInfoMessage = (connectionType) => ({ [AWS_ROOT_ACCOUNT]: renderConnectionTypeDescription([ { @@ -387,10 +407,29 @@ const renderConnectionTypeInfoMessage = ({ connectionType }) => p: (chunks) =>

{chunks}

} } + ]), + [GCP_TENANT_ACCOUNT]: renderConnectionTypeDescription([ + { + key: "createGCPTenantDocumentationReference1", + messageId: "createGCPTenantDocumentationReference1" + }, + { + key: "createGCPTenantDocumentationReference2", + messageId: "createGCPTenantDocumentationReference2", + values: { + link: (chunks) => ( + + {chunks} + + ), + strong: (chunks) => {chunks}, + p: (chunks) =>

{chunks}

+ } + } ]) })[connectionType]; -const ConnectCloudAccountForm = ({ onSubmit, onCancel, isLoading, showCancel = true }) => { +const ConnectCloudAccountForm = ({ onSubmit, onCancel, isLoading = false, showCancel = true }) => { const methods = useForm(); const ref = useRef(); @@ -452,6 +491,13 @@ const ConnectCloudAccountForm = ({ onSubmit, onCancel, isLoading, showCancel = t dataTestId: "btn_gcp_account", action: () => defaultTileAction(GCP_ACCOUNT, GCP_CNR) }, + { + id: GCP_TENANT_ACCOUNT, + icon: GcpLogoIcon, + messageId: GCP_TENANT_ACCOUNT, + dataTestId: "btn_gcp_tenant_account", + action: () => defaultTileAction(GCP_TENANT_ACCOUNT, GCP_TENANT) + }, { id: ALIBABA_ACCOUNT, icon: AlibabaLogoIcon, @@ -518,7 +564,7 @@ const ConnectCloudAccountForm = ({ onSubmit, onCancel, isLoading, showCancel = t ))} - {renderConnectionTypeInfoMessage({ connectionType })} + {renderConnectionTypeInfoMessage(connectionType)}
{ return ; case GCP_ACCOUNT: return ; + case GCP_TENANT_ACCOUNT: + return ; case NEBIUS_ACCOUNT: return ; case DATABRICKS_ACCOUNT: diff --git a/ngui/ui/src/components/forms/DisconnectCloudAccountForm/DisconnectCloudAccountForm.tsx b/ngui/ui/src/components/forms/DisconnectCloudAccountForm/DisconnectCloudAccountForm.tsx index 4348883b6..a0d7536c1 100644 --- a/ngui/ui/src/components/forms/DisconnectCloudAccountForm/DisconnectCloudAccountForm.tsx +++ b/ngui/ui/src/components/forms/DisconnectCloudAccountForm/DisconnectCloudAccountForm.tsx @@ -1,8 +1,10 @@ +import { Box } from "@mui/material"; import { FormProvider, useForm } from "react-hook-form"; import DeleteEntity from "components/DeleteEntity"; import PageContentDescription from "components/PageContentDescription"; import { useDataSources } from "hooks/useDataSources"; -import { AZURE_TENANT } from "utils/constants"; +import { AZURE_TENANT, GCP_TENANT } from "utils/constants"; +import { SPACING_1 } from "utils/layouts"; import Survey from "./FormElements/Survey"; import { DisconnectCloudAccountFormProps, FormValues } from "./types"; import { getDefaultValues } from "./utils"; @@ -17,6 +19,7 @@ const DisconnectCloudAccountForm = ({ }: DisconnectCloudAccountFormProps) => { const { disconnectQuestionId } = useDataSources(type); const isAzureTenant = type === AZURE_TENANT; + const isGcpTenant = type === GCP_TENANT; const methods = useForm({ defaultValues: getDefaultValues() }); const { handleSubmit } = methods; @@ -24,8 +27,8 @@ const DisconnectCloudAccountForm = ({ return ( - {(parentId || isAzureTenant) && ( - <> + {(parentId || isAzureTenant || isGcpTenant) && ( + {parentId && ( )} - {isAzureTenant && ( + {isAzureTenant || isGcpTenant ? ( - )} - + ) : null} + )} { ]} /> ); + case GCP_TENANT: + return ( +