@spinnaker/cloudfoundry 0.0.0-main-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/CHANGELOG.md +1085 -0
  2. package/LICENSE.txt +203 -0
  3. package/dist/cf.module.d.ts +24 -0
  4. package/dist/cf.settings.d.ts +7 -0
  5. package/dist/common/applicationName.validator.d.ts +1 -0
  6. package/dist/deploymentStrategy/CloudFoundryDeploymentStrategySelector.d.ts +21 -0
  7. package/dist/deploymentStrategy/strategies/redblack/redblack.strategy.d.ts +10 -0
  8. package/dist/deploymentStrategy/strategies/rollingredblack/AdditionalFields.d.ts +22 -0
  9. package/dist/domain/ICloudFoundryAccount.d.ts +7 -0
  10. package/dist/domain/ICloudFoundryApplication.d.ts +4 -0
  11. package/dist/domain/ICloudFoundryCluster.d.ts +5 -0
  12. package/dist/domain/ICloudFoundryDroplet.d.ts +19 -0
  13. package/dist/domain/ICloudFoundryInstance.d.ts +4 -0
  14. package/dist/domain/ICloudFoundryLoadBalancer.d.ts +25 -0
  15. package/dist/domain/ICloudFoundryServerGroup.d.ts +41 -0
  16. package/dist/domain/ICloudFoundrySpace.d.ts +9 -0
  17. package/dist/domain/index.d.ts +8 -0
  18. package/dist/help/cloudfoundry.help.d.ts +1 -0
  19. package/dist/image/image.reader.cf.d.ts +4 -0
  20. package/dist/index.d.ts +6 -0
  21. package/dist/index.js +5929 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/instance/details/CloudFoundryInstanceActions.d.ts +11 -0
  24. package/dist/instance/details/CloudFoundryInstanceDetails.d.ts +23 -0
  25. package/dist/instance/details/index.d.ts +1 -0
  26. package/dist/instance/details/sections/CloudFoundryInstanceDetailsSection.d.ts +9 -0
  27. package/dist/instance/details/sections/index.d.ts +1 -0
  28. package/dist/loadBalancer/configure/CloudFoundryMapLoadBalancerModal.d.ts +33 -0
  29. package/dist/loadBalancer/configure/loadBalancerDetails.d.ts +32 -0
  30. package/dist/loadBalancer/details/CloudFoundryLoadBalancerActions.d.ts +10 -0
  31. package/dist/loadBalancer/details/CloudFoundryLoadBalancerDetails.d.ts +26 -0
  32. package/dist/loadBalancer/details/index.d.ts +1 -0
  33. package/dist/loadBalancer/details/sections/CloudFoundryLoadBalancerDetailsSection.d.ts +9 -0
  34. package/dist/loadBalancer/details/sections/CloudFoundryLoadBalancerLinksSection.d.ts +9 -0
  35. package/dist/loadBalancer/details/sections/CloudFoundryLoadBalancerStatusSection.d.ts +9 -0
  36. package/dist/loadBalancer/details/sections/index.d.ts +3 -0
  37. package/dist/loadBalancer/index.d.ts +3 -0
  38. package/dist/loadBalancer/loadBalancer.transformer.d.ts +25 -0
  39. package/dist/pipeline/config/validation/cfTargetImpedance.validator.d.ts +9 -0
  40. package/dist/pipeline/config/validation/instanceSize.validator.d.ts +15 -0
  41. package/dist/pipeline/config/validation/requiredRoutes.validator.d.ts +4 -0
  42. package/dist/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfig.d.ts +7 -0
  43. package/dist/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfigForm.d.ts +13 -0
  44. package/dist/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestDetailsTab.d.ts +6 -0
  45. package/dist/pipeline/stages/bakeCloudFoundryManifest/bakeCloudFoundryManifestStage.d.ts +1 -0
  46. package/dist/pipeline/stages/cloneServerGroup/CloudFoundryCloneServerGroupStageConfig.d.ts +11 -0
  47. package/dist/pipeline/stages/cloneServerGroup/cloudFoundryCloneServerGroupStage.module.d.ts +1 -0
  48. package/dist/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsConfig.d.ts +9 -0
  49. package/dist/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsStageConfigForm.d.ts +26 -0
  50. package/dist/pipeline/stages/createServiceBindings/cloudFoundryCreateServiceBindingsStage.d.ts +1 -0
  51. package/dist/pipeline/stages/createServiceKey/CloudFoundryCreateServiceKeyStageConfig.d.ts +19 -0
  52. package/dist/pipeline/stages/createServiceKey/cloudFoundryCreateServiceKeyStage.module.d.ts +1 -0
  53. package/dist/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsConfig.d.ts +10 -0
  54. package/dist/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsStageConfigForm.d.ts +20 -0
  55. package/dist/pipeline/stages/deleteServiceBindings/cloudFoundryDeleteServiceBindingsStage.d.ts +1 -0
  56. package/dist/pipeline/stages/deleteServiceKey/CloudFoundryDeleteServiceKeyStageConfig.d.ts +19 -0
  57. package/dist/pipeline/stages/deleteServiceKey/cloudFoundryDeleteServiceKeyStage.module.d.ts +1 -0
  58. package/dist/pipeline/stages/deployService/CloudFoundryDeployServiceStageConfig.d.ts +24 -0
  59. package/dist/pipeline/stages/deployService/CreateServiceInstanceDirectInput.d.ts +29 -0
  60. package/dist/pipeline/stages/deployService/CreateUserProvidedInput.d.ts +19 -0
  61. package/dist/pipeline/stages/deployService/ICloudFoundryServiceManifestSource.d.ts +24 -0
  62. package/dist/pipeline/stages/deployService/ServiceTagsInput.d.ts +17 -0
  63. package/dist/pipeline/stages/deployService/cloudFoundryDeployServiceStage.module.d.ts +1 -0
  64. package/dist/pipeline/stages/destroyAsg/cloudFoundryDestroyAsgStage.module.d.ts +1 -0
  65. package/dist/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfig.d.ts +5 -0
  66. package/dist/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfigForm.d.ts +19 -0
  67. package/dist/pipeline/stages/destroyService/cloudFoundryDestroyServiceStage.module.d.ts +1 -0
  68. package/dist/pipeline/stages/disableAsg/cloudFoundryDisableAsgStage.module.d.ts +1 -0
  69. package/dist/pipeline/stages/enableAsg/cloudFoundryEnableAsgStage.module.d.ts +1 -0
  70. package/dist/pipeline/stages/mapLoadBalancers/cloudFoundryMapLoadBalancersStage.module.d.ts +1 -0
  71. package/dist/pipeline/stages/resizeAsg/CloudFoundryResizeAsgStageConfig.d.ts +17 -0
  72. package/dist/pipeline/stages/resizeAsg/cloudFoundryResizeAsgStage.module.d.ts +1 -0
  73. package/dist/pipeline/stages/rollbackCluster/CloudFoundryRollbackClusterStageConfig.d.ts +17 -0
  74. package/dist/pipeline/stages/rollbackCluster/cloudFoundryRollbackClusterStage.module.d.ts +1 -0
  75. package/dist/pipeline/stages/runJob/CloudFoundryRunJobStageConfig.d.ts +14 -0
  76. package/dist/pipeline/stages/runJob/RunJobExecutionDetails.d.ts +6 -0
  77. package/dist/pipeline/stages/runJob/cloudFoundryRunJob.module.d.ts +1 -0
  78. package/dist/pipeline/stages/shareService/CloudFoundryShareServiceExecutionDetails.d.ts +6 -0
  79. package/dist/pipeline/stages/shareService/CloudFoundryShareServiceStageConfig.d.ts +21 -0
  80. package/dist/pipeline/stages/shareService/cloudFoundryShareServiceStage.module.d.ts +1 -0
  81. package/dist/pipeline/stages/unmapLoadBalancers/cloudFoundryUnmapLoadBalancersStage.module.d.ts +1 -0
  82. package/dist/pipeline/stages/unshareService/CloudFoundryUnshareServiceExecutionDetails.d.ts +6 -0
  83. package/dist/pipeline/stages/unshareService/CloudFoundryUnshareServiceStageConfig.d.ts +18 -0
  84. package/dist/pipeline/stages/unshareService/cloudFoundryUnshareServiceStage.module.d.ts +1 -0
  85. package/dist/presentation/forms/index.d.ts +2 -0
  86. package/dist/presentation/forms/inputs/FormikConfigField.d.ts +10 -0
  87. package/dist/presentation/forms/inputs/index.d.ts +1 -0
  88. package/dist/presentation/forms/serverGroup/Buildpacks.d.ts +8 -0
  89. package/dist/presentation/forms/serverGroup/EnvironmentVariables.d.ts +8 -0
  90. package/dist/presentation/forms/serverGroup/HealthCheck.d.ts +12 -0
  91. package/dist/presentation/forms/serverGroup/InstanceParameters.d.ts +12 -0
  92. package/dist/presentation/forms/serverGroup/Routes.d.ts +10 -0
  93. package/dist/presentation/forms/serverGroup/Services.d.ts +5 -0
  94. package/dist/presentation/forms/serverGroup/index.d.ts +6 -0
  95. package/dist/presentation/index.d.ts +3 -0
  96. package/dist/presentation/pipeline/index.d.ts +1 -0
  97. package/dist/presentation/pipeline/stages/CloudFoundryAsgStageConfig.d.ts +14 -0
  98. package/dist/presentation/pipeline/stages/CloudFoundryLoadBalancersExecutionDetails.d.ts +6 -0
  99. package/dist/presentation/pipeline/stages/CloudFoundryLoadBalancersStageConfig.d.ts +25 -0
  100. package/dist/presentation/pipeline/stages/CloudFoundryServiceExecutionDetails.d.ts +6 -0
  101. package/dist/presentation/pipeline/stages/CloudFoundryServiceKeyExecutionDetails.d.ts +6 -0
  102. package/dist/presentation/pipeline/stages/index.d.ts +5 -0
  103. package/dist/presentation/widgets/accountRegionClusterSelector/AccountRegionClusterSelector.d.ts +33 -0
  104. package/dist/presentation/widgets/accountRegionClusterSelector/FormikAccountRegionClusterSelector.d.ts +32 -0
  105. package/dist/presentation/widgets/accountRegionClusterSelector/index.d.ts +2 -0
  106. package/dist/presentation/widgets/index.d.ts +1 -0
  107. package/dist/presentation/widgets/recentLogs/CloudFoundryRecentLogs.d.ts +27 -0
  108. package/dist/routeDomains/index.d.ts +1 -0
  109. package/dist/routeDomains/routeDomainSelectField.d.ts +15 -0
  110. package/dist/serverGroup/configure/index.d.ts +4 -0
  111. package/dist/serverGroup/configure/serverGroupCommandBuilder.service.cf.d.ts +12 -0
  112. package/dist/serverGroup/configure/serverGroupCommandBuilderShim.service.cf.d.ts +14 -0
  113. package/dist/serverGroup/configure/serverGroupConfigurationModel.cf.d.ts +65 -0
  114. package/dist/serverGroup/configure/wizard/CreateServerGroupModal.d.ts +31 -0
  115. package/dist/serverGroup/configure/wizard/ServerGroupTemplateSelection.d.ts +16 -0
  116. package/dist/serverGroup/configure/wizard/sections/artifactSettings/ArtifactSettings.cf.d.ts +17 -0
  117. package/dist/serverGroup/configure/wizard/sections/artifactSettings/ConstantArtifactSettings.cf.d.ts +11 -0
  118. package/dist/serverGroup/configure/wizard/sections/basicSettings/BasicSettings.cf.d.ts +24 -0
  119. package/dist/serverGroup/configure/wizard/sections/cloneSettings/CloneSettings.cf.d.ts +21 -0
  120. package/dist/serverGroup/configure/wizard/sections/configurationSettings/ConfigurationSettings.cf.d.ts +22 -0
  121. package/dist/serverGroup/details/cfServerGroupDetailsGetter.d.ts +4 -0
  122. package/dist/serverGroup/details/cloudFoundryServerGroupActions.d.ts +24 -0
  123. package/dist/serverGroup/details/mapLoadBalancers/CloudFoundryMapLoadBalancersModal.d.ts +28 -0
  124. package/dist/serverGroup/details/mapLoadBalancers/CloudFoundryUnmapLoadBalancersModal.d.ts +28 -0
  125. package/dist/serverGroup/details/resize/CloudFoundryResizeServerGroupModal.d.ts +37 -0
  126. package/dist/serverGroup/details/rollback/CloudFoundryRollbackServerGroupModal.d.ts +36 -0
  127. package/dist/serverGroup/details/sections/ApplicationManagerSection.d.ts +6 -0
  128. package/dist/serverGroup/details/sections/BoundServicesSection.d.ts +6 -0
  129. package/dist/serverGroup/details/sections/BuildSection.d.ts +6 -0
  130. package/dist/serverGroup/details/sections/EnvironmentVariablesSection.d.ts +6 -0
  131. package/dist/serverGroup/details/sections/HealthCheckSection.d.ts +6 -0
  132. package/dist/serverGroup/details/sections/ICloudFoundryServerGroupDetailsSectionProps.d.ts +5 -0
  133. package/dist/serverGroup/details/sections/MetricsSection.d.ts +6 -0
  134. package/dist/serverGroup/details/sections/PackageSection.d.ts +6 -0
  135. package/dist/serverGroup/details/sections/ServerGroupInformationSection.d.ts +6 -0
  136. package/dist/serverGroup/details/sections/ServerGroupSizingSection.d.ts +6 -0
  137. package/dist/serverGroup/details/sections/index.d.ts +9 -0
  138. package/dist/serverGroup/index.d.ts +5 -0
  139. package/dist/serverGroup/serverGroup.transformer.d.ts +10 -0
  140. package/package.json +52 -0
  141. package/src/cf.module.ts +85 -0
  142. package/src/cf.settings.ts +14 -0
  143. package/src/common/applicationName.validator.ts +43 -0
  144. package/src/common/cloudFoundry.less +16 -0
  145. package/src/deploymentStrategy/CloudFoundryDeploymentStrategySelector.tsx +175 -0
  146. package/src/deploymentStrategy/strategies/redblack/redblack.strategy.ts +11 -0
  147. package/src/deploymentStrategy/strategies/rollingredblack/AdditionalFields.tsx +161 -0
  148. package/src/domain/ICloudFoundryAccount.ts +9 -0
  149. package/src/domain/ICloudFoundryApplication.ts +5 -0
  150. package/src/domain/ICloudFoundryCluster.ts +6 -0
  151. package/src/domain/ICloudFoundryDroplet.ts +22 -0
  152. package/src/domain/ICloudFoundryInstance.ts +5 -0
  153. package/src/domain/ICloudFoundryLoadBalancer.ts +29 -0
  154. package/src/domain/ICloudFoundryServerGroup.ts +47 -0
  155. package/src/domain/ICloudFoundrySpace.ts +10 -0
  156. package/src/domain/index.ts +8 -0
  157. package/src/help/cloudfoundry.help.ts +31 -0
  158. package/src/image/image.reader.cf.ts +17 -0
  159. package/src/index.ts +7 -0
  160. package/src/instance/details/CloudFoundryInstanceActions.tsx +59 -0
  161. package/src/instance/details/CloudFoundryInstanceDetails.tsx +154 -0
  162. package/src/instance/details/index.ts +1 -0
  163. package/src/instance/details/sections/CloudFoundryInstanceDetailsSection.tsx +49 -0
  164. package/src/instance/details/sections/index.ts +1 -0
  165. package/src/loadBalancer/configure/CloudFoundryMapLoadBalancerModal.tsx +210 -0
  166. package/src/loadBalancer/configure/loadBalancerDetails.tsx +228 -0
  167. package/src/loadBalancer/details/CloudFoundryLoadBalancerActions.tsx +61 -0
  168. package/src/loadBalancer/details/CloudFoundryLoadBalancerDetails.tsx +148 -0
  169. package/src/loadBalancer/details/index.ts +1 -0
  170. package/src/loadBalancer/details/sections/CloudFoundryLoadBalancerDetailsSection.tsx +63 -0
  171. package/src/loadBalancer/details/sections/CloudFoundryLoadBalancerLinksSection.tsx +34 -0
  172. package/src/loadBalancer/details/sections/CloudFoundryLoadBalancerStatusSection.tsx +27 -0
  173. package/src/loadBalancer/details/sections/index.ts +3 -0
  174. package/src/loadBalancer/index.ts +3 -0
  175. package/src/loadBalancer/loadBalancer.transformer.ts +144 -0
  176. package/src/logo/cf.icon.svg +12 -0
  177. package/src/logo/cf.logo.less +5 -0
  178. package/src/logo/cf.logo.svg +12 -0
  179. package/src/pipeline/config/validation/cfTargetImpedance.validator.ts +60 -0
  180. package/src/pipeline/config/validation/instanceSize.validator.ts +66 -0
  181. package/src/pipeline/config/validation/requiredRoutes.validator.ts +26 -0
  182. package/src/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfig.tsx +62 -0
  183. package/src/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfigForm.tsx +174 -0
  184. package/src/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestDetailsTab.tsx +35 -0
  185. package/src/pipeline/stages/bakeCloudFoundryManifest/bakeCloudFoundryManifestConfig.spec.tsx +80 -0
  186. package/src/pipeline/stages/bakeCloudFoundryManifest/bakeCloudFoundryManifestStage.ts +35 -0
  187. package/src/pipeline/stages/cloneServerGroup/CloudFoundryCloneServerGroupStageConfig.tsx +113 -0
  188. package/src/pipeline/stages/cloneServerGroup/cloudFoundryCloneServerGroupStage.module.ts +14 -0
  189. package/src/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsConfig.spec.tsx +35 -0
  190. package/src/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsConfig.tsx +69 -0
  191. package/src/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsStageConfigForm.tsx +230 -0
  192. package/src/pipeline/stages/createServiceBindings/cloudFoundryCreateServiceBindingsStage.ts +19 -0
  193. package/src/pipeline/stages/createServiceBindings/cloudFoundryCreateServiceBindingsStageForm.spec.tsx +50 -0
  194. package/src/pipeline/stages/createServiceKey/CloudFoundryCreateServiceKeyStageConfig.tsx +116 -0
  195. package/src/pipeline/stages/createServiceKey/cloudFoundryCreateServiceKeyStage.module.ts +21 -0
  196. package/src/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsConfig.tsx +69 -0
  197. package/src/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsStageConfigForm.tsx +158 -0
  198. package/src/pipeline/stages/deleteServiceBindings/cloudFoundryDeleteServiceBindingsStage.ts +19 -0
  199. package/src/pipeline/stages/deleteServiceBindings/cloudFoundryDeleteServiceBindingsStageForm.spec.tsx +49 -0
  200. package/src/pipeline/stages/deleteServiceKey/CloudFoundryDeleteServiceKeyStageConfig.tsx +116 -0
  201. package/src/pipeline/stages/deleteServiceKey/cloudFoundryDeleteServiceKeyStage.module.ts +22 -0
  202. package/src/pipeline/stages/deployService/CloudFoundryDeployServiceStageConfig.tsx +198 -0
  203. package/src/pipeline/stages/deployService/CreateServiceInstanceDirectInput.tsx +164 -0
  204. package/src/pipeline/stages/deployService/CreateUserProvidedInput.tsx +116 -0
  205. package/src/pipeline/stages/deployService/ICloudFoundryServiceManifestSource.ts +27 -0
  206. package/src/pipeline/stages/deployService/ServiceTagsInput.tsx +89 -0
  207. package/src/pipeline/stages/deployService/cloudFoundryDeployServiceStage.module.ts +153 -0
  208. package/src/pipeline/stages/deployService/cloudfoundryDeployServiceStage.less +12 -0
  209. package/src/pipeline/stages/destroyAsg/cloudFoundryDestroyAsgStage.module.ts +23 -0
  210. package/src/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfig.tsx +46 -0
  211. package/src/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfigForm.tsx +134 -0
  212. package/src/pipeline/stages/destroyService/cloudFoundryDestroyServiceStage.module.ts +20 -0
  213. package/src/pipeline/stages/disableAsg/cloudFoundryDisableAsgStage.module.ts +18 -0
  214. package/src/pipeline/stages/enableAsg/cloudFoundryEnableAsgStage.module.ts +18 -0
  215. package/src/pipeline/stages/mapLoadBalancers/cloudFoundryMapLoadBalancersStage.module.ts +21 -0
  216. package/src/pipeline/stages/resizeAsg/CloudFoundryResizeAsgStageConfig.tsx +148 -0
  217. package/src/pipeline/stages/resizeAsg/cloudFoundryResizeAsgStage.module.ts +52 -0
  218. package/src/pipeline/stages/rollbackCluster/CloudFoundryRollbackClusterStageConfig.tsx +90 -0
  219. package/src/pipeline/stages/rollbackCluster/cloudFoundryRollbackClusterStage.module.ts +19 -0
  220. package/src/pipeline/stages/runJob/CloudFoundryRunJobStageConfig.tsx +100 -0
  221. package/src/pipeline/stages/runJob/RunJobExecutionDetails.tsx +62 -0
  222. package/src/pipeline/stages/runJob/cloudFoundryRunJob.module.ts +24 -0
  223. package/src/pipeline/stages/shareService/CloudFoundryShareServiceExecutionDetails.tsx +52 -0
  224. package/src/pipeline/stages/shareService/CloudFoundryShareServiceStageConfig.tsx +141 -0
  225. package/src/pipeline/stages/shareService/cloudFoundryShareServiceStage.module.ts +21 -0
  226. package/src/pipeline/stages/unmapLoadBalancers/cloudFoundryUnmapLoadBalancersStage.module.ts +21 -0
  227. package/src/pipeline/stages/unshareService/CloudFoundryUnshareServiceExecutionDetails.tsx +46 -0
  228. package/src/pipeline/stages/unshareService/CloudFoundryUnshareServiceStageConfig.tsx +114 -0
  229. package/src/pipeline/stages/unshareService/cloudFoundryUnshareServiceStage.module.ts +21 -0
  230. package/src/presentation/forms/index.ts +2 -0
  231. package/src/presentation/forms/inputs/FormikConfigField.tsx +28 -0
  232. package/src/presentation/forms/inputs/index.ts +1 -0
  233. package/src/presentation/forms/serverGroup/Buildpacks.tsx +69 -0
  234. package/src/presentation/forms/serverGroup/EnvironmentVariables.tsx +94 -0
  235. package/src/presentation/forms/serverGroup/HealthCheck.tsx +57 -0
  236. package/src/presentation/forms/serverGroup/InstanceParameters.tsx +63 -0
  237. package/src/presentation/forms/serverGroup/Routes.tsx +74 -0
  238. package/src/presentation/forms/serverGroup/Services.tsx +62 -0
  239. package/src/presentation/forms/serverGroup/index.ts +6 -0
  240. package/src/presentation/index.ts +3 -0
  241. package/src/presentation/pipeline/index.ts +1 -0
  242. package/src/presentation/pipeline/stages/CloudFoundryAsgStageConfig.tsx +67 -0
  243. package/src/presentation/pipeline/stages/CloudFoundryLoadBalancersExecutionDetails.tsx +53 -0
  244. package/src/presentation/pipeline/stages/CloudFoundryLoadBalancersStageConfig.tsx +116 -0
  245. package/src/presentation/pipeline/stages/CloudFoundryServiceExecutionDetails.tsx +46 -0
  246. package/src/presentation/pipeline/stages/CloudFoundryServiceKeyExecutionDetails.tsx +52 -0
  247. package/src/presentation/pipeline/stages/index.ts +5 -0
  248. package/src/presentation/widgets/accountRegionClusterSelector/AccountRegionClusterSelector.spec.tsx +385 -0
  249. package/src/presentation/widgets/accountRegionClusterSelector/AccountRegionClusterSelector.tsx +231 -0
  250. package/src/presentation/widgets/accountRegionClusterSelector/FormikAccountRegionClusterSelector.tsx +164 -0
  251. package/src/presentation/widgets/accountRegionClusterSelector/index.ts +2 -0
  252. package/src/presentation/widgets/index.ts +1 -0
  253. package/src/presentation/widgets/recentLogs/CloudFoundryRecentLogs.tsx +112 -0
  254. package/src/routeDomains/index.ts +1 -0
  255. package/src/routeDomains/routeDomainSelectField.tsx +48 -0
  256. package/src/serverGroup/configure/index.ts +4 -0
  257. package/src/serverGroup/configure/serverGroupCommandBuilder.service.cf.ts +168 -0
  258. package/src/serverGroup/configure/serverGroupCommandBuilderShim.service.cf.ts +64 -0
  259. package/src/serverGroup/configure/serverGroupConfigurationModel.cf.ts +77 -0
  260. package/src/serverGroup/configure/wizard/CreateServerGroupModal.tsx +194 -0
  261. package/src/serverGroup/configure/wizard/ServerGroupTemplateSelection.tsx +55 -0
  262. package/src/serverGroup/configure/wizard/sections/artifactSettings/ArtifactSettings.cf.tsx +78 -0
  263. package/src/serverGroup/configure/wizard/sections/artifactSettings/ConstantArtifactSettings.cf.tsx +49 -0
  264. package/src/serverGroup/configure/wizard/sections/basicSettings/BasicSettings.cf.tsx +163 -0
  265. package/src/serverGroup/configure/wizard/sections/cloneSettings/CloneSettings.cf.tsx +101 -0
  266. package/src/serverGroup/configure/wizard/sections/configurationSettings/ConfigurationSettings.cf.tsx +230 -0
  267. package/src/serverGroup/configure/wizard/serverGroup.less +3 -0
  268. package/src/serverGroup/details/cfServerGroupDetailsGetter.ts +60 -0
  269. package/src/serverGroup/details/cloudFoundryServerGroupActions.tsx +365 -0
  270. package/src/serverGroup/details/mapLoadBalancers/CloudFoundryMapLoadBalancersModal.tsx +137 -0
  271. package/src/serverGroup/details/mapLoadBalancers/CloudFoundryUnmapLoadBalancersModal.tsx +137 -0
  272. package/src/serverGroup/details/resize/CloudFoundryResizeServerGroupModal.tsx +232 -0
  273. package/src/serverGroup/details/rollback/CloudFoundryRollbackServerGroupModal.tsx +179 -0
  274. package/src/serverGroup/details/sections/ApplicationManagerSection.tsx +28 -0
  275. package/src/serverGroup/details/sections/BoundServicesSection.tsx +39 -0
  276. package/src/serverGroup/details/sections/BuildSection.tsx +61 -0
  277. package/src/serverGroup/details/sections/EnvironmentVariablesSection.tsx +34 -0
  278. package/src/serverGroup/details/sections/HealthCheckSection.tsx +28 -0
  279. package/src/serverGroup/details/sections/ICloudFoundryServerGroupDetailsSectionProps.ts +6 -0
  280. package/src/serverGroup/details/sections/MetricsSection.tsx +28 -0
  281. package/src/serverGroup/details/sections/PackageSection.tsx +27 -0
  282. package/src/serverGroup/details/sections/ServerGroupInformationSection.tsx +58 -0
  283. package/src/serverGroup/details/sections/ServerGroupSizingSection.tsx +27 -0
  284. package/src/serverGroup/details/sections/index.ts +9 -0
  285. package/src/serverGroup/index.ts +5 -0
  286. package/src/serverGroup/serverGroup.transformer.ts +42 -0
