import { useI18n } from '@wordpress/react-i18n'; import FormRadiosBar from 'calypso/components/forms/form-radios-bar'; import { HostingCardHeading, HostingCardDescription } from 'calypso/components/hosting-card'; import SupportInfo from 'calypso/components/support-info/index'; import { GitHubRepositoryData } from '../../use-github-repositories-query'; import { AdvancedWorkflowStyle } from './advanced-workflow-style'; import { DeploymentStyleContext, DeploymentStyleContextProps } from './context'; import { useDeploymentWorkflowsQuery } from './use-deployment-workflows-query'; import { CREATE_WORKFLOW_OPTION } from './workflow-picker'; import './style.scss'; type DeploymentStyleProps = { isDisabled: boolean; repository?: Pick< GitHubRepositoryData, 'id' | 'owner' | 'name' >; branchName: string; workflowPath?: string; onChooseWorkflow( workflowFilename: string | undefined ): void; useComposerWorkflow: boolean; } & DeploymentStyleContextProps; export const DeploymentStyle = ( { isDisabled, repository, branchName, workflowPath, onChooseWorkflow, isCheckingWorkflow, onWorkflowVerify, workflowCheckResult, useComposerWorkflow, }: DeploymentStyleProps ) => { const { __ } = useI18n(); const { data: workflows, isLoading, isFetching, refetch, } = useDeploymentWorkflowsQuery( repository, branchName, { refetchOnWindowFocus: false, enabled: ! isDisabled, } ); const supportMessage = ( <>
{ __( 'Simple deployments copy all of your repository files to a specified directory.' ) }
{ __( 'Advanced deployments allow you to use a workflow script, enabling custom build steps such as installing Composer dependencies, conducting pre-deployment code testing, and controlling file deployment.' ) }
> ); return (