-
+
{
- standaloneData.current = data;
+ standaloneData.current = data
}}
csrfToken={csrfToken}
manifestData={formInitData}
>
-
>
- );
-};
+ )
+}
-export default withCookies(Notification);
+export default withCookies(Notification)
diff --git a/src/components/manifest/SchemaForm.css b/src/components/manifest/SchemaForm.css
index 15b5fbd..24fddbc 100644
--- a/src/components/manifest/SchemaForm.css
+++ b/src/components/manifest/SchemaForm.css
@@ -8,4 +8,4 @@
}
.MuiInputBase-root {
font-size: 1.1rem !important;
-}
\ No newline at end of file
+}
diff --git a/src/components/manifest/SchemaForm.tsx b/src/components/manifest/SchemaForm.tsx
index 9c25db6..e38366e 100644
--- a/src/components/manifest/SchemaForm.tsx
+++ b/src/components/manifest/SchemaForm.tsx
@@ -6,47 +6,43 @@
*/
-import * as React from "react";
-import { JsonForms } from "@jsonforms/react";
-import {
- materialCells,
- materialRenderers,
-} from "@jsonforms/material-renderers";
-import customAjv from "../../configuration/jsonforms/CustomAjv";
-import _ from "lodash";
-import {
- FoldableGroupTester,
- FoldableGroupRenderer,
-} from "../../renderer/FoldableGroup";
-import { FoldableGroupContextProvider } from "../../renderer/FoldableGroupContext";
-import { ThemeProvider, CircularProgress } from "@material-ui/core";
-import { jsonformThemeOverride } from "../../configuration/jsonforms/Theme";
-import { httpClient } from "../../helper/api-client";
-import "./SchemaForm.css";
+import * as React from 'react'
+import { JsonForms } from '@jsonforms/react'
+import { materialCells, materialRenderers } from '@jsonforms/material-renderers'
+import customAjv from '../../configuration/jsonforms/CustomAjv'
+import _ from 'lodash'
+import { FoldableGroupTester, FoldableGroupRenderer } from '../../renderer/FoldableGroup'
+import { FoldableGroupContextProvider } from '../../renderer/FoldableGroupContext'
+import { ThemeProvider, CircularProgress } from '@material-ui/core'
+import { jsonformThemeOverride } from '../../configuration/jsonforms/Theme'
+import { httpClient } from '../../helper/api-client'
+import './SchemaForm.css'
interface IProps {
- csrfToken?: any;
- name: string;
- onDataChange?: any;
- children?: any;
- updateCompleteSchemaHandler?: any;
- schemaPath?: string;
- uiSchema?: any;
- manifestData?: any;
- additionalOptions?: any;
+ csrfToken?: any
+ name: string
+ onDataChange?: any
+ children?: any
+ updateCompleteSchemaHandler?: any
+ schemaPath?: string
+ uiSchema?: any
+ manifestData?: any
+ additionalOptions?: any
}
function isProperJsonSchema(completeSchema: any) {
- let jsonSchema = completeSchema.jsonSchema;
- const schemaStr = JSON.stringify(jsonSchema);
- let isProperSchema = schemaStr.search("resource:/") === -1;
- return isProperSchema;
+ const jsonSchema = completeSchema.jsonSchema
+ const schemaStr = JSON.stringify(jsonSchema)
+ const isProperSchema = schemaStr.search('resource:/') === -1
+ return isProperSchema
}
function optionsToUrlParams(options: any) {
- if(!options) { return ''}
+ if (!options) {
+ return ''
+ }
return Object.keys(options)
- .map(k => `${encodeURIComponent(k)}=${encodeURIComponent(options[k])}`)
+ .map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(options[k])}`)
.join('&')
}
@@ -54,59 +50,54 @@ export default function SchemaForm(props: IProps) {
const [completeSchema, setCompleteSchema] = React.useState({
uiSchema: undefined,
jsonSchema: undefined,
- });
- const [isLoading, setIsLoading] = React.useState(true);
+ })
+ const [isLoading, setIsLoading] = React.useState(true)
React.useEffect(() => {
- console.log(`Getting schema for ${props.name}`);
+ console.log(`Getting schema for ${props.name}`)
httpClient(`/api/schema/${props.name}?${optionsToUrlParams(props.additionalOptions)}`).then((res) => {
res.json().then((resBody) => {
if (props.uiSchema) {
- props.uiSchema.push(JSON.parse(resBody.data.uiSchema));
+ props.uiSchema.push(JSON.parse(resBody.data.uiSchema))
} else {
setCompleteSchema({
uiSchema: JSON.parse(resBody.data.uiSchema),
jsonSchema: undefined,
- });
+ })
}
- const schemaHandler =
- props.updateCompleteSchemaHandler || setCompleteSchema;
+ const schemaHandler = props.updateCompleteSchemaHandler || setCompleteSchema
schemaHandler((prevSchema) => {
_.set(
prevSchema,
- `jsonSchema${props.schemaPath ? props.schemaPath : ""}`,
- JSON.parse(resBody.data.jsonSchema)
- );
- //Creating new object here because if objectId is not changed react doesnt rerenders it
+ `jsonSchema${props.schemaPath ? props.schemaPath : ''}`,
+ JSON.parse(resBody.data.jsonSchema),
+ )
+ // Creating new object here because if objectId is not changed react doesnt rerenders it
const newSchema = {
uiSchema: prevSchema.uiSchema,
jsonSchema: prevSchema.jsonSchema,
- };
- return newSchema;
- });
- setIsLoading(false);
- });
- });
+ }
+ return newSchema
+ })
+ setIsLoading(false)
+ })
+ })
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, []);
+ }, [])
return !isLoading ? (
{React.Children.map(props.children, (child) => {
return React.cloneElement(child, {
- updateCompleteSchemaHandler:
- props.updateCompleteSchemaHandler || setCompleteSchema,
- schemaPath: `${props.schemaPath || ""}.properties.${
- child.props.name
- }`,
+ updateCompleteSchemaHandler: props.updateCompleteSchemaHandler || setCompleteSchema,
+ schemaPath: `${props.schemaPath || ''}.properties.${child.props.name}`,
uiSchema: (props.uiSchema || completeSchema.uiSchema).elements,
- });
+ })
})}
- {!props.updateCompleteSchemaHandler &&
- isProperJsonSchema(completeSchema) ? (
+ {!props.updateCompleteSchemaHandler && isProperJsonSchema(completeSchema) ? (
{
if (props.onDataChange) {
- props.onDataChange(data, errors);
+ props.onDataChange(data, errors)
}
}}
/>
@@ -134,5 +125,5 @@ export default function SchemaForm(props: IProps) {
) : (
- );
+ )
}
diff --git a/src/components/manifest/ShowDeploymentManifest.tsx b/src/components/manifest/ShowDeploymentManifest.tsx
index 4026085..ed21468 100644
--- a/src/components/manifest/ShowDeploymentManifest.tsx
+++ b/src/components/manifest/ShowDeploymentManifest.tsx
@@ -1,226 +1,220 @@
-import React from "react";
-import { Button, makeStyles, TextField, Snackbar, Paper} from "@material-ui/core";
-import { Autocomplete, Alert } from "@material-ui/lab";
-import { toast } from "react-toastify";
-import MenuAppBar from "../layout/Header";
-import { withCookies } from "react-cookie";
-import _ from "lodash";
-import { Link } from "react-router-dom";
-import { httpClient } from "../../helper/api-client";
-import ConfirmationButton from "../common/ConfirmationButton";
-import PortalMenu from "../layout/PortalMenu";
+import React from 'react'
+import { Button, makeStyles, TextField, Snackbar, Paper } from '@material-ui/core'
+import { Autocomplete, Alert } from '@material-ui/lab'
+import { toast } from 'react-toastify'
+import MenuAppBar from '../layout/Header'
+import { withCookies } from 'react-cookie'
+import _ from 'lodash'
+import { Link } from 'react-router-dom'
+import { httpClient } from '../../helper/api-client'
+import ConfirmationButton from '../common/ConfirmationButton'
+import PortalMenu from '../layout/PortalMenu'
-import * as _m from '../../models/Manifest';
+import * as _m from '../../models/Manifest'
-import CloneManifestForm from "../../coreform/CloneManifestForm";
-import Popup from "../common/Popup";
+import CloneManifestForm from '../../coreform/CloneManifestForm'
+import Popup from '../common/Popup'
const useStyles = makeStyles((theme) => ({
container: {
- padding: '2em'
+ padding: '2em',
},
root: {
- "& > *": {
+ '& > *': {
margin: theme.spacing(1),
},
},
paper: {
- marginRight: theme.spacing(2),
+ marginRight: theme.spacing(2),
},
field: {
- marginTop: 20,
- width: 300
- }
-}));
+ marginTop: 20,
+ width: 300,
+ },
+}))
export const ManifestListActions = (props: any) => {
- const deletePopupMsg = `WARNING! \n\n1. You are about to delete deployment manifest & kubernetes resources.\n2. This does not delete aws resources like rds, docdb, etc. \n3. run resource pipeline with destroy option before proceeding`;
- const { useRef } = React;
- const [popupOpen, setPopupOpen] = React.useState(false);
- const apiResponse = useRef
('')
+ const deletePopupMsg =
+ 'WARNING! \n\n1. You are about to delete deployment manifest & kubernetes resources.\n2. This does not delete aws resources like rds, docdb, etc. \n3. run resource pipeline with destroy option before proceeding'
+ const { useRef } = React
+ const [popupOpen, setPopupOpen] = React.useState(false)
+ const apiResponse = useRef('')
const responseSeverity = useRef('')
- const classes = useStyles();
- const [open, setOpen] = React.useState(false);
+ const classes = useStyles()
+ const [open, setOpen] = React.useState(false)
- const [deletePopupOpen, setDeletePopupOpen] = React.useState(false);
+ const [deletePopupOpen, setDeletePopupOpen] = React.useState(false)
const handleDeleteClick = () => {
- setDeletePopupOpen(true);
- };
+ setDeletePopupOpen(true)
+ }
const handleDeletePopupClose = () => {
- setDeletePopupOpen(false);
- };
+ setDeletePopupOpen(false)
+ }
const handleCloneClick = () => {
- setOpen(true);
- };
+ setOpen(true)
+ }
const handleCloneClose = () => {
- setOpen(false);
- };
- const parseLines = (value) => value.replace(/(\\n)/g, "\n");
+ setOpen(false)
+ }
+ const parseLines = (value) => value.replace(/(\\n)/g, '\n')
return (
<>
Show
-
+
-
- Clone
-
-
-
+
+ Clone
+
+
+
-
+ className={'secondary-confirmation-button'}
+ >
Delete
-
-
+
+
{
- const toastId = toast.info("In Progress ...", {
- autoClose: 50000,
- });
- httpClient(`/api/manifest/${props.manifestId}?deleteManifest=true`, { method: 'DELETE' })
- .then((res) => {
- res.json().then(resJson => {
- if (res.ok) {
- responseSeverity.current = "success"
- apiResponse.current = `Deleted manifest with resources: ${JSON.stringify(resJson)}`
- } else {
- responseSeverity.current = "error"
- apiResponse.current = JSON.stringify(resJson)
- }
- toast.dismiss(toastId)
- setPopupOpen(true)
- })
- })
+ const toastId = toast.info('In Progress ...', {
+ autoClose: 50000,
+ })
+ httpClient(`/api/manifest/${props.manifestId}?deleteManifest=true`, {
+ method: 'DELETE',
+ }).then((res) => {
+ res.json().then((resJson) => {
+ if (res.ok) {
+ responseSeverity.current = 'success'
+ apiResponse.current = `Deleted manifest with resources: ${JSON.stringify(resJson)}`
+ } else {
+ responseSeverity.current = 'error'
+ apiResponse.current = JSON.stringify(resJson)
+ }
+ toast.dismiss(toastId)
+ setPopupOpen(true)
+ })
+ })
}}
- variant="outlined"
+ variant='outlined'
disabled={!_.isNumber(props.manifestId)}
>
Delete
- { setPopupOpen(false) }}>
- { setPopupOpen(false) }} severity={responseSeverity.current}>
+ {
+ setPopupOpen(false)
+ }}
+ >
+ {
+ setPopupOpen(false)
+ }}
+ severity={responseSeverity.current}
+ >
{apiResponse.current}
>
- );
-};
+ )
+}
const ShowDeploymentManifest = () => {
- const { useState } = React;
- const [manifestNameList, setManifestNameList] = useState([]);
- const [selectedManifestId, setSelectedManifestId] = useState();
- const [isLoading, setIsLoading] = React.useState(false);
+ const { useState } = React
+ const [manifestNameList, setManifestNameList] = useState([])
+ const [selectedManifestId, setSelectedManifestId] = useState()
+ const [isLoading, setIsLoading] = React.useState(false)
function fetchListOfManifests(): Promise {
setIsLoading(true)
- return httpClient(`/api/manifest/list`)
+ return httpClient('/api/manifest/list')
.then((res) => {
console.log(`REDIRECTED: ${res.redirected}`)
console.log(`OK: ${res.ok}`)
- return res.json();
+ return res.json()
})
.then((response) => {
setIsLoading(false)
- return response;
+ return response
})
.catch((error) => {
- console.log(error);
- return [];
- });
+ console.log(error)
+ return []
+ })
}
React.useEffect(() => {
fetchListOfManifests().then((manifestList) => {
- setManifestNameList(manifestList);
- });
- }, []);
+ setManifestNameList(manifestList)
+ })
+ }, [])
- const classes = useStyles();
+ const classes = useStyles()
return (
<>
-
-
+
-
+
- `${option.environment}/${option.name}`
- }
- renderInput={(params) => (
-
- )}
- onChange={(_, value) =>
- value
- ? setSelectedManifestId(value.id)
- : setSelectedManifestId(undefined)
- }
+ getOptionLabel={(option: any) => `${option.environment}/${option.name}`}
+ renderInput={(params) => }
+ onChange={(_, value) => (value ? setSelectedManifestId(value.id) : setSelectedManifestId(undefined))}
/>
-
+
>
- );
-};
+ )
+}
-export default withCookies(ShowDeploymentManifest);
+export default withCookies(ShowDeploymentManifest)
diff --git a/src/components/manifest/ShowJson.tsx b/src/components/manifest/ShowJson.tsx
index 399d3e3..b584a41 100644
--- a/src/components/manifest/ShowJson.tsx
+++ b/src/components/manifest/ShowJson.tsx
@@ -1,23 +1,23 @@
-import { withCookies } from "react-cookie";
-import * as React from "react";
-import { httpClient } from "../../helper/api-client";
+import { withCookies } from 'react-cookie'
+import * as React from 'react'
+import { httpClient } from '../../helper/api-client'
const ShowJson = (props: any) => {
- const [jsonData, setJsonData] = React.useState({});
+ const [jsonData, setJsonData] = React.useState({})
const getManifestData = async (manifestId: number): Promise
=> {
- console.log(`Fetching manifest id ${manifestId}`);
- return httpClient(`/api/manifest/${manifestId}`).then((res) => res.json());
- };
+ console.log(`Fetching manifest id ${manifestId}`)
+ return httpClient(`/api/manifest/${manifestId}`).then((res) => res.json())
+ }
React.useEffect(() => {
- const manifestIdParam = props?.match?.params?.manifestId;
+ const manifestIdParam = props?.match?.params?.manifestId
getManifestData(manifestIdParam).then((res) => {
- setJsonData(res);
- });
- }, []);
+ setJsonData(res)
+ })
+ }, [])
- return {JSON.stringify(jsonData, null, 2)};
-};
+ return {JSON.stringify(jsonData, null, 2)}
+}
-export default withCookies(ShowJson);
+export default withCookies(ShowJson)
diff --git a/src/configuration/jsonforms/CustomAjv.ts b/src/configuration/jsonforms/CustomAjv.ts
index 15f363a..430a9a1 100644
--- a/src/configuration/jsonforms/CustomAjv.ts
+++ b/src/configuration/jsonforms/CustomAjv.ts
@@ -1,7 +1,7 @@
-import { createAjv } from "@jsonforms/core";
+import { createAjv } from '@jsonforms/core'
const customAjv = (() => {
- console.log("Creating custom ajv for jsonforms")
- return createAjv({useDefaults: true})
+ console.log('Creating custom ajv for jsonforms')
+ return createAjv({ useDefaults: true })
})()
-export default customAjv
\ No newline at end of file
+export default customAjv
diff --git a/src/configuration/jsonforms/Theme.tsx b/src/configuration/jsonforms/Theme.tsx
index f05a346..3cb083e 100644
--- a/src/configuration/jsonforms/Theme.tsx
+++ b/src/configuration/jsonforms/Theme.tsx
@@ -1,7 +1,7 @@
-import { createMuiTheme } from "@material-ui/core";
+import { createMuiTheme } from '@material-ui/core'
export const jsonformThemeOverride = createMuiTheme({
- // typography: {
- // fontSize: 18,
- // },
- });
\ No newline at end of file
+ // typography: {
+ // fontSize: 18,
+ // },
+})
diff --git a/src/coreform/AWSAccessForm.tsx b/src/coreform/AWSAccessForm.tsx
index 707c9df..a7dd82f 100644
--- a/src/coreform/AWSAccessForm.tsx
+++ b/src/coreform/AWSAccessForm.tsx
@@ -1,67 +1,81 @@
-import { Grid, makeStyles, TableCell } from '@material-ui/core';
-import { useFormikContext } from 'formik';
-import * as React from 'react';
-import { FormikTable } from '../components/common/FormikTable';
-import { FormikTextField } from '../components/common/FormikTextField';
-import { FormikCardList } from '../components/common/FormikCardList';
+import { Grid, makeStyles, TableCell } from '@material-ui/core'
+import { useFormikContext } from 'formik'
+import * as React from 'react'
+import { FormikTable } from '../components/common/FormikTable'
+import { FormikTextField } from '../components/common/FormikTextField'
+import { FormikCardList } from '../components/common/FormikCardList'
import * as _m from '../models/Manifest'
-import NotConfigured from './NotConfiguredPanel';
-import GeneratePipelineButton from "../components/common/GeneratePipelineButton";
+import NotConfigured from './NotConfiguredPanel'
+import GeneratePipelineButton from '../components/common/GeneratePipelineButton'
const useStyles = makeStyles({
- root: {
- width: 1200
- },
- field: {
- width: 510,
- marginTop: 10
- },
- smallField: {
- width: 400
- }
-});
+ root: {
+ width: 1200,
+ },
+ field: {
+ width: 510,
+ marginTop: 10,
+ },
+ smallField: {
+ width: 400,
+ },
+})
const PolicyAction = (props: { policy: string }) => {
- const { policy } = props
- const classes = useStyles();
- return (
-
- {(i) => (
- <>
-
-
-
- >
- )}
- )
+ const { policy } = props
+ const classes = useStyles()
+ return (
+
+ {(i) => (
+ <>
+
+
+
+ >
+ )}
+
+ )
}
const AWSAccessForm = () => {
- const { values, setValues }: { values: any, setValues: any } = useFormikContext()
- const classes = useStyles();
- return (<>
- setValues(_m.addAwsAccess(values))}
- removeAction={() => setValues(_m.removeAwsAccess(values))} >
-
-
-
- {(i) => <>
-
-
- >
- }
-
-
-
-
- <>{ values.extraResources !== undefined && values.extraResources.aws_access !== undefined?
-
- :''}
- >
- >)
+ const { values, setValues }: { values: any; setValues: any } = useFormikContext()
+ const classes = useStyles()
+ return (
+ <>
+ setValues(_m.addAwsAccess(values))}
+ removeAction={() => setValues(_m.removeAwsAccess(values))}
+ >
+
+
+ {(i) => (
+ <>
+
+
+ >
+ )}
+
+
+
+ <>
+ {values.extraResources !== undefined && values.extraResources.aws_access !== undefined ? (
+
+ ) : (
+ ''
+ )}
+ >
+ >
+ )
}
export default AWSAccessForm
diff --git a/src/coreform/AdditionalIpWhitelistingForm.tsx b/src/coreform/AdditionalIpWhitelistingForm.tsx
index 5c9e136..d7d3bee 100644
--- a/src/coreform/AdditionalIpWhitelistingForm.tsx
+++ b/src/coreform/AdditionalIpWhitelistingForm.tsx
@@ -1,79 +1,107 @@
-import { makeStyles, TableCell } from '@material-ui/core';
-import * as React from 'react';
-import { FormikTextField } from '../components/common/FormikTextField';
-import { FormikCardList } from '../components/common/FormikCardList';
+import { makeStyles, TableCell } from '@material-ui/core'
+import * as React from 'react'
+import { FormikTextField } from '../components/common/FormikTextField'
+import { FormikCardList } from '../components/common/FormikCardList'
import * as _m from '../models/Manifest'
-import { FormikTable } from '../components/common/FormikTable';
-import { toMenuItems } from './FormUtil';
-import { useFormikContext } from 'formik';
-import NotConfigured from './NotConfiguredPanel';
+import { FormikTable } from '../components/common/FormikTable'
+import { toMenuItems } from './FormUtil'
+import { useFormikContext } from 'formik'
+import NotConfigured from './NotConfiguredPanel'
const useStyles = makeStyles({
- root: {
- width: 1200
- },
- groupField: {
- width: 500
- },
- ruleField: {
- width: 280
- },
- cidrField: {
- width: 180
- }
-});
+ root: {
+ width: 1200,
+ },
+ groupField: {
+ width: 500,
+ },
+ ruleField: {
+ width: 280,
+ },
+ cidrField: {
+ width: 180,
+ },
+})
const IngresCidr = (props: { securityGroupRule: string }) => {
- const classes = useStyles();
- const { securityGroupRule } = props
- return (
-
- {(i) => }
-
- )
+ const classes = useStyles()
+ const { securityGroupRule } = props
+ return (
+
+ {(i) => (
+
+
+
+ )}
+
+ )
}
const SecurityGroupRule = (props: { securityGroup: string }) => {
- const classes = useStyles();
- const { securityGroup } = props
- return (
-
- {(i) => (
- <>
-
-
-
-
- {toMenuItems(['http', 'tcp'])}
-
-
- >
- )}
-
- )
+ const classes = useStyles()
+ const { securityGroup } = props
+ return (
+
+ {(i) => (
+ <>
+
+
+
+
+ {toMenuItems(['http', 'tcp'])}
+
+
+ >
+ )}
+
+ )
}
const AdditionalIpWhitelistingForm = () => {
- const classes = useStyles();
- const { values, setValues }: { values: any, setValues: any } = useFormikContext()
- return (
- setValues(_m.addAdditionalIpWhitelisting(values))}
- removeAction={() => setValues(_m.removeAdditionalIpWhitelisting(values))} >
-
-
- {(i) => (
- <>
-
-
- >
- )}
-
-
-
- )
+ const classes = useStyles()
+ const { values, setValues }: { values: any; setValues: any } = useFormikContext()
+ return (
+ setValues(_m.addAdditionalIpWhitelisting(values))}
+ removeAction={() => setValues(_m.removeAdditionalIpWhitelisting(values))}
+ >
+
+
+ {(i) => (
+ <>
+
+
+ >
+ )}
+
+
+
+ )
}
-export default AdditionalIpWhitelistingForm
\ No newline at end of file
+export default AdditionalIpWhitelistingForm
diff --git a/src/coreform/AlertForm.tsx b/src/coreform/AlertForm.tsx
index d1673a5..7a044e1 100644
--- a/src/coreform/AlertForm.tsx
+++ b/src/coreform/AlertForm.tsx
@@ -1,169 +1,197 @@
-import { AppBar, createStyles, makeStyles, styled, Tab, Tabs, Theme, withStyles } from '@material-ui/core';
+import { AppBar, createStyles, makeStyles, styled, Tab, Tabs, Theme, withStyles } from '@material-ui/core'
import * as React from 'react'
-import { tabA11yProps, TabPanel, toMenuItems } from './FormUtil';
+import { tabA11yProps, TabPanel, toMenuItems } from './FormUtil'
import * as _m from '../models/Manifest'
-import { FormikTextField } from '../components/common/FormikTextField';
-import { FormikCardList } from '../components/common/FormikCardList';
-import NotConfigured from './NotConfiguredPanel';
-import { useField, useFormikContext } from 'formik';
+import { FormikTextField } from '../components/common/FormikTextField'
+import { FormikCardList } from '../components/common/FormikCardList'
+import NotConfigured from './NotConfiguredPanel'
+import { useField, useFormikContext } from 'formik'
const useStyles = makeStyles((theme: Theme) => ({
- root: {
- flexGrow: 1,
- backgroundColor: theme.palette.background.paper,
- },
- alertPanel: {
- width: 1200
- },
-}));
+ root: {
+ flexGrow: 1,
+ backgroundColor: theme.palette.background.paper,
+ },
+ alertPanel: {
+ width: 1200,
+ },
+}))
const alertTypes = {
- 'loadBalancer': ['http4xx', 'http5xx', 'elb4xx', 'elb5xx', 'latency'],
- 'database': ['highActiveConnection', 'connectionAcquireTimeIsHigh', 'maxConnectionPoolReached'],
- 'kafka': ['consumerGroupLag', 'kafkaMessageRate'],
+ loadBalancer: ['http4xx', 'http5xx', 'elb4xx', 'elb5xx', 'latency'],
+ database: ['highActiveConnection', 'connectionAcquireTimeIsHigh', 'maxConnectionPoolReached'],
+ kafka: ['consumerGroupLag', 'kafkaMessageRate'],
}
const severity = ['critical', 'warning']
const FixWidthTextField = styled(FormikTextField)({
- margin: 5,
- width: 300
+ margin: 5,
+ width: 300,
})
interface StyledTabProps {
- label: string;
+ label: string
}
-const commonAlerts = (i, alertType) => (<>
-
- {toMenuItems(alertTypes[alertType])}
+const commonAlerts = (i, alertType) => (
+ <>
+
+ {toMenuItems(alertTypes[alertType])}
-
- {toMenuItems(severity)}
+
+ {toMenuItems(severity)}
-
-
->
+
+
+ >
)
const LoadBalancerAlert = () => {
- const alertType = 'loadBalancer'
- return (
-
- {(i) => commonAlerts(i, alertType)}
-
- )
+ const alertType = 'loadBalancer'
+ return (
+
+ {(i) => commonAlerts(i, alertType)}
+
+ )
}
const DatabaseAlert = () => {
- const alertType = 'database'
- return (
-
- {(i) => commonAlerts(i, alertType)}
-
- )
+ const alertType = 'database'
+ return (
+
+ {(i) => commonAlerts(i, alertType)}
+
+ )
}
const KafkaAlertGroupField = (props) => {
- const { i } = props
- const [kafkaAlertType] = useField(`deployment.alerts.kafka.${i}.type`)
- if (kafkaAlertType.value === "consumerGroupLag") {
- return
- } else {
- return <>>
- }
+ const { i } = props
+ const [kafkaAlertType] = useField(`deployment.alerts.kafka.${i}.type`)
+ if (kafkaAlertType.value === 'consumerGroupLag') {
+ return
+ } else {
+ return <>>
+ }
}
const KafkaAlert = () => {
- const alertType = 'kafka'
- return (
-
- {(i) => (<>
- {commonAlerts(i, alertType)}
-
-
- >)}
-
- )
+ const alertType = 'kafka'
+ return (
+
+ {(i) => (
+ <>
+ {commonAlerts(i, alertType)}
+
+
+ >
+ )}
+
+ )
}
const RecordingRules = () => {
- const alertType = 'prometheusRecordingRule'
- const classes = useStyles();
- const { values, setValues }: { values: any, setValues: any } = useFormikContext()
- return (
-
- {(i) => (<>
-
-
-
-
- >)}
-
- )
+ const alertType = 'prometheusRecordingRule'
+ const classes = useStyles()
+ const { values, setValues }: { values: any; setValues: any } = useFormikContext()
+ return (
+
+ {(i) => (
+ <>
+
+
+
+
+ >
+ )}
+
+ )
}
const CustomAlert = () => {
- const alertType = 'custom'
- return (
-
- {(i) => (<>
-
-
-
-
-
-
- {toMenuItems(severity)}
-
- >)}
-
- )
+ const alertType = 'custom'
+ return (
+
+ {(i) => (
+ <>
+
+
+
+
+
+
+ {toMenuItems(severity)}
+
+ >
+ )}
+
+ )
}
const AlertForm = () => {
- const classes = useStyles();
- const { values, setValues }: { values: any, setValues: any } = useFormikContext()
- const [currentTab, setCurrentTab] = React.useState(0);
+ const classes = useStyles()
+ const { values, setValues }: { values: any; setValues: any } = useFormikContext()
+ const [currentTab, setCurrentTab] = React.useState(0)
- const handleTabChange = (event: React.ChangeEvent<{}>, newTab: number) => {
- setCurrentTab(newTab);
- };
- return (
- setValues(_m.addAlerts(values))}
- removeAction={() => setValues(_m.removeAlerts(values))} >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )
+ const handleTabChange = (event: React.ChangeEvent<{}>, newTab: number) => {
+ setCurrentTab(newTab)
+ }
+ return (
+ setValues(_m.addAlerts(values))}
+ removeAction={() => setValues(_m.removeAlerts(values))}
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
}
-export default AlertForm
\ No newline at end of file
+export default AlertForm
diff --git a/src/coreform/AutoscalingCard.tsx b/src/coreform/AutoscalingCard.tsx
index 0a5dbf8..7350d3e 100644
--- a/src/coreform/AutoscalingCard.tsx
+++ b/src/coreform/AutoscalingCard.tsx
@@ -1,89 +1,159 @@
-import * as React from 'react';
-import {makeStyles, Typography, Box, TableCell, Tooltip} from '@material-ui/core';
-import { FormikTextField } from '../components/common/FormikTextField';
-import { toMenuItems } from './FormUtil';
+import * as React from 'react'
+import { makeStyles, Typography, Box, TableCell, Tooltip } from '@material-ui/core'
+import { FormikTextField } from '../components/common/FormikTextField'
+import { toMenuItems } from './FormUtil'
import * as _m from '../models/Manifest'
-import { FormikTable } from '../components/common/FormikTable';
-import { FormikCardList } from '../components/common/FormikCardList';
+import { FormikTable } from '../components/common/FormikTable'
+import { FormikCardList } from '../components/common/FormikCardList'
import { cardStyles, boxStyleProps } from './Styles'
-import CardLayout from '../components/common/CardLayout';
-import {FormikSelect} from "../components/common/FormikSelect";
+import CardLayout from '../components/common/CardLayout'
+import { FormikSelect } from '../components/common/FormikSelect'
const useStyles = makeStyles(() => {
- return {
- ...cardStyles,
- boxTableField: {
- width: 170
- },
- }
-});
+ return {
+ ...cardStyles,
+ boxTableField: {
+ width: 170,
+ },
+ }
+})
const ScalingParameters = () => {
- const classes = useStyles();
- return (
-
- Scaling Parameters (CPU or Memory)
-
- {(i) => <>
- {toMenuItems(['cpu', 'memory'])}
-
- >}
-
-
- )
+ const classes = useStyles()
+ return (
+
+
+ Scaling Parameters (CPU or Memory)
+
+
+ {(i) => (
+ <>
+
+ {' '}
+
+ {' '}
+ {toMenuItems(['cpu', 'memory'])}{' '}
+ {' '}
+
+
+ {' '}
+ {' '}
+
+ >
+ )}
+
+
+ )
}
const ScalingParametersAdvanced = () => {
- const classes = useStyles();
- return (
-
- Scaling Parameters (Advanced)
-
- {(i) => <>
-
-
-
- >}
-
-
- )
+ const classes = useStyles()
+ return (
+
+
+ Scaling Parameters (Advanced){' '}
+
+
+ {(i) => (
+ <>
+
+
+
+ >
+ )}
+
+
+ )
}
const Replicas = () => {
- const classes = useStyles();
- return (
-
- Replicas Count
-
-
-
- )
+ const classes = useStyles()
+ return (
+
+
+ Replicas Count
+
+
+
+
+ )
}
const CronHPAAutoscaling = () => {
- const classes = useStyles();
- return (
-
- Schedule Autoscaling
-
- {(i) => <>
- {toMenuItems(['ScaleDown', 'ScaleUp'])}
-
- >}
-
-
- )
+ const classes = useStyles()
+ return (
+
+
+ Schedule Autoscaling
+
+
+ {(i) => (
+ <>
+
+ {' '}
+
+ {toMenuItems(['ScaleDown', 'ScaleUp'])}{' '}
+ {' '}
+
+
+ {' '}
+ {' '}
+
+ >
+ )}
+
+
+ )
}
const AutoscalingCard = () => {
- return (
-
-
-
-
-
-
- )
+ return (
+
+
+
+
+
+
+ )
}
-export default AutoscalingCard
\ No newline at end of file
+export default AutoscalingCard
diff --git a/src/coreform/BaseForm.tsx b/src/coreform/BaseForm.tsx
index 6d11e00..47796ef 100644
--- a/src/coreform/BaseForm.tsx
+++ b/src/coreform/BaseForm.tsx
@@ -1,25 +1,25 @@
-import * as React from 'react';
-import {makeStyles, Theme} from '@material-ui/core/styles';
-import Tabs from '@material-ui/core/Tabs';
-import Tab from '@material-ui/core/Tab';
+import * as React from 'react'
+import { makeStyles, Theme } from '@material-ui/core/styles'
+import Tabs from '@material-ui/core/Tabs'
+import Tab from '@material-ui/core/Tab'
import ManifestForm from './ManifestForm'
import DatabaseForm from './DatabaseForm'
import ElasticCacheForm from './ElasticCacheForm'
import * as _m from '../models/Manifest'
-import {Form, Formik, validateYupSchema, yupToFormErrors} from 'formik';
-import {manifestValidationSchema} from "../models/ManifestValidationSchema";
-import {tabA11yProps, TabPanel} from './FormUtil';
-import Configuration from './ConfigurationForm';
-import S3BucketForm from './S3BucketForm';
-import {Button, Divider, Snackbar, Typography} from '@material-ui/core';
-import {Alert} from "@material-ui/lab";
-import DeploymentForm from './DeploymentForm';
-import AWSAccessForm from './AWSAccessForm';
-import ServiceMonitorForm from "./ServiceMonitorForm";
-import DocumentDbForm from "./DocumentDbForm";
-import ElasticSearchForm from "./ElasticSearchForm";
-import { Dispatch, SetStateAction } from 'react';
-import DynamoDbForm from "./DynamoDbForm";
+import { Form, Formik, validateYupSchema, yupToFormErrors } from 'formik'
+import { manifestValidationSchema } from '../models/ManifestValidationSchema'
+import { tabA11yProps, TabPanel } from './FormUtil'
+import Configuration from './ConfigurationForm'
+import S3BucketForm from './S3BucketForm'
+import { Button, Divider, Snackbar, Typography } from '@material-ui/core'
+import { Alert } from '@material-ui/lab'
+import DeploymentForm from './DeploymentForm'
+import AWSAccessForm from './AWSAccessForm'
+import ServiceMonitorForm from './ServiceMonitorForm'
+import DocumentDbForm from './DocumentDbForm'
+import ElasticSearchForm from './ElasticSearchForm'
+import { Dispatch, SetStateAction } from 'react'
+import DynamoDbForm from './DynamoDbForm'
const useStyles = makeStyles((theme: Theme) => ({
root: {
flexGrow: 1,
@@ -29,12 +29,12 @@ const useStyles = makeStyles((theme: Theme) => ({
tabs: {
borderRight: `1px solid ${theme.palette.divider}`,
},
-}));
+}))
interface BaseFormProps {
- initData: any,
- setFormInitData: Dispatch>,
- onSubmit: (values: any, setCanSubmit: Dispatch>) => void,
+ initData: any
+ setFormInitData: Dispatch>
+ onSubmit: (values: any, setCanSubmit: Dispatch>) => void
}
interface FormTab {
@@ -55,55 +55,55 @@ const tabList: Array = [
name: 'database',
displayName: 'database',
component: ,
- errorCheckFn: _m.hasDatabase
+ errorCheckFn: _m.hasDatabase,
},
{
name: 'docdb',
displayName: 'document db',
component: ,
- errorCheckFn: _m.hasDatabase
+ errorCheckFn: _m.hasDatabase,
},
{
name: 'elastic Cache',
displayName: 'elastic Cache',
component: ,
- errorCheckFn: _m.hasElasticCache
+ errorCheckFn: _m.hasElasticCache,
},
{
name: 's3 bucket',
displayName: 's3 bucket',
component: ,
- errorCheckFn: _m.hasS3Bucket
+ errorCheckFn: _m.hasS3Bucket,
},
{
name: 'configuration',
displayName: 'configuration',
component: ,
- errorCheckFn: _m.hasConfiguration
+ errorCheckFn: _m.hasConfiguration,
},
{
name: 'aws access',
displayName: 'aws access',
component: ,
- errorCheckFn: _m.hasAwsAccess
+ errorCheckFn: _m.hasAwsAccess,
},
{
name: 'Service Monitor',
displayName: 'service monitor',
component: ,
- errorCheckFn: _m.hasServiceMonitor
+ errorCheckFn: _m.hasServiceMonitor,
},
{
name: 'Elastic Search',
displayName: 'elastic search',
component: ,
- errorCheckFn: _m.hasElasticSearch
+ errorCheckFn: _m.hasElasticSearch,
},
{
name: 'DynamoDB',
displayName: 'DynamoDB',
component: ,
- errorCheckFn: _m.hasDynamoDb
+ errorCheckFn: _m.hasDynamoDb,
},
]
@@ -116,35 +116,33 @@ const ErrorSnackBar = (props: { errors: any }) => {
const errorData = Object.entries(errors).slice(0, 4)
return (
0} autoHideDuration={5000}>
-
+
{errorData.map((data, idx) => {
return (
-
- { JSON.stringify(data)}
+
+ {JSON.stringify(data)}
- );
+ )
})}
- )
+
+ )
}
const BaseForm = (props: BaseFormProps) => {
- const classes = useStyles();
- const [currentTab, setCurrentTab] = React.useState(0);
+ const classes = useStyles()
+ const [currentTab, setCurrentTab] = React.useState(0)
const { initData, onSubmit } = props
- const setFormInitData = props.setFormInitData;
+ const setFormInitData = props.setFormInitData
const [manifestVersion, setManifestVersion] = React.useState()
- const [versionListData, setVersionListData] = React.useState([]);
+ const [versionListData, setVersionListData] = React.useState([])
const [isSubmitButtonDisabled, disableSubmitButton] = React.useState(false)
const isDisabled = () => {
- if (!isSubmitButtonDisabled &&
- (manifestVersion === Math.max(...versionListData)
- || manifestVersion === undefined
- || manifestVersion === 'None')) {
+ if (
+ !isSubmitButtonDisabled &&
+ (manifestVersion === Math.max(...versionListData) || manifestVersion === undefined || manifestVersion === 'None')
+ ) {
disableSubmitButton(false)
} else {
disableSubmitButton(true)
@@ -153,8 +151,8 @@ const BaseForm = (props: BaseFormProps) => {
}
const handleTabChange = (e: React.ChangeEvent<{}>, newValue: number) => {
- setCurrentTab(newValue);
- };
+ setCurrentTab(newValue)
+ }
return (
@@ -162,61 +160,72 @@ const BaseForm = (props: BaseFormProps) => {
enableReinitialize
initialValues={initData}
validate={async (value) => {
- try {
- await validateYupSchema(value, manifestValidationSchema, false, value);
- } catch (err) {
- return yupToFormErrors(err); //for rendering validation errors
- }
- return {};
+ try {
+ await validateYupSchema(value, manifestValidationSchema, false, value)
+ } catch (err) {
+ return yupToFormErrors(err) // for rendering validation errors
+ }
+ return {}
}}
validateOnChange={false}
- onSubmit={values => {
- disableSubmitButton(true);
- onSubmit(values, disableSubmitButton);
- }} >
- {
- props => (
-
- )
- }
+ onSubmit={(values) => {
+ disableSubmitButton(true)
+ onSubmit(values, disableSubmitButton)
+ }}
+ >
+ {(props) => (
+
+ )}
- );
+ )
}
export default BaseForm
diff --git a/src/coreform/CloneManifestForm.tsx b/src/coreform/CloneManifestForm.tsx
index 22d8a57..b5ab0b1 100644
--- a/src/coreform/CloneManifestForm.tsx
+++ b/src/coreform/CloneManifestForm.tsx
@@ -1,147 +1,132 @@
-import React, {useState} from "react";
-import {withCookies} from "react-cookie";
-import {toMenuItems} from './FormUtil';
-import {makeStyles} from "@material-ui/core/styles";
-import * as _m from '../models/Manifest';
-import {Button,Grid,Snackbar} from "@material-ui/core";
-import {Form, Formik} from "formik";
-import {FormikTextField} from "../components/common/FormikTextField"
-import {cardStyles, text} from "../coreform/Styles";
-import {toast} from "react-toastify";
-import {getFormattedRuntimeException, post} from "../helper/api-client";
-import { FormikCheckbox } from "../components/common/FormikCheckbox";
-import * as yup from "yup";
-import {useHistory} from "react-router-dom";
-const { useRef } = React;
-import FormControlLabel from "@material-ui/core/FormControlLabel";
-import {Alert} from "@material-ui/lab";
+import React, { useState } from 'react'
+import { withCookies } from 'react-cookie'
+import { toMenuItems } from './FormUtil'
+import { makeStyles } from '@material-ui/core/styles'
+import * as _m from '../models/Manifest'
+import { Button, Grid, Snackbar } from '@material-ui/core'
+import { Form, Formik } from 'formik'
+import { FormikTextField } from '../components/common/FormikTextField'
+import { cardStyles, text } from '../coreform/Styles'
+import { toast } from 'react-toastify'
+import { getFormattedRuntimeException, post } from '../helper/api-client'
+import { FormikCheckbox } from '../components/common/FormikCheckbox'
+import * as yup from 'yup'
+import { useHistory } from 'react-router-dom'
+const { useRef } = React
+import FormControlLabel from '@material-ui/core/FormControlLabel'
+import { Alert } from '@material-ui/lab'
-
-const API_PATH = '/api/manifest/clone';
+const API_PATH = '/api/manifest/clone'
const useStyles = makeStyles({
- ...cardStyles,
- text,
- root: {
- minWidth: 500,
- padding: '2px',
- display: 'inline-block',
- margin: '4px'
- },
- field: {
- marginTop: 20,
- width: '100%'
- },
-});
+ ...cardStyles,
+ text,
+ root: {
+ minWidth: 500,
+ padding: '2px',
+ display: 'inline-block',
+ margin: '4px',
+ },
+ field: {
+ marginTop: 20,
+ width: '100%',
+ },
+})
const initialFormValues = {
- name: "",
- environment: "",
- teamName: "",
- copyEnvVariables: false,
- copyOutbound: false,
- manifestId: 0
- };
+ name: '',
+ environment: '',
+ teamName: '',
+ copyEnvVariables: false,
+ copyOutbound: false,
+ manifestId: 0,
+}
const CloneForm = (props: any) => {
- const classes = useStyles();
- const [formValues, setFormValues] = useState(initialFormValues);
- const [submitResponse, setSubmitResponse] = useState("");
- const [submitResponseStatus, setSubmitResponseStatus] = useState("");
- const apiResponse = useRef("");
- const history = useHistory();
+ const classes = useStyles()
+ const [formValues, setFormValues] = useState(initialFormValues)
+ const [submitResponse, setSubmitResponse] = useState('')
+ const [submitResponseStatus, setSubmitResponseStatus] = useState('')
+ const apiResponse = useRef('')
+ const history = useHistory()
- const submitManifest = (cloneManifest: any) => {
- console.log(props.clone);
-
- const toastId = toast.info("In Progress ...", {
- autoClose: 50000,
- });
- cloneManifest.manifestId = props.clone;
- let path =`/manifests/create?copyId=`+props.clone
- post(cloneManifest, API_PATH).then((r) => {
- r.json().then((resJson) => {
- if (r.ok) {
- toast.update(toastId, {
- render: "Updated",
- type: "success",
- autoClose: 3000,
- });
- history.push(path , { cloneValues: resJson });
- apiResponse.current = "";
- } else {
- toast.dismiss(toastId);
- setSubmitResponseStatus("error");
- setSubmitResponse(getFormattedRuntimeException(resJson));
- }
- });
- });
- }
+ const submitManifest = (cloneManifest: any) => {
+ console.log(props.clone)
- return (
-
-
{
- submitManifest(values)
- }}>
- {props => (
-
- )
- }
-
-
setSubmitResponseStatus("")}
- >
- {JSON.stringify(submitResponse)}
-
-
- );
+ const toastId = toast.info('In Progress ...', {
+ autoClose: 50000,
+ })
+ cloneManifest.manifestId = props.clone
+ const path = '/manifests/create?copyId=' + props.clone
+ post(cloneManifest, API_PATH).then((r) => {
+ r.json().then((resJson) => {
+ if (r.ok) {
+ toast.update(toastId, {
+ render: 'Updated',
+ type: 'success',
+ autoClose: 3000,
+ })
+ history.push(path, { cloneValues: resJson })
+ apiResponse.current = ''
+ } else {
+ toast.dismiss(toastId)
+ setSubmitResponseStatus('error')
+ setSubmitResponse(getFormattedRuntimeException(resJson))
+ }
+ })
+ })
+ }
+
+ return (
+
+
{
+ submitManifest(values)
+ }}
+ >
+ {(props) => (
+
+ )}
+
+
setSubmitResponseStatus('')}
+ >
+ {JSON.stringify(submitResponse)}
+
+
+ )
}
-export default withCookies(CloneForm);
-
-
+export default withCookies(CloneForm)
export const cloneFormValidationSchema = yup.object({
- name: yup.string().required('is Required'),
- environment: yup.string().required('is Required'),
- teamName: yup.string().required('is Required')
+ name: yup.string().required('is Required'),
+ environment: yup.string().required('is Required'),
+ teamName: yup.string().required('is Required'),
})
diff --git a/src/coreform/ConfigurationForm.tsx b/src/coreform/ConfigurationForm.tsx
index 44c9d83..289b2c8 100644
--- a/src/coreform/ConfigurationForm.tsx
+++ b/src/coreform/ConfigurationForm.tsx
@@ -1,36 +1,35 @@
-import * as React from 'react';
-import { useFormikContext } from 'formik';
+import * as React from 'react'
+import { useFormikContext } from 'formik'
import * as _m from '../models/Manifest'
-import { AppBar, Tab, Tabs } from '@material-ui/core';
-import { tabA11yProps, TabPanel } from './FormUtil';
-import EnvironmentVariablesForm from './EnvironmentVariablesForm';
-import DynamicConfigurationForm from './DynamicConfig';
+import { AppBar, Tab, Tabs } from '@material-ui/core'
+import { tabA11yProps, TabPanel } from './FormUtil'
+import EnvironmentVariablesForm from './EnvironmentVariablesForm'
+import DynamicConfigurationForm from './DynamicConfig'
const ConfigurationForm = () => {
- const { values, setValues }: { values: any, setValues: any } = useFormikContext()
- const [currentTab, setCurrentTab] = React.useState(0);
+ const { values, setValues }: { values: any; setValues: any } = useFormikContext()
+ const [currentTab, setCurrentTab] = React.useState(0)
- const handleTabChange = (event: React.ChangeEvent<{}>, newTab: number) => {
- setCurrentTab(newTab);
- };
-
- return (
- <>
-
-
-
-
-
-
-
-
-
-
-
-
- >
- )
+ const handleTabChange = (event: React.ChangeEvent<{}>, newTab: number) => {
+ setCurrentTab(newTab)
+ }
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ )
}
export default ConfigurationForm
diff --git a/src/coreform/DatabaseForm.tsx b/src/coreform/DatabaseForm.tsx
index caf4814..531fb1c 100644
--- a/src/coreform/DatabaseForm.tsx
+++ b/src/coreform/DatabaseForm.tsx
@@ -1,8 +1,8 @@
-import * as React from "react";
-import { FormikTable } from "../components/common/FormikTable";
-import { FormikTextField } from "../components/common/FormikTextField";
-import { toMenuItems } from "./FormUtil";
-import * as _m from "../models/Manifest";
+import * as React from 'react'
+import { FormikTable } from '../components/common/FormikTable'
+import { FormikTextField } from '../components/common/FormikTextField'
+import { toMenuItems } from './FormUtil'
+import * as _m from '../models/Manifest'
import {
FormControlLabel,
Grid,
@@ -17,16 +17,16 @@ import {
TableHead,
TableRow,
Tooltip,
-} from "@material-ui/core";
-import FormikMultiSelect from "../components/common/FormikMultiSelect";
-import { cardStyles } from "./Styles";
-import {useField, useFormikContext} from "formik";
-import NotConfigured from "./NotConfiguredPanel";
-import { FormikCheckbox } from "../components/common/FormikCheckbox";
-import AddRemoveButton from "../components/common/AddRemoveButton";
-import CardLayout from "../components/common/CardLayout";
-import { EnvironmentVariable } from "./Types";
-import GeneratePipelineButton from "../components/common/GeneratePipelineButton";
+} from '@material-ui/core'
+import FormikMultiSelect from '../components/common/FormikMultiSelect'
+import { cardStyles } from './Styles'
+import { useField, useFormikContext } from 'formik'
+import NotConfigured from './NotConfiguredPanel'
+import { FormikCheckbox } from '../components/common/FormikCheckbox'
+import AddRemoveButton from '../components/common/AddRemoveButton'
+import CardLayout from '../components/common/CardLayout'
+import { EnvironmentVariable } from './Types'
+import GeneratePipelineButton from '../components/common/GeneratePipelineButton'
const useStyles = makeStyles({
...cardStyles,
@@ -37,82 +37,82 @@ const useStyles = makeStyles({
width: 185,
},
button: {
- float: "right",
+ float: 'right',
marginRight: 10,
},
gridRow: {
width: 1200,
},
-});
+})
const rdsAlertFields = [
- { field: "cpuUtilization", label: "cpuUtilization(percent)" },
- { field: "cpuCreditBalance", label: "cpuCreditBalance(credit)" },
- { field: "burstBalance", label: "burstBalance(percent)" },
- { field: "dbConnections", label: "dbConnections(integer)" },
- { field: "queueDepth", label: "queueDepth(iops)" },
+ { field: 'cpuUtilization', label: 'cpuUtilization(percent)' },
+ { field: 'cpuCreditBalance', label: 'cpuCreditBalance(credit)' },
+ { field: 'burstBalance', label: 'burstBalance(percent)' },
+ { field: 'dbConnections', label: 'dbConnections(integer)' },
+ { field: 'queueDepth', label: 'queueDepth(iops)' },
{
- field: "freeStorageSpacePercent",
- label: "freeStorageSpacePercent(percent)",
+ field: 'freeStorageSpacePercent',
+ label: 'freeStorageSpacePercent(percent)',
},
- { field: "freeMemoryTooLowInMB", label: "freeMemoryTooLowInMB(MB)" },
- { field: "readLatency", label: "readLatency(ms)" },
- { field: "writeLatency", label: "writeLatency(ms)" },
-];
-const rdsAlertHeaders = ["Metric", "Threshold", "Duration\n(minutes)"];
+ { field: 'freeMemoryTooLowInMB', label: 'freeMemoryTooLowInMB(MB)' },
+ { field: 'readLatency', label: 'readLatency(ms)' },
+ { field: 'writeLatency', label: 'writeLatency(ms)' },
+]
+const rdsAlertHeaders = ['Metric', 'Threshold', 'Duration\n(minutes)']
const gravitonInstanceClass = [
- "db.t4g.nano",
- "db.t4g.micro",
- "db.t4g.small",
- "db.t4g.medium",
- "db.t4g.large",
- "db.t4g.xlarge",
- "db.t4g.2xlarge",
- "db.m6g.large",
- "db.m6g.xlarge",
- "db.m6g.2xlarge",
- "db.m6g.4xlarge",
- "db.m6g.12xlarge",
- "db.m6g.16xlarge",
-];
+ 'db.t4g.nano',
+ 'db.t4g.micro',
+ 'db.t4g.small',
+ 'db.t4g.medium',
+ 'db.t4g.large',
+ 'db.t4g.xlarge',
+ 'db.t4g.2xlarge',
+ 'db.m6g.large',
+ 'db.m6g.xlarge',
+ 'db.m6g.2xlarge',
+ 'db.m6g.4xlarge',
+ 'db.m6g.12xlarge',
+ 'db.m6g.16xlarge',
+]
const intelInstanceClasses = [
- "db.t3.micro",
- "db.t3.small",
- "db.t3.medium",
- "db.t3.large",
- "db.t3.xlarge",
- "db.t3.2xlarge",
- "db.m5.large",
- "db.m5.xlarge",
- "db.m5.2xlarge",
- "db.m5.4xlarge",
- "db.m5.12xlarge",
- "db.m5.24xlarge",
-];
+ 'db.t3.micro',
+ 'db.t3.small',
+ 'db.t3.medium',
+ 'db.t3.large',
+ 'db.t3.xlarge',
+ 'db.t3.2xlarge',
+ 'db.m5.large',
+ 'db.m5.xlarge',
+ 'db.m5.2xlarge',
+ 'db.m5.4xlarge',
+ 'db.m5.12xlarge',
+ 'db.m5.24xlarge',
+]
const awsInstanceClasses = {
- "11": [...gravitonInstanceClass, ...intelInstanceClasses],
- "13": gravitonInstanceClass
-};
-const databaseExtensions = ["pgcrypto", "uuid-ossp", "postgis"];
-const psqlEngineVersion = ["11", "13"];
+ '11': [...gravitonInstanceClass, ...intelInstanceClasses],
+ '13': gravitonInstanceClass,
+}
+const databaseExtensions = ['pgcrypto', 'uuid-ossp', 'postgis']
+const psqlEngineVersion = ['11', '13']
const MarginedTextField = styled(FormikTextField)({
marginBottom: 10,
-});
+})
const MarginedFormControlLabel = styled(FormControlLabel)({
marginBottom: 10,
width: 400,
-});
+})
const DbParameters = () => {
- const classes = useStyles();
+ const classes = useStyles()
return (
{(i) => (
@@ -124,201 +124,149 @@ const DbParameters = () => {
className={classes.tableField}
>
{toMenuItems([
- "rds.logical_replication",
- "log_lock_waits",
- "shared_preload_libraries",
- "auto_explain.log_analyze",
- "auto_explain.log_min_duration",
+ 'rds.logical_replication',
+ 'log_lock_waits',
+ 'shared_preload_libraries',
+ 'auto_explain.log_analyze',
+ 'auto_explain.log_min_duration',
])}
-
+
>
)}
- );
-};
+ )
+}
const DbSchemaNames = () => {
- const classes = useStyles();
+ const classes = useStyles()
return (
{(i) => (
-
+
)}
- );
-};
+ )
+}
-const toEnvironmentKeys = (
- environmentVariables: Array,
- environmentVariableType: string
-) => {
+const toEnvironmentKeys = (environmentVariables: Array, environmentVariableType: string) => {
return environmentVariables
.filter(
- (environmentVariable) =>
- environmentVariableType === "" ||
- environmentVariable.type === environmentVariableType
+ (environmentVariable) => environmentVariableType === '' || environmentVariable.type === environmentVariableType,
)
.map((environmentVariable) => (
-