): void => {
const { name, checked } = event.target;
const updatedResources: Pipeline[] = checked
? (addToArray(generateAwsTemplate(manifestName, environment, name), resource) as Pipeline[])
@@ -40,11 +46,11 @@ export const PipelineCard = (props: PipelineCardProps) => {
) as Pipeline[]);
setResource(updatedResources);
};
- const submitManifest = (pipelineManifest: any) => {
+ const submitPipeline = (pipelineManifest: DeploymentPipeline): void => {
const toastId = toast.info('In Progress ...', {
autoClose: 50000,
});
- post(pipelineManifest, API_TO_POST_PIPELINE_MANIFEST).then(r => {
+ post(pipelineManifest, API_PIPELINE_MANIFEST).then(r => {
r.json().then(resJson => {
if (r.ok) {
toast.update(toastId, {
@@ -52,7 +58,6 @@ export const PipelineCard = (props: PipelineCardProps) => {
type: 'success',
autoClose: 3000,
});
- // setYamlText(resJson);
} else {
toast.update(toastId, {
render: `${getFormattedRuntimeException(resJson)}`,
@@ -64,11 +69,11 @@ export const PipelineCard = (props: PipelineCardProps) => {
});
};
- const getManifestByName = (name: string) => {
+ const getPipelineManifestByNameAndEnvironment = (name: string, env: string): void => {
const toastId = toast.info('In Progress ...', {
autoClose: 50000,
});
- httpClient(`${API_TO_POST_PIPELINE_MANIFEST}/name/${name}`).then(r => {
+ httpClient(`${API_PIPELINE_MANIFEST}?name=${name}&env=${env}`).then(r => {
r.json().then(resJson => {
if (r.ok) {
toast.update(toastId, {
@@ -87,6 +92,9 @@ export const PipelineCard = (props: PipelineCardProps) => {
});
});
};
+ useEffect(() => {
+ getPipelineManifestByNameAndEnvironment(manifestName, environment);
+ }, [manifestName, environment]);
return (
@@ -95,7 +103,7 @@ export const PipelineCard = (props: PipelineCardProps) => {
initialValues={manifest}
validateOnChange={false}
onSubmit={values => {
- console.log(createPipelineManifestObject(values, upstream, resource));
+ submitPipeline(createPipelineManifestObject(values, upstream, resource));
}}
>
- {/*
- Include resource pipeline
-
-
*/}
);
};
diff --git a/src/coreform/documentdb/DocumentDbForm.tsx b/src/coreform/documentdb/DocumentDbForm.tsx
index a21b98e..3d8e4f4 100644
--- a/src/coreform/documentdb/DocumentDbForm.tsx
+++ b/src/coreform/documentdb/DocumentDbForm.tsx
@@ -17,7 +17,6 @@ import {
TableRow,
Tooltip,
} from '@material-ui/core';
-import GeneratePipelineButton from '../../components/common/GeneratePipelineButton';
import { cardStyles } from '../Styles';
import CardLayout from '../../components/common/CardLayout';
import { toMenuItems } from '../FormUtil';
diff --git a/src/coreform/elasticcache/ElasticCacheForm.tsx b/src/coreform/elasticcache/ElasticCacheForm.tsx
index f9523a6..ebb78d0 100644
--- a/src/coreform/elasticcache/ElasticCacheForm.tsx
+++ b/src/coreform/elasticcache/ElasticCacheForm.tsx
@@ -16,7 +16,6 @@ import { FormikTextField } from '../../components/common/FormikTextField';
import * as _m from '../../models/Manifest';
import { FormikCheckbox } from '../../components/common/FormikCheckbox';
import CardLayout from '../../components/common/CardLayout';
-import GeneratePipelineButton from '../../components/common/GeneratePipelineButton';
import { Environment } from '../../constants/Environment';
import NotConfigured from '../NotConfiguredPanel';
import { toMenuItems } from '../FormUtil';
diff --git a/src/coreform/s3bucket/S3BucketForm.tsx b/src/coreform/s3bucket/S3BucketForm.tsx
index 734e760..77db49a 100644
--- a/src/coreform/s3bucket/S3BucketForm.tsx
+++ b/src/coreform/s3bucket/S3BucketForm.tsx
@@ -11,15 +11,10 @@ import AddRemoveButton from '../../components/common/AddRemoveButton';
import NotConfigured from '../NotConfiguredPanel';
import CardLayout from '../../components/common/CardLayout';
import { FormikCheckbox } from '../../components/common/FormikCheckbox';
-import GeneratePipelineButton from '../../components/common/GeneratePipelineButton';
-import { List } from 'material-ui';
-import { FormikAutocomplete } from '../../components/common/FormikAutocomplete';
import FormikMultiSelect from '../../components/common/FormikMultiSelect';
import { FormikTable } from '../../components/common/FormikTable';
import { Announcement } from '../../components/common/Announcement';
import { Environment } from '../../constants/Environment';
-import { boolean } from 'yup';
-import { hasS3Bucket } from '../../models/Manifest';
import MenuItem from '@material-ui/core/MenuItem';
import { environmentsNeedingAllMetadataFields } from '../../components/manifest/MetadataForm';