diff --git a/app/scripts/modules/core/src/ci/igor.service.ts b/app/scripts/modules/core/src/ci/igor.service.ts index b36af2cce06..f7b123ee9da 100644 --- a/app/scripts/modules/core/src/ci/igor.service.ts +++ b/app/scripts/modules/core/src/ci/igor.service.ts @@ -76,4 +76,11 @@ export class IgorService { .one('accounts') .get(); } + + public static getCodeBuildProjects(account: string): IPromise { + return API.one('codebuild') + .one('projects') + .one(account) + .get(); + } } diff --git a/app/scripts/modules/core/src/pipeline/config/stages/awsCodeBuild/AwsCodeBuildStageForm.tsx b/app/scripts/modules/core/src/pipeline/config/stages/awsCodeBuild/AwsCodeBuildStageForm.tsx index 1a979fd1be7..7787d8b7597 100644 --- a/app/scripts/modules/core/src/pipeline/config/stages/awsCodeBuild/AwsCodeBuildStageForm.tsx +++ b/app/scripts/modules/core/src/pipeline/config/stages/awsCodeBuild/AwsCodeBuildStageForm.tsx @@ -33,6 +33,12 @@ export function AwsCodeBuildStageForm(props: IAwsCodeBuildStageFormProps & IForm [], ); + const { result: fetchProjectsResult, status: fetchProjectsStatus } = useData( + () => IgorService.getCodeBuildProjects(stage.account), + [], + [stage.account], + ); + const onFieldChange = (fieldName: string, fieldValue: any): void => { props.formik.setFieldValue(fieldName, fieldValue); }; @@ -53,12 +59,18 @@ export function AwsCodeBuildStageForm(props: IAwsCodeBuildStageFormProps & IForm /> )} /> - {/* TODO: Select project from a drop-down list. Behind the scene, gate calls igor to fetch projects list */} } + input={(inputProps: IFormInputProps) => ( + + )} />

Source Configuration

)} /> - {stage.source.sourceOverride === true && ( + {get(stage, 'source.sourceOverride') === true && ( )} - {stage.source.sourceOverride === true && ( + {get(stage, 'source.sourceOverride') === true && (