@@ -0,0 +1,194 @@
1
+ import { get } from 'lodash';
2
+ import React from 'react';
3
+
4
+ import type { Application, IModalComponentProps, IPipeline, IStage } from '@spinnaker/core';
5
+ import { noop, ReactInjector, ReactModal, TaskMonitor, WizardModal, WizardPage } from '@spinnaker/core';
6
+
7
+ import { ServerGroupTemplateSelection } from './ServerGroupTemplateSelection';
8
+ import type { ICloudFoundryServerGroup } from '../../../domain';
9
+ import { CloudFoundryServerGroupArtifactSettings } from './sections/artifactSettings/ArtifactSettings.cf';
10
+ import { CloudFoundryServerGroupConstantArtifactSettings } from './sections/artifactSettings/ConstantArtifactSettings.cf';
11
+ import { CloudFoundryServerGroupBasicSettings } from './sections/basicSettings/BasicSettings.cf';
12
+ import { CloudFoundryServerGroupCloneSettings } from './sections/cloneSettings/CloneSettings.cf';
13
+ import { CloudFoundryServerGroupConfigurationSettings } from './sections/configurationSettings/ConfigurationSettings.cf';
14
+ import type { ICloudFoundryCreateServerGroupCommand } from '../serverGroupConfigurationModel.cf';
15
+
16
+ import './serverGroup.less';
17
+
18
+ export interface ICloudFoundryCreateServerGroupProps extends IModalComponentProps {
19
+ application: Application;
20
+ command: ICloudFoundryCreateServerGroupCommand;
21
+ isSourceConstant?: boolean;
22
+ serverGroup?: ICloudFoundryServerGroup;
23
+ title: string;
24
+ }
25
+
26
+ export interface ICloudFoundryCreateServerGroupState {
27
+ pipeline: IPipeline;
28
+ isClone: boolean;
29
+ loading: boolean;
30
+ requiresTemplateSelection: boolean;
31
+ stage?: IStage;
32
+ taskMonitor: TaskMonitor;
33
+ }
34
+
35
+ export class CloudFoundryCreateServerGroupModal extends React.Component<
36
+ ICloudFoundryCreateServerGroupProps,
37
+ ICloudFoundryCreateServerGroupState
38
+ > {
39
+ public static defaultProps: Partial<ICloudFoundryCreateServerGroupProps> = {
40
+ closeModal: noop,
41
+ dismissModal: noop,
42
+ };
43
+
44
+ public static show(props: ICloudFoundryCreateServerGroupProps): Promise<ICloudFoundryCreateServerGroupCommand> {
45
+ const modalProps = { dialogClassName: 'wizard-modal modal-lg' };
46
+ return ReactModal.show(CloudFoundryCreateServerGroupModal, props, modalProps);
47
+ }
48
+
49
+ constructor(props: ICloudFoundryCreateServerGroupProps) {
50
+ super(props);
51
+ const pipeline = get(props, 'command.viewState.pipeline', undefined);
52
+ const stage = get(props, 'command.viewState.stage', undefined);
53
+ const mode = get(props, 'command.viewState.mode', undefined);
54
+ this.state = {
55
+ pipeline: pipeline,
56
+ isClone: !!props.isSourceConstant || mode === 'editClonePipeline',
57
+ loading: false,
58
+ requiresTemplateSelection: get(props, 'command.viewState.requiresTemplateSelection', false),
59
+ stage,
60
+ taskMonitor: new TaskMonitor({
61
+ application: props.application,
62
+ title: 'Creating your server group',
63
+ modalInstance: TaskMonitor.modalInstanceEmulation(() => this.props.dismissModal()),
64
+ onTaskComplete: this.onTaskComplete,
65
+ }),
66
+ };
67
+ }
68
+
69
+ private templateSelected = () => {
70
+ this.setState({ requiresTemplateSelection: false });
71
+ this.initialize();
72
+ };
73
+
74
+ private initialize = () => {
75
+ this.setState({ loading: false });
76
+ };
77
+
78
+ private onTaskComplete = () => {
79
+ this.props.application.serverGroups.refresh();
80
+ };
81
+
82
+ private submit = (command: ICloudFoundryCreateServerGroupCommand): void => {
83
+ command.selectedProvider = 'cloudfoundry';
84
+ if (
85
+ command.viewState.mode === 'createPipeline' ||
86
+ command.viewState.mode === 'editPipeline' ||
87
+ command.viewState.mode === 'editClonePipeline'
88
+ ) {
89
+ this.props.closeModal && this.props.closeModal(command);
90
+ } else if (command.viewState.mode === 'clone') {
91
+ this.state.taskMonitor.submit(() =>
92
+ ReactInjector.serverGroupWriter.cloneServerGroup(command, this.props.application),
93
+ );
94
+ } else {
95
+ this.state.taskMonitor.submit(() =>
96
+ ReactInjector.serverGroupWriter.cloneServerGroup(command, this.props.application),
97
+ );
98
+ }
99
+ };
100
+
101
+ public render(): React.ReactElement<CloudFoundryCreateServerGroupModal> {
102
+ const { loading, pipeline, isClone, requiresTemplateSelection, stage, taskMonitor } = this.state;
103
+ const { application, command, dismissModal, title, isSourceConstant } = this.props;
104
+
105
+ if (requiresTemplateSelection) {
106
+ return (
107
+ <ServerGroupTemplateSelection
108
+ app={application}
109
+ command={command}
110
+ onDismiss={dismissModal}
111
+ onTemplateSelected={this.templateSelected}
112
+ />
113
+ );
114
+ }
115
+
116
+ return (
117
+ <WizardModal<ICloudFoundryCreateServerGroupCommand>
118
+ heading={title}
119
+ initialValues={command}
120
+ loading={loading}
121
+ taskMonitor={taskMonitor}
122
+ dismissModal={dismissModal}
123
+ closeModal={this.submit}
124
+ submitButtonLabel={command.viewState.submitButtonLabel}
125
+ render={({ formik, nextIdx, wizard }) => (
126
+ <>
127
+ <WizardPage
128
+ label="Basic Settings"
129
+ wizard={wizard}
130
+ order={nextIdx()}
131
+ render={({ innerRef }) => <CloudFoundryServerGroupBasicSettings ref={innerRef} formik={formik} />}
132
+ />
133
+
134
+ {isClone && isSourceConstant && (
135
+ <WizardPage
136
+ label="Application"
137
+ wizard={wizard}
138
+ order={nextIdx()}
139
+ render={({ innerRef }) => (
140
+ <CloudFoundryServerGroupConstantArtifactSettings
141
+ ref={innerRef}
142
+ formik={formik}
143
+ source={command.source}
144
+ />
145
+ )}
146
+ />
147
+ )}
148
+
149
+ {isClone && !isSourceConstant && (
150
+ <WizardPage
151
+ label="Source"
152
+ wizard={wizard}
153
+ order={nextIdx()}
154
+ render={({ innerRef }) => (
155
+ <CloudFoundryServerGroupCloneSettings application={application} ref={innerRef} formik={formik} />
156
+ )}
157
+ />
158
+ )}
159
+
160
+ {!isClone && (
161
+ <WizardPage
162
+ label="Application"
163
+ wizard={wizard}
164
+ order={nextIdx()}
165
+ render={({ innerRef }) => (
166
+ <CloudFoundryServerGroupArtifactSettings
167
+ ref={innerRef}
168
+ formik={formik}
169
+ pipeline={pipeline}
170
+ stage={stage}
171
+ />
172
+ )}
173
+ />
174
+ )}
175
+
176
+ <WizardPage
177
+ label="Manifest"
178
+ wizard={wizard}
179
+ order={nextIdx()}
180
+ render={({ innerRef }) => (
181
+ <CloudFoundryServerGroupConfigurationSettings
182
+ ref={innerRef}
183
+ formik={formik}
184
+ pipeline={pipeline}
185
+ stage={stage}
186
+ />
187
+ )}
188
+ />
189
+ </>
190
+ )}
191
+ />
192
+ );
193
+ }
194
+ }
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+
3
+ import type { Application, ITemplateSelectionText } from '@spinnaker/core';
4
+ import { DeployInitializer } from '@spinnaker/core';
5
+
6
+ import type { ICloudFoundryCreateServerGroupCommand } from '../serverGroupConfigurationModel.cf';
7
+
8
+ export interface IServerGroupTemplateSelectionProps {
9
+ app: Application;
10
+ command: ICloudFoundryCreateServerGroupCommand;
11
+ onDismiss: () => void;
12
+ onTemplateSelected: () => void;
13
+ }
14
+
15
+ export interface IServerGroupTemplateSelectionState {
16
+ templateSelectionText: ITemplateSelectionText;
17
+ }
18
+
19
+ export class ServerGroupTemplateSelection extends React.Component<
20
+ IServerGroupTemplateSelectionProps,
21
+ IServerGroupTemplateSelectionState
22
+ > {
23
+ constructor(props: IServerGroupTemplateSelectionProps) {
24
+ super(props);
25
+ this.state = {
26
+ templateSelectionText: {
27
+ copied: [
28
+ 'account, region, cluster name (stack, details)',
29
+ 'routes',
30
+ 'service instances',
31
+ 'instance settings',
32
+ 'environment variables',
33
+ ],
34
+ notCopied: ['artifacts'],
35
+ additionalCopyText: '',
36
+ },
37
+ };
38
+ }
39
+
40
+ public render() {
41
+ const { app, command, onDismiss, onTemplateSelected } = this.props;
42
+ const { templateSelectionText } = this.state;
43
+
44
+ return (
45
+ <DeployInitializer
46
+ cloudProvider="cloudfoundry"
47
+ application={app}
48
+ command={command}
49
+ onDismiss={onDismiss}
50
+ onTemplateSelected={onTemplateSelected}
51
+ templateSelectionText={templateSelectionText}
52
+ />
53
+ );
54
+ }
55
+ }
@@ -0,0 +1,78 @@
1
+ import type { FormikProps } from 'formik';
2
+ import React from 'react';
3
+
4
+ import type { IArtifact, IExpectedArtifact, IPipeline, IStage, IWizardPageComponent } from '@spinnaker/core';
5
+ import { ArtifactTypePatterns, StageArtifactSelector } from '@spinnaker/core';
6
+ import { FormikConfigField } from '../../../../../presentation';
7
+
8
+ import type { ICloudFoundryCreateServerGroupCommand } from '../../../serverGroupConfigurationModel.cf';
9
+
10
+ export interface ICloudFoundryCreateServerGroupArtifactSettingsProps {
11
+ formik: FormikProps<ICloudFoundryCreateServerGroupCommand>;
12
+ stage: IStage;
13
+ pipeline: IPipeline;
14
+ }
15
+
16
+ export class CloudFoundryServerGroupArtifactSettings
17
+ extends React.Component<ICloudFoundryCreateServerGroupArtifactSettingsProps>
18
+ implements IWizardPageComponent<ICloudFoundryCreateServerGroupCommand> {
19
+ public static get LABEL() {
20
+ return 'Artifact';
21
+ }
22
+
23
+ private excludedArtifactTypePatterns = [
24
+ ArtifactTypePatterns.KUBERNETES,
25
+ ArtifactTypePatterns.FRONT50_PIPELINE_TEMPLATE,
26
+ ];
27
+
28
+ private onExpectedArtifactSelected = (expectedArtifact: IExpectedArtifact): void => {
29
+ this.props.formik.setFieldValue('applicationArtifact', { artifactId: expectedArtifact.id });
30
+ };
31
+
32
+ private onArtifactChanged = (artifact: IArtifact): void => {
33
+ this.props.formik.setFieldValue('applicationArtifact', { artifact: artifact });
34
+ };
35
+
36
+ public validate(_values: ICloudFoundryCreateServerGroupCommand) {
37
+ const { applicationArtifact } = this.props.formik.values;
38
+ const errors = {} as any;
39
+ if (
40
+ !applicationArtifact ||
41
+ !(
42
+ (applicationArtifact.artifact && applicationArtifact.artifact.type && applicationArtifact.artifact.reference) ||
43
+ applicationArtifact.artifactId
44
+ )
45
+ ) {
46
+ errors.applicationArtifact = 'Application artifact information is required';
47
+ }
48
+
49
+ return errors;
50
+ }
51
+
52
+ public render() {
53
+ const { formik, stage, pipeline } = this.props;
54
+ const applicationArtifact = formik.values.applicationArtifact;
55
+ return (
56
+ <div className="form-group">
57
+ <div className="col-md-11">
58
+ <div className="StandardFieldLayout flex-container-h margin-between-lg">
59
+ <div className="flex-grow">
60
+ <StageArtifactSelector
61
+ pipeline={pipeline}
62
+ stage={stage}
63
+ expectedArtifactId={applicationArtifact && applicationArtifact.artifactId}
64
+ artifact={applicationArtifact && applicationArtifact.artifact}
65
+ onExpectedArtifactSelected={this.onExpectedArtifactSelected}
66
+ onArtifactEdited={this.onArtifactChanged}
67
+ excludedArtifactTypePatterns={this.excludedArtifactTypePatterns}
68
+ renderLabel={(field: React.ReactNode) => {
69
+ return <FormikConfigField label={'Artifact'}>{field}</FormikConfigField>;
70
+ }}
71
+ />
72
+ </div>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ );
77
+ }
78
+ }
@@ -0,0 +1,49 @@
1
+ import type { FormikProps } from 'formik';
2
+ import React from 'react';
3
+
4
+ import type {
5
+ ICloudFoundryCreateServerGroupCommand,
6
+ ICloudFoundrySource,
7
+ } from '../../../serverGroupConfigurationModel.cf';
8
+
9
+ export interface ICloudFoundryCloneServerGroupProps {
10
+ formik: FormikProps<ICloudFoundryCreateServerGroupCommand>;
11
+ source: ICloudFoundrySource;
12
+ }
13
+
14
+ export class CloudFoundryServerGroupConstantArtifactSettings extends React.Component<
15
+ ICloudFoundryCloneServerGroupProps
16
+ > {
17
+ constructor(props: ICloudFoundryCloneServerGroupProps) {
18
+ super(props);
19
+ const { source } = props;
20
+ this.props.formik.setFieldValue('source', source);
21
+ }
22
+
23
+ public render(): JSX.Element {
24
+ const { source } = this.props;
25
+
26
+ return (
27
+ <div>
28
+ <div className="form-group row">
29
+ <label className="col-md-3 col-form-label sm-label-right">Account</label>
30
+ <div className="col-md-7">
31
+ <input className="form-control" type="text" id="cluster" value={source.account} readOnly={true} />
32
+ </div>
33
+ </div>
34
+ <div className="form-group row">
35
+ <label className="col-md-3 col-form-label sm-label-right">Region</label>
36
+ <div className="col-md-7">
37
+ <input className="form-control" type="text" id="cluster" value={source.region} readOnly={true} />
38
+ </div>
39
+ </div>
40
+ <div className="form-group row">
41
+ <label className="col-md-3 col-form-label sm-label-right">Server Group</label>
42
+ <div className="col-md-7">
43
+ <input className="form-control" type="text" id="cluster" value={source.asgName} readOnly={true} />
44
+ </div>
45
+ </div>
46
+ </div>
47
+ );
48
+ }
49
+ }
@@ -0,0 +1,163 @@
1
+ import type { FormikErrors, FormikProps } from 'formik';
2
+ import { get } from 'lodash';
3
+ import React from 'react';
4
+ import { from as observableFrom, Subject } from 'rxjs';
5
+ import { takeUntil } from 'rxjs/operators';
6
+
7
+ import type { IAccount, IRegion, IWizardPageComponent } from '@spinnaker/core';
8
+ import {
9
+ AccountService,
10
+ CheckboxInput,
11
+ FormikFormField,
12
+ HelpField,
13
+ ReactSelectInput,
14
+ TextInput,
15
+ } from '@spinnaker/core';
16
+ import { CloudFoundryDeploymentStrategySelector } from '../../../../../deploymentStrategy/CloudFoundryDeploymentStrategySelector';
17
+
18
+ import type { ICloudFoundryCreateServerGroupCommand } from '../../../serverGroupConfigurationModel.cf';
19
+
20
+ import '../../../../../common/cloudFoundry.less';
21
+
22
+ export interface ICloudFoundryServerGroupBasicSettingsProps {
23
+ formik: FormikProps<ICloudFoundryCreateServerGroupCommand>;
24
+ }
25
+
26
+ export interface ICloudFoundryServerGroupLocationSettingsState {
27
+ accounts: IAccount[];
28
+ regions: IRegion[];
29
+ }
30
+
31
+ export class CloudFoundryServerGroupBasicSettings
32
+ extends React.Component<ICloudFoundryServerGroupBasicSettingsProps, ICloudFoundryServerGroupLocationSettingsState>
33
+ implements IWizardPageComponent<ICloudFoundryCreateServerGroupCommand> {
34
+ private destroy$ = new Subject();
35
+ public state: ICloudFoundryServerGroupLocationSettingsState = {
36
+ accounts: [],
37
+ regions: [],
38
+ };
39
+
40
+ public componentDidMount(): void {
41
+ observableFrom(AccountService.listAccounts('cloudfoundry'))
42
+ .pipe(takeUntil(this.destroy$))
43
+ .subscribe((accounts) => {
44
+ this.setState({ accounts });
45
+ this.updateRegionList();
46
+ });
47
+ }
48
+
49
+ public componentWillUnmount(): void {
50
+ this.destroy$.next();
51
+ }
52
+
53
+ private accountChanged = (): void => {
54
+ this.updateRegionList();
55
+ this.props.formik.setFieldValue('region', '');
56
+ };
57
+
58
+ private updateRegionList = (): void => {
59
+ const credentials = get(this.props.formik.values, 'credentials', undefined);
60
+ if (credentials) {
61
+ observableFrom(AccountService.getRegionsForAccount(credentials))
62
+ .pipe(takeUntil(this.destroy$))
63
+ .subscribe((regions) => this.setState({ regions }));
64
+ }
65
+ };
66
+
67
+ private strategyChanged = (_values: ICloudFoundryCreateServerGroupCommand, strategy: any) => {
68
+ this.props.formik.setFieldValue('strategy', strategy.key);
69
+ };
70
+
71
+ private onStrategyFieldChange = (key: string, value: any) => {
72
+ this.props.formik.setFieldValue(key, value);
73
+ };
74
+
75
+ public render(): JSX.Element {
76
+ const { formik } = this.props;
77
+ const { accounts, regions } = this.state;
78
+ const { values } = formik;
79
+ return (
80
+ <div className="form-group">
81
+ <div className="col-md-11">
82
+ <div className="sp-margin-m-bottom">
83
+ <FormikFormField
84
+ name="credentials"
85
+ label="Account"
86
+ input={(props) => (
87
+ <ReactSelectInput
88
+ inputClassName="cloudfoundry-react-select"
89
+ {...props}
90
+ stringOptions={accounts && accounts.map((acc: IAccount) => acc.name)}
91
+ clearable={false}
92
+ />
93
+ )}
94
+ onChange={this.accountChanged}
95
+ required={true}
96
+ />
97
+ </div>
98
+ <div className="sp-margin-m-bottom">
99
+ <FormikFormField
100
+ name="region"
101
+ label="Region"
102
+ input={(props) => (
103
+ <ReactSelectInput
104
+ {...props}
105
+ stringOptions={regions && regions.map((region: IRegion) => region.name)}
106
+ inputClassName={'cloudfoundry-react-select'}
107
+ clearable={false}
108
+ />
109
+ )}
110
+ required={true}
111
+ />
112
+ </div>
113
+ <div className="sp-margin-m-bottom">
114
+ <FormikFormField
115
+ name="stack"
116
+ label="Stack"
117
+ input={(props) => <TextInput {...props} />}
118
+ help={<HelpField id="cf.serverGroup.stack" />}
119
+ />
120
+ </div>
121
+ <div className="sp-margin-m-bottom">
122
+ <FormikFormField
123
+ name="freeFormDetails"
124
+ label="Detail"
125
+ input={(props) => <TextInput {...props} />}
126
+ help={<HelpField id="cf.serverGroup.detail" />}
127
+ />
128
+ </div>
129
+ <div className="sp-margin-m-bottom cloud-foundry-checkbox">
130
+ <FormikFormField
131
+ name="startApplication"
132
+ label="Start on creation"
133
+ input={(props) => <CheckboxInput {...props} />}
134
+ help={<HelpField id="cf.serverGroup.startApplication" />}
135
+ />
136
+ </div>
137
+ {(values.viewState.mode === 'editPipeline' ||
138
+ values.viewState.mode === 'createPipeline' ||
139
+ values.viewState.mode === 'editClonePipeline') && (
140
+ <CloudFoundryDeploymentStrategySelector
141
+ onFieldChange={this.onStrategyFieldChange}
142
+ onStrategyChange={this.strategyChanged}
143
+ command={values}
144
+ />
145
+ )}
146
+ </div>
147
+ </div>
148
+ );
149
+ }
150
+
151
+ public validate(values: ICloudFoundryCreateServerGroupCommand) {
152
+ const errors = {} as FormikErrors<ICloudFoundryCreateServerGroupCommand>;
153
+
154
+ if (values.stack && !values.stack.match(/^[a-zA-Z0-9]*$/)) {
155
+ errors.stack = 'Stack can only contain letters and numbers.';
156
+ }
157
+ if (values.freeFormDetails && !values.freeFormDetails.match(/^[a-zA-Z0-9-]*$/)) {
158
+ errors.freeFormDetails = 'Detail can only contain letters, numbers, and dashes.';
159
+ }
160
+
161
+ return errors;
162
+ }
163
+ }
@@ -0,0 +1,101 @@
1
+ import type { FormikErrors, FormikProps } from 'formik';
2
+ import React from 'react';
3
+ import { from as observableFrom, Subject } from 'rxjs';
4
+ import { takeUntil } from 'rxjs/operators';
5
+
6
+ import type { Application, IAccount, IDeploymentStrategy, IWizardPageComponent } from '@spinnaker/core';
7
+ import { AccountService, FormikFormField, Markdown, ReactSelectInput, StageConstants } from '@spinnaker/core';
8
+ import { FormikAccountRegionClusterSelector } from '../../../../../presentation';
9
+
10
+ import type { ICloudFoundryCreateServerGroupCommand } from '../../../serverGroupConfigurationModel.cf';
11
+
12
+ import '../../../../../common/cloudFoundry.less';
13
+
14
+ export interface ICloudFoundryCloneSettingsProps {
15
+ formik: FormikProps<ICloudFoundryCreateServerGroupCommand>;
16
+ application: Application;
17
+ }
18
+
19
+ export interface ICloudFoundryCloneSettingsState {
20
+ accounts: IAccount[];
21
+ }
22
+
23
+ export class CloudFoundryServerGroupCloneSettings
24
+ extends React.Component<ICloudFoundryCloneSettingsProps, ICloudFoundryCloneSettingsState>
25
+ implements IWizardPageComponent<ICloudFoundryCreateServerGroupCommand> {
26
+ private destroy$ = new Subject();
27
+ public state: ICloudFoundryCloneSettingsState = {
28
+ accounts: [],
29
+ };
30
+
31
+ public componentDidMount(): void {
32
+ observableFrom(AccountService.listAccounts('cloudfoundry'))
33
+ .pipe(takeUntil(this.destroy$))
34
+ .subscribe((accounts) => this.setState({ accounts }));
35
+ }
36
+
37
+ public componentWillUnmount(): void {
38
+ this.destroy$.next();
39
+ }
40
+
41
+ private strategyOptionRenderer = (option: IDeploymentStrategy) => {
42
+ return (
43
+ <div className="body-regular">
44
+ <strong>
45
+ <Markdown tag="span" message={option.label} />
46
+ </strong>
47
+ <div>
48
+ <Markdown tag="span" message={option.description} />
49
+ </div>
50
+ </div>
51
+ );
52
+ };
53
+
54
+ public render(): JSX.Element {
55
+ const { application, formik } = this.props;
56
+ const { accounts } = this.state;
57
+ return (
58
+ <div className="form-group">
59
+ <FormikAccountRegionClusterSelector
60
+ componentName={'source'}
61
+ accounts={accounts}
62
+ application={application}
63
+ cloudProvider={'cloudfoundry'}
64
+ clusterField={'clusterName'}
65
+ credentialsField={'account'}
66
+ formik={formik}
67
+ />
68
+ <div className="col-md-9">
69
+ <div className="sp-margin-m-bottom">
70
+ <FormikFormField
71
+ name={'target'}
72
+ label="Target"
73
+ input={(props) => (
74
+ <ReactSelectInput
75
+ inputClassName="cloudfoundry-react-select"
76
+ {...props}
77
+ options={StageConstants.TARGET_LIST.map((t) => {
78
+ return {
79
+ label: t.label,
80
+ value: t.val,
81
+ description: t.description,
82
+ };
83
+ })}
84
+ optionRenderer={this.strategyOptionRenderer}
85
+ clearable={false}
86
+ />
87
+ )}
88
+ required={true}
89
+ />
90
+ </div>
91
+ </div>
92
+ </div>
93
+ );
94
+ }
95
+
96
+ public validate(_values: ICloudFoundryCreateServerGroupCommand) {
97
+ const errors = {} as FormikErrors<ICloudFoundryCreateServerGroupCommand>;
98
+
99
+ return errors;
100
+ }
101
+ }