@@ -294,6 +360,111 @@ export class CloudfoundryDeployServiceStageConfig extends React.Component<
+
+ );
+ };
+
+ private artifactManifestInput = (
+ manifest: ICloudfoundryServiceManifestArtifactSource,
+ state: ICloudfoundryDeployServiceStageConfigState,
+ ): JSX.Element => {
+ const { account, reference } = manifest;
+ const { artifactAccounts } = state;
+ return (
+
+ );
+ };
+
+ public render() {
+ const { stage } = this.props;
+ const { credentials, manifest, timeout } = stage;
+ const { accounts, regions } = this.state;
+
+ let manifestInput;
+
+ switch (manifest.type) {
+ case 'direct':
+ manifestInput = this.directManifestInput(manifest, this.state);
+ break;
+ case 'artifact':
+ manifestInput = this.artifactManifestInput(manifest, this.state);
+ break;
+ }
+
+ return (
+
+
+
+
+
+
+
+
+ {manifestInput}
diff --git a/app/scripts/modules/cloudfoundry/src/pipeline/stages/deployService/cloudfoundryDeployServiceStage.module.ts b/app/scripts/modules/cloudfoundry/src/pipeline/stages/deployService/cloudfoundryDeployServiceStage.module.ts
index 72999fc7c74..1ff952b3fb3 100644
--- a/app/scripts/modules/cloudfoundry/src/pipeline/stages/deployService/cloudfoundryDeployServiceStage.module.ts
+++ b/app/scripts/modules/cloudfoundry/src/pipeline/stages/deployService/cloudfoundryDeployServiceStage.module.ts
@@ -4,6 +4,7 @@ import { react2angular } from 'react2angular';
import { CloudfoundryDeployServiceStageConfig } from './CloudfoundryDeployServiceStageConfig';
import { ExecutionDetailsTasks, IStage, Registry } from '@spinnaker/core';
import { CloudfoundryDeployServiceExecutionDetails } from 'cloudfoundry/pipeline/stages/deployService/CloudfoundryDeployServiceExecutionDetails';
+import { IManifestFieldValidatorConfig } from 'cloudfoundry/pipeline/config/validation/ManifestConfigValidator';
class CloudFoundryDeployServiceStageCtrl implements IController {
constructor(public $scope: IScope) {
@@ -11,6 +12,41 @@ class CloudFoundryDeployServiceStageCtrl implements IController {
}
}
+const serviceValidatorConfig: IManifestFieldValidatorConfig = {
+ type: 'requiredManifestField',
+ manifestType: 'direct',
+ fieldName: 'service',
+ preventSave: true,
+};
+
+const servicePlanValidatorConfig: IManifestFieldValidatorConfig = {
+ type: 'requiredManifestField',
+ manifestType: 'direct',
+ fieldName: 'servicePlan',
+ preventSave: true,
+};
+
+const jsonValidatorConfig: IManifestFieldValidatorConfig = {
+ type: 'validServiceParameterJson',
+ manifestType: 'direct',
+ fieldName: 'parameters',
+ preventSave: true,
+};
+
+const accountValidatorConfig: IManifestFieldValidatorConfig = {
+ type: 'requiredManifestField',
+ manifestType: 'artifact',
+ fieldName: 'account',
+ preventSave: true,
+};
+
+const referenceValidatorConfig: IManifestFieldValidatorConfig = {
+ type: 'requiredManifestField',
+ manifestType: 'artifact',
+ fieldName: 'reference',
+ preventSave: true,
+};
+
export const CLOUD_FOUNDRY_DEPLOY_SERVICE_STAGE = 'spinnaker.cloudfoundry.pipeline.stage.deployServiceStage';
module(CLOUD_FOUNDRY_DEPLOY_SERVICE_STAGE, [])
.config(function() {
@@ -27,9 +63,11 @@ module(CLOUD_FOUNDRY_DEPLOY_SERVICE_STAGE, [])
{ type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' },
{ type: 'requiredField', fieldName: 'region' },
{ type: 'requiredField', fieldName: 'serviceName', preventSave: true },
- { type: 'requiredField', fieldName: 'service', preventSave: true },
- { type: 'requiredField', fieldName: 'servicePlan', preventSave: true },
- { type: 'validServiceParameterJson', fieldName: 'parameters', preventSave: true },
+ serviceValidatorConfig,
+ servicePlanValidatorConfig,
+ jsonValidatorConfig,
+ accountValidatorConfig,
+ referenceValidatorConfig,
],
});
})
diff --git a/app/scripts/modules/cloudfoundry/src/serverGroup/configure/wizard/sections/configurationSettings.cf.tsx b/app/scripts/modules/cloudfoundry/src/serverGroup/configure/wizard/sections/configurationSettings.cf.tsx
index 7ebb15d135f..05b34065332 100644
--- a/app/scripts/modules/cloudfoundry/src/serverGroup/configure/wizard/sections/configurationSettings.cf.tsx
+++ b/app/scripts/modules/cloudfoundry/src/serverGroup/configure/wizard/sections/configurationSettings.cf.tsx
@@ -457,7 +457,6 @@ class ConfigurationSettingsImpl extends React.Component
this.manifestTypeUpdated('artifact')}
/>{' '}
@@ -503,7 +501,6 @@ class ConfigurationSettingsImpl extends React.Component
this.manifestTypeUpdated('direct')}
/>{' '}