diff --git a/packages/amazon/src/aws.module.ts b/packages/amazon/src/aws.module.ts index d06b6dc7c21..69880732559 100644 --- a/packages/amazon/src/aws.module.ts +++ b/packages/amazon/src/aws.module.ts @@ -26,22 +26,26 @@ import { AWS_LOAD_BALANCER_MODULE } from './loadBalancer/loadBalancer.module'; import amazonLogo from './logo/amazon.logo.svg'; import { AMAZON_PIPELINE_STAGES_BAKE_AWSBAKESTAGE } from './pipeline/stages/bake/awsBakeStage'; import { AMAZON_PIPELINE_STAGES_CLONESERVERGROUP_AWSCLONESERVERGROUPSTAGE } from './pipeline/stages/cloneServerGroup/awsCloneServerGroupStage'; +import { AMAZON_PIPELINE_STAGES_LAMBDA_DELETE } from './pipeline/stages/deleteLambda'; import { CLOUD_FORMATION_CHANGE_SET_INFO } from './pipeline/stages/deployCloudFormation/CloudFormationChangeSetInfo'; import { CLOUDFORMATION_TEMPLATE_ENTRY } from './pipeline/stages/deployCloudFormation/cloudFormationTemplateEntry.component'; import { DEPLOY_CLOUDFORMATION_STACK_STAGE } from './pipeline/stages/deployCloudFormation/deployCloudFormationStackStage'; import { AWS_EVALUATE_CLOUD_FORMATION_CHANGE_SET_EXECUTION_SERVICE } from './pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecution.service'; +import { AMAZON_PIPELINE_STAGES_LAMBDA_DEPLOY } from './pipeline/stages/deployLambda'; import { AMAZON_PIPELINE_STAGES_DESTROYASG_AWSDESTROYASGSTAGE } from './pipeline/stages/destroyAsg/awsDestroyAsgStage'; import { AMAZON_PIPELINE_STAGES_DISABLEASG_AWSDISABLEASGSTAGE } from './pipeline/stages/disableAsg/awsDisableAsgStage'; import { AMAZON_PIPELINE_STAGES_DISABLECLUSTER_AWSDISABLECLUSTERSTAGE } from './pipeline/stages/disableCluster/awsDisableClusterStage'; import { AMAZON_PIPELINE_STAGES_ENABLEASG_AWSENABLEASGSTAGE } from './pipeline/stages/enableAsg/awsEnableAsgStage'; import { AMAZON_PIPELINE_STAGES_FINDAMI_AWSFINDAMISTAGE } from './pipeline/stages/findAmi/awsFindAmiStage'; import { AMAZON_PIPELINE_STAGES_FINDIMAGEFROMTAGS_AWSFINDIMAGEFROMTAGSSTAGE } from './pipeline/stages/findImageFromTags/awsFindImageFromTagsStage'; +import { AMAZON_PIPELINE_STAGES_LAMBDA_INVOKE } from './pipeline/stages/invokeLambda'; import { AMAZON_PIPELINE_STAGES_MODIFYSCALINGPROCESS_MODIFYSCALINGPROCESSSTAGE } from './pipeline/stages/modifyScalingProcess/modifyScalingProcessStage'; import { AMAZON_PIPELINE_STAGES_RESIZEASG_AWSRESIZEASGSTAGE } from './pipeline/stages/resizeAsg/awsResizeAsgStage'; import { AMAZON_PIPELINE_STAGES_ROLLBACKCLUSTER_AWSROLLBACKCLUSTERSTAGE } from './pipeline/stages/rollbackCluster/awsRollbackClusterStage'; import { AMAZON_PIPELINE_STAGES_SCALEDOWNCLUSTER_AWSSCALEDOWNCLUSTERSTAGE } from './pipeline/stages/scaleDownCluster/awsScaleDownClusterStage'; import { AMAZON_PIPELINE_STAGES_SHRINKCLUSTER_AWSSHRINKCLUSTERSTAGE } from './pipeline/stages/shrinkCluster/awsShrinkClusterStage'; import { AMAZON_PIPELINE_STAGES_TAGIMAGE_AWSTAGIMAGESTAGE } from './pipeline/stages/tagImage/awsTagImageStage'; +import { AMAZON_PIPELINE_STAGES_LAMBDA_UPDATE } from './pipeline/stages/updateCodeLambda'; import { AWS_REACT_MODULE } from './reactShims/aws.react.module'; import { AMAZON_SEARCH_SEARCHRESULTFORMATTER } from './search/searchResultFormatter'; import { AWS_SECURITY_GROUP_MODULE } from './securityGroup/securityGroup.module'; @@ -114,6 +118,10 @@ module(AMAZON_MODULE, [ INSTANCE_SECURITY_GROUPS_COMPONENT, INSTANCE_DNS_COMPONENT, AMAZON_INSTANCE_INFORMATION_COMPONENT, + AMAZON_PIPELINE_STAGES_LAMBDA_DELETE, + AMAZON_PIPELINE_STAGES_LAMBDA_DEPLOY, + AMAZON_PIPELINE_STAGES_LAMBDA_INVOKE, + AMAZON_PIPELINE_STAGES_LAMBDA_UPDATE, ]).config(() => { CloudProviderRegistry.registerProvider('aws', { name: 'Amazon', diff --git a/packages/amazon/src/pipeline/stages/deleteLambda/index.ts b/packages/amazon/src/pipeline/stages/deleteLambda/index.ts index a2bcdd62906..9df8bc99929 100644 --- a/packages/amazon/src/pipeline/stages/deleteLambda/index.ts +++ b/packages/amazon/src/pipeline/stages/deleteLambda/index.ts @@ -1,11 +1,17 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 +import { module } from 'angular'; + import { Registry, SETTINGS } from '@spinnaker/core'; -import { lambdaDeleteStage } from './LambdaDeleteStage'; +import { lambdaDeleteStage } from './LambdaDeleteStage'; export * from './LambdaDeleteStage'; -if (SETTINGS.feature.lambdaAdditionalStages) { - Registry.pipeline.registerStage(lambdaDeleteStage); -} +export const AMAZON_PIPELINE_STAGES_LAMBDA_DELETE = 'spinnaker.amazon.pipeline.stage.Aws.LambdaDeleteStage'; + +module(AMAZON_PIPELINE_STAGES_LAMBDA_DELETE, []).config(function () { + if (SETTINGS.feature.lambdaAdditionalStages) { + Registry.pipeline.registerStage(lambdaDeleteStage); + } +}); diff --git a/packages/amazon/src/pipeline/stages/deployLambda/components/AwsLambdaFunctionStageForm.tsx b/packages/amazon/src/pipeline/stages/deployLambda/components/AwsLambdaFunctionStageForm.tsx index bbe837f855b..9e03752a57b 100644 --- a/packages/amazon/src/pipeline/stages/deployLambda/components/AwsLambdaFunctionStageForm.tsx +++ b/packages/amazon/src/pipeline/stages/deployLambda/components/AwsLambdaFunctionStageForm.tsx @@ -15,7 +15,6 @@ import { TetheredCreatable, TextInput, } from '@spinnaker/core'; -import { NumberConcurrencyInput } from '@spinnaker/core/dist/presentation/forms/inputs/NumberConcurrencyInput'; import { BasicSettingsForm, ExecutionRoleForm, LambdaAtEdgeForm, NetworkForm, TriggerEventsForm } from './index'; @@ -96,7 +95,7 @@ export function AwsLambdaFunctionStageForm(props: IFormikStageConfigInjectedProp help={ } - input={(props) => } + input={(props) => } /> ) : ( - + ) } required={false} diff --git a/packages/amazon/src/pipeline/stages/routeLambda/index.ts b/packages/amazon/src/pipeline/stages/routeLambda/index.ts index 154d3d60cb2..3ae71566143 100644 --- a/packages/amazon/src/pipeline/stages/routeLambda/index.ts +++ b/packages/amazon/src/pipeline/stages/routeLambda/index.ts @@ -1,11 +1,18 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 +import { module } from 'angular'; + import { Registry, SETTINGS } from '@spinnaker/core'; + import { lambdaRouteStage } from './LambdaRouteStage'; export * from './LambdaRouteStage'; -if (SETTINGS.feature.lambdaAdditionalStages) { - Registry.pipeline.registerStage(lambdaRouteStage); -} +export const AMAZON_PIPELINE_STAGES_LAMBDA_ROUTE = 'spinnaker.amazon.pipeline.stage.Aws.LambdaTrafficRoutingStage'; + +module(AMAZON_PIPELINE_STAGES_LAMBDA_ROUTE, []).config(function () { + if (SETTINGS.feature.lambdaAdditionalStages) { + Registry.pipeline.registerStage(lambdaRouteStage); + } +}); diff --git a/packages/amazon/src/pipeline/stages/updateCodeLambda/LambdaUpdateCodeStage.less b/packages/amazon/src/pipeline/stages/updateCodeLambda/LambdaUpdateCodeStage.less new file mode 100644 index 00000000000..35112591771 --- /dev/null +++ b/packages/amazon/src/pipeline/stages/updateCodeLambda/LambdaUpdateCodeStage.less @@ -0,0 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +.LambdaCodeUpdateStageConfig { +} diff --git a/packages/amazon/src/pipeline/stages/updateCodeLambda/index.ts b/packages/amazon/src/pipeline/stages/updateCodeLambda/index.ts index f8f0dccc76a..65297db27d3 100644 --- a/packages/amazon/src/pipeline/stages/updateCodeLambda/index.ts +++ b/packages/amazon/src/pipeline/stages/updateCodeLambda/index.ts @@ -1,11 +1,18 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 +import { module } from 'angular'; + import { Registry, SETTINGS } from '@spinnaker/core'; + import { lambdaUpdateCodeStage } from './LambdaUpdateCodeStage'; export * from './LambdaUpdateCodeStage'; -if (SETTINGS.feature.lambdaAdditionalStages) { - Registry.pipeline.registerStage(lambdaUpdateCodeStage); -} +export const AMAZON_PIPELINE_STAGES_LAMBDA_UPDATE = 'spinnaker.amazon.pipeline.stage.Aws.LambdaUpdateCodeStage'; + +module(AMAZON_PIPELINE_STAGES_LAMBDA_UPDATE, []).config(function () { + if (SETTINGS.feature.lambdaAdditionalStages) { + Registry.pipeline.registerStage(lambdaUpdateCodeStage); + } +}); diff --git a/packages/core/src/presentation/forms/inputs/NumberConcurrencyInput.tsx b/packages/core/src/presentation/forms/inputs/NumberConcurrencyInput.tsx deleted file mode 100644 index 81970637415..00000000000 --- a/packages/core/src/presentation/forms/inputs/NumberConcurrencyInput.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import React from 'react'; - -import { useInternalValidator } from './hooks'; -import type { IFormInputProps, OmitControlledInputPropsFrom } from './interface'; -import { orEmptyString, validationClassName } from './utils'; -import type { IValidator } from '../validation'; -import { composeValidators, Validators } from '../validation'; - -interface INumberInputProps extends IFormInputProps, OmitControlledInputPropsFrom> { - inputClassName?: string; -} - -const isNumber = (val: any): val is number => typeof val === 'number'; - -export function NumberConcurrencyInput(props: INumberInputProps) { - const { value, validation, inputClassName, ...otherProps } = props; - - const minMaxValidator: IValidator = (val: any, label?: string) => { - const minValidator = isNumber(props.min) ? Validators.minValue(props.min) : undefined; - const maxValidator = isNumber(props.max) ? Validators.maxValue(props.max) : undefined; - const validator = composeValidators([minValidator, maxValidator]); - return validator ? validator(val, label) : null; - }; - - useInternalValidator(validation, minMaxValidator); - - const className = `NumberInput form-control ${orEmptyString(inputClassName)} ${validationClassName(validation)}`; - return ; -}